37 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: Constructor";
53 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"DTChamberEfficiencyTest: analyzed " << nevents <<
" events";
66 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
67 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
68 for (; ch_it != ch_end; ++ch_it) {
80 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: End of LS transition, performing the DQM client operation";
88 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: "<<nLumiSegs<<
" updates";
91 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
92 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
94 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: ChamberEfficiency tests results";
97 for (; ch_it != ch_end; ++ch_it) {
102 stringstream sector; sector << chID.
sector();
104 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
108 MonitorElement * GoodSegDen_histo = igetter.
get(getMEName(
"hEffGoodSegVsPosDen", chID));
109 MonitorElement * GoodCloseSegNum_histo = igetter.
get(getMEName(
"hEffGoodCloseSegVsPosNum", chID));
112 if(GoodSegDen_histo && GoodCloseSegNum_histo) {
113 TH2F * GoodSegDen_histo_root = GoodSegDen_histo->
getTH2F();
114 TH2F * GoodCloseSegNum_histo_root = GoodCloseSegNum_histo->
getTH2F();
116 int lastBinX=(*GoodSegDen_histo_root).GetNbinsX();
117 TH1D* proxN=GoodCloseSegNum_histo_root->ProjectionX();
118 TH1D* proxD=GoodSegDen_histo_root->ProjectionX();
120 int lastBinY=(*GoodSegDen_histo_root).GetNbinsY();
121 TH1D* proyN=GoodCloseSegNum_histo_root->ProjectionY();
122 TH1D* proyD=GoodSegDen_histo_root->ProjectionY();
124 for(
int xBin=1; xBin<=lastBinX; xBin++) {
125 if(proxD->GetBinContent(xBin)!=0){
126 float Xefficiency = proxN->GetBinContent(xBin) / proxD->GetBinContent(xBin);
127 xEfficiencyHistos.find(HistoName)->second->setBinContent(xBin, Xefficiency);
131 if(GoodSegDen_histo_root->GetBinContent(xBin,
yBin)!=0){
132 float XvsYefficiency = GoodCloseSegNum_histo_root->GetBinContent(xBin,
yBin) / GoodSegDen_histo_root->GetBinContent(xBin,
yBin);
133 xVSyEffHistos.find(HistoName)->second->setBinContent(xBin,
yBin, XvsYefficiency);
140 if(proyD->GetBinContent(
yBin)!=0){
141 float Yefficiency = proyN->GetBinContent(
yBin) / proyD->GetBinContent(
yBin);
142 yEfficiencyHistos.find(HistoName)->second->setBinContent(
yBin, Yefficiency);
150 string XEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"XEfficiencyTestName",
"ChEfficiencyInRangeX");
151 for(map<string, MonitorElement*>::const_iterator hXEff = xEfficiencyHistos.begin();
152 hXEff != xEfficiencyHistos.end();
154 const QReport * theXEfficiencyQReport = (*hXEff).second->getQReport(XEfficiencyCriterionName);
155 if(theXEfficiencyQReport) {
156 vector<dqm::me_util::Channel> badChannels = theXEfficiencyQReport->
getBadChannels();
157 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
158 channel != badChannels.end(); channel++) {
159 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hXEff).first <<
" Bad XChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
166 string YEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"YEfficiencyTestName",
"ChEfficiencyInRangeY");
167 for(map<string, MonitorElement*>::const_iterator hYEff = yEfficiencyHistos.begin();
168 hYEff != yEfficiencyHistos.end();
170 const QReport * theYEfficiencyQReport = (*hYEff).second->getQReport(YEfficiencyCriterionName);
171 if(theYEfficiencyQReport) {
172 vector<dqm::me_util::Channel> badChannels = theYEfficiencyQReport->
getBadChannels();
173 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
174 channel != badChannels.end(); channel++) {
175 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hYEff).first <<
" Bad YChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
181 for(
int wh=-2; wh<=2; wh++){
182 for(
int sec=1; sec<=12; sec++){
183 for(
int st=1; st<=4; st++){
185 summaryHistos[wh]->Fill(sec,st,1);
195 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest] endjob called!";
203 stringstream sector; sector << chID.
sector();
205 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
207 folderRoot +
"DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() +
208 "/Sector" + sector.str() +
209 "/Station" + station.str() +
"/";
211 string histoname = folderName + histoTag
213 +
"_St" + station.str()
214 +
"_Sec" + sector.str();
224 stringstream sector; sector << chId.
sector();
226 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
227 string xEfficiencyHistoName =
"xEfficiency_" +
HistoName;
228 string yEfficiencyHistoName =
"yEfficiency_" +
HistoName;
229 string xVSyEffHistoName =
"xVSyEff_" +
HistoName;
232 "/Sector" + sector.str() +
233 "/Station" + station.str());
235 xEfficiencyHistos[
HistoName] = ibooker.
book1D(xEfficiencyHistoName.c_str(),xEfficiencyHistoName.c_str(),25,-250.,250.);
236 yEfficiencyHistos[
HistoName] = ibooker.
book1D(yEfficiencyHistoName.c_str(),yEfficiencyHistoName.c_str(),25,-250.,250.);
237 xVSyEffHistos[
HistoName] = ibooker.
book2D(xVSyEffHistoName.c_str(),xVSyEffHistoName.c_str(),25,-250.,250., 25,-250.,250.);
243 for(
int wh=-2; wh<=2; wh++){
244 stringstream
wheel; wheel << wh;
245 string histoName =
"chEfficiencySummary_W" + wheel.str();
248 summaryHistos[wh] = ibooker.
book2D(histoName.c_str(),histoName.c_str(),12,1,13,4,1,5);
250 summaryHistos[wh]->setBinLabel(1,
"MB1",2);
251 summaryHistos[wh]->setBinLabel(2,
"MB2",2);
252 summaryHistos[wh]->setBinLabel(3,
"MB3",2);
253 summaryHistos[wh]->setBinLabel(4,
"MB4",2);
LuminosityBlockID id() const
void bookHistos(DQMStore::IBooker &, const DTChamberId &ch)
book the new ME
const std::vector< DQMChannel > & getBadChannels() const
MonitorElement * get(const std::string &path)
std::string getMEName(std::string histoTag, const DTChamberId &chID)
Get the ME name.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic.
MonitorElement * book1D(Args &&...args)
~DTChamberEfficiencyTest() override
Destructor.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
LuminosityBlockNumber_t luminosityBlock() const
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
DTChamberEfficiencyTest(const edm::ParameterSet &ps)
Constructor.