// GTrackPropagator_t.cpp // Test GTrack. #include "GTrackPropagator.hpp" #include "GTrackTest.hpp" #include "GtrTrfPropagator.hpp" #include "framework/Testing.hpp" #include "run_config_fwk/RunConfigPkg.hpp" using std::cout; using std::cerr; using std::endl; using std::vector; using std::string; namespace edm { class Event; } using edm::ChunkID; using edm::Event; using namespace trf; //********************************************************************** int main( ) { string component = "GTrackPropagator"; 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; } //******************************************************************** RunConfigPkg* p1 = 0; makePackage(p1, "run_config_fwk", "RunConfigPkg"); assert(p1 != 0); GTrackTest test(ok_prefix); int nclus = test.nclus; int nmiss = test.nmiss; int nstate = nclus + nmiss; const vector& surfs = test.all_surfs; const vector& states = test.states; assert( states.size() == surfs.size() ); const GTrack& gtr = test.gtr; //******************************************************************** cout << ok_prefix << "Build default propagator." << endl; GTrackPropagator gpropd; assert( gpropd.get_propagator() != 0 ); //******************************************************************** cout << ok_prefix << "Build without propagator." << endl; GTrackPropagator gpropn( PropagatorPtr(0) ); assert( gpropn.get_propagator() == 0 ); //******************************************************************** cout << ok_prefix << "Build propagator from TRF++ propagator." << endl; GtrTrfPropagator propmake; GTrackPropagator gprop(propmake.get_propagator()); assert( gprop.get_propagator() != 0 ); //******************************************************************** cout << ok_prefix << "Null propagate to an existing surface." << endl; for ( int i=0; i r; r.push_back(5.0); r.push_back(13.0); r.push_back(23.0); r.push_back(33.0); r.push_back(43.0); r.push_back(55.0); r.push_back(100.0); for ( int i=0; i