38 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: Constructor";
52 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"DTChamberEfficiencyTest: analyzed " <<
nevents <<
" events";
59 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: BeginJob";
68 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: Begin of LS transition";
82 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
83 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
84 for (; ch_it != ch_end; ++ch_it) {
96 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: "<<
nevents<<
" events";
110 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: End of LS transition, performing the DQM client operation";
118 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: "<<nLumiSegs<<
" updates";
121 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
122 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
124 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest]: ChamberEfficiency tests results";
127 for (; ch_it != ch_end; ++ch_it) {
130 stringstream wheel; wheel << chID.
wheel();
132 stringstream sector; sector << chID.
sector();
134 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
137 MonitorElement * GoodSegDen_histo = dbe->get(getMEName(
"hEffGoodSegVsPosDen", chID));
138 MonitorElement * GoodCloseSegNum_histo = dbe->get(getMEName(
"hEffGoodCloseSegVsPosNum", chID));
141 if(GoodSegDen_histo && GoodCloseSegNum_histo) {
142 TH2F * GoodSegDen_histo_root = GoodSegDen_histo->
getTH2F();
143 TH2F * GoodCloseSegNum_histo_root = GoodCloseSegNum_histo->
getTH2F();
145 int lastBinX=(*GoodSegDen_histo_root).GetNbinsX();
146 TH1D* proxN=GoodCloseSegNum_histo_root->ProjectionX();
147 TH1D* proxD=GoodSegDen_histo_root->ProjectionX();
149 int lastBinY=(*GoodSegDen_histo_root).GetNbinsY();
150 TH1D* proyN=GoodCloseSegNum_histo_root->ProjectionY();
151 TH1D* proyD=GoodSegDen_histo_root->ProjectionY();
153 for(
int xBin=1; xBin<=lastBinX; xBin++) {
154 if(proxD->GetBinContent(xBin)!=0){
155 float Xefficiency = proxN->GetBinContent(xBin) / proxD->GetBinContent(xBin);
156 xEfficiencyHistos.find(HistoName)->second->setBinContent(xBin, Xefficiency);
159 for(
int yBin=1; yBin<=lastBinY; yBin++) {
160 if(GoodSegDen_histo_root->GetBinContent(xBin, yBin)!=0){
161 float XvsYefficiency = GoodCloseSegNum_histo_root->GetBinContent(xBin, yBin) / GoodSegDen_histo_root->GetBinContent(xBin, yBin);
162 xVSyEffHistos.find(HistoName)->second->setBinContent(xBin, yBin, XvsYefficiency);
168 for(
int yBin=1; yBin<=lastBinY; yBin++) {
169 if(proyD->GetBinContent(yBin)!=0){
170 float Yefficiency = proyN->GetBinContent(yBin) / proyD->GetBinContent(yBin);
171 yEfficiencyHistos.find(HistoName)->second->setBinContent(yBin, Yefficiency);
179 string XEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"XEfficiencyTestName",
"ChEfficiencyInRangeX");
180 for(map<string, MonitorElement*>::const_iterator hXEff = xEfficiencyHistos.begin();
181 hXEff != xEfficiencyHistos.end();
183 const QReport * theXEfficiencyQReport = (*hXEff).second->getQReport(XEfficiencyCriterionName);
184 if(theXEfficiencyQReport) {
185 vector<dqm::me_util::Channel> badChannels = theXEfficiencyQReport->
getBadChannels();
186 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
187 channel != badChannels.end(); channel++) {
188 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hXEff).first <<
" Bad XChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
197 string YEfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"YEfficiencyTestName",
"ChEfficiencyInRangeY");
198 for(map<string, MonitorElement*>::const_iterator hYEff = yEfficiencyHistos.begin();
199 hYEff != yEfficiencyHistos.end();
201 const QReport * theYEfficiencyQReport = (*hYEff).second->getQReport(YEfficiencyCriterionName);
202 if(theYEfficiencyQReport) {
203 vector<dqm::me_util::Channel> badChannels = theYEfficiencyQReport->
getBadChannels();
204 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
205 channel != badChannels.end(); channel++) {
206 edm::LogError (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"Chamber : " << (*hYEff).first <<
" Bad YChamberEfficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
214 for(
int wh=-2; wh<=2; wh++){
215 for(
int sec=1; sec<=12; sec++){
216 for(
int st=1; st<=4; st++){
218 summaryHistos[wh]->Fill(sec,st,1);
230 edm::LogVerbatim (
"DTDQM|DTMonitorClient|DTChamberEfficiencyTest") <<
"[DTChamberEfficiencyTest] endjob called!";
239 stringstream wheel; wheel << chID.
wheel();
241 stringstream sector; sector << chID.
sector();
243 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
245 folderRoot +
"DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() +
246 "/Sector" + sector.str() +
247 "/Station" + station.str() +
"/";
249 string histoname = folderName + histoTag
251 +
"_St" + station.str()
252 +
"_Sec" + sector.str();
261 stringstream wheel; wheel << chId.
wheel();
263 stringstream sector; sector << chId.
sector();
265 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
266 string xEfficiencyHistoName =
"xEfficiency_" +
HistoName;
267 string yEfficiencyHistoName =
"yEfficiency_" +
HistoName;
268 string xVSyEffHistoName =
"xVSyEff_" +
HistoName;
270 dbe->setCurrentFolder(
"DT/01-DTChamberEfficiency/Wheel" + wheel.str() +
271 "/Sector" + sector.str() +
272 "/Station" + station.str());
274 xEfficiencyHistos[
HistoName] = dbe->book1D(xEfficiencyHistoName.c_str(),xEfficiencyHistoName.c_str(),25,-250.,250.);
275 yEfficiencyHistos[
HistoName] = dbe->book1D(yEfficiencyHistoName.c_str(),yEfficiencyHistoName.c_str(),25,-250.,250.);
276 xVSyEffHistos[
HistoName] = dbe->book2D(xVSyEffHistoName.c_str(),xVSyEffHistoName.c_str(),25,-250.,250., 25,-250.,250.);
283 for(
int wh=-2; wh<=2; wh++){
284 stringstream wheel; wheel << wh;
285 string histoName =
"chEfficiencySummary_W" + wheel.str();
286 dbe->setCurrentFolder(
"DT/01-DTChamberEfficiency");
287 summaryHistos[wh] = dbe->book2D(histoName.c_str(),histoName.c_str(),12,1,13,4,1,5);
288 summaryHistos[wh]->setAxisTitle(
"Sector",1);
289 summaryHistos[wh]->setBinLabel(1,
"MB1",2);
290 summaryHistos[wh]->setBinLabel(2,
"MB2",2);
291 summaryHistos[wh]->setBinLabel(3,
"MB3",2);
292 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.
DTChamberEfficiencyTest(const edm::ParameterSet &ps)
Constructor.