33 LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyClient")
34 <<
"DTChamberEfficiencyClient: Constructor called";
42 LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyClient")
43 <<
"DTChamberEfficiencyClient: Destructor called";
57 LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyClient")
58 <<
"DTChamberEfficiencyClient: endluminosityBlock";
63 LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyClient")
64 <<
"DTChamberEfficiencyClient: endRun";
69 globalEffSummary->Reset();
73 stringstream wheel_str; wheel_str <<
wheel;
78 MonitorElement* MECountAll = igetter.
get(
"DT/05-ChamberEff/Task/hCountSectVsChamb_All_W" + wheel_str.str());
79 MonitorElement* MECountQual = igetter.
get(
"DT/05-ChamberEff/Task/hCountSectVsChamb_Qual_W" + wheel_str.str());
80 MonitorElement* MEExtrap = igetter.
get(
"DT/05-ChamberEff/Task/hExtrapSectVsChamb_W" + wheel_str.str());
83 if(!MECountAll || !(MECountAll->
getTH2F())) {
84 edm::LogWarning(
"DTChamberEfficiencyClient") <<
"ME not available" << std::endl;
88 TH2F* hCountAll = MECountAll->
getTH2F();
89 TH2F* hCountQual = MECountQual->
getTH2F();
90 TH2F* hExtrap = MEExtrap->
getTH2F();
94 const int nBinX = summaryHistos[wheel+2][0]->getNbinsX();
95 const int nBinY = summaryHistos[wheel+2][0]->getNbinsY();
99 summaryHistos[wheel+2][0]->setBinContent(
j,
k,0.);
100 summaryHistos[wheel+2][1]->setBinContent(
j,
k,0.);
102 const float numerAll = hCountAll->GetBinContent(
j,
k);
103 const float numerQual = hCountQual->GetBinContent(
j,
k);
104 const float denom = hExtrap->GetBinContent(
j,
k);
107 const float effAll= numerAll/denom;
108 const float eff_error_All =
sqrt((effAll+effAll*effAll)/denom);
110 const float effQual= numerQual/denom;
111 const float eff_error_Qual =
sqrt((effQual+effQual*effQual)/denom);
113 summaryHistos[wheel+2][0]->setBinContent(
j,
k,effAll);
114 summaryHistos[wheel+2][0]->setBinError(
j,
k,eff_error_All);
116 summaryHistos[wheel+2][1]->setBinContent(
j,
k,effQual);
117 summaryHistos[wheel+2][1]->setBinError(
j,
k,eff_error_Qual);
120 globalEffDistr ->
Fill(effAll);
121 EffDistrPerWh[wheel+2] ->
Fill(effAll);
133 if(segmentWheelSummary != 0) {
135 for(
int sector=1; sector<=12; sector++) {
136 float nFailingChambers = 0.;
139 double errorsum = 0.;
146 if(tmpefficiency < 0.2 || tmpvariance == 0){
151 meaneff += tmpefficiency/tmpvariance;
152 errorsum += 1./tmpvariance;
154 LogTrace(
"DTDQM|DTMonitorClient|DTChamberEfficiencyClient")
156 <<
" Sect: " << sector <<
" status: " << meaneff/errorsum << endl;
159 if(sector == 4 || sector == 10) {
160 int whichSector = (sector == 4) ? 13 : 14;
162 const double tmpefficiency = segmentWheelSummary->
getBinContent(whichSector, 4);
163 const double tmpvariance =
pow(segmentWheelSummary->
getBinError(whichSector, 4),2);
165 if(tmpefficiency > 0.2 && tmpvariance != 0) {
166 meaneff += tmpefficiency/tmpvariance;
167 errorsum += 1./tmpvariance;
169 else nFailingChambers++;
173 double eff_result = 0;
174 if(errorsum != 0) eff_result = meaneff/errorsum;
176 if(nFailingChambers != 0) {
177 if(sector != 4 && sector != 10) eff_result = eff_result*(4.-nFailingChambers)/4.;
178 else eff_result = eff_result*(5.-nFailingChambers)/5.;
181 if(eff_result > 0.7) globalEffSummary->Fill(sector,
wheel,1.);
182 else if(eff_result < 0.7 && eff_result > 0.5) globalEffSummary->Fill(sector,
wheel,0.6);
183 else if(eff_result < 0.5 && eff_result > 0.3) globalEffSummary->Fill(sector,
wheel,0.4);
184 else if(eff_result < 0.3 && eff_result > 0.) globalEffSummary->Fill(sector,
wheel,0.15);
197 globalEffSummary = ibooker.
book2D(
"EfficiencyGlbSummary",
"Efficiency Summary",12,1,13,5,-2,3);
199 globalEffSummary->setAxisTitle(
"wheel",2);
201 globalEffDistr = ibooker.
book1D(
"TotalEfficiency",
"Total efficiency",51,0.,1.02);
202 globalEffDistr -> setAxisTitle(
"Eff",1);
204 for(
int wh=-2; wh<=2; wh++){
205 stringstream
wheel; wheel << wh;
206 string histoNameAll =
"EfficiencyMap_All_W" + wheel.str();
207 string histoTitleAll =
"Efficiency map for all segments for wheel " + wheel.str();
209 string histoNameQual =
"EfficiencyMap_Qual_W" + wheel.str();
210 string histoTitleQual =
"Efficiency map for quality segments for wheel " + wheel.str();
212 string histoNameEff =
"Efficiency_W" + wheel.str();
213 string histoTitleEff =
"Segment efficiency, wheel " + wheel.str();
217 summaryHistos[wh+2][0] = ibooker.
book2D(histoNameAll.c_str(),histoTitleAll.c_str(),14,1.,15.,4,1.,5.);
219 summaryHistos[wh+2][0]->setBinLabel(1,
"MB1",2);
220 summaryHistos[wh+2][0]->setBinLabel(2,
"MB2",2);
221 summaryHistos[wh+2][0]->setBinLabel(3,
"MB3",2);
222 summaryHistos[wh+2][0]->setBinLabel(4,
"MB4",2);
224 EffDistrPerWh[wh+2] = ibooker.
book1D(histoNameEff.c_str(),histoTitleEff.c_str(),51,0.,1.02);
225 EffDistrPerWh[wh+2] -> setAxisTitle(
"Eff",1);
229 summaryHistos[wh+2][1] = ibooker.
book2D(histoNameQual.c_str(),histoTitleQual.c_str(),14,1.,15.,4,1.,5.);
231 summaryHistos[wh+2][1]->setBinLabel(1,
"MB1",2);
232 summaryHistos[wh+2][1]->setBinLabel(2,
"MB2",2);
233 summaryHistos[wh+2][1]->setBinLabel(3,
"MB3",2);
234 summaryHistos[wh+2][1]->setBinLabel(4,
"MB4",2);
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * get(const std::string &path)
def setup(process, global_tag, zero_tesla=False)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual ~DTChamberEfficiencyClient()
Destructor.
MonitorElement * book1D(Args &&...args)
void beginRun(const edm::Run &, const edm::EventSetup &) override
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void bookHistos(DQMStore::IBooker &)
book the report summary
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
double getBinContent(int binx) const
get content of bin (1-D)
TH2F * getTH2F(void) const
DTChamberEfficiencyClient(const edm::ParameterSet &ps)
Constructor.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Power< A, B >::type pow(const A &a, const B &b)