CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Histograms.cc
Go to the documentation of this file.
3 
4 #include "TROOT.h"
5 #include "TTree.h"
6 #include "TFile.h"
7 #include "TH1F.h"
8 #include "TH2F.h"
9 #include "TH3F.h"
10 
11 #include <iostream>
12 
13 #include <cmath>
14 using namespace std;
15 
16 /*****************************************************************************/
17 #define nCharges 2
18 enum Charges
20 
21 const char *chargeName[nCharges + 2] =
22 { "pos", "neg", "zero", "undefined" };
23 
24 /*****************************************************************************/
25 #define nParticles 21
27 {
28  pip, pim, kap, kam,
29  prp, prm, elp, elm,
30  hap, ham,
31  gam, k0s, lam, ala,
32  rho, kst, aks, phi,
33  sip, asi,
35 };
36 
37 const char *partName[nParticles] =
38 {
39  "pip", "pim", "kap", "kam",
40  "prp", "prm", "elp", "elm",
41  "hap", "ham",
42  "gam", "k0s", "lam", "ala",
43  "rho", "kst", "aks", "phi",
44  "sip", "asi",
45  "any"
46 };
47 
48 const int partCharge[nParticles] =
49 {
50  pos , neg , pos , neg ,
51  pos , neg , pos , neg ,
52  pos , neg ,
53  zero, zero, zero, zero,
54  zero, zero, zero, zero,
55  pos , neg ,
56  undefined
57 };
58 
59 /*****************************************************************************/
60 #define nFeedDowns 18
61 const std::pair<int,int> feedDown[nFeedDowns] =
62 {
63  std::pair<int,int>(k0s, pip), std::pair<int,int>(k0s, pim),
64  std::pair<int,int>(lam, prp), std::pair<int,int>(lam, pim),
65  std::pair<int,int>(ala, prm), std::pair<int,int>(ala, pip),
66  std::pair<int,int>(sip, prp), std::pair<int,int>(asi, prm),
67  std::pair<int,int>(any, pip), std::pair<int,int>(any, pim),
68  std::pair<int,int>(any, kap), std::pair<int,int>(any, kam),
69  std::pair<int,int>(any, prp), std::pair<int,int>(any, prm),
70  std::pair<int,int>(any, elp), std::pair<int,int>(any, elm),
71  std::pair<int,int>(any, hap), std::pair<int,int>(any, ham)
72 };
73 
74 #define nResonances 4
75 const std::pair<int,int> resonance[nResonances] =
76 {
77  std::pair<int,int>(pip, pim),
78  std::pair<int,int>(kap, pim),
79  std::pair<int,int>(pip, kam),
80  std::pair<int,int>(kap, kam)
81 };
82 
83 /*****************************************************************************/
85 {
86  fillHistograms = pset.getParameter<bool>("fillHistograms");
87  fillNtuples = pset.getParameter<bool>("fillNtuples");
88 
89  std::string histoFileLabel = pset.getParameter<std::string>("histoFile");
90  histoFile = new TFile(histoFileLabel.c_str(),"recreate");
91 
92  std::string ntupleFileLabel = pset.getParameter<std::string>("ntupleFile");
93  ntupleFile = new TFile(ntupleFileLabel.c_str(),"recreate");
94 
95 // resultFile->cd();
96 }
97 
98 /*****************************************************************************/
100 {
101 }
102 
103 /****************************************************************************/
105 {
106  switch(id)
107  {
108  case 211 : return pip; break;
109  case -211 : return pim; break;
110 
111  case 321 : return kap; break;
112  case -321 : return kam; break;
113 
114  case 2212 : return prp; break;
115  case -2212 : return prm; break;
116 
117  case 11 : return elp; break;
118  case -11 : return elm; break;
119 
120  // SimG4Core/Notification/src/G4TrackToParticleID.cc
121  // "deuteron" = -100; 1p 1n
122  // "triton" = -101; 1p 2n
123  // "alpha" = -102; 2p 2n
124  // "He3" = -104; 2p 1n
125 
126  case 22 : return gam; break;
127  case 310 : return k0s; break;
128  case 3122 : return lam; break;
129  case -3122 : return ala; break;
130 
131 /*
132  case 113 : return rho; break;
133  case 313 : return kst; break;
134  case -313 : return aks; break;
135  case 333 : return phi; break;
136 */
137 
138  case 3222 : return sip; break;
139  case -3222 : return asi; break;
140 
141  default : return -1; break;
142  }
143 }
144 
145 /****************************************************************************/
147 {
148  if(charge > 0) return pos;
149  else return neg;
150 }
151 
152 /*****************************************************************************/
154 {
155  if(fillNtuples)
156  {
157  TString leafStr;
158 
159  trackTrees.push_back(new TTree("simTrackTree","simTrackTree"));
160  leafStr = "ids/I:etas/F:pts/F:acc/I:prim/I:nrec/I:ntrkr/I";
161  trackTrees[0]->Branch("simTrackValues", &simTrackValues, leafStr.Data());
162 
163  trackTrees.push_back(new TTree("recTrackTree","recTrackTree"));
164  leafStr = "charge/I:etar/F:ptr/F:phir/F:zr/F:logpr/F:logde/F:nhitr/I:prim/I:nsim/I:ids/I:parids/I:etas/F:pts/F:ntrkr/I";
165  trackTrees[1]->Branch("recTrackValues", &recTrackValues, leafStr.Data());
166 
167  trackTrees.push_back(new TTree("recVzeroTree","recVzeroTree"));
168  leafStr = "etar/F:ptr/F:ima/F:rhor/F";
169  trackTrees[2]->Branch("recVzeroValues", &recVzeroValues, leafStr.Data());
170 
171  trackTrees.push_back(new TTree("eventInfoTree","eventInfoTree"));
172  leafStr = "proc/I:strk/I:ntrkr/I";
173  trackTrees[3]->Branch("eventInfoValues", &eventInfoValues, leafStr.Data());
174  }
175 
176  if(fillHistograms)
177  {
179  // Pt
180  const double small = 1e-3;
181  double pt;
182 
183  for(pt = 0; pt < 1 - small; pt += 0.05) ptBins.push_back(pt);
184  for(pt = 1; pt < 2 - small; pt += 0.1 ) ptBins.push_back(pt);
185  for(pt = 2; pt < 4 - small; pt += 0.2 ) ptBins.push_back(pt);
186  for(pt = 4; pt < 8 - small; pt += 0.5 ) ptBins.push_back(pt);
187  for(pt = 8; pt < 16 - small; pt += 1. ) ptBins.push_back(pt);
188  for(pt = 16; pt < 32 - small; pt += 2. ) ptBins.push_back(pt);
189  for(pt = 32; pt < 64 - small; pt += 4. ) ptBins.push_back(pt);
190 
191  static float ratMin = 0.5;
192  static float ratMax = 1.5;
193  static float ratWidth = 1./200;
194 
195  for(double rat = ratMin; rat < ratMax + ratWidth/2; rat += ratWidth)
196  ratBins.push_back(rat);
197 
199  // Eta (-3,3)
200  static float etaMin = -3.0;
201  static float etaMax = 3.0;
202  static float etaWidth = 0.2;
203 
204  for(double eta = etaMin; eta < etaMax + etaWidth/2; eta += etaWidth)
205  etaBins.push_back(eta);
206 
207 // for(double eta = etaMin; eta < etaMax + etaWidth/2; eta += etaWidth/10)
208  for(double eta = etaMin; eta < etaMax + etaWidth/2; eta += etaWidth/5)
209  metaBins.push_back(eta);
210 
211  static float zMin = -20.;
212  static float zMax = 20.;
213 // static float zWidth = 0.1;
214  static float zWidth = 0.2;
215 
216  for(double z = zMin; z < zMax + zWidth/2; z += zWidth)
217  zBins.push_back(z);
218 
220  // Number of recontructed tracks
221  static float ntrkMin = 0.5;
222 // FIXME
223 // static float ntrkMax = 200.;
224 // static float ntrkWidth = 5.;
225  static float ntrkMax = 1000.;
226  static float ntrkWidth = 10.;
227 
228  for(double ntrk = ntrkMin; ntrk < ntrkMax + ntrkWidth; ntrk += ntrkWidth)
229  ntrkBins.push_back(ntrk);
230 
231 
232  char histName[256];
233 
235  // EventInfo
236  sprintf(histName,"heve");
237  heve.push_back(new TH1F(histName,histName, 200, -0.5,199.5));
238 
239  sprintf(histName,"hsdx");
240  heve.push_back(new TH1F(histName,histName, 200, -0.5,199.5));
241 
242  sprintf(histName,"hddx");
243  heve.push_back(new TH1F(histName,histName, 200, -0.5,199.5));
244 
245  sprintf(histName,"hndx");
246  heve.push_back(new TH1F(histName,histName, 200, -0.5,199.5));
247 
248  sprintf(histName,"hder");
249  hder.push_back(new TH2F(histName,histName, 200, -0.5,199.5,
250  200, -0.5,199.5));
251 
253  // SimTrack
254  for(int part = pip; part <= ala; part++)
255  {
256  // simulated
257  sprintf(histName,"hsim_%s", partName[part]);
258  hsim.push_back(new TH3F(histName,histName,
259  etaBins.size()-1, &etaBins[0],
260  ptBins.size()-1, &ptBins[0],
261  ntrkBins.size()-1, &ntrkBins[0]));
262 
263  // accepted
264  sprintf(histName,"hacc_%s", partName[part]);
265  hacc.push_back(new TH3F(histName,histName,
266  etaBins.size()-1, &etaBins[0],
267  ptBins.size()-1, &ptBins[0],
268  ntrkBins.size()-1, &ntrkBins[0]));
269 
270  // reconstructed/efficiency
271  sprintf(histName,"href_%s", partName[part]);
272  href.push_back(new TH3F(histName,histName,
273  etaBins.size()-1, &etaBins[0],
274  ptBins.size()-1, &ptBins[0],
275  ntrkBins.size()-1, &ntrkBins[0]));
276 
277  // multiply reconstructed
278  sprintf(histName,"hmul_%s", partName[part]);
279  hmul.push_back(new TH3F(histName,histName,
280  etaBins.size()-1, &etaBins[0],
281  ptBins.size()-1, &ptBins[0],
282  ntrkBins.size()-1, &ntrkBins[0]));
283  }
284 
286  // RecTrack
287  for(int charge = 0; charge < nCharges; charge++)
288  {
289  sprintf(histName,"hall_%s",chargeName[charge]);
290  hall.push_back(new TH3F(histName,histName,
291  etaBins.size()-1, &etaBins[0],
292  ptBins.size()-1, &ptBins[0],
293  ntrkBins.size()-1, &ntrkBins[0]));
294 
295  sprintf(histName,"hdac_%s",chargeName[charge]);
296  hdac.push_back(new TH2F(histName,histName,
297  metaBins.size()-1, &metaBins[0],
298  zBins.size()-1, &zBins[0]));
299 
301  // RecTrack -- FakeRate
302  sprintf(histName,"hfak_%s",chargeName[charge]);
303  hfak.push_back(new TH3F(histName,histName,
304  etaBins.size()-1, &etaBins[0],
305  ptBins.size()-1, &ptBins[0],
306  ntrkBins.size()-1, &ntrkBins[0]));
307  }
308 
310  // RecTrack -- Resolution, bias
311  for(int part = pip; part <= ala; part++)
312  {
313  // value
314  sprintf(histName,"hvpt_%s",partName[part]);
315  hvpt.push_back(new TH3F(histName,histName,
316  etaBins.size()-1, &etaBins[0],
317  ptBins.size()-1, &ptBins[0],
318  ptBins.size()-1, &ptBins[0]));
319 
320  // ratio
321  sprintf(histName,"hrpt_%s",partName[part]);
322  hrpt.push_back(new TH3F(histName,histName,
323  etaBins.size()-1, &etaBins[0],
324  ptBins.size()-1, &ptBins[0],
325  ratBins.size()-1, &ratBins[0]));
326 
327  sprintf(histName,"hsp0_%s",partName[part]);
328  hsp0.push_back(new TH2F(histName,histName,
329  etaBins.size()-1, &etaBins[0],
330  ptBins.size()-1, &ptBins[0]));
331 
332  sprintf(histName,"hsp1_%s",partName[part]);
333  hsp1.push_back(new TH2F(histName,histName,
334  etaBins.size()-1, &etaBins[0],
335  ptBins.size()-1, &ptBins[0]));
336 
337  sprintf(histName,"hsp2_%s",partName[part]);
338  hsp2.push_back(new TH2F(histName,histName,
339  etaBins.size()-1, &etaBins[0],
340  ptBins.size()-1, &ptBins[0]));
341  }
342 
344  // RecTrack -- FeedDown
345  for(int k = 0; k < nFeedDowns; k++)
346  {
347  sprintf(histName,"hpro_%s_%s", partName[feedDown[k].first], // produced
349  hpro.push_back(new TH2F(histName,histName,
350  etaBins.size()-1, &etaBins[0],
351  ptBins.size()-1, &ptBins[0]));
352 
353  sprintf(histName,"hdec_%s_%s", partName[feedDown[k].first], // decay
354  partName[feedDown[k].second]);
355  hdec.push_back(new TH2F(histName,histName,
356  etaBins.size()-1, &etaBins[0],
357  ptBins.size()-1, &ptBins[0]));
358  }
359 
361  // EnergyLoss
362  static float lpMin = -3; // 50 MeV
363  static float lpMax = 2; // 7.4 GeV
364  static float lpWidth = (lpMax - lpMin)/100;
365  for(double lp = lpMin; lp < lpMax + lpWidth/2; lp += lpWidth)
366  lpBins.push_back(lp);
367 
368  static float ldeMin = log(1);
369  static float ldeMax = log(100);
370  static float ldeWidth = (ldeMax - ldeMin)/250;
371  for(double lde = ldeMin; lde < ldeMax + ldeWidth/2; lde += ldeWidth)
372  ldeBins.push_back(lde);
373 
374  for(double nhit = -0.5; nhit < 50; nhit += 1)
375  nhitBins.push_back(nhit);
376 
377  for(int charge = 0; charge < nCharges; charge++)
378  {
379  // All hits
380  // dE/dx
381  sprintf(histName,"helo_%s", chargeName[charge]);
382  helo.push_back(new TH3F(histName,histName,
383  etaBins.size()-1, &etaBins[0],
384  ptBins.size()-1, &ptBins[0],
385  ldeBins.size()-1, &ldeBins[0]));
386 
387  // Number of hits used
388  sprintf(histName,"hnhi_%s", chargeName[charge]);
389  hnhi.push_back(new TH3F(histName,histName,
390  etaBins.size()-1, &etaBins[0],
391  ptBins.size()-1, &ptBins[0],
392  nhitBins.size()-1, &nhitBins[0]));
393 
394  // Demo plot
395  sprintf(histName,"held_%s", chargeName[charge]);
396  held.push_back(new TH2F(histName,histName,
397  lpBins.size()-1, &lpBins[0],
398  ldeBins.size()-1, &ldeBins[0]));
399  }
400 
401 /*
402  for(int charge = 0; charge < nCharges; charge++)
403  {
404  // Strip hits
405  // dE/dx
406  sprintf(histName,"selo_%s", chargeName[charge]);
407  selo.push_back(new TH3F(histName,histName,
408  etaBins.size()-1, &etaBins[0],
409  ptBins.size()-1, &ptBins[0],
410  ldeBins.size()-1, &ldeBins[0]));
411 
412  // Number of hits used
413  sprintf(histName,"snhi_%s", chargeName[charge]);
414  snhi.push_back(new TH3F(histName,histName,
415  etaBins.size()-1, &etaBins[0],
416  ptBins.size()-1, &ptBins[0],
417  nhitBins.size()-1, &nhitBins[0]));
418 
419  // Demo plot
420  sprintf(histName,"seld_%s", chargeName[charge]);
421  seld.push_back(new TH2F(histName,histName,
422  lpBins.size()-1, &lpBins[0],
423  ldeBins.size()-1, &ldeBins[0]));
424  }
425 */
426 
428  // Invariant mass
429  static float rhoMin = 0.;
430  static float rhoMax = 5.;
431  static float rhoWidth = 0.2;
432  for(double rho_ = rhoMin; rho_ < rhoMax + rhoWidth/2; rho_ += rhoWidth)
433  rhoBins.push_back(rho_);
434 
435 
436  for(int part = gam; part <= phi; part++)
437  {
438  float imMin = 0;
439  float imMax = 0;
440  float imWidth = 0;
441 
442  if(part == gam) { imMin = 0.0; imMax = 0.2; imWidth = 0.005; }
443  if(part == k0s) { imMin = 0.3; imMax = 0.7; imWidth = 0.005; }
444  if(part == lam ||
445  part == ala) { imMin = 1.0; imMax = 1.3; imWidth = 0.002; }
446 
447  if(part == rho) { imMin = 0.2; imMax = 1.2; imWidth = 0.010; }
448  if(part == kst ||
449  part == aks) { imMin = 0.6; imMax = 1.6; imWidth = 0.010; }
450  if(part == phi) { imMin = 0.9; imMax = 1.1; imWidth = 0.002; }
451 
452  std::vector<double> imBins;
453  double im;
454  for(im = imMin; im < imMax + imWidth/2; im += imWidth)
455  imBins.push_back(im);
456 
457  if(imWidth > 0)
458  {
459  sprintf(histName,"hima_%s", partName[part]);
460  hima.push_back(new TH3F(histName,histName,
461  etaBins.size()-1, &etaBins[0],
462  ptBins.size()-1, &ptBins[0],
463  imBins.size()-1, &imBins[0]));
464 
465  if(part >= rho && part <= phi)
466  {
467  sprintf(histName,"himp_%s", partName[part]);
468  hima.push_back(new TH3F(histName,histName,
469  etaBins.size()-1, &etaBins[0],
470  ptBins.size()-1, &ptBins[0],
471  imBins.size()-1, &imBins[0]));
472 
473  sprintf(histName,"himm_%s", partName[part]);
474  hima.push_back(new TH3F(histName,histName,
475  etaBins.size()-1, &etaBins[0],
476  ptBins.size()-1, &ptBins[0],
477  imBins.size()-1, &imBins[0]));
478 
479  sprintf(histName,"himx_%s", partName[part]);
480  hima.push_back(new TH3F(histName,histName,
481  etaBins.size()-1, &etaBins[0],
482  ptBins.size()-1, &ptBins[0],
483  imBins.size()-1, &imBins[0]));
484  }
485 
486  sprintf(histName,"hrho_%s", partName[part]);
487  hrho.push_back(new TH3F(histName,histName,
488  rhoBins.size()-1, &rhoBins[0],
489  ptBins.size()-1, &ptBins[0],
490  imBins.size()-1, &imBins[0]));
491  }
492  }
493  }
494 }
495 
496 /****************************************************************************/
497 void Histograms::fillEventInfo(int proc, int strk, int ntrk)
498 {
499  if(fillNtuples)
500  {
501  EventInfo_t e;
502  e.proc = proc;
503  e.strk = strk;
504  e.ntrkr = ntrk;
505 
506  eventInfoValues = e;
507 
508  trackTrees[3]->Fill();
509  }
510 
511  if(fillHistograms)
512  {
513  heve[0]->Fill(ntrk);
514 
515  if(proc == 92 || proc == 93)
516  heve[1]->Fill(ntrk); // hsdx
517 
518  if(proc == 94)
519  heve[2]->Fill(ntrk); // hddx
520 
521  if(!(proc == 92 || proc == 93 || proc == 94))
522  heve[3]->Fill(ntrk); // hndx
523 
524  // For multiplicity, detector response matrix
525  hder[0]->Fill(strk,ntrk);
526  }
527 }
528 
529 /****************************************************************************/
531 {
532  if(fillNtuples)
533  {
534  if(s.prim)
535  {
536  simTrackValues = s;
537  trackTrees[0]->Fill();
538  }
539  }
540 
541  if(fillHistograms)
542  {
543  int part = getParticle(s.ids);
544 
545  if(pip <= part && part <= ala && s.prim)
546  {
547  hsim[part]->Fill(s.etas, s.pts, s.ntrkr);
548  if(s.acc) hacc[part]->Fill(s.etas, s.pts, s.ntrkr);
549 if(s.acc)
550 {
551  if(s.nrec > 0) href[part]->Fill(s.etas, s.pts, s.ntrkr);
552  if(s.nrec > 1) hmul[part]->Fill(s.etas, s.pts, s.ntrkr);
553 }
554 
555  if(partCharge[part] == pos || partCharge[part] == neg)
556  {
557  if(partCharge[part] == pos) part = hap;
558  if(partCharge[part] == neg) part = ham;
559 
560  hsim[part]->Fill(s.etas, s.pts, s.ntrkr);
561  if(s.acc) hacc[part]->Fill(s.etas, s.pts, s.ntrkr);
562 if(s.acc)
563 {
564  if(s.nrec > 0) href[part]->Fill(s.etas, s.pts, s.ntrkr);
565  if(s.nrec > 1) hmul[part]->Fill(s.etas, s.pts, s.ntrkr);
566 }
567  }
568  }
569  }
570 }
571 
572 /****************************************************************************/
574 {
575  if(fillNtuples)
576  {
577  if(r.prim)
578  {
579  recTrackValues = r;
580  trackTrees[1]->Fill();
581  }
582  }
583 
584  if(fillHistograms)
585  {
586  int charge = getCharge(r.charge);
587  double p = exp(r.logpr);
588 
589  if(r.prim)
590  {
591  hall[charge]->Fill(r.etar, r.ptr, r.ntrkr);
592 
593  if(r.ptr > 0.3) // !!!
594  hdac[charge]->Fill(r.etar, r.zr);
595 
596  if(r.nsim == 0)
597  hfak[charge]->Fill(r.etar, r.ptr, r.ntrkr);
598 
599  if(r.nsim == 1)
600  {
601  int part = getParticle(r.ids);
602  int moth = getParticle(r.parids);
603 
604  if(pip <= part && part <= ala)
605  {
606  hvpt[part]->Fill(r.etas, r.pts, r.ptr ); // value
607  hrpt[part]->Fill(r.etas, r.pts, r.ptr/r.pts); // ratio
608 
609  hsp0[part]->Fill(r.etas, r.pts); // sum p^0
610  hsp1[part]->Fill(r.etas, r.pts, p); // sum p^1
611  hsp2[part]->Fill(r.etas, r.pts, p*p); // sum p^2
612  }
613 
614  for(int k = 0; k < nFeedDowns; k++)
615  if(part == feedDown[k].second) // daughter same
616  {
617  hpro[k]->Fill(r.etar, r.ptr);
618 
619  if((r.parids != 0 && feedDown[k].first == any) ||
620  feedDown[k].first == moth)
621  hdec[k]->Fill(r.etar, r.ptr);
622  }
623 
624  if(partCharge[part] == pos || partCharge[part] == neg)
625  {
626  if(partCharge[part] == pos) part = hap;
627  if(partCharge[part] == neg) part = ham;
628 
629  hvpt[part]->Fill(r.etas, r.pts, r.ptr ); // value
630  hrpt[part]->Fill(r.etas, r.pts, r.ptr/r.pts); // ratio
631 
632  hsp0[part]->Fill(r.etas, r.pts); // sum p^0
633  hsp1[part]->Fill(r.etas, r.pts, p); // sum p^1
634  hsp2[part]->Fill(r.etas, r.pts, p*p); // sum p^2
635 
636  for(int k = 0; k < nFeedDowns; k++)
637  if(part == feedDown[k].second) // daughter same
638  {
639  hpro[k]->Fill(r.etar, r.ptr);
640 
641  if((r.parids != 0 && feedDown[k].first == any) ||
642  feedDown[k].first == moth)
643  hdec[k]->Fill(r.etar, r.ptr);
644  }
645  }
646  }
647 
648  // All hits
649  helo[charge]->Fill(r.etar, r.ptr, r.logde);
650  hnhi[charge]->Fill(r.etar, r.ptr, r.nhitr);
651  held[charge]->Fill(r.logpr, r.logde);
652 
653  // Strip hits
654 /*
655  selo[charge]->Fill(r.etar, r.ptr, r.logde_strip);
656  snhi[charge]->Fill(r.etar, r.ptr, r.nhitr_strip);
657  seld[charge]->Fill(r.logpr, r.logde_strip);
658 */
659  }
660  }
661 }
662 
663 /****************************************************************************/
665 {
666  if(fillNtuples)
667  {
668  recVzeroValues = v;
669  trackTrees[2]->Fill();
670  }
671 
672  if(fillHistograms)
673  hima[part]->Fill(v.etar, v.ptr, v.ima);
674 }
675 
676 /****************************************************************************/
678 {
679  typedef std::vector<TH3F *>::const_iterator H3I;
680  typedef std::vector<TH2F *>::const_iterator H2I;
681  typedef std::vector<TH1F *>::const_iterator H1I;
682  typedef std::vector<TTree *>::const_iterator TI;
683 
684  if(fillHistograms)
685  {
686  histoFile->cd();
687  for(H1I h = heve.begin(); h!= heve.end(); h++) (*h)->Write();
688  for(H2I h = hder.begin(); h!= hder.end(); h++) (*h)->Write();
689 
690  for(H3I h = hsim.begin(); h!= hsim.end(); h++) (*h)->Write();
691  for(H3I h = hacc.begin(); h!= hacc.end(); h++) (*h)->Write();
692  for(H3I h = href.begin(); h!= href.end(); h++) (*h)->Write();
693  for(H3I h = hmul.begin(); h!= hmul.end(); h++) (*h)->Write();
694 
695  for(H3I h = hall.begin(); h!= hall.end(); h++) (*h)->Write();
696  for(H2I h = hdac.begin(); h!= hdac.end(); h++) (*h)->Write();
697 
698  for(H3I h = hvpt.begin(); h!= hvpt.end(); h++) (*h)->Write();
699  for(H3I h = hrpt.begin(); h!= hrpt.end(); h++) (*h)->Write();
700 
701  for(H2I h = hsp0.begin(); h!= hsp0.end(); h++) (*h)->Write();
702  for(H2I h = hsp1.begin(); h!= hsp1.end(); h++) (*h)->Write();
703  for(H2I h = hsp2.begin(); h!= hsp2.end(); h++) (*h)->Write();
704 
705  for(H3I h = hfak.begin(); h!= hfak.end(); h++) (*h)->Write();
706 
707  for(H2I h = hpro.begin(); h!= hpro.end(); h++) (*h)->Write();
708  for(H2I h = hdec.begin(); h!= hdec.end(); h++) (*h)->Write();
709 
710  for(H3I h = helo.begin(); h!= helo.end(); h++) (*h)->Write();
711  for(H3I h = hnhi.begin(); h!= hnhi.end(); h++) (*h)->Write();
712  for(H2I h = held.begin(); h!= held.end(); h++) (*h)->Write();
713 
714  for(H3I h = hima.begin(); h!= hima.end(); h++) (*h)->Write();
715  for(H3I h = hrho.begin(); h!= hrho.end(); h++) (*h)->Write();
716  histoFile->Close();
717  }
718 
719  if(fillNtuples)
720  {
721  ntupleFile->cd();
722  for(TI t = trackTrees.begin(); t!= trackTrees.end(); t++) (*t)->Write();
723  ntupleFile->Close();
724  }
725 }
726 
T getParameter(std::string const &) const
TFile * histoFile
Definition: hcalCalib.cc:45
float pts
Definition: Histograms.h:42
#define nFeedDowns
Definition: Histograms.cc:60
float etar
Definition: Histograms.h:48
TrainProcessor *const proc
Definition: MVATrainer.cc:101
Definition: DDAxes.h:10
int charge
Definition: Histograms.h:28
float etas
Definition: Histograms.h:16
float pts
Definition: Histograms.h:17
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
double double double z
float logpr
Definition: Histograms.h:33
const char * chargeName[nCharges+2]
Definition: Histograms.cc:21
float ima
Definition: Histograms.h:50
const std::pair< int, int > resonance[nResonances]
Definition: Histograms.cc:75
U second(std::pair< T, U > const &p)
void declareHistograms()
Definition: Histograms.cc:153
const int partCharge[nParticles]
Definition: Histograms.cc:48
const char * partName[nParticles]
Definition: Histograms.cc:37
#define nParticles
Definition: Histograms.cc:25
#define nCharges
Definition: Histograms.cc:17
int parids
Definition: Histograms.h:40
bool first
Definition: L1TdeRCT.cc:94
#define nResonances
Definition: Histograms.cc:74
int getCharge(int charge)
Definition: Histograms.cc:146
Particles
Definition: Histograms.cc:26
int k[5][pyjets_maxn]
void fillSimHistograms(const SimTrack_t &s)
Definition: Histograms.cc:530
void fillVzeroHistograms(const RecVzero_t &r, int part)
Definition: Histograms.cc:664
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
float zr
Definition: Histograms.h:32
float ptr
Definition: Histograms.h:30
part
Definition: HCALResponse.h:21
const std::pair< int, int > feedDown[nFeedDowns]
Definition: Histograms.cc:61
void fillEventInfo(int proc, int strk, int ntrkr)
Definition: Histograms.cc:497
float logde
Definition: Histograms.h:34
float etas
Definition: Histograms.h:41
void fillRecHistograms(const RecTrack_t &r)
Definition: Histograms.cc:573
Charges
Definition: Histograms.cc:18
virtual ~Histograms()
Definition: Histograms.h:59
int getParticle(int id)
Definition: Histograms.cc:104
void writeHistograms()
Definition: Histograms.cc:677
mathSSE::Vec4< T > v
float etar
Definition: Histograms.h:29
float ptr
Definition: Histograms.h:49
Definition: DDAxes.h:10