Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_TOF_Eff.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_TOF_Eff.h
4 //
5 
6 #ifndef _JEventProcessor_TOF_Eff_
7 #define _JEventProcessor_TOF_Eff_
8 
9 #include <JANA/JEventProcessor.h>
10 #include <JANA/JApplication.h>
11 
12 #include "TH1I.h"
13 #include "TH2I.h"
14 
15 #include "TRIGGER/DTrigger.h"
17 
18 #include "PID/DChargedTrack.h"
20 #include "PID/DParticleID.h"
21 #include "PID/DDetectorMatches.h"
22 #include "ANALYSIS/DCutActions.h"
24 
25 #include <vector>
26 #include <string>
27 #include <iostream>
28 #include <map>
29 #include <set>
30 #include <thread>
31 
32 using namespace jana;
33 using namespace std;
34 
35 class JEventProcessor_TOF_Eff : public jana::JEventProcessor
36 {
37  public:
40  const char* className(void){return "JEventProcessor_TOF_Eff";}
41 
42  private:
43  jerror_t init(void); ///< Called once at program start.
44  jerror_t brun(jana::JEventLoop* locEventLoop, int locRunNumber); ///< Called every time a new run number is detected.
45  jerror_t evnt(jana::JEventLoop* locEventLoop, uint64_t locEventNumber); ///< Called every event.
46  jerror_t erun(void); ///< Called every time run number changes, provided brun has been called.
47  jerror_t fini(void); ///< Called after last event of last event source has been processed.
48 
49  int Calc_NearestHit(const DTOFPaddleHit* locPaddleHit) const;
50  bool Cut_FCALTiming(const DChargedTrackHypothesis* locChargedTrackHypothesis, const DParticleID* locParticleID, const DEventRFBunch* locEventRFBunch);
51  double Calc_TOFTiming(const DChargedTrackHypothesis* locChargedTrackHypothesis, const DParticleID* locParticleID, const DEventRFBunch* locEventRFBunch, double& locDeltaT);
52 
53  //TRACK REQUIREMENTS
56  unsigned int dMinNumTrackHits;
58  double dMaxVertexR;
59  int dMinHitRingsPerCDCSuperlayer, dMinHitPlanesPerFDCPackage;
61 
62  //HISTOGRAMS
63  //DTOFPaddle
69 
74 
75  //TOFPoint
80 
81 
82 
83  //TREE
85  //thread_local: Each thread has its own object: no lock needed
86  //important: manages it's own data internally: don't want to call new/delete every event!
87  static thread_local DTreeFillData dTreeFillData;
88 };
89 
90 #endif // _JEventProcessor_TOF_Eff_
91 
TH2I * dHist_TOFPaddleHorizontalPaddleVsTrackX_HasHit_North
TH2I * dHist_TOFPaddleHorizontalPaddleVsTrackX_HasHit_South
TH2I * dHist_TOFPaddleHorizontalPaddleVsTrackX_TotalHit_North
TH2I * dHist_TOFPaddleTrackYVsVerticalPaddle_HasHit_Bottom
static thread_local DTreeFillData dTreeFillData
TH2I * dHist_TOFPaddleTrackYVsVerticalPaddle_TotalHit_Bottom
TH2I * dHist_TOFPaddleTrackYVsVerticalPaddle_TotalHit_Top
DCutAction_TrackHitPattern * dCutAction_TrackHitPattern
TH2I * dHist_TOFPaddleHorizontalPaddleVsTrackX_TotalHit_South