40 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest") <<
"[DTSegmentAnalysisTest]: Constructor";
62 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest") <<
"DTSegmentAnalysisTest: analyzed " <<
nevents <<
" events";
66 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest") <<
"[DTSegmentAnalysisTest]: BeginRun";
85 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
86 <<
"[DTSegmentAnalysisTest]: End of LS " << nLumiSegs
87 <<
". Client called in online mode , perform DQM client operation";
89 performClientDiagnostic(igetter);
97 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
98 <<
"[DTSegmentAnalysisTest]: endJob. Client called in offline mode , perform DQM client operation";
100 performClientDiagnostic(igetter);
104 LogTrace(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest") <<
" Performing time-histo normalization" << endl;
110 hNevtPerLS = igetter.
get(
"DT/EventInfo/NevtPerLS");
112 if (hNevtPerLS !=
nullptr) {
114 for (
int sector = 1; sector <= 12; ++sector) {
115 stringstream wheelstr;
117 stringstream sectorstr;
119 string sectorHistoName =
topHistoFolder +
"/Wheel" + wheelstr.str() +
"/Sector" + sectorstr.str() +
120 "/NSegmPerEvent_W" + wheelstr.str() +
"_Sec" + sectorstr.str();
132 LogError(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest") <<
"Histo NevtPerLS not found!" << endl;
138 summaryHistos[3]->Reset();
139 summaryHistos[4]->Reset();
140 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
141 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
143 for (; ch_it != ch_end; ++ch_it) {
149 if (hNHits && hSegmOcc) {
150 TH1F* hNHits_root = hNHits->
getTH1F();
151 TH2F* hSegmOcc_root = hSegmOcc->
getTH2F();
152 TH2F* summary_histo_root = summaryHistos[3]->getTH2F();
154 int sector = chID.
sector();
162 summaryHistos[chID.
wheel()]->setBinContent(sector, chID.
station(), 1);
163 if (summary_histo_root->GetBinContent(sector, chID.
wheel() + 3) < 1)
164 summaryHistos[3]->setBinContent(sector, chID.
wheel() + 3, 1);
166 summaryHistos[chID.
wheel()]->setBinContent(sector, chID.
station(), 0);
171 abs(12 - hNHits_root->GetMaximumBin()));
174 abs(8 - hNHits_root->GetMaximumBin()));
177 TH2F* summary2_histo_root = summaryHistos[3]->getTH2F();
179 if (hSegmOcc_root->GetBinContent(sector, chID.
station()) == 0) {
180 summaryHistos[chID.
wheel()]->setBinContent(sector, chID.
station(), 2);
181 if (summary2_histo_root->GetBinContent(sector, chID.
wheel() + 3) < 2)
182 summaryHistos[3]->setBinContent(sector, chID.
wheel() + 3, 2);
186 if ((sector == 4 || sector == 10) && chID.
station() == 4)
189 summaryHistos[4]->Fill(sector, chID.
wheel(),
weight);
191 LogVerbatim(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
192 <<
"[DTSegmentAnalysisTest]: histos not found!!";
201 TH1F* chi2_histo_root = chi2_histo->
getTH1F();
203 double maximum = chi2_histo_root->GetXaxis()->GetXmax();
204 double minimum = chi2_histo_root->GetXaxis()->GetXmin();
205 int nbins = chi2_histo_root->GetXaxis()->GetNbins();
206 int thresholdBin =
int(threshold / ((maximum - minimum) / nbins));
208 double badSegments = 0;
210 badSegments += chi2_histo_root->GetBinContent(
bin);
213 if (chi2_histo_root->GetEntries() != 0) {
214 double badSegmentsPercentual = badSegments / double(chi2_histo_root->GetEntries());
218 LogVerbatim(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
219 <<
"[DTSegmentAnalysisTest]: Histo: " << getMEName(chID,
"h4DChi2") <<
" not found!" << endl;
225 string nEvtsName =
"DT/EventInfo/Counters/nProcessedEventsSegment";
231 summaryHistos[4]->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
233 summaryHistos[4]->setEntries(nMinEvts + 1);
234 LogVerbatim(
"DTDQM|DTMonitorClient|DTOccupancyTest")
235 <<
"[DTOccupancyTest] ME: " << nEvtsName <<
" not found!" << endl;
239 string chi2CriterionName =
parameters.getUntrackedParameter<
string>(
"chi2TestName",
"chi2InRange");
242 const QReport* theChi2QReport = (*histo).second->getQReport(chi2CriterionName);
243 if (theChi2QReport) {
244 vector<dqm::me_util::Channel> badChannels = theChi2QReport->
getBadChannels();
245 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
247 LogError(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
248 <<
"Wheel: " << (*histo).first.first <<
" Sector: " << (*histo).first.second
249 <<
" Bad stations: " << (*channel).getBin() <<
" Contents : " << (*channel).getContents();
254 string segmRecHitCriterionName =
255 parameters.getUntrackedParameter<
string>(
"segmRecHitTestName",
"segmRecHitInRange");
257 histo != segmRecHitHistos.end();
259 const QReport* theSegmRecHitQReport = (*histo).second->getQReport(segmRecHitCriterionName);
260 if (theSegmRecHitQReport) {
261 vector<dqm::me_util::Channel> badChannels = theSegmRecHitQReport->
getBadChannels();
262 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
264 LogError(
"DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
265 <<
"Wheel: " << (*histo).first.first <<
" Sector: " << (*histo).first.second
266 <<
" Bad stations on recHit number: " << (*channel).getBin()
267 <<
" Contents : " << (*channel).getContents();
277 wheel << chID.
wheel();
284 topHistoFolder +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() +
"/";
286 string histoname = folderName + histoTag +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
288 if (histoTag ==
"numberOfSegments")
289 histoname =
topHistoFolder +
"/Wheel" + wheel.str() +
"/" + histoTag + +
"_W" + wheel.str();
295 for (
int wh = -2; wh <= 2; wh++) {
298 string histoName =
"segmentSummary_W" + wheel.str();
302 summaryHistos[wh] = ibooker.
book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
304 summaryHistos[wh]->setBinLabel(1,
"MB1", 2);
305 summaryHistos[wh]->setBinLabel(2,
"MB2", 2);
306 summaryHistos[wh]->setBinLabel(3,
"MB3", 2);
307 summaryHistos[wh]->setBinLabel(4,
"MB4", 2);
310 for (
int sect = 1; sect <= 14; sect++) {
313 string chi2HistoName =
"chi2BadSegmPercentual_W" + wheel.str() +
"_Sec" + sector.str();
315 chi2Histos[make_pair(wh, sect)] = ibooker.
book1D(chi2HistoName.c_str(), chi2HistoName.c_str(), 4, 1, 5);
316 chi2Histos[make_pair(wh, sect)]->
setBinLabel(1,
"MB1");
317 chi2Histos[make_pair(wh, sect)]->setBinLabel(2,
"MB2");
318 chi2Histos[make_pair(wh, sect)]->setBinLabel(3,
"MB3");
319 chi2Histos[make_pair(wh, sect)]->setBinLabel(4,
"MB4");
321 string segmHistoName =
"residualsOnSegmRecHitNumber_W" + wheel.str() +
"_Sec" + sector.str();
322 segmRecHitHistos[make_pair(wh, sect)] = ibooker.
book1D(segmHistoName.c_str(), segmHistoName.c_str(), 4, 1, 5);
323 segmRecHitHistos[make_pair(wh, sect)]->
setBinLabel(1,
"MB1");
324 segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(2,
"MB2");
325 segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(3,
"MB3");
326 segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(4,
"MB4");
335 summaryHistos[3] = ibooker.
book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 5, -2, 3);
337 summaryHistos[3]->setAxisTitle(
"Wheel", 2);
339 summaryHistos[4] = ibooker.
book2D(
"SegmentGlbSummary", histoName.c_str(), 12, 1, 13, 5, -2, 3);
341 summaryHistos[4]->setAxisTitle(
"Wheel", 2);
LuminosityBlockID id() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getUntrackedParameter(std::string const &, T const &) const
virtual TH2F * getTH2F() const
const std::vector< DQMChannel > & getBadChannels() const
~DTSegmentAnalysisTest() override
Destructor.
void beginRun(const edm::Run &, const edm::EventSetup &) override
void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
void endRun(edm::Run const &run, edm::EventSetup const &c) override
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
void bookHistos(DQMStore::IBooker &)
DTSegmentAnalysisTest(const edm::ParameterSet &ps)
Constructor.
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::string getMEName(const DTChamberId &chID, std::string histoTag)
Get the ME name.
LuminosityBlockNumber_t luminosityBlock() const
void normalizeTo(const MonitorElement *histForNorm)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
virtual double getFloatValue() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
int station() const
Return the station number.
MonitorElement * get(std::string const &path)
int wheel() const
Return the wheel number.
void performClientDiagnostic(DQMStore::IGetter &)
Perform client diagnostic operations.
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)