// $Id$ // // File: DEventRFBunch_factory.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_ #define _DEventRFBunch_factory_ #include #include #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 : public jana::JFactory { public: DEventRFBunch_factory(){}; ~DEventRFBunch_factory(){}; bool Get_RFTimeGuess(JEventLoop* locEventLoop, double& locRFTimeGuess, double& locRFVariance, DetectorSystem_t& locTimeSource) const; private: void Select_GoodTracks(JEventLoop* locEventLoop, vector& locSelectedTimeBasedTracks) const; jerror_t Select_RFBunch(JEventLoop* locEventLoop, vector& locTrackTimeBasedVector, const DRFTime* locRFTime); int Conduct_Vote(JEventLoop* locEventLoop, double locRFTime, vector >& locTimes, bool locUsedTracksFlag, int& locHighestNumVotes); bool Find_TrackTimes_SC(const DDetectorMatches* locDetectorMatches, const vector& locTrackTimeBasedVector, vector >& locTimes) const; bool Find_TrackTimes_NonSC(const DDetectorMatches* locDetectorMatches, const vector& locTrackTimeBasedVector, vector >& locTimes); bool Find_NeutralTimes(JEventLoop* locEventLoop, vector >& locTimes); int Find_BestRFBunchShifts(double locRFHitTime, const vector >& locTimes, map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts); bool Break_TieVote_BeamPhotons(vector& locBeamPhotons, double locRFTime, map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts, int locHighestNumVotes); int Break_TieVote_Tracks(map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts); int Break_TieVote_Neutrals(map >& locNumRFBucketsShiftedMap, set& locBestRFBunchShifts); jerror_t Select_RFBunch_NoRFTime(JEventLoop* locEventLoop, vector& locTrackTimeBasedVector); void Get_RFTimeGuess(vector >& locTimes, double& locRFTimeGuess, double& locRFVariance) const; jerror_t Create_NaNRFBunch(void); const DParticleID* dParticleID; double dRFBunchFrequency; DVector3 dTargetCenter; double dMinTrackingFOM; 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_