Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_BCAL_attenlength_gainratio.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_BCAL_attenlength_gainratio.cc
4 // Created: Mon Aug 10 10:17:48 EDT 2015
5 // Creator: dalton (on Linux gluon02.jlab.org 2.6.32-358.18.1.el6.x86_64 x86_64)
6 //
7 
9 using namespace jana;
10 
11 #include "BCAL/DBCALPoint.h"
12 #include "BCAL/DBCALDigiHit.h"
13 #include "DANA/DApplication.h"
14 #include "DANA/DStatusBits.h"
15 #include "HistogramTools.h" // To make my life easier
16 
17 #include <TDirectory.h>
18 #include <TStyle.h>
19 #include <TF1.h>
20 
21 
22 // Routine used to create our JEventProcessor
23 #include <JANA/JApplication.h>
24 #include <JANA/JFactory.h>
25 extern "C"{
26 void InitPlugin(JApplication *app){
27  InitJANAPlugin(app);
28  app->AddProcessor(new JEventProcessor_BCAL_attenlength_gainratio());
29 }
30 } // "C"
31 
32 
33 //------------------
34 // JEventProcessor_BCAL_attenlength_gainratio (Constructor)
35 //------------------
37 {
38  VERBOSE = 0; // 4: once per event, 5: multipple times per event
39  VERBOSEHISTOGRAMS = 0;
40 
41  if(gPARMS){
42  gPARMS->SetDefaultParameter("BCAL_ALGR:VERBOSE", VERBOSE, "Verbosity level");
43  gPARMS->SetDefaultParameter("BCAL_ALGR:VERBOSEHISTOGRAMS", VERBOSEHISTOGRAMS, "Create more histograms (default 0 for monitoring)");
44  }
45 
46 }
47 
48 //------------------
49 // ~JEventProcessor_BCAL_attenlength_gainratio (Destructor)
50 //------------------
52 {
53 
54 }
55 
56 //------------------
57 // init
58 //------------------
60 {
61 
62  // Set style
63  gStyle->SetTitleOffset(1, "Y");
64  gStyle->SetTitleOffset(1.3, "z");
65  gStyle->SetTitleSize(0.06,"xyz");
66  gStyle->SetTitleSize(0.07,"h");
67  gStyle->SetLabelSize(0.06,"xy");
68  gStyle->SetLabelSize(0.04,"z");
69  gStyle->SetTitleX(0);
70  gStyle->SetTitleAlign(13);
71  gStyle->SetNdivisions(505,"xy");
72 
73  gStyle->SetOptStat(11);
74  gStyle->SetOptFit(1);
75 
76  // create root folder for bcal and cd to it, store main dir
77  TDirectory *main = gDirectory; // save current directory
78  TDirectory *bcalgainratio = main->mkdir("bcalgainratio");
79  bcalgainratio->cd();
80 
81  char histname[255], modtitle[255], histtitle[255];
82 
83  sprintf(histtitle,"All channels;Z Position (cm);log of integral ratio US/DS");
84  logintratiovsZ_all = new TH2I("logintratiovsZ_all",histtitle,500,-250.0,250.0,500,-3,3);
85  sprintf(histtitle,"All channels;Z Position (cm);log of peak ratio US/DS");
86  logpeakratiovsZ_all = new TH2I("logpeakratiovsZ_all",histtitle,500,-250.0,250.0,500,-3,3);
87 
88  sprintf(histtitle,"Atten. length from integ.;-2 / slope of [ln(A_{U}/A_{D}) vs position];BCAL cells");
89  hist_attenlength = new TH1I("hist_attenlength",histtitle,100,200,900);
90  sprintf(histtitle,"Gain ratio from integ.;G_{U}/G_{D} from [ln(A_{U}/A_{D}) vs position];BCAL cells");
91  hist_gainratio = new TH1I("hist_gainratio",histtitle,100,0.3,1.7);
92 
93  sprintf(histtitle,"Atten. length from integ. (Uncertainty);fit uncertainty;BCAL cells");
94  hist_attenlength_err = new TH1I("hist_attenlength_err",histtitle,100,0,0);
95  sprintf(histtitle,"Gain ratio from integ. (Uncertainty);fit uncertainty;BCAL cells");
96  hist_gainratio_err = new TH1I("hist_gainratio_err",histtitle,100,0,0);
97 
98  sprintf(histtitle,"Atten. length from integ. (Uncertainty);rel. fit uncertainty (%%);BCAL cells");
99  hist_attenlength_relerr = new TH1I("hist_attenlength_relerr",histtitle,100,0,0);
100  sprintf(histtitle,"Gain ratio from integ. (Uncertainty);rel. fit uncertainty (%%);BCAL cells");
101  hist_gainratio_relerr = new TH1I("hist_gainratio_relerr",histtitle,100,0,0);
102 
103  sprintf(histtitle,"Atten. length from integ.;Module;Layer and Sector");
104  hist2D_intattenlength = new TH2F("hist2D_intattenlength",histtitle,48,0.5,48.5,16,0.5,16.5);
105  sprintf(histtitle,"Gain ratio from integ.;Module;Layer and Sector;G_{U}/G_{D}");
106  hist2D_intgainratio = new TH2F("hist2D_intgainratio",histtitle,48,0.5,48.5,16,0.5,16.5);
107 
108  if (VERBOSEHISTOGRAMS) {
109  sprintf(histtitle,"Atten. length from peak;Module;Layer and Sector");
110  hist2D_peakattenlength = new TH2F("hist2D_peakattenlength",histtitle,48,0.5,48.5,16,0.5,16.5);
111  sprintf(histtitle,"Gain ratio from peak;Module;Layer and Sector;G_{U}/G_{D}");
112  hist2D_peakgainratio = new TH2F("hist2D_peakgainratio",histtitle,48,0.5,48.5,16,0.5,16.5);
113 
114  sprintf(histtitle,"Average Z pos;Module;Layer and Sector;Z (cm)");
115  hist2D_aveZ = new TH2F("hist2D_aveZ",histtitle,48,0.5,48.5,16,0.5,16.5);
116  }
117 
118  EvsZ_all = new TH2I("EvsZ_all","E vs Z;Z Position (cm);Energy",100,-250.0,250.0,200,0,0.2);
119  EvsZ_layer[0] = new TH2I("EvsZ_layer1","E vs Z (layer 1);Z Position (cm);Energy",100,-250.0,250.0,200,0,0.2);
120  EvsZ_layer[1] = new TH2I("EvsZ_layer2","E vs Z (layer 2);Z Position (cm);Energy",100,-250.0,250.0,200,0,0.2);
121  EvsZ_layer[2] = new TH2I("EvsZ_layer3","E vs Z (layer 3);Z Position (cm);Energy",100,-250.0,250.0,200,0,0.2);
122  EvsZ_layer[3] = new TH2I("EvsZ_layer4","E vs Z (layer 4);Z Position (cm);Energy",100,-250.0,250.0,200,0,0.2);
123 
124  gStyle->SetOptFit(0);
125  gStyle->SetOptStat(0);
126 
127  TDirectory *dirlogpeakratiovsZ = bcalgainratio->mkdir("logpeakratiovsZ");
128  TDirectory *dirlogintratiovsZ = bcalgainratio->mkdir("logintratiovsZ");
129  TDirectory *dirEvsZ = bcalgainratio->mkdir("EvsZ");
130 
131  // Create histograms
132  if (VERBOSEHISTOGRAMS) {
133  dirlogpeakratiovsZ->cd();
134  for (int module=0; module<nummodule; module++) {
135  for (int layer=0; layer<numlayer; layer++) {
136  for (int sector=0; sector<numsector; sector++) {
137  sprintf(histname,"logpeakratiovsZ_%02i%i%i",module+1,layer+1,sector+1);
138  sprintf(modtitle,"Channel (M%i,L%i,S%i)",module+1,layer+1,sector+1);
139  sprintf(histtitle,"%s;Z Position (cm);log of pulse height ratio US/DS",modtitle);
140  logpeakratiovsZ[module][layer][sector] = new TH2I(histname,histtitle,220,-220.0,220.0,400,-4,4);
141  }
142  }
143  }
144  }
145  dirlogintratiovsZ->cd();
146  for (int module=0; module<nummodule; module++) {
147  for (int layer=0; layer<numlayer; layer++) {
148  for (int sector=0; sector<numsector; sector++) {
149  sprintf(histname,"logintratiovsZ_%02i%i%i",module+1,layer+1,sector+1);
150  sprintf(modtitle,"Channel (M%i,L%i,S%i)",module+1,layer+1,sector+1);
151  sprintf(histtitle,"%s;Z Position (cm);log of integral ratio US/DS",modtitle);
152  logintratiovsZ[module][layer][sector] = new TH2I(histname,histtitle,220,-220.0,220.0,400,-4,4);
153  }
154  }
155  }
156  if (VERBOSEHISTOGRAMS) {
157  dirEvsZ->cd();
158  for (int module=0; module<nummodule; module++) {
159  for (int layer=0; layer<numlayer; layer++) {
160  for (int sector=0; sector<numsector; sector++) {
161  sprintf(histname,"EvsZ_%02i%i%i",module+1,layer+1,sector+1);
162  sprintf(modtitle,"Channel (M%i,L%i,S%i)",module+1,layer+1,sector+1);
163  sprintf(histtitle,"%s;Z Position (cm);Energy",modtitle);
164  EvsZ[module][layer][sector] = new TH2I(histname,histtitle,100,-250.0,250.0,200,0,0.2);
165  }
166  }
167  }
168  }
169 
170  // back to main dir
171  main->cd();
172 
173  return NOERROR;
174 }
175 
176 //------------------
177 // brun
178 //------------------
179 jerror_t JEventProcessor_BCAL_attenlength_gainratio::brun(JEventLoop *eventLoop, int32_t runnumber)
180 {
181  // This is called whenever the run number changes
182 
183  DApplication* app = dynamic_cast<DApplication*>(eventLoop->GetJApplication());
184  DGeometry* geom = app->GetDGeometry(runnumber);
185  geom->GetTargetZ(z_target_center);
186 
187 
188  return NOERROR;
189 }
190 
191 //------------------
192 // evnt
193 //------------------
194 jerror_t JEventProcessor_BCAL_attenlength_gainratio::evnt(JEventLoop *loop, uint64_t eventnumber)
195 {
196  // simulation is tagged by being an HDDM file
197  bool locIsHDDMEvent = loop->GetJEvent().GetStatusBit(kSTATUS_HDDM);
198 
199  // load BCAL geometry
200  vector<const DBCALGeometry *> BCALGeomVec;
201  loop->Get(BCALGeomVec);
202  if(BCALGeomVec.size() == 0)
203  throw JException("Could not load DBCALGeometry object!");
204  auto locBCALGeom = BCALGeomVec[0];
205 
206  // Start with matched points
207  vector<const DBCALPoint*> dbcalpoints;
208  loop->Get(dbcalpoints);
209 
210  // pull out the associated digihits
211  vector< vector<const DBCALDigiHit*> > digihits_vec;
212  for(unsigned int i=0; i<dbcalpoints.size(); i++) {
213  const DBCALPoint *point = dbcalpoints[i];
214  vector<const DBCALDigiHit*> digihits;
215  point->Get(digihits);
216 
217  digihits_vec.push_back(digihits);
218  }
219 
220  char name[255], histtitle[255];
221 
222  // FILL HISTOGRAMS
223  // Since we are filling histograms local to this plugin, it will not interfere with other ROOT operations: can use plugin-wide ROOT fill lock
224  japp->RootFillLock(this); //ACQUIRE ROOT FILL LOCK
225 
226  if (VERBOSE>=4) printf("BCAL_attenlength_gainratio::evnt() event %4lu points %3lu \n", eventnumber, dbcalpoints.size());
227  for(unsigned int i=0; i<dbcalpoints.size(); i++) {
228  const DBCALPoint *point = dbcalpoints[i];
229  int module = point->module();
230  int layer = point->layer();
231  int sector = point->sector();
232  float pointE = point->E();
233  float pointEus = point->E_US();
234  float pointEds = point->E_DS();
235 
236  // get the associated digi hits
237  vector<const DBCALDigiHit*> &digihits = digihits_vec[i];
238  //point->Get(digihits);
239  if (digihits.size()!=2) {
240  printf("Warning: BCAL_attenlength_gainratio: event %llu: wrong number of BCALDigiHit objects found %i\n",
241  (long long unsigned int)eventnumber,(int)digihits.size());
242  continue;
243  }
244  if (digihits[0]->end==digihits[1]->end) {
245  printf("Warning: BCAL_attenlength_gainratio: event %llu: two hits in same end of point\n",(long long unsigned int)eventnumber);
246  continue;
247  }
248  int Vmid0 = (digihits[0]->pulse_peak+digihits[0]->pedestal)/2;
249  int Vmid1 = (digihits[1]->pulse_peak+digihits[1]->pedestal)/2;
250  if (VERBOSE>=5) printf("BCAL_attenlength_gainratio::evnt() peak %4i ped %3i peak %4i ped %3i\n",
251  digihits[0]->pulse_peak,digihits[0]->pedestal,digihits[0]->pulse_peak,digihits[0]->pedestal);
252  if (Vmid0 <= 105 || Vmid1 <= 105 || digihits[0]->pulse_time > 2880 || digihits[1]->pulse_time > 2880) { // 2880 = 45 samples x 64 subsamples
253  if (!locIsHDDMEvent) continue; // simulation doesn't have peaks at this time
254  }
255 
256  float peakUS, peakDS;
257  float integralUS, integralDS;
258  // end 0=upstream, 1=downstream
259  if (digihits[0]->end==0) {
260  integralUS = digihits[0]->pulse_integral - ((float)digihits[0]->nsamples_integral*(float)digihits[0]->pedestal)/
261  (float)digihits[0]->nsamples_pedestal;
262  integralDS = digihits[1]->pulse_integral - ((float)digihits[1]->nsamples_integral*(float)digihits[1]->pedestal)/
263  (float)digihits[1]->nsamples_pedestal;
264  peakUS = digihits[0]->pulse_peak - (float)digihits[0]->pedestal/(float)digihits[0]->nsamples_pedestal;
265  peakDS = digihits[1]->pulse_peak - (float)digihits[1]->pedestal/(float)digihits[1]->nsamples_pedestal;
266  } else {
267  integralDS = digihits[0]->pulse_integral - ((float)digihits[0]->nsamples_integral*(float)digihits[0]->pedestal)/
268  (float)digihits[0]->nsamples_pedestal;
269  integralUS = digihits[1]->pulse_integral - ((float)digihits[1]->nsamples_integral*(float)digihits[1]->pedestal)/
270  (float)digihits[1]->nsamples_pedestal;
271  peakDS = digihits[0]->pulse_peak - (float)digihits[0]->pedestal/(float)digihits[0]->nsamples_pedestal;
272  peakUS = digihits[1]->pulse_peak - (float)digihits[1]->pedestal/(float)digihits[1]->nsamples_pedestal;
273  }
274 
275  //float timediff = t_ADCus_vec[0]-t_ADCds_vec[0];
276  //float zpos = (timediff)*17./2;
277  float zpos = point->z() - locBCALGeom->GetBCAL_center() + z_target_center;
278  float intratio = (float)integralUS/(float)integralDS;
279  float logintratio = log(intratio);
280  float peakratio = (float)peakUS/(float)peakDS;
281  float logpeakratio = log(peakratio);
282  float logEratio = log(pointEus/pointEds);
283  if (VERBOSE>=5) printf("%5llu %2i %i %i %8.1f %8.1f %8.3f %8.3f %8.3f\n",
284  (long long unsigned int)eventnumber,module,layer,sector,integralUS,integralDS,intratio,logintratio,zpos);
285 
286  if (pointE > 0.01) { // 10 MeV cut to remove bias due to attenuation
287  logintratiovsZ[module-1][layer-1][sector-1]->Fill(zpos, logintratio);
288  logintratiovsZ_all->Fill(zpos, logintratio);
289  logpeakratiovsZ_all->Fill(zpos, logpeakratio);
290 
291  sprintf(name,"logintratiovsZ_layer%i",layer);
292  sprintf(histtitle,"Layer %i;Z Position (cm);log of integral ratio US/DS",layer);
293  Fill2DHistogram("bcalgainratio", "logintratiovsZ", name,
294  zpos, logintratio, histtitle, 500,-250.0,250.0,500,-3,3);
295 
296  if (VERBOSEHISTOGRAMS) {
297  sprintf(name,"logEratiovsZ_%02i%i%i",module,layer,sector);
298  sprintf(histtitle,"Channel (M%i,L%i,S%i);Z Position (cm);log of E ratio ln(E_{US}/E_{DS}) ",module,layer,sector);
299  Fill2DHistogram("bcalgainratio", "logEratiovsZ", name,
300  zpos, logEratio, histtitle, 250,-250.0,250.0,400,-4,4);
301  }
302 
303  sprintf(name,"logEratiovsZ_layer%i",layer);
304  sprintf(histtitle,"Layer %i;Z Position (cm);log of E ratio ln(E_{US}/E_{DS}) ",layer);
305  Fill2DHistogram("bcalgainratio", "logEratiovsZ", name,
306  zpos, logEratio, histtitle, 500,-250.0,250.0,500,-3,3);
307 
308 
309  if (VERBOSEHISTOGRAMS) {
310  logpeakratiovsZ[module-1][layer-1][sector-1]->Fill(zpos, logpeakratio);
311  }
312  }
313  if (VERBOSEHISTOGRAMS) EvsZ[module-1][layer-1][sector-1]->Fill(zpos, pointE);
314  EvsZ_all->Fill(zpos, pointE);
315  EvsZ_layer[layer-1]->Fill(zpos, pointE);
316  }
317 
318  japp->RootFillUnLock(this); //RELEASE ROOT FILL LOCK
319 
320 
321  return NOERROR;
322 }
323 
324 //------------------
325 // erun
326 //------------------
328 {
329  // This is called whenever the run number changes, before it is
330  // changed to give you a chance to clean up before processing
331  // events from the next run number.
332  return NOERROR;
333 }
334 
335 //------------------
336 // fini
337 //------------------
339 {
340  // Called before program exit after event processing is finished.
341 
342 
343  // FILL HISTOGRAMS
344  // Since we are filling histograms local to this plugin, it will not interfere with other ROOT operations: can use plugin-wide ROOT fill lock
345  japp->RootFillLock(this); //ACQUIRE ROOT FILL LOCK
346 
347  // for (int module=0; module<nummodule; module++) {
348  // if (VERBOSE>0) printf("M%i ",module);
349  // for (int layer=0; layer<numlayer; layer++) {
350  // for (int sector=0; sector<numsector; sector++) {
351  // int entries = logintratiovsZ[module][layer][sector]->GetEntries();
352  // if (VERBOSE>0) printf("(%i,%i) %3i ", layer,sector,entries);
353  // }
354  // }
355  // if (VERBOSE>0) printf("\n");
356  // }
357  printf("BCAL_attenlength_gainratio::fini >> Fitting all histograms\n");
358 
359  TF1 *intfit = new TF1("intfit","pol1");
360  if (VERBOSEHISTOGRAMS) {
361  for (int module=0; module<nummodule; module++) {
362  for (int layer=0; layer<numlayer; layer++) {
363  for (int sector=0; sector<numsector; sector++) {
364  char name[255];
365  sprintf(name,"logEratiovsZ_%02i%i%i",module+1,layer+1,sector+1);
366  TH2I* hist = (TH2I*)GetHistPointer("bcalgainratio", "logEratiovsZ", name);
367  if (hist) {
368  int layersect = (layer)*4 + sector + 1;
369  int entries = hist->GetEntries();
370  if (entries>10) {
371  hist->Fit(intfit,"q");
372  float p0 = intfit->GetParameter(0);
373  float p1 = intfit->GetParameter(1);
374  //float p0err = intfit->GetParError(0);
375  //float p1err = intfit->GetParError(1);
376 
377  float attenlength = -2./p1;
378  float gainratio = exp(p0);
379  //float attenlengtherr = 2/p1/p1*p1err;
380  //float gainratioerr = exp(p0)*p0err;
381  if (VERBOSE>0) printf("(%2i,%i,%i) %3i %8.3f %8.3f ", module, layer,sector,entries,attenlength,gainratio);
382 
383  char histtitle[255];
384  sprintf(histtitle,"Atten. length from E;Module;Layer and Sector");
385  Fill2DWeightedHistogram("bcalgainratio", "results", "hist2D_Eattenlength",
386  module+1,layersect,attenlength, histtitle, 48,0.5,48.5,16,0.5,16.5);
387  sprintf(histtitle,"Gain ratio from integ.;Module;Layer and Sector;G_{U}/G_{D}");
388  Fill2DWeightedHistogram("bcalgainratio", "results", "hist2D_Egainratio",
389  module+1,layersect,gainratio, histtitle, 48,0.5,48.5,16,0.5,16.5);
390  }
391  }
392  }
393  }
394  }
395  }
396  TF1 *peakfit = new TF1("peakfit","pol1");
397  for (int module=0; module<nummodule; module++) {
398  for (int layer=0; layer<numlayer; layer++) {
399  for (int sector=0; sector<numsector; sector++) {
400  int layersect = (layer)*4 + sector + 1;
401  int entries = logintratiovsZ[module][layer][sector]->GetEntries();
402  if (entries>10) {
403  logintratiovsZ[module][layer][sector]->Fit(intfit,"q");
404  float p0 = intfit->GetParameter(0);
405  float p1 = intfit->GetParameter(1);
406  float p0err = intfit->GetParError(0);
407  float p1err = intfit->GetParError(1);
408 
409  float attenlength = -2./p1;
410  float gainratio = exp(p0);
411  float attenlengtherr = 2/p1/p1*p1err;
412  float gainratioerr = exp(p0)*p0err;
413  if (VERBOSE>0) printf("(%2i,%i,%i) %3i %8.3f %8.3f ", module, layer,sector,entries,attenlength,gainratio);
414  hist_attenlength->Fill(attenlength);
415  hist_gainratio->Fill(gainratio);
416  hist_attenlength_err->Fill(attenlengtherr);
417  hist_gainratio_err->Fill(gainratioerr);
418  hist_attenlength_relerr->Fill(attenlengtherr/attenlength*100);
419  hist_gainratio_relerr->Fill(gainratioerr/gainratio*100);
420  hist2D_intattenlength->SetBinContent(module+1,layersect,attenlength);
421  hist2D_intattenlength->SetBinError(module+1,layersect,attenlengtherr);
422  hist2D_intgainratio->SetBinContent(module+1,layersect,gainratio);
423  hist2D_intgainratio->SetBinError(module+1,layersect,gainratioerr);
424 
425  if (VERBOSEHISTOGRAMS) {
426  logpeakratiovsZ[module][layer][sector]->Fit(peakfit,"q");
427  p0 = peakfit->GetParameter(0);
428  p1 = peakfit->GetParameter(1);
429  p0err = peakfit->GetParError(0);
430  p1err = peakfit->GetParError(1);
431  attenlength = -2./p1;
432  gainratio = exp(p0);
433  attenlengtherr = 2/p1/p1*p1err;
434  gainratioerr = exp(p0)*p0err;
435  hist2D_peakattenlength->SetBinContent(module+1,layersect,attenlength);
436  hist2D_peakattenlength->SetBinError(module+1,layersect,attenlengtherr);
437  hist2D_peakgainratio->SetBinContent(module+1,layersect,gainratio);
438  hist2D_peakgainratio->SetBinError(module+1,layersect,gainratioerr);
439  float aveZ = EvsZ[module][layer][sector]->GetMean(1);
440  float aveZerr = EvsZ[module][layer][sector]->GetMeanError(1);
441  hist2D_aveZ->SetBinContent(module+1,layersect,aveZ);
442  hist2D_aveZ->SetBinError(module+1,layersect,aveZerr);
443  }
444  }
445  }
446  }
447  }
448  if (VERBOSEHISTOGRAMS) {
449  hist2D_peakattenlength->SetBinContent(0,0,1);
450  hist2D_peakgainratio->SetBinContent(0,0,1);
451  }
452  hist2D_intattenlength->SetBinContent(0,0,1);
453  hist2D_intgainratio->SetBinContent(0,0,1);
454 
455  japp->RootFillUnLock(this); //RELEASE ROOT FILL LOCK
456 
457  SortDirectories();
458 
459  return NOERROR;
460 }
461 
int module() const
Definition: DBCALPoint.h:64
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
TObject * GetHistPointer(const char *plugin, const char *directoryName, const char *name)
Int_t layer
sprintf(text,"Post KinFit Cut")
int sector() const
Definition: DBCALPoint.h:66
static const int numsector
static const int numlayer
int layer() const
Definition: DBCALPoint.h:65
JApplication * japp
void Fill2DWeightedHistogram(const char *plugin, const char *directoryName, const char *name, const double valueX, const double valueY, const double weight, const char *title, int nBinsX, double xmin, double xmax, int nBinsY, double ymin, double ymax, bool print=false)
void SortDirectories()
float E() const
Definition: DBCALPoint.h:38
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
InitPlugin_t InitPlugin
const bool VERBOSE
DGeometry * GetDGeometry(unsigned int run_number)
float z() const
Definition: DBCALPoint.h:60
void Fill2DHistogram(const char *plugin, const char *directoryName, const char *name, const double valueX, const double valueY, const char *title, int nBinsX, double xmin, double xmax, int nBinsY, double ymin, double ymax, bool print=false)
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
static TH1I * pedestal[nChan]
float E_DS() const
Return the attenuation corrected Energy of DS Hit.
Definition: DBCALPoint.h:40
static const int nummodule
float E_US() const
Return the attenuation corrected Energy of US Hit.
Definition: DBCALPoint.h:39
printf("string=%s", string)
bool GetTargetZ(double &z_target) const
z-location of center of target
Definition: DGeometry.cc:1933
jerror_t fini(void)
Called after last event of last event source has been processed.
int main(int argc, char *argv[])
Definition: gendoc.cc:6
TH1F * hist[Idx+1]
Definition: readhist.C:10