// SimpleCFTDetector_t.cpp #include "SimpleCFTDetector.h" #include #include #include #include "trfutil/trfstream.h" #include "trflayer/Layer.h" using std::cout; using std::cerr; using std::endl; using std::string; using std::list; using namespace trf; //********************************************************************** int main( ) { string component = "SimpleCFTDetector"; string ok_prefix = component + " (I): "; string error_prefix = component + " test (E): "; cout << ok_prefix << "-------- Testing component " + component + ". --------" << endl; // Make sure assert is enabled. bool assert_flag = false; assert ( ( assert_flag = true, assert_flag ) ); if ( ! assert_flag ) { cerr << "Assert is disabled" << endl; return 1; } //******************************************************************** cout << trf_format; cout << ok_prefix << "Construct." << endl; SimpleCFTDetector det; cout << det << endl; //******************************************************************** cout << ok_prefix << "Check the layers." << endl; assert( det.get_layer_names().size() == 16 ); list names; names.push_back( "CFTX1" ); names.push_back( "CFTX2" ); names.push_back( "CFTX3" ); names.push_back( "CFTX4" ); names.push_back( "CFTX5" ); names.push_back( "CFTX6" ); names.push_back( "CFTX7" ); names.push_back( "CFTX8" ); names.push_back( "CFTU1" ); names.push_back( "CFTU2" ); names.push_back( "CFTU3" ); names.push_back( "CFTU4" ); names.push_back( "CFTV1" ); names.push_back( "CFTV2" ); names.push_back( "CFTV3" ); names.push_back( "CFTV4" ); list::const_iterator iname; for ( iname=names.begin(); iname!=names.end(); ++iname ) { string name = *iname; cout << name << endl; assert( det.is_assigned(name) ); const Layer& lyr = det.get_layer(*iname); cout << lyr << endl; } //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }