// PropComparator.hpp #ifndef PropComparator_H #define PropComparator_H #include #include "trfbase/PropStat.h" #include "trfbase/PropagatorPtr.h" #include "trfbase/ETrack.h" #include "PropSurfList.hpp" // Defining the interface: // // For setup, PropComparator needs: // An ending surface, and the following: // // 1) two propagators // or // 2) a propagator and a *list* of surfaces and propagators // or // 3) two *lists* of surfaces and propagators // // PropComparator.computeChi2(ETrack mytrack) will then: // Propagate this track (which has it's own surface) along the two // different "routes" provided in the setup. The routes both end at // the "ending surface" of the setup. The Chi2 provides the measure // of similarity of the two different routes. // // Note: although redundant, the "ending surface" must be the same as the // last surface in a *list* of propagators and surfaces. // // There are methods provided to give you the // 2 resulting tracks at the ending surface // // computeChi2 may be called over and over with different tracks after // the setup is complete. // // // Global definitions class PropComparator { private: trf::PropagatorPtr _myprop; trf::SurfacePtr _mysurf; double _mychi2; trf::ETrack _TrkInitial; PropSurfList _PropSurfList1,_PropSurfList2; bool _sameEndSurf(); public: // Constructors PropComparator(); // provide final surface and two propagators to test PropComparator(trf::SurfacePtr theirsurf, trf::PropagatorPtr theirprop1, trf::PropagatorPtr theirprop2); // can provide "PropSurfList" objects instead of simple propagators PropComparator(trf::SurfacePtr theirsurf, PropSurfList theirPropSurfList1, trf::PropagatorPtr theirprop2); PropComparator(trf::SurfacePtr theirsurf, trf::PropagatorPtr theirprop1, PropSurfList theirPropSurfList1); PropComparator(PropSurfList theirPropSurfList1, PropSurfList theirPropSurfList2); // Destructors ~PropComparator() {} // actually performs the computation void computeChi2(const trf::ETrack *initialTrk, // user's input double *_mychi2, trf::ETrack *trkFinal1, // 4 outputs trf::ETrack *trkFinal2, double *dist1, double *dist2, double *code ); }; // code 0.0 success // 1.0 undiagnosed failure // // 1.1 propagator failure on propagator 1, route 1 // 2.1 " " propagator 2, route 1 // etc. // // 1.2 propagator failure on propagator 1, route 2 // 2.2 " " propagator 2, route 2 // etc. #endif //PropComparator_H