Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_TOF_calib.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_TOF_calib.h
4 // Created: Fri Mar 13 10:37:27 EDT 2015
5 // Creator: zihlmann (on Linux gluon47.jlab.org 2.6.32-358.23.2.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_TOF_calib_
9 #define _JEventProcessor_TOF_calib_
10 
11 #include <JANA/JEventProcessor.h>
12 using namespace jana;
13 using namespace std;
14 #include <stdint.h>
15 #include <DAQ/DCODAEventInfo.h>
16 #include <TOF/DTOFDigiHit.h>
17 
18 #include <TOF/DTOFTDCDigiHit.h>
19 #include <DAQ/Df250PulseIntegral.h>
20 #include <DAQ/Df250PulsePedestal.h>
21 #include <DAQ/Df250WindowRawData.h>
22 #include <TRIGGER/DL1Trigger.h>
23 #include <DAQ/DCAEN1290TDCHit.h>
24 #include <DAQ/DCODAROCInfo.h>
25 
26 #include <TDirectory.h>
27 #include <TFile.h>
28 #include <TTree.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 
32 #include <math.h>
33 
34 #define MaxHits 100
35 
36 class JEventProcessor_TOF_calib:public jana::JEventProcessor{
37  public:
40  const char* className(void){return "JEventProcessor_TOF_calib";}
41 
42  int first;
43  int RunNumber;
44 
45  float TDCTLOC;
46  float ADCTLOC;
47 
49 
50  TH2F *TOFTDCtime;
51  TH2F *TOFADCtime;
52  TH2F *TOFEnergy;
53  TH2F *TOFPeak;
54  TH2F *TOFPedestal;
55 
56 
57  float ADCTimeCut;
58  float TDCTimeCut;
59 
62  struct paddle{
63  int paddle;
64  float timeL;
65  float timeR;
66  float mt;
67  float td;
68  float adcL;
69  float adcR;
70  int OverFlowL;
71  int OverFlowR;
72  float PeakL;
73  float PeakR;
74  };
75 
76  struct SingleP{
77  int paddle;
78  int LR;
79  float time;
80  float adc;
81  int OverFlow;
82  float Peak;
83  };
84 
85 
86  char ROOTFileName[128];
87  TFile *ROOTFile;
88  TTree *t3;
89  int Event;
90  int Nhits;
91  int Plane[MaxHits];
92  int Paddle[MaxHits];
93  float MeanTime[MaxHits];
94  float TimeDiff[MaxHits];
95  float TShift;
96 
97  int NhitsA;
98  int PlaneA[MaxHits];
99  int PaddleA[MaxHits];
100  float MeanTimeA[MaxHits];
101  float TimeDiffA[MaxHits];
102  float ADCL[MaxHits];
103  float ADCR[MaxHits];
104  int OFL[MaxHits];
105  int OFR[MaxHits];
106  float PEAKL[MaxHits];
107  float PEAKR[MaxHits];
108 
110  int PlaneSA[MaxHits];
111  int PaddleSA[MaxHits];
112  int LRA[MaxHits];
113  float ADCS[MaxHits];
114  float TADCS[MaxHits];
115  int OF[MaxHits];
116  float PEAK[MaxHits];
117 
119  int PlaneST[MaxHits];
120  int PaddleST[MaxHits];
121  int LRT[MaxHits];
122  float TDCST[MaxHits];
123 
124  pthread_mutex_t mutex;
125  private:
126  jerror_t WriteRootFile(void);
127  jerror_t MakeHistograms(void);
128  jerror_t init(void);
129  //jerror_t brun(jana::JEventLoop *eventLoop, int runnumber);
130  //jerror_t evnt(jana::JEventLoop *eventLoop, int eventnumber);
131  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber);
132  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber);
133  jerror_t erun(void);
134  jerror_t fini(void);
135 };
136 
137 #endif // _JEventProcessor_TOF_calib_
138 
139 
140 
#define MaxHits