CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalEtaPhiHists.h
Go to the documentation of this file.
1 #ifndef DQM_HCALMONITORTASKS_HCALETAPHIHISTS_H
2 #define DQM_HCALMONITORTASKS_HCALETAPHIHISTS_H
3 
4 #include "TH1F.h"
5 #include "TH2F.h"
6 
11 
12 #include <iostream>
13 
14 
15 // Define EtaPhi histograms
16 
18  // Make a set of eta-phi histograms (one for each depth)
19  public:
22 
23  // dummy
24  void setup(DQMStore *& m_dbe,std::string Name, std::string Units="")
25  {
26  std::stringstream name;
27  name<<Name;
28 
29  std::stringstream unitname;
30  std::stringstream unittitle;
31  std::string s(Units);
32  if (s.empty())
33  {
34  unitname<<Units;
35  unittitle<<"No Units";
36  }
37  else
38  {
39  unitname<<" "<<Units;
40  unittitle<<Units;
41  }
42 
43  // Push back depth plots
44  depth.push_back(m_dbe->book2D(("HB HE HF Depth 1 "+name.str()+unitname.str()).c_str(),
45  (name.str()+" Depth 1 -- HB HE HF ("+unittitle.str().c_str()+")"),
46  85,-42.5,42.5,
47  72,0.5,72.5));
48  float ybins[73];
49  for (int i=0;i<=72;i++) ybins[i]=(float)(i+0.5);
50  float xbinsd2[]={-42.5,-41.5,-40.5,-39.5,-38.5,-37.5,-36.5,-35.5,-34.5,-33.5,-32.5,-31.5,-30.5,-29.5,
51  -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
52  -15.5,-14.5,
53  14.5, 15.5,
54  16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
55  31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
56  depth.push_back(m_dbe->book2D(("HB HE HF Depth 2 "+name.str()+unitname.str()).c_str(),
57  (name.str()+" Depth 2 -- HB HE HF ("+unittitle.str().c_str()+")"),
58  57, xbinsd2, 72, ybins));
59 
60  // Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
61  float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
62  15.5,16.5,26.5,27.5,28.5};
63 
64  depth.push_back(m_dbe->book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
65  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
66  // Use variable-sized eta bins
67  9, xbins, 72, ybins));
68  // HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
69  depth.push_back(m_dbe->book2D(("HO Depth 4 "+name.str()+unitname.str()).c_str(),
70  (name.str()+" Depth 4 -- HO ("+unittitle.str().c_str()+")"),
71  31,-15.5,15.5,
72  72,0.5,72.5));
73  for (unsigned int i=0;i<depth.size();++i)
74  (depth[i]->getTH2F())->SetOption("colz");
75  setBinLabels(); // set axis titles, special bins
76 
77  } // void setup(...)
78 
79  void setup(DQMStore::IBooker & m_dbe,std::string Name, std::string Units="")
80  {
81  std::stringstream name;
82  name<<Name;
83 
84  std::stringstream unitname;
85  std::stringstream unittitle;
86  std::string s(Units);
87  if (s.empty())
88  {
89  unitname<<Units;
90  unittitle<<"No Units";
91  }
92  else
93  {
94  unitname<<" "<<Units;
95  unittitle<<Units;
96  }
97 
98  // Push back depth plots
99  depth.push_back(m_dbe.book2D(("HB HE HF Depth 1 "+name.str()+unitname.str()).c_str(),
100  (name.str()+" Depth 1 -- HB HE HF ("+unittitle.str().c_str()+")"),
101  85,-42.5,42.5,
102  72,0.5,72.5));
103  float ybins[73];
104  for (int i=0;i<=72;i++) ybins[i]=(float)(i+0.5);
105  float xbinsd2[]={-42.5,-41.5,-40.5,-39.5,-38.5,-37.5,-36.5,-35.5,-34.5,-33.5,-32.5,-31.5,-30.5,-29.5,
106  -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
107  -15.5,-14.5,
108  14.5, 15.5,
109  16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
110  31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
111  depth.push_back(m_dbe.book2D(("HB HE HF Depth 2 "+name.str()+unitname.str()).c_str(),
112  (name.str()+" Depth 2 -- HB HE HF ("+unittitle.str().c_str()+")"),
113  57, xbinsd2, 72, ybins));
114 
115  // Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
116  float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
117  15.5,16.5,26.5,27.5,28.5};
118 
119  depth.push_back(m_dbe.book2D(("HE Depth 3 "+name.str()+unitname.str()).c_str(),
120  (name.str()+" Depth 3 -- HE ("+unittitle.str().c_str()+")"),
121  // Use variable-sized eta bins
122  9, xbins, 72, ybins));
123  // HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
124  depth.push_back(m_dbe.book2D(("HO Depth 4 "+name.str()+unitname.str()).c_str(),
125  (name.str()+" Depth 4 -- HO ("+unittitle.str().c_str()+")"),
126  31,-15.5,15.5,
127  72,0.5,72.5));
128  for (unsigned int i=0;i<depth.size();++i)
129  (depth[i]->getTH2F())->SetOption("colz");
130  setBinLabels(); // set axis titles, special bins
131 
132  } // void setup(...)
133 
134  int getEtaBins(int depth)
135  {
136  if (depth==1) return 85;
137  if (depth==2) return 57;
138  if (depth==3) return 9;
139  if (depth==4) return 31;
140  return 0;
141  }
142 
143  int getPhiBins(int depth)
144  {
145  if (depth>0 && depth<5)
146  return 72;
147  return 0;
148  }
149 
151  {
152  // Set labels for all depth histograms
153  for (unsigned int i=0;i<depth.size();++i)
154  {
155  depth[i]->setAxisTitle("i#eta",1);
156  depth[i]->setAxisTitle("i#phi",2);
157  }
158 
159  std::stringstream label;
160  // set label on every other bin
161  for (int i=-41;i<=-29;i=i+2)
162  {
163  label<<i;
164  depth[0]->setBinLabel(i+42,label.str().c_str());
165  depth[1]->setBinLabel(i+42,label.str().c_str());
166  label.str("");
167  }
168  depth[0]->setBinLabel(14,"-29HE");
169  depth[1]->setBinLabel(14,"-29HE");
170 
171  // offset by one for HE
172  for (int i=-27;i<=27;i=i+2)
173  {
174  label<<i;
175  depth[0]->setBinLabel(i+43,label.str().c_str());
176  label.str("");
177  }
178  depth[0]->setBinLabel(72,"29HE");
179  for (int i=29;i<=41;i=i+2)
180  {
181  label<<i;
182  depth[0]->setBinLabel(i+44,label.str().c_str());
183  label.str("");
184  }
185  for (int i=16;i<=28;i=i+2)
186  {
187  label<<i-43;
188  depth[1]->setBinLabel(i,label.str().c_str());
189  label.str("");
190  }
191  depth[1]->setBinLabel(29,"NULL");
192  for (int i=15;i<=27;i=i+2)
193  {
194  label<<i;
195  depth[1]->setBinLabel(i+15,label.str().c_str());
196  label.str("");
197  }
198 
199  depth[1]->setBinLabel(44,"29HE");
200  for (int i=29;i<=41;i=i+2)
201  {
202  label<<i;
203  depth[1]->setBinLabel(i+16,label.str().c_str());
204  label.str("");
205  }
206 
207  // HE depth 3 labels;
208  depth[2]->setBinLabel(1,"-28");
209  depth[2]->setBinLabel(2,"-27");
210  depth[2]->setBinLabel(3,"Null");
211  depth[2]->setBinLabel(4,"-16");
212  depth[2]->setBinLabel(5,"Null");
213  depth[2]->setBinLabel(6,"16");
214  depth[2]->setBinLabel(7,"Null");
215  depth[2]->setBinLabel(8,"27");
216  depth[2]->setBinLabel(9,"28");
217 
218  for (int d=0;d<4;++d)
219  {
220  depth[d]->setAxisTitle("i#eta",1);
221  depth[d]->setAxisTitle("i#phi",2);
222  }
223  };
224  // special fill call based on detid -- eventually will need special treatment
225  void Fill(HcalDetId& id, double val=1)
226  {
227  // If in HF, need to shift by 1 bin (-1 bin lower in -HF, +1 bin higher in +HF)
228  if (id.subdet()==HcalForward)
229  depth[id.depth()-1]->Fill(id.ieta()<0 ? id.ieta()-1 : id.ieta()+1, id.iphi(), val);
230  else
231  depth[id.depth()-1]->Fill(id.ieta(),id.iphi(),val);
232  };
233 
234  void Reset(void)
235  {
236  for (unsigned int d=0;d<depth.size();d++)
237  if(depth[d]) depth[d]->Reset();
238  }; // void Reset(void)
239 
240  //******************************************************************************************
241  std::vector<MonitorElement*> depth;
242 
243 };
244 
245 // Now define functions that can be used in conjunction with EtaPhi histograms
246 
247 // This arrays the eta binning for depth 2 histograms (with a gap between -15 -> +15)
248 const int binmapd2[]={-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,
249  -29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,
250  -16,-15,-9999, 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
251  30,31,32,33,34,35,36,37,38,39,40,41,42};
252 
253 // This stores eta binning in depth 3 (where HE is only present at a few ieta values)
254 
255 const int binmapd3[]={-28,-27,-9999,-16,-9999,16,-9999,27,28};
256 
257 inline int CalcEtaBin(int subdet, int ieta, int depth)
258 {
259  // This takes the eta value from a subdetector and return an eta counter value as used by eta-phi array
260  // (ieta=-41 corresponds to bin 0, +41 to bin 85 -- there are two offsets to deal with the overlap at |ieta|=29).
261  // For HO, ieta = -15 corresponds to bin 0, and ieta=15 is bin 30
262  // For HE depth 3, things are more complicated, but feeding the ieta value will give back the corresponding counter eta value
263 
264  // The CalcEtaBin value is the value as used within our array counters, and thus starts at 0.
265  // If you are using it with getBinContent or setBinContent, you will need to add +1 to the result of this function
266 
267  int etabin=-9999; // default invalid value
268 
269  if (depth==1)
270  {
271  // Depth 1 is fairly straightforward -- just shift HF-, HF+ by -/+1
272  etabin=ieta+42;
273  if (subdet==HcalForward)
274  {
275  ieta < 0 ? etabin-- : etabin++;
276  }
277  }
278 
279  else if (depth==2)
280  {
281  // Depth 2 is more complicated, given that there are no cells in the range |ieta|<15
282  if (ieta<-14)
283  {
284  etabin=ieta+42;
285  if (subdet==HcalForward) etabin--;
286  }
287  else if (ieta>14)
288  {
289  etabin=ieta+14;
290  if (subdet==HcalForward) etabin++;
291  }
292 
293  }
294  // HO is also straightforward; a simple offset to the ieta value is applied
295  else if (subdet==HcalOuter && abs(ieta)<16)
296  etabin=ieta+15;
297  else if (subdet==HcalEndcap)
298  {
299  // HE depth 3 has spotty coverage; hard-code the bin response
300  if (depth==3)
301  {
302  if (ieta==-28) etabin=0;
303  else if (ieta==-27) etabin=1;
304  else if (ieta==-16) etabin=3;
305  else if (ieta==16) etabin=5;
306  else if (ieta==27) etabin=7;
307  else if (ieta==28) etabin=8;
308  }
309  }
310  return etabin;
311 }
312 
313 inline int CalcIeta(int subdet, int eta, int depth)
314 {
315  // This function returns the 'true' ieta value given subdet, eta, and depth
316  // Here 'eta' is the index from our arrays (it starts at 0);
317  // remember that histogram bins start with bin 1, so there's an offset of 1
318  // to consider if using getBinContent(eta,phi)
319 
320  // eta runs from 0...X (X depends on depth)
321  int ieta=-9999; // default value is nonsensical
322  if (subdet==HcalBarrel)
323  {
324  if (depth==1)
325  {
326  ieta=eta-42;
327  if (ieta==0) return -9999;
328  return ieta;
329  }
330  else if (depth==2)
331  {
332  ieta=binmapd2[eta];
333  if (ieta==0) return -9999;
334  if (ieta==17 || ieta == -17)
335  return -9999; // no depth 2 cells at |ieta| = 17
336  return ieta;
337  }
338  else
339  return -9999; // non-physical value
340  }
341  else if (subdet==HcalForward)
342  {
343  if (depth==1)
344  {
345  ieta=eta-42;
346  if (eta<13) ieta++;
347  else if (eta>71) ieta--;
348  else return -9999; // if outside forward range, return dummy
349  return ieta;
350  }
351  else if (depth==2)
352  {
353  ieta=binmapd2[eta]; // special map for depth 2
354  if (ieta<=-30) ieta++;
355  else if (ieta>=30) ieta--;
356  else return -9999;
357  return ieta;
358  }
359  else return -9999;
360  }
361 
362  else if (subdet==HcalEndcap)
363  {
364  if (depth==1)
365  ieta=eta-42;
366  else if (depth==2)
367  {
368  ieta=binmapd2[eta];
369  if (abs(ieta)>29 || abs(ieta)<18) return -9999; // outside HE
370  if (ieta==0) return -9999;
371  return ieta;
372  }
373  else if (depth==3)
374  {
375  if (eta<0 || eta>8) return -9999;
376  else
377  ieta=binmapd3[eta]; // special map for depth 3
378  if (ieta==0) return -9999;
379  return ieta;
380  }
381  else return -9999;
382  } // HcalEndcap
383  else if ( subdet==HcalOuter)
384  {
385  if (depth!=4)
386  return -9999;
387  else
388  {
389  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
390  if (abs(ieta)>15) return -9999;
391  if (ieta==0) return -9999;
392  return ieta;
393  }
394  } // HcalOuter
395  if (ieta==0) return -9999;
396  return ieta;
397 }
398 
399 inline int CalcIeta(int eta, int depth)
400 {
401  // This version of CalcIeta does the same as the function above,
402  // but does not require that 'subdet' be specified.
403 
404  // returns ieta value give an eta counter.
405  // eta runs from 0...X (X depends on depth)
406  int ieta=-9999;
407  if (eta<0) return ieta;
408  if (depth==1)
409  {
410  ieta=eta-42; // default shift: bin 0 corresponds to a histogram ieta of -42 (which is offset by 1 from true HF value of -41)
411  if (eta<13) ieta++;
412  else if (eta>71) ieta--;
413  if (ieta==0) ieta=-9999;
414  return ieta;
415  }
416  else if (depth==2)
417  {
418  if (eta>56) return -9999;
419  else
420  {
421  ieta=binmapd2[eta];
422  if (ieta==-9999) return ieta;
423  if (ieta==0) return -9999;
424  if (ieta==17 || ieta == -17) return -9999; // no depth 2 cells at |ieta| = 17
425  else if (ieta<=-30) ieta++;
426  else if (ieta>=30) ieta--;
427  return ieta;
428  }
429  }
430  else if (depth==3)
431  {
432  if (eta>8) return -9999;
433  else
434  ieta=binmapd3[eta];
435  if (ieta==0) return -9999;
436  return ieta;
437  }
438  else if (depth==4)
439  {
440  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
441  if (abs(ieta)>15) return -9999;
442  if (ieta==0) return -9999;
443  return ieta;
444  }
445  return ieta; // avoids compilation warning
446 }
447 
448 
449 // Functions to check whether a given (eta,depth) value is valid for a given subdetector
450 
451 inline std::vector<std::string> HcalEtaPhiHistNames()
452 {
453  std::vector<std::string> name;
454  name.push_back("HB HE HF Depth 1 ");
455  name.push_back("HB HE HF Depth 2 ");
456  name.push_back("HE Depth 3 ");
457  name.push_back("HO Depth 4 ");
458  return name;
459 }
460 
461 
462 inline bool isHB(int etabin, int depth)
463 {
464  if (depth>2) return false;
465  else if (depth<1) return false;
466  else
467  {
468  int ieta=CalcIeta(etabin,depth);
469  if (ieta==-9999) return false;
470  if (depth==1)
471  {
472  if (abs(ieta)<=16 ) return true;
473  else return false;
474  }
475  else if (depth==2)
476  {
477  if (abs(ieta)==15 || abs(ieta)==16) return true;
478  else return false;
479  }
480  }
481  return false;
482 }
483 
484 inline bool isHE(int etabin, int depth)
485 {
486  if (depth>3) return false;
487  else if (depth<1) return false;
488  else
489  {
490  int ieta=CalcIeta(etabin,depth);
491  if (ieta==-9999) return false;
492  if (depth==1)
493  {
494  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
495  if (ieta==-29 && etabin==13) return true; // HE -29
496  if (ieta==29 && etabin == 71) return true; // HE +29
497  }
498  else if (depth==2)
499  {
500  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
501  if (ieta==-29 && etabin==13) return true; // HE -29
502  if (ieta==29 && etabin == 43) return true; // HE +29
503  }
504  else if (depth==3)
505  return true;
506  }
507  return false;
508 }
509 
510 inline bool isHF(int etabin, int depth)
511 {
512  if (depth>2) return false;
513  else if (depth<1) return false;
514  else
515  {
516  int ieta=CalcIeta(etabin,depth);
517  if (ieta==-9999) return false;
518  if (depth==1)
519  {
520  if (ieta==-29 && etabin==13) return false; // HE -29
521  else if (ieta==29 && etabin == 71) return false; // HE +29
522  else if (abs(ieta)>=29 ) return true;
523  }
524  else if (depth==2)
525  {
526  if (ieta==-29 && etabin==13) return false; // HE -29
527  else if (ieta==29 && etabin==43) return false; // HE +29
528  else if (abs(ieta)>=29 ) return true;
529  }
530  }
531  return false;
532 }
533 
534 inline bool isHO(int etabin, int depth)
535 {
536  if (depth!=4) return false;
537  int ieta=CalcIeta(etabin,depth);
538  if (ieta!=-9999) return true;
539  return false;
540 }
541 
542 // Checks whether HO region contains SiPM
543 
544 inline bool isSiPM(int ieta, int iphi, int depth)
545 {
546  if (depth!=4) return false;
547  // HOP1
548  if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58) return true;
549  // HOP2
550  if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70) return true;
551  return false;
552 } // bool isSiPM
553 
554 
555 // Checks whether (subdet, ieta, iphi, depth) value is a valid Hcal cell
556 
557 inline bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
558 {
559  // inputs are (subdetector, ieta, iphi, depth)
560  // stolen from latest version of DataFormats/HcalDetId/src/HcalDetId.cc (not yet available in CMSSW_2_1_9)
561 
562  const int ie ( abs( ies ) ) ;
563 
564  return ( ( ip >= 1 ) &&
565  ( ip <= 72 ) &&
566  ( dp >= 1 ) &&
567  ( ie >= 1 ) &&
568  ( ( ( sd == HcalBarrel ) &&
569  ( ( ( ie <= 14 ) &&
570  ( dp == 1 ) ) ||
571  ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
572  ( dp <= 2 ) ) ) ) ||
573  ( ( sd == HcalEndcap ) &&
574  ( ( ( ie == 16 ) &&
575  ( dp == 3 ) ) ||
576  ( ( ie == 17 ) &&
577  ( dp == 1 ) ) ||
578  ( ( ie >= 18 ) &&
579  ( ie <= 20 ) &&
580  ( dp <= 2 ) ) ||
581  ( ( ie >= 21 ) &&
582  ( ie <= 26 ) &&
583  ( dp <= 2 ) &&
584  ( ip%2 == 1 ) ) ||
585  ( ( ie >= 27 ) &&
586  ( ie <= 28 ) &&
587  ( dp <= 3 ) &&
588  ( ip%2 == 1 ) ) ||
589  ( ( ie == 29 ) &&
590  ( dp <= 2 ) &&
591  ( ip%2 == 1 ) ) ) ) ||
592  ( ( sd == HcalOuter ) &&
593  ( ie <= 15 ) &&
594  ( dp == 4 ) ) ||
595  ( ( sd == HcalForward ) &&
596  ( dp <= 2 ) &&
597  ( ( ( ie >= 29 ) &&
598  ( ie <= 39 ) &&
599  ( ip%2 == 1 ) ) ||
600  ( ( ie >= 40 ) &&
601  ( ie <= 41 ) &&
602  ( ip%4 == 3 ) ) ) ) ) ) ;
603 
604 
605 
606 } // bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
607 
608 
609 // Sets eta, phi labels for 'summary' eta-phi plots (identical to Depth 1 Eta-Phi labelling)
610 
612 {
613  std::stringstream label;
614  for (int i=-41;i<=-29;i=i+2)
615  {
616  label<<i;
617  h->setBinLabel(i+42,label.str().c_str());
618  label.str("");
619  }
620  h->setBinLabel(14,"-29HE");
621 
622  // offset by one for HE
623  for (int i=-27;i<=27;i=i+2)
624  {
625  label<<i;
626  h->setBinLabel(i+43,label.str().c_str());
627  label.str("");
628  }
629  h->setBinLabel(72,"29HE");
630  for (int i=29;i<=41;i=i+2)
631  {
632  label<<i;
633  h->setBinLabel(i+44,label.str().c_str());
634  label.str("");
635  }
636  return;
637 }
638 
639 
640 // Fill Unphysical bins in histograms
641 
643 {
644  int ieta=0;
645  int iphi=0;
646  // First 2 depths have 5-10-20 degree corrections
647  for (unsigned int d=0;d<3;++d)
648  {
649  if (!hh.depth[d]) continue;
650  for (int eta=0;eta<hh.depth[d]->getNbinsX();++eta)
651  {
652  ieta=CalcIeta(eta,d+1);
653  if (ieta==-9999 || abs(ieta)<21) continue;
654  for (int phi=0;phi<hh.depth[d]->getNbinsY();++phi)
655  {
656  iphi=phi+1;
657  if (iphi%2==1 && abs(ieta)<40 && iphi<73)
658  {
659  hh.depth[d]->setBinContent(eta+1,iphi+1,hh.depth[d]->getBinContent(eta+1,iphi));
660  }
661  // last two eta strips span 20 degrees in phi
662  // Fill the phi cell above iphi, and the 2 below it
663  else if (abs(ieta)>39 && iphi%4==3 && iphi<73)
664  {
665  //ieta=40, iphi=3 covers iphi 3,4,5,6
666  hh.depth[d]->setBinContent(eta+1,(iphi)%72+1, hh.depth[d]->getBinContent(eta+1,iphi));
667  hh.depth[d]->setBinContent(eta+1,(iphi+1)%72+1, hh.depth[d]->getBinContent(eta+1,iphi));
668  hh.depth[d]->setBinContent(eta+1,(iphi+2)%72+1, hh.depth[d]->getBinContent(eta+1,iphi));
669  }
670  } // for (int phi...)
671  } // for (int eta...)
672  } // for (int d=0;...)
673  // no corrections needed for HO (depth 4)
674  return;
675 } // FillUnphysicalHEHFBins(MonitorElement* hh)
676 
677 
678 // Fill unphysical bins for single ME
680 {
681  // Fills unphysical HE/HF bins for Summary Histogram
682  // Summary Histogram is binned with the same binning as the Depth 1 EtaPhiHists
683  if (hh==0) return;
684  int ieta=0;
685  int iphi=0;
686  int etabins = hh->getNbinsX();
687  int phibins = hh->getNbinsY();
688  float binval=0;
689  for (int eta=0;eta<etabins;++eta) // loop over eta bins
690  {
691  ieta=CalcIeta(eta,1);
692  if (ieta==-9999 || abs(ieta)<21) continue; // ignore etas that don't exist, or that have 5 degree phi binning
693 
694  for (int phi=0;phi<phibins;++phi)
695  {
696  iphi=phi+1;
697  if (iphi%2==1 && abs(ieta)<40 && iphi<73) // 10 degree phi binning condition
698  {
699  binval=hh->getBinContent(eta+1,iphi);
700  hh->setBinContent(eta+1,iphi+1,binval);
701  } // if (iphi%2==1...)
702  else if (abs(ieta)>39 && iphi%4==3 && iphi<73) // 20 degree phi binning condition
703  {
704  // Set last two eta strips where each cell spans 20 degrees in phi
705  // Set next phi cell above iphi, and 2 cells below the actual cell
706  hh->setBinContent(eta+1, (iphi)%72+1, hh->getBinContent(eta+1,iphi));
707  hh->setBinContent(eta+1, (iphi+1)%72+1, hh->getBinContent(eta+1,iphi));
708  hh->setBinContent(eta+1, (iphi+2)%72+1, hh->getBinContent(eta+1,iphi));
709  } // else if (abs(ieta)>39 ...)
710  } // for (int phi=0;phi<72;++phi)
711 
712  } // for (int eta=0; eta< (etaBins_-2);++eta)
713 
714  return;
715 } // FillUnphysicalHEHFBins(std::vector<MonitorElement*> &hh)
716 
717 
718 
719 
720 #endif
bool isHO(int etabin, int depth)
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
const int binmapd2[]
const double xbins[]
void Reset(void)
std::vector< std::string > HcalEtaPhiHistNames()
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
bool isHE(int etabin, int depth)
T eta() const
void setBinLabels()
const int binmapd3[]
int getNbinsY(void) const
get # of bins in Y-axis
int getEtaBins(int depth)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getPhiBins(int depth)
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
auto dp
Definition: deltaR.h:24
double sd
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int CalcEtaBin(int subdet, int ieta, int depth)
double getBinContent(int binx) const
get content of bin (1-D)
TH2F * getTH2F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1092
void SetEtaPhiLabels(MonitorElement *h)
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
void Fill(HcalDetId &id, double val=1)
Definition: DDAxes.h:10