1 #ifndef DQM_HCALMONITORTASKS_HCALETAPHIHISTS_H
2 #define DQM_HCALMONITORTASKS_HCALETAPHIHISTS_H
26 std::stringstream
name;
29 std::stringstream unitname;
30 std::stringstream unittitle;
35 unittitle<<
"No Units";
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()+
")"),
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,
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));
61 float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
62 15.5,16.5,26.5,27.5,28.5};
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()+
")"),
67 9, xbins, 72, ybins));
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()+
")"),
73 for (
unsigned int i=0;
i<
depth.size();++
i)
81 std::stringstream
name;
84 std::stringstream unitname;
85 std::stringstream unittitle;
90 unittitle<<
"No Units";
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()+
")"),
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,
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));
116 float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
117 15.5,16.5,26.5,27.5,28.5};
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()+
")"),
122 9, xbins, 72, ybins));
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()+
")"),
128 for (
unsigned int i=0;
i<
depth.size();++
i)
136 if (depth==1)
return 85;
137 if (depth==2)
return 57;
138 if (depth==3)
return 9;
139 if (depth==4)
return 31;
145 if (depth>0 && depth<5)
153 for (
unsigned int i=0;
i<
depth.size();++
i)
155 depth[
i]->setAxisTitle(
"i#eta",1);
156 depth[
i]->setAxisTitle(
"i#phi",2);
159 std::stringstream
label;
161 for (
int i=-41;
i<=-29;
i=
i+2)
164 depth[0]->setBinLabel(i+42,label.str().c_str());
165 depth[1]->setBinLabel(i+42,label.str().c_str());
168 depth[0]->setBinLabel(14,
"-29HE");
169 depth[1]->setBinLabel(14,
"-29HE");
172 for (
int i=-27;
i<=27;
i=
i+2)
175 depth[0]->setBinLabel(i+43,label.str().c_str());
178 depth[0]->setBinLabel(72,
"29HE");
179 for (
int i=29;
i<=41;
i=
i+2)
182 depth[0]->setBinLabel(i+44,label.str().c_str());
185 for (
int i=16;
i<=28;
i=
i+2)
188 depth[1]->setBinLabel(i,label.str().c_str());
191 depth[1]->setBinLabel(29,
"NULL");
192 for (
int i=15;
i<=27;
i=
i+2)
195 depth[1]->setBinLabel(i+15,label.str().c_str());
199 depth[1]->setBinLabel(44,
"29HE");
200 for (
int i=29;
i<=41;
i=
i+2)
203 depth[1]->setBinLabel(i+16,label.str().c_str());
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");
218 for (
int d=0;d<4;++d)
220 depth[d]->setAxisTitle(
"i#eta",1);
221 depth[d]->setAxisTitle(
"i#phi",2);
229 depth[
id.depth()-1]->Fill(
id.ieta()<0 ?
id.ieta()-1 :
id.ieta()+1,
id.iphi(), val);
231 depth[
id.depth()-1]->Fill(
id.ieta(),
id.iphi(),val);
236 for (
unsigned int d=0;d<
depth.size();d++)
241 std::vector<MonitorElement*>
depth;
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};
255 const int binmapd3[]={-28,-27,-9999,-16,-9999,16,-9999,27,28};
275 ieta < 0 ? etabin-- : etabin++;
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;
327 if (ieta==0)
return -9999;
333 if (ieta==0)
return -9999;
334 if (ieta==17 || ieta == -17)
347 else if (eta>71) ieta--;
354 if (ieta<=-30) ieta++;
355 else if (ieta>=30) ieta--;
369 if (
abs(ieta)>29 ||
abs(ieta)<18)
return -9999;
370 if (ieta==0)
return -9999;
375 if (eta<0 || eta>8)
return -9999;
378 if (ieta==0)
return -9999;
390 if (
abs(ieta)>15)
return -9999;
391 if (ieta==0)
return -9999;
395 if (ieta==0)
return -9999;
407 if (eta<0)
return ieta;
412 else if (eta>71) ieta--;
413 if (ieta==0) ieta=-9999;
418 if (eta>56)
return -9999;
422 if (ieta==-9999)
return ieta;
423 if (ieta==0)
return -9999;
424 if (ieta==17 || ieta == -17)
return -9999;
425 else if (ieta<=-30) ieta++;
426 else if (ieta>=30) ieta--;
432 if (eta>8)
return -9999;
435 if (ieta==0)
return -9999;
441 if (
abs(ieta)>15)
return -9999;
442 if (ieta==0)
return -9999;
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 ");
462 inline bool isHB(
int etabin,
int depth)
464 if (depth>2)
return false;
465 else if (depth<1)
return false;
469 if (ieta==-9999)
return false;
472 if (
abs(ieta)<=16 )
return true;
477 if (
abs(ieta)==15 ||
abs(ieta)==16)
return true;
484 inline bool isHE(
int etabin,
int depth)
486 if (depth>3)
return false;
487 else if (depth<1)
return false;
491 if (ieta==-9999)
return false;
494 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
495 if (ieta==-29 && etabin==13)
return true;
496 if (ieta==29 && etabin == 71)
return true;
500 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
501 if (ieta==-29 && etabin==13)
return true;
502 if (ieta==29 && etabin == 43)
return true;
510 inline bool isHF(
int etabin,
int depth)
512 if (depth>2)
return false;
513 else if (depth<1)
return false;
517 if (ieta==-9999)
return false;
520 if (ieta==-29 && etabin==13)
return false;
521 else if (ieta==29 && etabin == 71)
return false;
522 else if (
abs(ieta)>=29 )
return true;
526 if (ieta==-29 && etabin==13)
return false;
527 else if (ieta==29 && etabin==43)
return false;
528 else if (
abs(ieta)>=29 )
return true;
534 inline bool isHO(
int etabin,
int depth)
536 if (depth!=4)
return false;
538 if (ieta!=-9999)
return true;
544 inline bool isSiPM(
int ieta,
int iphi,
int depth)
546 if (depth!=4)
return false;
548 if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58)
return true;
550 if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70)
return true;
562 const int ie (
abs( ies ) ) ;
564 return ( ( ip >= 1 ) &&
571 ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
591 ( ip%2 == 1 ) ) ) ) ||
602 ( ip%4 == 3 ) ) ) ) ) ) ;
613 std::stringstream
label;
614 for (
int i=-41;
i<=-29;
i=
i+2)
623 for (
int i=-27;
i<=27;
i=
i+2)
630 for (
int i=29;
i<=41;
i=
i+2)
647 for (
unsigned int d=0;d<3;++d)
649 if (!hh.
depth[d])
continue;
653 if (ieta==-9999 ||
abs(ieta)<21)
continue;
657 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
659 hh.
depth[d]->setBinContent(
eta+1,iphi+1,hh.
depth[d]->getBinContent(
eta+1,iphi));
663 else if (
abs(ieta)>39 && iphi%4==3 && iphi<73)
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));
692 if (ieta==-9999 ||
abs(ieta)<21)
continue;
697 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
702 else if (
abs(ieta)>39 && iphi%4==3 && iphi<73)
bool isHO(int etabin, int depth)
void setBinContent(int binx, double content)
set content of bin (1-D)
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)
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)
Abs< T >::type abs(const T &t)
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.
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
MonitorElement * book2D(Args &&...args)
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.
void SetEtaPhiLabels(MonitorElement *h)
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
void Fill(HcalDetId &id, double val=1)