29 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
30 prefixME_.append(
"/");
68 TH2F* OccupancyByDepth[4];
69 TH2F* SumEnergyByDepth[4];
70 TH2F* SumTimeByDepth[4];
71 TH2F* SqrtSumEnergy2ByDepth[4];
73 TH2F* OccupancyThreshByDepth[4];
74 TH2F* SumEnergyThreshByDepth[4];
75 TH2F* SumTimeThreshByDepth[4];
76 TH2F* SqrtSumEnergy2ThreshByDepth[4];
87 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
88 OccupancyByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, OccupancyByDepth[
i],
debug_);
89 s=
subdir_+
"Distributions_AllRecHits/sumplots/"+name[
i]+
"RecHit Summed Energy GeV";
91 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
92 SumEnergyByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SumEnergyByDepth[
i],
debug_);
93 s=
subdir_+
"Distributions_AllRecHits/sumplots/"+name[
i]+
"RecHit Summed Time nS";
95 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
96 SumTimeByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SumTimeByDepth[
i],
debug_);
97 s=
subdir_+
"Distributions_AllRecHits/sumplots/"+name[
i]+
"RecHit Sqrt Summed Energy2 GeV";
99 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
100 SqrtSumEnergy2ByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SqrtSumEnergy2ByDepth[
i],
debug_);
103 s=
subdir_+
"Distributions_PassedMinBias/"+name[
i]+
"Above Threshold RecHit Occupancy";
104 me=ig.
get(s.c_str());
105 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
106 OccupancyThreshByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, OccupancyThreshByDepth[
i],
debug_);
107 s=
subdir_+
"Distributions_PassedMinBias/sumplots/"+name[
i]+
"Above Threshold RecHit Summed Energy GeV";
108 me=ig.
get(s.c_str());
109 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
110 SumEnergyThreshByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SumEnergyThreshByDepth[
i],
debug_);
111 s=
subdir_+
"Distributions_PassedMinBias/sumplots/"+name[
i]+
"Above Threshold RecHit Summed Time nS";
112 me=ig.
get(s.c_str());
113 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
114 SumTimeThreshByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SumTimeThreshByDepth[
i],
debug_);
115 s=
subdir_+
"Distributions_PassedMinBias/sumplots/"+name[
i]+
"Above Threshold RecHit Sqrt Summed Energy2 GeV";
116 me=ig.
get(s.c_str());
117 if (me==0) {
if (
debug_>0)
std::cout <<
"Could not get histogram "<<s<<std::endl; gotHistos=
false;
break;}
118 SqrtSumEnergy2ThreshByDepth[
i]=HcalUtilsClient::getHisto<TH2F*>(
me,
cloneME_, SqrtSumEnergy2ThreshByDepth[
i],
debug_);
120 if (gotHistos==
false)
122 if (
debug_>0)
std::cout <<
"<HcalRecHitClient::calculateProblems()> Not all histograms could be found; skipping normalization"<<std::endl;
144 for (
int mydepth=0;mydepth<4;++mydepth)
146 for (
int eta=0;
eta<OccupancyByDepth[mydepth]->GetNbinsX();++
eta)
153 if (OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)>0)
161 meHBEnergyRMS_1D->
Fill(
sqrt(
pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)));
170 meHEEnergyRMS_1D->
Fill(
sqrt(
pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)));
178 meHOEnergyRMS_1D->
Fill(
sqrt(
pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)));
186 meHFEnergyRMS_1D->
Fill(
sqrt(
pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)));
195 if (OccupancyThreshByDepth[mydepth]==0)
continue;
196 if (OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)>0)
204 double RMS=
pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2);
205 RMS=
pow(fabs(RMS),0.5);
215 double RMS=
pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2);
216 RMS=
pow(fabs(RMS),0.5);
225 double RMS=
pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2);
226 RMS=
pow(fabs(RMS),0.5);
235 double RMS=
pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)-
pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(
eta+1,
phi+1),2);
236 RMS=
pow(fabs(RMS),0.5);
258 if (
debug_>2)
std::cout <<
"\t\tHcalRecHitClient::calculateProblems()"<<std::endl;
259 double totalevents=0;
260 int etabins=0, phibins=0,
zside=0;
261 double problemvalue=0;
296 if (totalevents==0 || totalevents<
minevents_)
continue;
303 if (ieta==-9999)
continue;
311 if (problemvalue==0)
continue;
312 problemvalue/=totalevents;
313 problemvalue =
std::min(1.,problemvalue);
317 ieta<0 ?
zside = -1 : zside = 1;
342 if (
debug_>0)
std::cout <<
"<HcalRecHitClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
370 "Problem RecHit Rate for all HCAL;ieta;iphi",
396 for (
int x=1;
x<=etabins;++
x)
397 for (
int y=1;
y<=phibins;++
y)
413 for (
int x=1;
x<=etabins;++
x)
414 for (
int y=1;
y<=phibins;++
y)
419 meHBEnergy_1D=ib.
book1D(
"HB_energy_1D",
"HB Average Energy Per RecHit;Energy (GeV)",200,-5,15);
420 meHEEnergy_1D=ib.
book1D(
"HE_energy_1D",
"HE Average Energy Per RecHit;Energy (GeV)",200,-5,15);
421 meHOEnergy_1D=ib.
book1D(
"HO_energy_1D",
"HO Average Energy Per RecHit;Energy (GeV)",200,-10,20);
422 meHFEnergy_1D=ib.
book1D(
"HF_energy_1D",
"HF Average Energy Per RecHit;Energy (GeV)",200,-5,15);
430 meHBEnergyThresh_1D=ib.
book1D(
"HB_energyThresh_1D",
"HB Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
431 meHEEnergyThresh_1D=ib.
book1D(
"HE_energyThresh_1D",
"HE Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
432 meHOEnergyThresh_1D=ib.
book1D(
"HO_energyThresh_1D",
"HO Average Energy Per RecHit Above Threshold;Energy (GeV)",300,-10,50);
433 meHFEnergyThresh_1D=ib.
book1D(
"HF_energyThresh_1D",
"HF Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,95);
463 if (
debug_>1)
std::cout <<
"<HcalRecHitClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
473 for (
int hist_eta=0;hist_eta<etabins;++hist_eta)
475 for (
int hist_phi=0; hist_phi<phibins;++hist_phi)
478 if (ieta==-9999)
continue;
487 if (problemcount>0)
return true;
bool isHO(int etabin, int depth)
MonitorElement * meHFEnergyThresh_1D
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
MonitorElement * ProblemCells
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meHOEnergyRMS_1D
EtaPhiHists * meSqrtSumEnergy2ByDepth
MonitorElement * meHEEnergyRMS_1D
void updateChannelStatus(std::map< HcalDetId, unsigned int > &myqual)
MonitorElement * get(const std::string &path)
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
EtaPhiHists * meSqrtSumEnergy2ThreshByDepth
MonitorElement * meHFEnergyRMS_1D
MonitorElement * meHEEnergyRMSThresh_1D
std::vector< std::string > HcalEtaPhiHistNames()
HcalRecHitClient()
Constructors.
MonitorElement * meHBEnergyRMS_1D
const HcalTopology * topo_
bool isHE(int etabin, int depth)
EtaPhiHists * meTimeThreshByDepth
MonitorElement * meHFEnergyRMSThresh_1D
MonitorElement * meHEEnergy_1D
MonitorElement * meHBEnergy_1D
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * meHOEnergyRMSThresh_1D
bool hasErrors_Temp(void)
std::vector< std::string > problemnames_
EtaPhiHists * ProblemCellsByDepth
EtaPhiHists * meEnergyThreshByDepth
MonitorElement * book1D(Args &&...args)
MonitorElement * meHOEnergyThresh_1D
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
bool isHB(int etabin, int depth)
void setupProblemCells(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * meHOEnergy_1D
MonitorElement * meHEEnergyThresh_1D
~HcalRecHitClient()
Destructor.
virtual void calculateProblems(void)
bool isHF(int etabin, int depth)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meHFEnergy_1D
MonitorElement * book2D(Args &&...args)
EtaPhiHists * meEnergyByDepth
MonitorElement * meHBEnergyThresh_1D
std::map< HcalDetId, unsigned int > badstatusmap
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
void analyze(DQMStore::IBooker &, DQMStore::IGetter &)
double getBinContent(int binx) const
get content of bin (1-D)
EtaPhiHists * meTimeByDepth
MonitorElement * meHBEnergyRMSThresh_1D
int badChannelStatusMask_
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
bool hasWarnings_Temp(void)
Power< A, B >::type pow(const A &a, const B &b)