// LayerSimGeneric_t.cpp #include "LayerSimGeneric.h" #include #include #include #include "trfutil/trfstream.h" #include "trfbase/HitGeneratorTest.h" #include "trfbase/PropDirectedTest.h" #include "trfbase/VTrack.h" #include "LayerTest.h" using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** int main( ) { string component = "LayerSimGeneric"; 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 << "Check constructor." << endl; double spar = 5.0; SurfTest srf(spar); LayerSimGeneric::HitGeneratorPtr phgen( new HitGeneratorTest(srf) ); LayerPtr plyr; plyr = new LayerTest(spar); PropagatorPtr pprop( new PropTest() ); LayerSimGeneric lsim(plyr,phgen,pprop); cout << lsim << endl; Layer& lyr = lsim.get_layer(); cout << lyr << endl; assert( plyr == &lyr ); assert( lsim.get_generators().size() == 1 ); VTrack trv( SurfacePtr(srf.new_pure_surface()) ); lsim.add_clusters(trv); lsim.drop_clusters(); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }