Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_PSC_online.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_PSC_online.cc
4 // Created: Fri Nov 9 11:58:09 EST 2012
5 // Creator: wolin (on Linux stan.jlab.org 2.6.32-279.11.1.el6.x86_64 x86_64)
6 
7 
8 #include <stdint.h>
9 #include <vector>
10 
12 #include <JANA/JApplication.h>
13 
14 using namespace std;
15 using namespace jana;
16 
17 #include "TTAB/DTTabUtilities.h"
21 
22 #include <TDirectory.h>
23 #include <TH1.h>
24 #include <TH2.h>
25 #include <TProfile.h>
26 
27 // number of PSC modules (counters) per arm
28 const int Nmods = 8;
29 const int Narms = 2;
30 
31 const int NmultBins = 10; //number of bins for multiplicity histograms
32 
33 const double counts_cut = 100.0;
34 // root hist pointers
35 static TH1I *psc_num_events;
36 static TH1I *hHit_NHits;
37 static TH1I *hHit_Arm;
38 static TH2I *hHit_NHitsVsArm;
39 static TH2F *hHit_HasTDCvsHasADC[Narms];
40 static TH1I *hHit_Occupancy[Narms];
41 static TH1I *hHit_Integral[Narms];
43 //static TH1I *hHit_Npe[Narms];
44 static TH1I *hHit_fadcTime[Narms];
46 static TH1I *hHit_Time[Narms];
47 static TH2I *hHit_TimeVsModule[Narms];
48 static TH1I *hHit_tdcTime[Narms];
50 
51 static TH1I *hDigiHit_NfadcHits;
52 static TH1I *hDigiHit_Arm;
55 static TH1I *hDigiHit_Pedestal[Narms];
56 static TProfile *hDigiHit_PedestalVsModule[Narms];
59 static TH1I *hDigiHit_RawPeak[Narms];
67 static TH1I *hDigiHit_PulseTime[Narms];
68 static TH1I *hDigiHit_fadcTime[Narms];
71 
73 static TH1I *hDigiHit_Arm_cut;
79 
80 static TH1I *hDigiHit_NtdcHits;
82 static TH1I *hDigiHit_tdcRawTime[Narms];
83 static TH1I *hDigiHit_tdcTime[Narms];
90 //----------------------------------------------------------------------------------
91 
92 // Routine used to create our JEventProcessor
93 extern "C"{
94  void InitPlugin(JApplication *app){
95  InitJANAPlugin(app);
96  app->AddProcessor(new JEventProcessor_PSC_online());
97  }
98 }
99 
100 
101 //----------------------------------------------------------------------------------
102 
103 
105 }
106 
107 
108 //----------------------------------------------------------------------------------
109 
110 
112 }
113 
114 
115 //----------------------------------------------------------------------------------
116 
118 
119  // create root folder for psc and cd to it, store main dir
120  TDirectory *mainDir = gDirectory;
121  TDirectory *pscDir = gDirectory->mkdir("PSC");
122  pscDir->cd();
123 
124  // book hists
125  psc_num_events = new TH1I("psc_num_events","PSC Number of events",1,0.5,1.5);
126  // fADC250 hit-level hists (after calibration)
127  TDirectory *hitDir = gDirectory->mkdir("Hit"); hitDir->cd();
128  hHit_NHits = new TH1I("Hit_NHits","PSC hit multiplicity;hits;events",NmultBins,0.5,0.5+NmultBins);
129  hHit_Arm = new TH1I("Hit_Arm","PSC arm;arm;hits",Narms,-0.5,-0.5+Narms);
130  hHit_NHitsVsArm = new TH2I("Hit_NHitsVsArm","PSC hit multiplicity vs. arm;arm;hits",Narms,-0.5,-0.5+Narms,NmultBins,0.5,0.5+NmultBins);
131  TString arm_str[] = {"Left","Right"};
132  for (int i = 0; i < Narms; i++) {
133  gDirectory->mkdir(arm_str[i]+"Arm")->cd();
134  TString strN = "_" + arm_str[i] + "Arm";
135  TString strT = ", " + arm_str[i] + " arm";
136  hHit_HasTDCvsHasADC[i] = new TH2F("Hit_HasTDCvsHasADC"+strN,"PSC has TDC? vs. has ADC?"+strT+";fADC status;TDC status",2,-0.5,1.5,2,-0.5,1.5);
137  hHit_Occupancy[i] = new TH1I("Hit_Occupancy"+strN,"PSC occupancy"+strT+";module (counter);hits / module",Nmods,0.5,0.5+Nmods);
138  hHit_Integral[i] = new TH1I("Hit_Integral"+strN,"PSC fADC pulse integral"+strT+";pulse integral;hits",250,0.0,10000.0);
139  hHit_IntegralVsModule[i] = new TH2I("Hit_IntegralVsModule"+strN,"PSC fADC pulse integral vs. module"+strT+";module (counter);pulse integral",Nmods,0.5,0.5+Nmods,250,0.0,10000.0);
140  //hHit_Npe[i] = new TH1I("Hit_Npe"+strN,"PSC fADC number of pixels"+strT+";pixels;hits",200,0,100);
141  hHit_fadcTime[i] = new TH1I("Hit_fadcTime"+strN,"PSC fADC time"+strT+";time [ns];hits / 400 ps",200,-40.0,40.0);
142  hHit_fadcTimeVsModule[i] = new TH2I("Hit_fadcTimeVsModule"+strN,"PSC fADC time vs. module"+strT+";module (counter);time [ns]",Nmods,0.5,0.5+Nmods,200,-40.0,40.0);
143  hHit_Time[i] = new TH1I("Hit_Time"+strN,"PSC time"+strT+";time [ns];hits / 400 ps",200,-40.0,40.0);
144  hHit_TimeVsModule[i] = new TH2I("Hit_TimeVsModule"+strN,"PSC time vs. module"+strT+";module (counter);time [ns]",Nmods,0.5,0.5+Nmods,200,-40.0,40.0);
145  hHit_tdcTime[i] = new TH1I("Hit_tdcTime"+strN,"PSC TDC time"+strT+";time [ns];hits / 400 ps",200,-40.0,40.0);
146  hHit_tdcadcTimeDiffVsModule[i] = new TH2I("Hit_tdcadcTimeDiffVsModule"+strN,"PSC TDC/ADC time difference vs. module"+strT+";module (counter);time(TDC) - time(ADC) [ns]",Nmods,0.5,0.5+Nmods,200,-40.0,40.0);
147  hitDir->cd();
148  }
149  // fADC250 and F1TDC digihit-level hists
150  pscDir->cd();
151  TDirectory *digihitDir = gDirectory->mkdir("DigiHit"); digihitDir->cd();
152  hDigiHit_NfadcHits = new TH1I("DigiHit_NfadcHits","PSC fADC hit multiplicity;raw hits;events",NmultBins,0.5,0.5+NmultBins);
153  hDigiHit_Arm = new TH1I("DigiHit_Arm","PSC arm;arm;raw hits",Narms,-0.5,-0.5+Narms);
154  hDigiHit_NfadcHitsVsArm = new TH2I("DigiHit_NfadcHitsVsArm","PSC fADC hit multiplicity vs. arm;arm;raw hits",Narms,-0.5,-0.5+Narms,NmultBins,0.5,0.5+NmultBins);
155  hDigiHit_NtdcHits = new TH1I("DigiHit_NtdcHits","PSC TDC hit multiplicity;raw hits;events",NmultBins,0.5,0.5+NmultBins);
156  hDigiHit_NfadcHits_cut = new TH1I("DigiHit_NfadcHits_cut","PSC fADC hit multiplicity (> 100 ADC integral counts);raw hits;events",NmultBins,0.5,0.5+NmultBins);
157  hDigiHit_Arm_cut = new TH1I("DigiHit_Arm_cut","PSC arm (> 100 ADC integral counts);arm;raw hits",Narms,-0.5,-0.5+Narms);
158  hDigiHit_NfadcHitsVsArm_cut = new TH2I("DigiHit_NfadcHitsVsArm_cut","PSC fADC hit multiplicity vs. arm (> 100 ADC integral counts);arm;raw hits",Narms,-0.5,-0.5+Narms,NmultBins,0.5,0.5+NmultBins);
159  for (int i = 0; i < Narms; i++) {
160  gDirectory->mkdir(arm_str[i]+"Arm")->cd();
161  TString strN = "_" + arm_str[i] + "Arm";
162  TString strT = ", " + arm_str[i] + " arm";
163  hDigiHit_NSamplesPedestal[i] = new TH1I("DigiHit_NSamplesPedestal"+strN,"PSC fADC pedestal samples"+strT+";pedestal samples;raw hits",50,-0.5,49.5);
164  hDigiHit_Pedestal[i] = new TH1I("DigiHit_Pedestal"+strN,"PSC fADC pedestals"+strT+";pedestal [fADC counts];raw hits",200,0.0,200.0);
165  hDigiHit_PedestalVsModule[i] = new TProfile("DigiHit_PedestalVsModule"+strN,"PSC pedestal vs. module"+strT+";module (counter);average pedestal [fADC counts]",Nmods,0.5,0.5+Nmods,"s");
166  hDigiHit_QualityFactor[i] = new TH1I("DigiHit_QualityFactor"+strN,"PSC fADC quality factor"+strT+";quality factor;raw hits",4,-0.5,3.5);
167  hDigiHit_fadcOccupancy[i] = new TH1I("DigiHit_fadcOccupancy"+strN,"PSC fADC hit occupancy"+strT+";module (counter);raw hits / module",Nmods,0.5,0.5+Nmods);
168  hDigiHit_RawPeak[i] = new TH1I("DigiHit_RawPeak"+strN,"PSC fADC pulse peak (raw)"+strT+";pulse peak (raw);raw hits",410,0.0,4100.0);
169  hDigiHit_RawPeakVsModule[i] = new TH2I("DigiHit_RawPeakVsModule"+strN,"PSC fADC pulse peak (raw) vs. module"+strT+";module (counter);pulse peak (raw)",Nmods,0.5,0.5+Nmods,410,0.0,4100.0);
170  hDigiHit_RawIntegral[i] = new TH1I("DigiHit_RawIntegral"+strN,"PSC fADC pulse integral (raw)"+strT+";pulse integral (raw);raw hits",500,0.0,20000.0);
171  hDigiHit_RawIntegralVsModule[i] = new TH2I("DigiHit_RawIntegralVsModule"+strN,"PSC fADC pulse integral (raw) vs. module"+strT+";module (counter);pulse integral (raw)",Nmods,0.5,0.5+Nmods,500,0.0,20000.0);
172  hDigiHit_NSamplesIntegral[i] = new TH1I("DigiHit_NSamplesIntegral"+strN,"PSC fADC integral samples"+strT+";integral samples;raw hits",60,-0.5,59.5);
173  hDigiHit_PeakVsModule[i] = new TH2I("DigiHit_PeakVsModule"+strN,"PSC fADC pulse peak vs. module"+strT+";module (counter);pulse peak",Nmods,0.5,0.5+Nmods,410,0.0,4100.0);
174  hDigiHit_IntegralVsPeak[i] = new TH2I("DigiHit_IntegralVsPeak"+strN,"PSC fADC pulse integral vs. peak"+strT+";pulse peak;pulse integral",410,0.0,4100.0,250,0.0,10000.0);
175  hDigiHit_IntegralVsModule[i] = new TH2I("DigiHit_IntegralVsModule"+strN,"PSC fADC pulse integral vs. module"+strT+";module (counter);pulse integral",Nmods,0.5,0.5+Nmods,250,0.0,10000.0);
176  hDigiHit_PulseTime[i] = new TH1I("DigiHit_PulseTime"+strN,"PSC fADC pulse time"+strT+";pulse time [62.5 ps];raw hits",2000,0.0,6500.0);
177  hDigiHit_fadcTime[i] = new TH1I("DigiHit_fadcTime"+strN,"PSC fADC pulse time"+strT+";pulse time [ns];raw hits / 400 ps",1000,0.0,400.0);
178  hDigiHit_fadcTimeVsModule[i] = new TH2I("DigiHit_fadcTimeVsModule"+strN,"PSC fADC pulse time vs. module"+strT+";module (counter);pulse time [ns]",Nmods,0.5,0.5+Nmods,1000,0.0,400.0);
179  hDigiHit_fadcTimeVsIntegral[i] = new TH2I("DigiHit_fadcTimeVsIntegral"+strN,"PSC fADC pulse time vs. integral"+strT+";pulse integral;pulse time [ns]",250,0.0,10000.0,1000,0.0,400.0);
180  // digihit-level hists after cut on ADC integral counts
181  hDigiHit_fadcOccupancy_cut[i] = new TH1I("DigiHit_fadcOccupancy_cut"+strN,"PSC fADC hit occupancy (> 100 ADC integral counts)"+strT+";module (counter);raw hits / module",Nmods,0.5,0.5+Nmods);
182  hDigiHit_fadcTime_cut[i] = new TH1I("DigiHit_fadcTime_cut"+strN,"PSC fADC pulse time (> 100 ADC integral counts)"+strT+";pulse time [ns];raw hits / 400 ps",1000,0.0,400.0);
183  hDigiHit_fadcTimeVsModule_cut[i] = new TH2I("DigiHit_fadcTimeVsModule_cut"+strN,"PSC fADC pulse time vs. module (> 100 ADC integral counts)"+strT+";module (counter);pulse time [ns]",Nmods,0.5,0.5+Nmods,1000,0.0,400.0);
184  hDigiHit_fadcTimeVsQF_cut[i] = new TH2I("DigiHit_fadcTimeVsQF_cut"+strN,"PSC fADC pulse time vs. quality factor (> 100 ADC integral counts)"+strT+";fADC quality factor;pulse time [ns]",4,-0.5,3.5,1000,0.0,400.0);
185  // TDC hists
186  hDigiHit_tdcOccupancy[i] = new TH1I("DigiHit_tdcOccupancy"+strN,"PSC TDC hit occupancy"+strT+";module (counter);raw hits / module",Nmods,0.5,0.5+Nmods);
187  hDigiHit_tdcRawTime[i] = new TH1I("DigiHit_tdcRawTime"+strN,"PSC TDC raw time"+strT+";time [60 ps];raw hits",1000,0.0,65500.0);
188  hDigiHit_tdcTime[i] = new TH1I("DigiHit_tdcTime"+strN,"PSC TDC time"+strT+";time [ns];raw hits / 250 ps",3200,0.0,800.0);
189  hDigiHit_tdcTimeVsModule[i] = new TH2I("DigiHit_tdcTimeVsModule"+strN,"PSC TDC time"+strT+";module (counter);TDC time [ns]",Nmods,0.5,0.5+Nmods,3200,0.0,800.0);
190  hDigiHit_tdcTimeVsfadcTime[i] = new TH2I("DigiHit_tdcTimeVsfadcTime"+strN,"PSC TDC time vs. ADC time"+strT+";fADC time [ns];TDC time [ns]",400,0.0,400.0,800,0.0,800.0);
191  hDigiHit_tdcadcTimeDiff[i] = new TH1I("DigiHit_tdcadcTimeDiff"+strN,"PSC TDC/ADC time difference"+strT+";time(TDC) - time(ADC) [ns];hits",1000,0.0,400.0);
192  hDigiHit_tdcadcTimeDiffVsModule[i] = new TH2I("DigiHit_tdcadcTimeDiffVsModule"+strN,"PSC TDC/ADC time difference vs. module"+strT+";module (counter);time(TDC) - time(ADC) [ns]",Nmods,0.5,0.5+Nmods,1000,0.0,400.0);
193  hDigiHit_tdcadcTimeDiffVsIntegral[i] = new TH2I("DigiHit_tdcadcTimeDiffVsIntegral"+strN,"PSC TDC/ADC time difference vs. pulse integral"+strT+";pulse integral;time(TDC) - time(ADC) [ns]",500,0.0,15000.0,1000,0.0,400.0);
194  hDigiHit_adctdcMatchesVsModule[i] = new TH2I("DigiHit_adctdcMatchesVsModule"+strN,"PSC #TDC matches / fADC hit vs. module"+strT+";module (counter);#TDC matches / fADC hit",Nmods,0.5,0.5+Nmods,5,-0.5,4.5);
195  digihitDir->cd();
196  }
197  // back to main dir
198  mainDir->cd();
199 
200  return NOERROR;
201 }
202 
203 
204 //----------------------------------------------------------------------------------
205 
206 
207 jerror_t JEventProcessor_PSC_online::brun(JEventLoop *eventLoop, int32_t runnumber) {
208  // This is called whenever the run number changes
209  return NOERROR;
210 }
211 
212 
213 //----------------------------------------------------------------------------------
214 
215 
216 jerror_t JEventProcessor_PSC_online::evnt(JEventLoop *eventLoop, uint64_t eventnumber) {
217  // This is called for every event. Use of common resources like writing
218  // to a file or filling a histogram should be mutex protected. Using
219  // loop-Get(...) to get reconstructed objects (and thereby activating the
220  // reconstruction algorithm) should be done outside of any mutex lock
221  // since multiple threads may call this method at the same time.
222 
223  // Get data for PSC
224  vector<const DPSCDigiHit*> digihits;
225  eventLoop->Get(digihits);
226  vector<const DPSCTDCDigiHit*> tdcdigihits;
227  eventLoop->Get(tdcdigihits);
228  vector<const DPSCHit*> hits;
229  eventLoop->Get(hits);
230 
231  const DTTabUtilities* ttabUtilities = nullptr;
232  eventLoop->GetSingle(ttabUtilities);
233 
234  // FILL HISTOGRAMS
235  // Since we are filling histograms local to this plugin, it will not interfere with other ROOT operations: can use plugin-wide ROOT fill lock
236  japp->RootFillLock(this); //ACQUIRE ROOT FILL LOCK
237 
238  if (digihits.size() > 0 || tdcdigihits.size() > 0) psc_num_events->Fill(1);
239 
240  // Fill digihit hists
241  int NDigiHits[] = {0,0};
242  int NDigiHits_cut[] = {0,0};
243  hDigiHit_NfadcHits->Fill(digihits.size());
244  hDigiHit_NtdcHits->Fill(tdcdigihits.size());
245  for (const auto& hit : digihits) {
246  int arm = (hit->counter_id <= Nmods) ? 0 : 1;
247  int module = (hit->counter_id <= Nmods) ? hit->counter_id : (hit->counter_id - Nmods);
248  double ped = (double)hit->pedestal/hit->nsamples_pedestal;
249  hDigiHit_NSamplesPedestal[arm]->Fill(hit->nsamples_pedestal);
250  hDigiHit_Pedestal[arm]->Fill(ped);
251  hDigiHit_RawPeak[arm]->Fill(hit->pulse_peak);
252  if (ped == 0.0 || hit->pulse_peak == 0) continue;
253  NDigiHits[arm]++;
254  hDigiHit_Arm->Fill(arm);
255  hDigiHit_PedestalVsModule[arm]->Fill(module,ped);
256  hDigiHit_fadcOccupancy[arm]->Fill(module);
257  hDigiHit_RawPeakVsModule[arm]->Fill(module,hit->pulse_peak);
258  hDigiHit_RawIntegral[arm]->Fill(hit->pulse_integral);
259  hDigiHit_RawIntegralVsModule[arm]->Fill(module,hit->pulse_integral);
260  hDigiHit_NSamplesIntegral[arm]->Fill(hit->nsamples_integral);
261  hDigiHit_PeakVsModule[arm]->Fill(module,hit->pulse_peak-ped);
262  double pI = hit->pulse_integral - hit->nsamples_integral*ped;
263  hDigiHit_IntegralVsModule[arm]->Fill(module,pI);
264  hDigiHit_IntegralVsPeak[arm]->Fill(hit->pulse_peak-ped,pI);
265  hDigiHit_PulseTime[arm]->Fill(hit->pulse_time);
266  double t_ns = 0.0625*hit->pulse_time;
267  hDigiHit_fadcTime[arm]->Fill(t_ns);
268  hDigiHit_fadcTimeVsModule[arm]->Fill(module,t_ns);
269  hDigiHit_fadcTimeVsIntegral[arm]->Fill(pI,t_ns);
270  hDigiHit_QualityFactor[arm]->Fill(hit->QF);
271  if (pI > counts_cut) {
272  NDigiHits_cut[arm]++;
273  hDigiHit_Arm_cut->Fill(arm);
274  hDigiHit_fadcOccupancy_cut[arm]->Fill(module);
275  hDigiHit_fadcTime_cut[arm]->Fill(t_ns);
276  hDigiHit_fadcTimeVsModule_cut[arm]->Fill(module,t_ns);
277  hDigiHit_fadcTimeVsQF_cut[arm]->Fill(hit->QF,t_ns);
278  }
279  }
280  hDigiHit_NfadcHitsVsArm->Fill(0.,NDigiHits[0]); hDigiHit_NfadcHitsVsArm->Fill(1.,NDigiHits[1]);
281  hDigiHit_NfadcHitsVsArm_cut->Fill(0.,NDigiHits_cut[0]); hDigiHit_NfadcHitsVsArm_cut->Fill(1.,NDigiHits_cut[1]);
282  hDigiHit_NfadcHits_cut->Fill(NDigiHits_cut[0]+NDigiHits_cut[1]);
283 
284  for (const auto& hit : digihits) {
285  double ped = (double)hit->pedestal/hit->nsamples_pedestal;
286  double pI = hit->pulse_integral - hit->nsamples_integral*ped;
287  if (hit->pedestal > 0 && pI > counts_cut) {
288  int arm = (hit->counter_id <= Nmods) ? 0 : 1;
289  int module = (hit->counter_id <= Nmods) ? hit->counter_id : (hit->counter_id - Nmods);
290  int matches = 0;
291  for (const auto& tdchit : tdcdigihits) {
292  if (hit->counter_id == tdchit->counter_id) {
293  matches++;
294  double T_tdc = ttabUtilities->Convert_DigiTimeToNs_F1TDC(tdchit);
295  double T_adc = 0.0625*hit->pulse_time;
296  hDigiHit_tdcTimeVsfadcTime[arm]->Fill(T_adc,T_tdc);
297  hDigiHit_tdcadcTimeDiff[arm]->Fill(T_tdc-T_adc);
298  hDigiHit_tdcadcTimeDiffVsModule[arm]->Fill(module,T_tdc-T_adc);
299  hDigiHit_tdcadcTimeDiffVsIntegral[arm]->Fill(pI,T_tdc-T_adc);
300  }
301  }
302  hDigiHit_adctdcMatchesVsModule[arm]->Fill(module,matches);
303  }
304  }
305 
306  for (const auto& hit : tdcdigihits) {
307  int arm = (hit->counter_id <= Nmods) ? 0 : 1;
308  int module = (hit->counter_id <= Nmods) ? hit->counter_id : (hit->counter_id - Nmods);
309  hDigiHit_tdcOccupancy[arm]->Fill(module);
310  hDigiHit_tdcRawTime[arm]->Fill(hit->time);
311  double T_tdc = ttabUtilities->Convert_DigiTimeToNs_F1TDC(hit);
312  hDigiHit_tdcTime[arm]->Fill(T_tdc);
313  hDigiHit_tdcTimeVsModule[arm]->Fill(module,T_tdc);
314  }
315 
316  // Fill calibrated-hit hists
317  int NHits[] = {0,0};
318  for (const auto& hit : hits) {
319  int arm = hit->arm;
320  hHit_HasTDCvsHasADC[arm]->Fill(hit->has_fADC,hit->has_TDC);
321  if (hit->has_fADC) {
322  hHit_Arm->Fill(arm);
323  NHits[arm]++;
324  hHit_Occupancy[arm]->Fill(hit->module);
325  hHit_Integral[arm]->Fill(hit->integral);
326  hHit_IntegralVsModule[arm]->Fill(hit->module,hit->integral);
327  //hHit_Npe[arm]->Fill(hit->npe_fadc);
328  hHit_fadcTime[arm]->Fill(hit->time_fadc);
329  hHit_fadcTimeVsModule[arm]->Fill(hit->module,hit->time_fadc);
330  hHit_Time[arm]->Fill(hit->t);
331  hHit_TimeVsModule[arm]->Fill(hit->module,hit->t);
332  if (hit->has_TDC) {
333  hHit_tdcTime[arm]->Fill(hit->time_tdc);
334  hHit_tdcadcTimeDiffVsModule[arm]->Fill(hit->module,hit->time_tdc-hit->time_fadc);
335  }
336  }
337  }
338  hHit_NHits->Fill(NHits[0]+NHits[1]);
339  hHit_NHitsVsArm->Fill(0.,NHits[0]); hHit_NHitsVsArm->Fill(1.,NHits[1]);
340 
341  japp->RootFillUnLock(this); //RELEASE ROOT FILL LOCK
342 
343  return NOERROR;
344 }
345 
346 
347 //----------------------------------------------------------------------------------
348 
349 
351  // This is called whenever the run number changes, before it is
352  // changed to give you a chance to clean up before processing
353  // events from the next run number.
354  return NOERROR;
355 }
356 
357 
358 //----------------------------------------------------------------------------------
359 
360 
362  // Called before program exit after event processing is finished.
363  return NOERROR;
364 }
365 
366 
367 //----------------------------------------------------------------------------------
368 //----------------------------------------------------------------------------------
static TH1I * hDigiHit_NSamplesPedestal[Narms]
double counts_cut
double Convert_DigiTimeToNs_F1TDC(const JObject *locTDCDigiHit) const
const int Nmods
if(locHist_BCALShowerPhiVsZ!=NULL)
static TH1I * hDigiHit_fadcOccupancy[Narms]
static TH2I * hHit_IntegralVsModule[Narms]
static TH1I * hHit_fadcTime[Narms]
static TH1I * hDigiHit_tdcOccupancy[Narms]
static TH1I * hDigiHit_fadcTime_cut[Narms]
static TH1I * hDigiHit_NfadcHits_cut
static TH1I * hDigiHit_tdcadcTimeDiff[Narms]
static TH2I * hDigiHit_fadcTimeVsModule_cut[Narms]
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
static TH2I * hDigiHit_RawIntegralVsModule[Narms]
const int NmultBins
static TH2I * hDigiHit_IntegralVsPeak[Narms]
static TH1I * hDigiHit_QualityFactor[Narms]
static TH2I * hDigiHit_IntegralVsModule[Narms]
TDirectory * mainDir
Definition: p2k_hists.C:2
static TH1I * hDigiHit_PulseTime[Narms]
static TH2I * hDigiHit_NfadcHitsVsArm
static TH1I * hDigiHit_NtdcHits
static TH2I * hDigiHit_fadcTimeVsModule[Narms]
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
static TH1I * hDigiHit_tdcTime[Narms]
JApplication * japp
static TH1I * hHit_Time[Narms]
static TH2I * hDigiHit_tdcTimeVsfadcTime[Narms]
static TH2I * hDigiHit_PeakVsModule[Narms]
static TH2I * hHit_TimeVsModule[Narms]
static TH2I * hDigiHit_fadcTimeVsQF_cut[Narms]
InitPlugin_t InitPlugin
static TH1I * hDigiHit_Arm_cut
static TH1I * hHit_Arm
static TH2I * hDigiHit_RawPeakVsModule[Narms]
static TH1I * hDigiHit_tdcRawTime[Narms]
static TH2F * hHit_HasTDCvsHasADC[Narms]
const int Narms
static TH1I * hDigiHit_fadcOccupancy_cut[Narms]
static TH1I * hDigiHit_Pedestal[Narms]
static TH1I * hDigiHit_RawIntegral[Narms]
static TH1I * hHit_NHits
jerror_t fini(void)
Called after last event of last event source has been processed.
static int matches(char *d, char *c, t_iostream *fp)
Definition: hddm_t.c:356
static TH1I * psc_num_events
static TH2I * hHit_tdcadcTimeDiffVsModule[Narms]
static TH1I * hHit_Integral[Narms]
static TProfile * hDigiHit_PedestalVsModule[Narms]
static TH1I * hDigiHit_fadcTime[Narms]
static TH1I * hDigiHit_RawPeak[Narms]
static TH2I * hDigiHit_fadcTimeVsIntegral[Narms]
static TH1I * hHit_Occupancy[Narms]
static TH2I * hDigiHit_adctdcMatchesVsModule[Narms]
static TH1I * hDigiHit_NfadcHits
static TH1I * hHit_tdcTime[Narms]
static TH1I * hDigiHit_NSamplesIntegral[Narms]
static TH2I * hDigiHit_NfadcHitsVsArm_cut
static TH2I * hHit_NHitsVsArm
static TH2I * hHit_fadcTimeVsModule[Narms]
static TH2I * hDigiHit_tdcadcTimeDiffVsModule[Narms]
static TH2I * hDigiHit_tdcadcTimeDiffVsIntegral[Narms]
static TH1I * hDigiHit_Arm
static TH2I * hDigiHit_tdcTimeVsModule[Narms]
jerror_t init(void)
Called once at program start.