75 for (
int wheel = -2; wheel < 3; wheel++) {
79 for (vector<const DTChamber*>::const_iterator chamber = chambers.begin(); chamber != chambers.end(); ++chamber) {
85 edm::LogVerbatim(
"resolution") <<
"[DTResolutionTest]: End of LS transition, performing the DQM client operation";
96 (*histo).second->Reset();
101 (*histo).second->Reset();
107 (*histo).second->Reset();
112 for (
int i = -2;
i < 3;
i++) {
113 for (
int j = 1;
j < 15;
j++) {
119 for (
int i = -2;
i < 3;
i++) {
120 for (
int j = 1;
j < 15;
j++) {
127 for (
int i = -2;
i < 3;
i++) {
128 for (
int j = 1;
j < 15;
j++) {
135 for (
int wh = -2; wh <= 3; wh++) {
137 for (
int xBin = 0; xBin < 14; xBin++) {
147 for (
int xBin = 0; xBin < 14; xBin++) {
161 vector<const DTChamber*>::const_iterator ch_it =
muonGeom->
chambers().begin();
162 vector<const DTChamber*>::const_iterator ch_end =
muonGeom->
chambers().end();
164 edm::LogVerbatim(
"resolution") <<
"[DTResolutionTest]: Residual Distribution tests results";
166 for (; ch_it != ch_end; ++ch_it) {
180 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
181 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
183 for (; sl_it != sl_end; ++sl_it) {
186 edm::LogVerbatim(
"resolution") <<
"[DTResolutionTest]: Superlayer: " << slID;
189 wheel << slID.
wheel();
194 stringstream superLayer;
197 string HistoName =
"W" + wheel.str() +
"_Sec" + sector.str();
198 string supLayer =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str();
203 string GaussianCriterionName =
206 if (GaussianReport) {
214 float mean = (*res_histo).getMean(1);
215 float sigma = (*res_histo).getRMS(1);
224 TH2F* res_histo_2D_root = res_histo_2D->
getTH2F();
228 TProfile* prof = res_histo_2D_root->ProfileX();
229 prof->GetXaxis()->SetRangeUser(0, 2);
232 TF1 fitting(
"mypol1",
"pol1");
234 prof->Fit(&fitting,
"Q0");
236 edm::LogError(
"resolution") <<
"[DTResolutionTest]: Exception when fitting..."
237 <<
"SuperLayer : " << slID <<
"\n"
240 <<
"Filling slope histogram with standard value -99. for bin " << BinNumber;
244 double slope = fitting.GetParameter(1);
255 const QReport* theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
257 wheel << (*hMean).first.first;
259 sector << (*hMean).first.second;
261 if (theMeanQReport) {
262 vector<dqm::me_util::Channel> badChannels = theMeanQReport->
getBadChannels();
263 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
265 edm::LogError(
"resolution") <<
"Bad mean channel: wh: " << wheel.str()
266 <<
" st: " <<
stationFromBin((*channel).getBin()) <<
" sect: " << sector.str()
267 <<
" sl: " <<
slFromBin((*channel).getBin())
268 <<
" mean (cm): " << (*channel).getContents();
269 string HistoName =
"W" + wheel.str() +
"_Sec" + sector.str();
272 MeanHistosSetRange2D.find(HistoName)->second->Fill((*channel).getBin(), (*channel).getContents());
276 wheelMeanHistos[(*hMean).first.first]->Fill(((*hMean).first.second) - 1, (*channel).getBin() - 1, 1);
278 wheelMeanHistos[(*hMean).first.first]->Fill(((*hMean).first.second) - 1, (*channel).getBin() - 1, 2);
282 cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]++;
283 if (((*hMean).first.second < 13 &&
284 double(
cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]) / 11 >
286 MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] ==
false) ||
287 ((*hMean).first.first >= 13 &&
288 double(
cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]) / 2 >
290 MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] ==
false)) {
291 MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] =
true;
292 wheelMeanHistos[3]->Fill(((*hMean).first.second) - 1, (*hMean).first.first);
304 const QReport* theSigmaQReport = (*hSigma).second->getQReport(SigmaCriterionName);
306 wheel << (*hSigma).first.first;
308 sector << (*hSigma).first.second;
309 if (theSigmaQReport) {
310 vector<dqm::me_util::Channel> badChannels = theSigmaQReport->
getBadChannels();
311 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
313 edm::LogError(
"resolution") <<
"Bad sigma: wh: " << wheel.str()
314 <<
" st: " <<
stationFromBin((*channel).getBin()) <<
" sect: " << sector.str()
315 <<
" sl: " <<
slFromBin((*channel).getBin())
316 <<
" sigma (cm): " << (*channel).getContents();
317 string HistoName =
"W" + wheel.str() +
"_Sec" + sector.str();
321 wheelSigmaHistos[(*hSigma).first.first]->Fill(((*hSigma).first.second) - 1, (*channel).getBin() - 1);
324 cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]++;
325 if (((*hSigma).first.second < 13 &&
326 double(
cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]) / 11 >
328 SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] ==
false) ||
329 ((*hSigma).first.first >= 13 &&
330 double(
cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]) / 2 >
332 SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] ==
false)) {
333 SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] =
true;
334 wheelSigmaHistos[3]->Fill((*hSigma).first.second - 1, (*hSigma).first.first);
346 const QReport* theSlopeQReport = (*hSlope).second->getQReport(SlopeCriterionName);
348 wheel << (*hSlope).first.first;
350 sector << (*hSlope).first.second;
351 if (theSlopeQReport) {
352 vector<dqm::me_util::Channel> badChannels = theSlopeQReport->
getBadChannels();
353 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
355 edm::LogError(
"resolution") <<
"Bad slope: wh: " << wheel.str()
356 <<
" st: " <<
stationFromBin((*channel).getBin()) <<
" sect: " << sector.str()
357 <<
" sl: " <<
slFromBin((*channel).getBin())
358 <<
" slope: " << (*channel).getContents();
359 string HistoName =
"W" + wheel.str() +
"_Sec" + sector.str();
363 wheelSlopeHistos[(*hSlope).first.first]->Fill(((*hSlope).first.second) - 1, (*channel).getBin() - 1);
366 cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]++;
367 if (((*hSlope).first.second < 13 &&
368 double(
cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]) / 11 >
370 SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] ==
false) ||
371 ((*hSlope).first.first >= 13 &&
372 double(
cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]) / 2 >
374 SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] ==
false)) {
375 SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] =
true;
376 wheelSlopeHistos[3]->Fill((*hSlope).first.second - 1, (*hSlope).first.first);
397 wheel << slID.
wheel();
402 stringstream superLayer;
409 folderName = folderRoot +
"DT/DTCalibValidation/Wheel" + wheel.str() +
"/Station" + station.str() +
"/Sector" +
412 folderName = folderRoot +
"DT/DTResolutionAnalysisTask/Wheel" + wheel.str() +
"/Station" + station.str() +
413 "/Sector" + sector.str() +
"/";
418 string histoname = folderName + histoTag +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
419 "_SL" + superLayer.str();
426 wheel << slID.
wheel();
431 stringstream superLayer;
438 folderName = folderRoot +
"DT/DTCalibValidation/Wheel" + wheel.str() +
"/Station" + station.str() +
"/Sector" +
441 folderName = folderRoot +
"DT/DTResolutionAnalysisTask/Wheel" + wheel.str() +
"/Station" + station.str() +
442 "/Sector" + sector.str() +
"/";
447 string histoname = folderName + histoTag2D +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
448 "_SL" + superLayer.str();
460 "_Sec" + sector.str();
462 wheel.str() +
"_Sec" + sector.str();
464 wheel.str() +
"_Sec" + sector.str();
471 ibooker.
book1D(MeanHistoName.c_str(), MeanHistoName.c_str(), 11, 0, 11);
487 ibooker.
book1D(SigmaHistoName.c_str(), SigmaHistoName.c_str(), 11, 0, 11);
504 ibooker.
book1D(SlopeHistoName.c_str(), SlopeHistoName.c_str(), 11, 0, 11);
518 string HistoName =
"W" + wheel.str() +
"_Sec" + sector.str();
522 wheel.str() +
"_Sec" + sector.str() +
"_SetRange";
525 ibooker.
book1D(MeanHistoNameSetRange.c_str(), MeanHistoNameSetRange.c_str(), 11, 0.5, 11.5);
527 wheel.str() +
"_Sec" + sector.str() +
"_SetRange" +
"_2D";
529 MeanHistoNameSetRange2D.c_str(), MeanHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 100, -0.05, 0.05);
534 wheel.str() +
"_Sec" + sector.str() +
"_SetRange";
537 ibooker.
book1D(SigmaHistoNameSetRange.c_str(), SigmaHistoNameSetRange.c_str(), 11, 0.5, 11.5);
539 wheel.str() +
"_Sec" + sector.str() +
"_SetRange" +
"_2D";
542 ibooker.
book2D(SigmaHistoNameSetRange2D.c_str(), SigmaHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 500, 0, 0.5);
547 wheel.str() +
"_Sec" + sector.str() +
"_SetRange";
550 ibooker.
book1D(SlopeHistoNameSetRange.c_str(), SlopeHistoNameSetRange.c_str(), 11, 0.5, 11.5);
552 wheel.str() +
"_Sec" + sector.str() +
"_SetRange" +
"_2D";
555 SlopeHistoNameSetRange2D.c_str(), SlopeHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 200, -0.1, 0.1);
568 wheelMeanHistos[3]->setBinLabel(1,
"Sector1", 1);
569 wheelMeanHistos[3]->setBinLabel(2,
"Sector2", 1);
570 wheelMeanHistos[3]->setBinLabel(3,
"Sector3", 1);
571 wheelMeanHistos[3]->setBinLabel(4,
"Sector4", 1);
572 wheelMeanHistos[3]->setBinLabel(5,
"Sector5", 1);
573 wheelMeanHistos[3]->setBinLabel(6,
"Sector6", 1);
574 wheelMeanHistos[3]->setBinLabel(7,
"Sector7", 1);
575 wheelMeanHistos[3]->setBinLabel(8,
"Sector8", 1);
576 wheelMeanHistos[3]->setBinLabel(9,
"Sector9", 1);
577 wheelMeanHistos[3]->setBinLabel(10,
"Sector10", 1);
578 wheelMeanHistos[3]->setBinLabel(11,
"Sector11", 1);
579 wheelMeanHistos[3]->setBinLabel(12,
"Sector12", 1);
580 wheelMeanHistos[3]->setBinLabel(13,
"Sector13", 1);
581 wheelMeanHistos[3]->setBinLabel(14,
"Sector14", 1);
582 wheelMeanHistos[3]->setBinLabel(1,
"Wheel-2", 2);
583 wheelMeanHistos[3]->setBinLabel(2,
"Wheel-1", 2);
584 wheelMeanHistos[3]->setBinLabel(3,
"Wheel0", 2);
585 wheelMeanHistos[3]->setBinLabel(4,
"Wheel+1", 2);
586 wheelMeanHistos[3]->setBinLabel(5,
"Wheel+2", 2);
596 wheelSigmaHistos[3]->setBinLabel(1,
"Sector1", 1);
597 wheelSigmaHistos[3]->setBinLabel(2,
"Sector2", 1);
598 wheelSigmaHistos[3]->setBinLabel(3,
"Sector3", 1);
599 wheelSigmaHistos[3]->setBinLabel(4,
"Sector4", 1);
600 wheelSigmaHistos[3]->setBinLabel(5,
"Sector5", 1);
601 wheelSigmaHistos[3]->setBinLabel(6,
"Sector6", 1);
602 wheelSigmaHistos[3]->setBinLabel(7,
"Sector7", 1);
603 wheelSigmaHistos[3]->setBinLabel(8,
"Sector8", 1);
604 wheelSigmaHistos[3]->setBinLabel(9,
"Sector9", 1);
605 wheelSigmaHistos[3]->setBinLabel(10,
"Sector10", 1);
606 wheelSigmaHistos[3]->setBinLabel(11,
"Sector11", 1);
607 wheelSigmaHistos[3]->setBinLabel(12,
"Sector12", 1);
608 wheelSigmaHistos[3]->setBinLabel(13,
"Sector13", 1);
609 wheelSigmaHistos[3]->setBinLabel(14,
"Sector14", 1);
610 wheelSigmaHistos[3]->setBinLabel(1,
"Wheel-2", 2);
611 wheelSigmaHistos[3]->setBinLabel(2,
"Wheel-1", 2);
612 wheelSigmaHistos[3]->setBinLabel(3,
"Wheel0", 2);
613 wheelSigmaHistos[3]->setBinLabel(4,
"Wheel+1", 2);
614 wheelSigmaHistos[3]->setBinLabel(5,
"Wheel+2", 2);
625 wheelSlopeHistos[3]->setBinLabel(1,
"Sector1", 1);
626 wheelSlopeHistos[3]->setBinLabel(2,
"Sector2", 1);
627 wheelSlopeHistos[3]->setBinLabel(3,
"Sector3", 1);
628 wheelSlopeHistos[3]->setBinLabel(4,
"Sector4", 1);
629 wheelSlopeHistos[3]->setBinLabel(5,
"Sector5", 1);
630 wheelSlopeHistos[3]->setBinLabel(6,
"Sector6", 1);
631 wheelSlopeHistos[3]->setBinLabel(7,
"Sector7", 1);
632 wheelSlopeHistos[3]->setBinLabel(8,
"Sector8", 1);
633 wheelSlopeHistos[3]->setBinLabel(9,
"Sector9", 1);
634 wheelSlopeHistos[3]->setBinLabel(10,
"Sector10", 1);
635 wheelSlopeHistos[3]->setBinLabel(11,
"Sector11", 1);
636 wheelSlopeHistos[3]->setBinLabel(12,
"Sector12", 1);
637 wheelSlopeHistos[3]->setBinLabel(13,
"Sector13", 1);
638 wheelSlopeHistos[3]->setBinLabel(14,
"Sector14", 1);
639 wheelSlopeHistos[3]->setBinLabel(1,
"Wheel-2", 2);
640 wheelSlopeHistos[3]->setBinLabel(2,
"Wheel-1", 2);
641 wheelSlopeHistos[3]->setBinLabel(3,
"Wheel0", 2);
642 wheelSlopeHistos[3]->setBinLabel(4,
"Wheel+1", 2);
643 wheelSlopeHistos[3]->setBinLabel(5,
"Wheel+2", 2);
755 if (ret == 0 || bin == 11)
LuminosityBlockID id() const
Log< level::Info, true > LogVerbatim
DTResolutionTest(const edm::ParameterSet &ps)
Constructor.
~DTResolutionTest() override
Destructor.
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::pair< int, int >, int > cmsMeanHistos
tuple ret
prodAgent to be discontinued
std::map< std::string, MonitorElement * > MeanHistosSetRange
edm::ParameterSet parameters
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
virtual TH2F * getTH2F() const
virtual void setCurrentFolder(std::string const &fullpath)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
static const double slope[3]
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
std::map< std::pair< int, int >, MonitorElement * > SlopeHistos
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
Log< level::Error, false > LogError
std::map< std::pair< int, int >, bool > MeanFilled
std::map< std::string, MonitorElement * > SigmaHistosSetRange2D
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
std::map< std::pair< int, int >, int > cmsSigmaHistos
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
void bookHistos(DQMStore::IBooker &, const DTChamberId &ch)
book the new ME
bool getData(T &iHolder) const
std::map< std::string, MonitorElement * > MeanHistosSetRange2D
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Endjob.
virtual MonitorElement * get(std::string const &fullpath) const
std::map< std::string, MonitorElement * > SlopeHistosSetRange2D
Abs< T >::type abs(const T &t)
int superLayer() const
Return the superlayer number.
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::map< std::pair< int, int >, int > cmsSlopeHistos
int superlayer() const
Return the superlayer number (deprecated method name)
std::map< std::string, MonitorElement * > SigmaHistosSetRange
std::string getMEName2D(const DTSuperLayerId &slID)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
LuminosityBlockNumber_t luminosityBlock() const
std::map< std::pair< int, int >, bool > SigmaFilled
const std::vector< DQMChannel > & getBadChannels() const
int slFromBin(int bin) const
const DTGeometry * muonGeom
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int station() const
Return the station number.
static char chambers[264][20]
std::map< std::string, MonitorElement * > SlopeHistosSetRange
std::map< int, MonitorElement * > wheelSlopeHistos
int wheel() const
Return the wheel number.
int stationFromBin(int bin) const
std::map< std::pair< int, int >, bool > SlopeFilled