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 if (depth==1)
return 85;
82 if (depth==2)
return 57;
83 if (depth==3)
return 9;
84 if (depth==4)
return 31;
90 if (depth>0 && depth<5)
98 for (
unsigned int i=0;
i<
depth.size();++
i)
100 depth[
i]->setAxisTitle(
"i#eta",1);
101 depth[
i]->setAxisTitle(
"i#phi",2);
104 std::stringstream
label;
106 for (
int i=-41;
i<=-29;
i=
i+2)
109 depth[0]->setBinLabel(i+42,label.str().c_str());
110 depth[1]->setBinLabel(i+42,label.str().c_str());
113 depth[0]->setBinLabel(14,
"-29HE");
114 depth[1]->setBinLabel(14,
"-29HE");
117 for (
int i=-27;
i<=27;
i=
i+2)
120 depth[0]->setBinLabel(i+43,label.str().c_str());
123 depth[0]->setBinLabel(72,
"29HE");
124 for (
int i=29;
i<=41;
i=
i+2)
127 depth[0]->setBinLabel(i+44,label.str().c_str());
130 for (
int i=16;
i<=28;
i=
i+2)
133 depth[1]->setBinLabel(i,label.str().c_str());
136 depth[1]->setBinLabel(29,
"NULL");
137 for (
int i=15;
i<=27;
i=
i+2)
140 depth[1]->setBinLabel(i+15,label.str().c_str());
144 depth[1]->setBinLabel(44,
"29HE");
145 for (
int i=29;
i<=41;
i=
i+2)
148 depth[1]->setBinLabel(i+16,label.str().c_str());
153 depth[2]->setBinLabel(1,
"-28");
154 depth[2]->setBinLabel(2,
"-27");
155 depth[2]->setBinLabel(3,
"Null");
156 depth[2]->setBinLabel(4,
"-16");
157 depth[2]->setBinLabel(5,
"Null");
158 depth[2]->setBinLabel(6,
"16");
159 depth[2]->setBinLabel(7,
"Null");
160 depth[2]->setBinLabel(8,
"27");
161 depth[2]->setBinLabel(9,
"28");
163 for (
int d=0;
d<4;++
d)
165 depth[
d]->setAxisTitle(
"i#eta",1);
166 depth[
d]->setAxisTitle(
"i#phi",2);
174 depth[
id.depth()-1]->Fill(
id.ieta()<0 ?
id.ieta()-1 :
id.ieta()+1,
id.iphi(), val);
176 depth[
id.depth()-1]->Fill(
id.ieta(),
id.iphi(),val);
181 for (
unsigned int d=0;
d<
depth.size();
d++)
186 std::vector<MonitorElement*>
depth;
193 const int binmapd2[]={-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,
194 -29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,
195 -16,-15,-9999, 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
196 30,31,32,33,34,35,36,37,38,39,40,41,42};
200 const int binmapd3[]={-28,-27,-9999,-16,-9999,16,-9999,27,28};
220 ieta < 0 ? etabin-- : etabin++;
247 if (ieta==-28) etabin=0;
248 else if (ieta==-27) etabin=1;
249 else if (ieta==-16) etabin=3;
250 else if (ieta==16) etabin=5;
251 else if (ieta==27) etabin=7;
252 else if (ieta==28) etabin=8;
272 if (ieta==0)
return -9999;
278 if (ieta==0)
return -9999;
279 if (ieta==17 || ieta == -17)
292 else if (eta>71) ieta--;
299 if (ieta<=-30) ieta++;
300 else if (ieta>=30) ieta--;
314 if (
abs(ieta)>29 ||
abs(ieta)<18)
return -9999;
315 if (ieta==0)
return -9999;
320 if (eta<0 || eta>8)
return -9999;
323 if (ieta==0)
return -9999;
335 if (
abs(ieta)>15)
return -9999;
336 if (ieta==0)
return -9999;
340 if (ieta==0)
return -9999;
352 if (eta<0)
return ieta;
357 else if (eta>71) ieta--;
358 if (ieta==0) ieta=-9999;
363 if (eta>56)
return -9999;
367 if (ieta==-9999)
return ieta;
368 if (ieta==0)
return -9999;
369 if (ieta==17 || ieta == -17)
return -9999;
370 else if (ieta<=-30) ieta++;
371 else if (ieta>=30) ieta--;
377 if (eta>8)
return -9999;
380 if (ieta==0)
return -9999;
386 if (
abs(ieta)>15)
return -9999;
387 if (ieta==0)
return -9999;
398 std::vector<std::string>
name;
399 name.push_back(
"HB HE HF Depth 1 ");
400 name.push_back(
"HB HE HF Depth 2 ");
401 name.push_back(
"HE Depth 3 ");
402 name.push_back(
"HO Depth 4 ");
409 if (depth>2)
return false;
410 else if (depth<1)
return false;
414 if (ieta==-9999)
return false;
417 if (
abs(ieta)<=16 )
return true;
422 if (
abs(ieta)==15 ||
abs(ieta)==16)
return true;
431 if (depth>3)
return false;
432 else if (depth<1)
return false;
436 if (ieta==-9999)
return false;
439 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
440 if (ieta==-29 && etabin==13)
return true;
441 if (ieta==29 && etabin == 71)
return true;
445 if (
abs(ieta)>=17 &&
abs(ieta)<=28 )
return true;
446 if (ieta==-29 && etabin==13)
return true;
447 if (ieta==29 && etabin == 43)
return true;
457 if (depth>2)
return false;
458 else if (depth<1)
return false;
462 if (ieta==-9999)
return false;
465 if (ieta==-29 && etabin==13)
return false;
466 else if (ieta==29 && etabin == 71)
return false;
467 else if (
abs(ieta)>=29 )
return true;
471 if (ieta==-29 && etabin==13)
return false;
472 else if (ieta==29 && etabin==43)
return false;
473 else if (
abs(ieta)>=29 )
return true;
481 if (depth!=4)
return false;
483 if (ieta!=-9999)
return true;
491 if (depth!=4)
return false;
493 if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58)
return true;
495 if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70)
return true;
558 std::stringstream
label;
559 for (
int i=-41;
i<=-29;
i=
i+2)
568 for (
int i=-27;
i<=27;
i=
i+2)
575 for (
int i=29;
i<=41;
i=
i+2)
592 for (
unsigned int d=0;
d<3;++
d)
594 if (!hh.
depth[
d])
continue;
598 if (ieta==-9999 ||
abs(ieta)<21)
continue;
602 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
608 else if (
abs(ieta)>39 && iphi%4==3 && iphi<73)
611 hh.
depth[
d]->setBinContent(
eta+1,(iphi)%72+1, hh.
depth[
d]->getBinContent(
eta+1,iphi));
612 hh.
depth[
d]->setBinContent(
eta+1,(iphi+1)%72+1, hh.
depth[
d]->getBinContent(
eta+1,iphi));
613 hh.
depth[
d]->setBinContent(
eta+1,(iphi+2)%72+1, hh.
depth[
d]->getBinContent(
eta+1,iphi));
637 if (ieta==-9999 ||
abs(ieta)<21)
continue;
642 if (iphi%2==1 &&
abs(ieta)<40 && iphi<73)
647 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)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< std::string > HcalEtaPhiHistNames()
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="")
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)
Geom::Phi< T > phi() const
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
void SetEtaPhiLabels(MonitorElement *h)
void Fill(HcalDetId &id, double val=1)