// CylTrackNtuple_t.cpp #include "CylTrackNtuple.h" #include #include #include "trfcyl/SurfCylinder.h" #include "trfbase/ETrack.h" #include "trffit/HTrack.h" using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** int main( ) { string component = "CylTrackNtuple"; 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; } //******************************************************************** // CylTrackNtuple only supports filling MC-reco pairs. We should add // more tests when other opions are provided (see DCATrackNtple_t.cpp). cout << ok_prefix << "Create ntuple." << endl; SurfacePtr psrf( new SurfCylinder(10.) ); TrackVector vec; TrackError err; for ( int i=0; i<5; ++i ) { err(i,i) = 1.0; } VTrack trv(psrf, vec); ETrack tre(psrf, vec, err); HTrack trh(tre); { CylTrackNtuple ntp(true,true,false);; cout << ok_prefix << "Check for 3 matches, two not found, and 1 fake." << endl; ntp.fill(trv,trh); ntp.fill(trv,trh); ntp.fill(trv,trh); ntp.fill(trv); ntp.fill(trv); ntp.fill(trh); } //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }