36 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: Constructor";
50 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"DTChamberEfficiencyTest: analyzed " <<
nevents <<
" events";
57 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: BeginJob";
66 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: Begin of LS transition";
80 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
81 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
82 for (; ch_it != ch_end; ++ch_it) {
94 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: "<<
nevents<<
" events";
108 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: End of LS transition, performing the DQM client operation";
116 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: "<<nLumiSegs<<
" updates";
119 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
120 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
122 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: ChamberEfficiency tests results";
125 for (; ch_it != ch_end; ++ch_it) {
128 stringstream wheel; wheel << chID.
wheel();
130 stringstream sector; sector << chID.
sector();
132 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
135 MonitorElement * GoodSegDen_histo = dbe->get(getMEName(
"hEffGoodSegVsPosDen", chID));
136 MonitorElement * GoodCloseSegNum_histo = dbe->get(getMEName(
"hEffGoodCloseSegVsPosNum", chID));
139 if(GoodSegDen_histo && GoodCloseSegNum_histo) {
140 TH2F * GoodSegDen_histo_root = GoodSegDen_histo->
getTH2F();
141 TH2F * GoodCloseSegNum_histo_root = GoodCloseSegNum_histo->
getTH2F();
143 int lastBinX=(*GoodSegDen_histo_root).GetNbinsX();
144 TH1D* proxN=GoodCloseSegNum_histo_root->ProjectionX();
145 TH1D* proxD=GoodSegDen_histo_root->ProjectionX();
147 int lastBinY=(*GoodSegDen_histo_root).GetNbinsY();
148 TH1D* proyN=GoodCloseSegNum_histo_root->ProjectionY();
149 TH1D* proyD=GoodSegDen_histo_root->ProjectionY();
151 for(
int xBin=1; xBin<=lastBinX; xBin++) {
152 if(proxD->GetBinContent(xBin)!=0){
153 float Xefficiency = proxN->GetBinContent(xBin) / proxD->GetBinContent(xBin);
154 xEfficiencyHistos.find(HistoName)->second->setBinContent(xBin, Xefficiency);
158 if(GoodSegDen_histo_root->GetBinContent(xBin,
yBin)!=0){
159 float XvsYefficiency = GoodCloseSegNum_histo_root->GetBinContent(xBin,
yBin) / GoodSegDen_histo_root->GetBinContent(xBin,
yBin);
160 xVSyEffHistos.find(HistoName)->second->setBinContent(xBin,
yBin, XvsYefficiency);
167 if(proyD->GetBinContent(
yBin)!=0){
168 float Yefficiency = proyN->GetBinContent(
yBin) / proyD->GetBinContent(
yBin);
169 yEfficiencyHistos.find(HistoName)->second->setBinContent(
yBin, Yefficiency);
177 string XEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"XEfficiencyTestName",
"ChEfficiencyInRangeX");
178 for(map<string, MonitorElement*>::const_iterator hXEff = xEfficiencyHistos.begin();
179 hXEff != xEfficiencyHistos.end();
181 const QReport * theXEfficiencyQReport = (*hXEff).second->getQReport(XEfficiencyCriterionName);
182 if(theXEfficiencyQReport) {
183 vector<dqm::me_util::Channel> badChannels = theXEfficiencyQReport->
getBadChannels();
184 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
185 channel != badChannels.end(); channel++) {
186 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hXEff).first <<
" Bad XChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
195 string YEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"YEfficiencyTestName",
"ChEfficiencyInRangeY");
196 for(map<string, MonitorElement*>::const_iterator hYEff = yEfficiencyHistos.begin();
197 hYEff != yEfficiencyHistos.end();
199 const QReport * theYEfficiencyQReport = (*hYEff).second->getQReport(YEfficiencyCriterionName);
200 if(theYEfficiencyQReport) {
201 vector<dqm::me_util::Channel> badChannels = theYEfficiencyQReport->
getBadChannels();
202 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
203 channel != badChannels.end(); channel++) {
204 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hYEff).first <<
" Bad YChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
212 for(
int wh=-2; wh<=2; wh++){
213 for(
int sec=1; sec<=12; sec++){
214 for(
int st=1; st<=4; st++){
216 summaryHistos[wh]->Fill(sec,st,1);
228 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest] endjob called!";
237 stringstream wheel; wheel << chID.
wheel();
239 stringstream sector; sector << chID.
sector();
241 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
243 folderRoot +
"DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() +
244 "/Sector" + sector.str() +
245 "/Station" + station.str() +
"/";
247 string histoname = folderName + histoTag
249 +
"_St" + station.str()
250 +
"_Sec" + sector.str();
259 stringstream wheel; wheel << chId.
wheel();
261 stringstream sector; sector << chId.
sector();
263 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
264 string xEfficiencyHistoName =
"xEfficiency_" +
HistoName;
265 string yEfficiencyHistoName =
"yEfficiency_" +
HistoName;
266 string xVSyEffHistoName =
"xVSyEff_" +
HistoName;
268 dbe->setCurrentFolder(
"DT/01-DTChamberEfficiency/Wheel" + wheel.str() +
269 "/Sector" + sector.str() +
270 "/Station" + station.str());
272 xEfficiencyHistos[
HistoName] = dbe->book1D(xEfficiencyHistoName.c_str(),xEfficiencyHistoName.c_str(),25,-250.,250.);
273 yEfficiencyHistos[
HistoName] = dbe->book1D(yEfficiencyHistoName.c_str(),yEfficiencyHistoName.c_str(),25,-250.,250.);
274 xVSyEffHistos[
HistoName] = dbe->book2D(xVSyEffHistoName.c_str(),xVSyEffHistoName.c_str(),25,-250.,250., 25,-250.,250.);
281 for(
int wh=-2; wh<=2; wh++){
282 stringstream wheel; wheel << wh;
283 string histoName =
"chEfficiencySummary_W" + wheel.str();
284 dbe->setCurrentFolder(
"DT/01-DTChamberEfficiency");
285 summaryHistos[wh] = dbe->book2D(histoName.c_str(),histoName.c_str(),12,1,13,4,1,5);
286 summaryHistos[wh]->setAxisTitle(
"Sector",1);
287 summaryHistos[wh]->setBinLabel(1,
"MB1",2);
288 summaryHistos[wh]->setBinLabel(2,
"MB2",2);
289 summaryHistos[wh]->setBinLabel(3,
"MB3",2);
290 summaryHistos[wh]->setBinLabel(4,
"MB4",2);
LuminosityBlockID id() const
void bookHistos()
book the report summary
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
BeginRun.
virtual ~DTChamberEfficiencyTest()
Destructor.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
std::string getMEName(std::string histoTag, const DTChamberId &chID)
Get the ME name.
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
const std::vector< DQMChannel > & getBadChannels(void) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
LuminosityBlockNumber_t luminosityBlock() const
int station() const
Return the station number.
TH2F * getTH2F(void) const
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
DTChamberEfficiencyTest(const edm::ParameterSet &ps)
Constructor.