// $Id$ // // File: DEventRFBunch_factory_Calibrations.h // Created: Tue Aug 9 14:29:24 EST 2011 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64) // #ifndef _DEventRFBunch_factory_Calibrations_ #define _DEventRFBunch_factory_Calibrations_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace jana; class DEventRFBunch_factory_Calibrations : public jana::JFactory { public: DEventRFBunch_factory_Calibrations(){}; ~DEventRFBunch_factory_Calibrations(){}; const char* Tag(void){return "Calibrations";} private: void Select_GoodTracks(JEventLoop* locEventLoop, vector& locSelectedWireBasedTracks) const; jerror_t Select_RFBunch(JEventLoop* locEventLoop, vector& locTrackWireBasedVector, double locRFTime); bool Find_TrackTimes_SC(const DDetectorMatches* locDetectorMatches, const vector& locTrackWireBasedVector, vector >& locTimes) const; int Conduct_Vote(JEventLoop* locEventLoop, double locRFTime, vector >& locTimes, int& locHighestNumVotes); int Find_BestRFBunchShifts(double locRFHitTime, const vector >& locTimes, map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts); int Break_TieVote_Tracks(map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts); jerror_t Create_NaNRFBunch(void); const DParticleID* dParticleID; double dRFBunchPeriod; DVector3 dTargetCenter; DetectorSystem_t dRFTDCSourceSystem; double dMinTrackingFOM; unsigned int dMinHitRingsPerCDCSuperlayer; unsigned int dMinHitPlanesPerFDCPackage; DCutAction_TrackHitPattern *dCutAction_TrackHitPattern; jerror_t init(void); ///< Called once at program start. jerror_t brun(jana::JEventLoop *locEventLoop, int runnumber); ///< Called everytime a new run number is detected. jerror_t evnt(jana::JEventLoop *locEventLoop, int eventnumber); ///< Called every event. jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called. jerror_t fini(void); ///< Called after last event of last event source has been processed. }; #endif // _DEventRFBunch_factory_Calibrations_