Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventRFBunch_factory_CalorimeterOnly.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEventRFBunch_factory_CalorimeterOnly.h
4 //
5 
6 #ifndef _DEventRFBunch_factory_CalorimeterOnly_
7 #define _DEventRFBunch_factory_CalorimeterOnly_
8 
9 #include <iostream>
10 #include <iomanip>
11 #include <map>
12 #include <utility>
13 #include <deque>
14 #include <vector>
15 
16 #include <TMath.h>
17 
18 #include <JANA/JFactory.h>
19 
20 #include <DVector3.h>
21 #include <DMatrix.h>
22 
23 #include <PID/DDetectorMatches.h>
24 #include <PID/DParticleID.h>
25 #include <PID/DEventRFBunch.h>
26 #include <RF/DRFTime.h>
28 #include <START_COUNTER/DSCHit.h>
29 #include <BCAL/DBCALShower.h>
30 #include <TOF/DTOFPoint.h>
31 #include <PID/DBeamPhoton.h>
32 
33 #include <HDGEOMETRY/DGeometry.h>
34 #include <DANA/DApplication.h>
35 
36 using namespace std;
37 using namespace jana;
38 
39 class DEventRFBunch_factory_CalorimeterOnly : public jana::JFactory<DEventRFBunch>
40 {
41  public:
44  const char* Tag(void){return "CalorimeterOnly";}
45 
46  private:
47 
48  jerror_t Select_RFBunch(JEventLoop* locEventLoop, const DRFTime* locRFTime);
49  int Conduct_Vote(JEventLoop* locEventLoop, double locRFTime, vector<pair<double, const JObject*> >& locTimes, bool locUsedTracksFlag, int& locHighestNumVotes);
50 
51  bool Find_NeutralTimes(JEventLoop* locEventLoop, vector<pair<double, const JObject*> >& locTimes);
52 
53  int Find_BestRFBunchShifts(double locRFHitTime, const vector<pair<double, const JObject*> >& locTimes, map<int, vector<const JObject*> >& locNumBeamBucketsShiftedMap, set<int>& locBestRFBunchShifts);
54 
55  bool Break_TieVote_BeamPhotons(vector<const DBeamPhoton*>& locBeamPhotons, double locRFTime, map<int, vector<const JObject*> >& locNumBeamBucketsShiftedMap, set<int>& locBestRFBunchShifts, int locHighestNumVotes);
56  //int Break_TieVote_Tracks(map<int, vector<const JObject*> >& locNumBeamBucketsShiftedMap, set<int>& locBestRFBunchShifts);
57  int Break_TieVote_Neutrals(map<int, vector<const JObject*> >& locNumBeamBucketsShiftedMap, set<int>& locBestRFBunchShifts);
58 
59  //jerror_t Select_RFBunch_NoRFTime(JEventLoop* locEventLoop, vector<const DTrackTimeBased*>& locTrackTimeBasedVector);
60 
61  //void Get_RFTimeGuess(vector<pair<double, const JObject*> >& locTimes, double& locRFTimeGuess, double& locRFVariance) const;
62 
63  jerror_t Create_NaNRFBunch(void);
64 
66 
69 
71 
72  bool USE_FCAL;
73  bool USE_BCAL;
74  bool USE_CCAL;
75 
76  jerror_t init(void); ///< Called once at program start.
77  jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
78  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber); ///< Called every event.
79  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
80  jerror_t fini(void); ///< Called after last event of last event source has been processed.
81 };
82 
83 #endif // _DEventRFBunch_factory_
84 
TVector3 DVector3
Definition: DVector3.h:14