Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-01 03:53:35

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  \author C. Battilana S. Marcellini - INFN Bologna
0005  *
0006  *  threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
0007  *
0008  */
0009 
0010 // This class header
0011 #include "DQM/DTMonitorClient/src/DTLocalTriggerTest.h"
0012 
0013 // Framework headers
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0016 #include "DQMServices/Core/interface/DQMStore.h"
0017 
0018 // Geometry
0019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0020 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0021 
0022 // Root
0023 #include "TF1.h"
0024 #include "TProfile.h"
0025 
0026 //C++ headers
0027 #include <iostream>
0028 #include <sstream>
0029 
0030 using namespace edm;
0031 using namespace std;
0032 
0033 DTLocalTriggerTest::DTLocalTriggerTest(const edm::ParameterSet& ps) {
0034   setConfig(ps, "DTLocalTrigger");
0035   baseFolderTM = "DT/03-LocalTrigger-TM/";
0036   nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
0037 
0038   bookingdone = false;
0039 }
0040 
0041 DTLocalTriggerTest::~DTLocalTriggerTest() {}
0042 
0043 void DTLocalTriggerTest::Bookings(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0044   vector<string>::const_iterator iTr = trigSources.begin();
0045   vector<string>::const_iterator trEnd = trigSources.end();
0046   vector<string>::const_iterator iHw = hwSources.begin();
0047   vector<string>::const_iterator hwEnd = hwSources.end();
0048 
0049   //Booking
0050   if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
0051     for (; iTr != trEnd; ++iTr) {
0052       trigSource = (*iTr);
0053       for (; iHw != hwEnd; ++iHw) {
0054         hwSource = (*iHw);
0055         // Loop over the TriggerUnits
0056         for (int wh = -2; wh <= 2; ++wh) {
0057           for (int sect = 1; sect <= 12; ++sect) {
0058             bookSectorHistos(ibooker, wh, sect, "BXDistribPhiIn");
0059             bookSectorHistos(ibooker, wh, sect, "QualDistribPhiIn");
0060             bookSectorHistos(ibooker, wh, sect, "BXDistribPhiOut");
0061             bookSectorHistos(ibooker, wh, sect, "QualDistribPhiOut");
0062           }
0063 
0064           bookWheelHistos(ibooker, wh, "CorrectBXPhiIn");
0065           bookWheelHistos(ibooker, wh, "ResidualBXPhiIn");
0066           bookWheelHistos(ibooker, wh, "CorrFractionPhiIn");
0067           bookWheelHistos(ibooker, wh, "2ndFractionPhiIn");
0068           bookWheelHistos(ibooker, wh, "TriggerInclusivePhiIn");
0069 
0070           bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
0071           bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
0072           bookWheelHistos(ibooker, wh, "CorrFractionPhiOut");
0073           bookWheelHistos(ibooker, wh, "2ndFractionPhiOut");
0074           bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
0075         }
0076       }
0077     }
0078   }
0079   // Summary test histo booking (only static)
0080   for (iTr = trigSources.begin(); iTr != trEnd; ++iTr) {
0081     trigSource = (*iTr);
0082     for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
0083       hwSource = (*iHw);
0084       // Loop over the TriggerUnits
0085       for (int wh = -2; wh <= 2; ++wh) {
0086         bookWheelHistos(ibooker, wh, "CorrFractionSummaryIn", "Summaries");
0087         bookWheelHistos(ibooker, wh, "2ndFractionSummaryIn", "Summaries");
0088         bookWheelHistos(ibooker, wh, "CorrFractionSummaryOut", "Summaries");
0089         bookWheelHistos(ibooker, wh, "2ndFractionSummaryOut", "Summaries");
0090       }
0091       bookCmsHistos(ibooker, "CorrFractionSummaryIn");
0092       bookCmsHistos(ibooker, "2ndFractionSummaryIn");
0093       bookCmsHistos(ibooker, "CorrFractionSummaryOut");
0094       bookCmsHistos(ibooker, "2ndFractionSummaryOut");
0095 
0096       if (hwSource == "TM") {
0097         bookCmsHistos(ibooker, "TrigGlbSummary", "", true);
0098       }
0099     }
0100   }
0101 
0102   bookingdone = true;
0103 }
0104 
0105 void DTLocalTriggerTest::beginRun(const edm::Run& r, const edm::EventSetup& c) {
0106   DTLocalTriggerBaseTest::beginRun(r, c);
0107 }
0108 
0109 void DTLocalTriggerTest::runClientDiagnostic(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0110   if (!bookingdone)
0111     Bookings(ibooker, igetter);
0112 
0113   // Loop over Trig & Hw sources
0114   for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
0115     trigSource = (*iTr);
0116 
0117     for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
0118       hwSource = (*iHw);
0119       // Loop over the TriggerUnits
0120       for (int stat = 1; stat <= 4; ++stat) {
0121         for (int wh = -2; wh <= 2; ++wh) {
0122           for (int sect = 1; sect <= 12; ++sect) {
0123             DTChamberId chId(wh, stat, sect);
0124             int sector_id = (wh + wheelArrayShift) + (sect - 1) * 5;
0125 
0126             // IN part
0127             TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_In", "LocalTriggerPhiIn", chId)));
0128             TH1F* BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_In", "LocalTriggerPhiIn", chId)));
0129             TH2F* Flag1stvsQual = getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_In", "LocalTriggerPhiIn", chId)));
0130             if (BXvsQual && Flag1stvsQual && BestQual) {
0131               int corrSummary = 1;
0132               int secondSummary = 1;
0133               //default values for histograms
0134               double BX_OK = 51.;
0135               double BXMean = 51.;
0136               double corrFrac = 0.;
0137               double secondFrac = 0.;
0138               double besttrigs = 0.;
0139               if (BestQual->GetEntries() > 1) {
0140                 TH1D* BXHH = BXvsQual->ProjectionY("", 6, 7, "");
0141                 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
0142                 int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
0143                 BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
0144                 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
0145                 double trigsFlag2nd = Flag1st->GetBinContent(2);
0146                 double trigs = Flag1st->GetEntries();
0147                 besttrigs = BestQual->GetEntries();
0148                 double besttrigsCorr = BestQual->Integral(5, 7, "");
0149                 delete BXHH;
0150                 delete Flag1st;
0151 
0152                 corrFrac = besttrigsCorr / besttrigs;
0153                 secondFrac = trigsFlag2nd / trigs;
0154                 if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
0155                   corrSummary = 2;
0156                 } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
0157                   corrSummary = 3;
0158                 } else {
0159                   corrSummary = 0;
0160                 }
0161                 if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
0162                   secondSummary = 2;
0163                 } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
0164                   secondSummary = 3;
0165                 } else {
0166                   secondSummary = 0;
0167                 }
0168 
0169                 if (secME[sector_id].find(fullName("BXDistribPhiIn")) == secME[sector_id].end()) {
0170                   bookSectorHistos(ibooker, wh, sect, "QualDistribPhiIn");
0171                   bookSectorHistos(ibooker, wh, sect, "BXDistribPhiIn");
0172                 }
0173 
0174                 TH1D* BXDistr = BXvsQual->ProjectionY();
0175                 TH1D* QualDistr = BXvsQual->ProjectionX();
0176                 std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
0177 
0178                 int nbinsBX = BXDistr->GetNbinsX();
0179                 int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
0180                 int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
0181                 int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
0182                 int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
0183                 for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
0184                   innerME->find(fullName("BXDistribPhiIn"))
0185                       ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
0186                 }
0187                 for (int ibin = 1; ibin <= 7; ++ibin) {
0188                   innerME->find(fullName("QualDistribPhiIn"))
0189                       ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
0190                 }
0191 
0192                 delete BXDistr;
0193                 delete QualDistr;
0194               }
0195 
0196               std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
0197 
0198               if (whME[wh].find(fullName("CorrectBXPhiIn")) == whME[wh].end()) {
0199                 bookWheelHistos(ibooker, wh, "ResidualBXPhiIn");
0200                 bookWheelHistos(ibooker, wh, "CorrectBXPhiIn");
0201                 bookWheelHistos(ibooker, wh, "CorrFractionPhiIn");
0202                 bookWheelHistos(ibooker, wh, "2ndFractionPhiIn");
0203                 bookWheelHistos(ibooker, wh, "TriggerInclusivePhiIn");
0204               }
0205 
0206               innerME = &(whME[wh]);
0207               innerME->find(fullName("CorrectBXPhiIn"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
0208               innerME->find(fullName("ResidualBXPhiIn"))
0209                   ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
0210               innerME->find(fullName("CorrFractionPhiIn"))->second->setBinContent(sect, stat, corrFrac);
0211               innerME->find(fullName("TriggerInclusivePhiIn"))->second->setBinContent(sect, stat, besttrigs);
0212               innerME->find(fullName("2ndFractionPhiIn"))->second->setBinContent(sect, stat, secondFrac);
0213 
0214               whME[wh].find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, stat, corrSummary);
0215               whME[wh].find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, stat, secondSummary);
0216 
0217             }  // closes BXvsQual && Flag1stvsQual && BestQual
0218 
0219             if (hwSource == "TM") {
0220               //Out part
0221 
0222               TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_Out", "LocalTriggerPhiOut", chId)));
0223               TH1F* BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_Out", "LocalTriggerPhiOut", chId)));
0224               TH2F* Flag1stvsQual =
0225                   getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_Out", "LocalTriggerPhiOut", chId)));
0226               if (BXvsQual && Flag1stvsQual && BestQual) {
0227                 int corrSummary = 1;
0228                 int secondSummary = 1;
0229                 //default values for histograms
0230                 double BX_OK = 51.;
0231                 double BXMean = 51.;
0232                 double corrFrac = 0.;
0233                 double secondFrac = 0.;
0234                 double besttrigs = 0.;
0235 
0236                 if (BestQual->GetEntries() > 1) {
0237                   TH1D* BXHH = BXvsQual->ProjectionY("", 6, 7, "");
0238                   TH1D* Flag1st = Flag1stvsQual->ProjectionY();
0239                   int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
0240                   BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
0241                   BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
0242                   double trigsFlag2nd = Flag1st->GetBinContent(2);
0243                   double trigs = Flag1st->GetEntries();
0244                   besttrigs = BestQual->GetEntries();
0245                   double besttrigsCorr = BestQual->Integral(5, 7, "");
0246                   delete BXHH;
0247                   delete Flag1st;
0248 
0249                   corrFrac = besttrigsCorr / besttrigs;
0250                   secondFrac = trigsFlag2nd / trigs;
0251                   if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
0252                     corrSummary = 2;
0253                   } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
0254                     corrSummary = 3;
0255                   } else {
0256                     corrSummary = 0;
0257                   }
0258                   if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
0259                     secondSummary = 2;
0260                   } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
0261                     secondSummary = 3;
0262                   } else {
0263                     secondSummary = 0;
0264                   }
0265 
0266                   if (secME[sector_id].find(fullName("BXDistribPhiOut")) == secME[sector_id].end()) {
0267                     bookSectorHistos(ibooker, wh, sect, "QualDistribPhiOut");
0268                     bookSectorHistos(ibooker, wh, sect, "BXDistribPhiOut");
0269                   }
0270 
0271                   TH1D* BXDistr = BXvsQual->ProjectionY();
0272                   TH1D* QualDistr = BXvsQual->ProjectionX();
0273                   std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
0274 
0275                   int nbinsBX = BXDistr->GetNbinsX();
0276                   int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
0277                   int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
0278                   int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
0279                   int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
0280                   for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
0281                     innerME->find(fullName("BXDistribPhiOut"))
0282                         ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
0283                   }
0284                   for (int ibin = 1; ibin <= 7; ++ibin) {
0285                     innerME->find(fullName("QualDistribPhiOut"))
0286                         ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
0287                   }
0288 
0289                   delete BXDistr;
0290                   delete QualDistr;
0291                 }
0292 
0293                 std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
0294 
0295                 if (whME[wh].find(fullName("CorrectBXPhiOut")) == whME[wh].end()) {
0296                   bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
0297                   bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
0298                   bookWheelHistos(ibooker, wh, "CorrFractionPhiOut");
0299                   bookWheelHistos(ibooker, wh, "2ndFractionPhiOut");
0300                   bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
0301                 }
0302 
0303                 innerME = &(whME[wh]);
0304                 innerME->find(fullName("CorrectBXPhiOut"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
0305                 innerME->find(fullName("ResidualBXPhiOut"))
0306                     ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
0307                 innerME->find(fullName("CorrFractionPhiOut"))->second->setBinContent(sect, stat, corrFrac);
0308                 innerME->find(fullName("TriggerInclusivePhiOut"))->second->setBinContent(sect, stat, besttrigs);
0309                 innerME->find(fullName("2ndFractionPhiOut"))->second->setBinContent(sect, stat, secondFrac);
0310 
0311                 whME[wh].find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, stat, corrSummary);
0312                 whME[wh].find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, stat, secondSummary);
0313 
0314               }  // closes BXvsQual && Flag1stvsQual && BestQual
0315 
0316             }  // Check on TM source
0317                //Theta part
0318             if (hwSource == "TM") {
0319               // Perform TM plot analysis (Theta ones)
0320               TH2F* ThetaPosvsBX = getHisto<TH2F>(igetter.get(getMEName("PositionvsBX", "LocalTriggerTheta", chId)));
0321               double BX_OK = 48;
0322               // no theta triggers in stat 4!
0323               if (ThetaPosvsBX && stat < 4 && ThetaPosvsBX->GetEntries() > 1) {
0324                 TH1D* BX = ThetaPosvsBX->ProjectionX();
0325                 int BXOK_bin = BX->GetEffectiveEntries() >= 1 ? BX->GetMaximumBin() : 10;
0326                 BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
0327                 delete BX;
0328 
0329                 if (whME[wh].find(fullName("CorrectBXTheta")) == whME[wh].end()) {
0330                   bookWheelHistos(ibooker, wh, "CorrectBXTheta");
0331                 }
0332                 std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
0333                 innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
0334               }
0335               // Adding trigger info to compute H fraction (11/10/2016) M.C.Fouz
0336               TH2F* ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual", "LocalTriggerTheta", chId)));
0337               TH1F* ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual", "LocalTriggerTheta", chId)));
0338               if (ThetaBXvsQual && ThetaBestQual && stat < 4 && ThetaBestQual->GetEntries() > 1) {
0339                 double trigs = ThetaBestQual->GetEntries();
0340                 double trigsH = ThetaBestQual->GetBinContent(
0341                     2);  // Note that for the new plots H is at bin=2 and not 4 as in DDU!!!!
0342                 if (whME[wh].find(fullName("HFractionTheta")) == whME[wh].end()) {
0343                   bookWheelHistos(ibooker, wh, "HFractionTheta");
0344                 }
0345                 std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
0346                 innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect, stat, trigsH / trigs);
0347               }
0348               // END ADDING H Fraction info
0349             }
0350           }
0351         }
0352       }
0353     }
0354   }
0355 
0356   for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
0357     trigSource = (*iTr);
0358     for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
0359       hwSource = (*iHw);
0360       for (int wh = -2; wh <= 2; ++wh) {
0361         std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
0362         // In part
0363         TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryIn"))->second);
0364         TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryIn"))->second);
0365         for (int sect = 1; sect <= 12; ++sect) {
0366           int corrErr = 0;
0367           int secondErr = 0;
0368           int corrNoData = 0;
0369           int secondNoData = 0;
0370           for (int stat = 1; stat <= 4; ++stat) {
0371             switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect, stat))) {
0372               case 1:
0373                 corrNoData++;
0374                 [[fallthrough]];
0375               case 2:
0376                 corrErr++;
0377             }
0378             switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect, stat))) {
0379               case 1:
0380                 secondNoData++;
0381                 [[fallthrough]];
0382               case 2:
0383                 secondErr++;
0384             }
0385           }
0386           if (corrNoData == 4)
0387             corrErr = 5;
0388           if (secondNoData == 4)
0389             secondErr = 5;
0390           cmsME.find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
0391           cmsME.find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
0392         }
0393         // Out part
0394         TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryOut"))->second);
0395         TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryOut"))->second);
0396         for (int sect = 1; sect <= 12; ++sect) {
0397           int corrErr = 0;
0398           int secondErr = 0;
0399           int corrNoData = 0;
0400           int secondNoData = 0;
0401           for (int stat = 1; stat <= 4; ++stat) {
0402             switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect, stat))) {
0403               case 1:
0404                 corrNoData++;
0405                 [[fallthrough]];
0406               case 2:
0407                 corrErr++;
0408             }
0409             switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect, stat))) {
0410               case 1:
0411                 secondNoData++;
0412                 [[fallthrough]];
0413               case 2:
0414                 secondErr++;
0415             }
0416           }
0417           if (corrNoData == 4)
0418             corrErr = 5;
0419           if (secondNoData == 4)
0420             secondErr = 5;
0421           cmsME.find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
0422           cmsME.find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
0423         }
0424       }
0425     }
0426   }
0427   fillGlobalSummary(igetter);
0428 }
0429 
0430 void DTLocalTriggerTest::fillGlobalSummary(DQMStore::IGetter& igetter) {
0431   float glbPerc[5] = {1., 0.9, 0.6, 0.3, 0.01};
0432   trigSource = "";
0433   hwSource = "TM";
0434 
0435   int nSecReadout = 0;
0436 
0437   for (int wh = -2; wh <= 2; ++wh) {
0438     for (int sect = 1; sect <= 12; ++sect) {
0439       float maxErr = 8.;
0440       int corr = cmsME.find(fullName("CorrFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
0441       int second = cmsME.find(fullName("2ndFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
0442       int lut = 0;
0443       MonitorElement* lutsME = igetter.get(topFolder() + "Summaries/TrigLutSummary");
0444       if (lutsME) {
0445         lut = lutsME->getBinContent(sect, wh + wheelArrayShift);
0446         maxErr += 4;
0447       } else {
0448         LogTrace(category()) << "[" << testName << "Test]: TM Lut test Summary histo not found." << endl;
0449       }
0450       (corr < 5 || second < 5) && nSecReadout++;
0451       int errcode = ((corr < 5 ? corr : 4) + (second < 5 ? second : 4) + (lut < 5 ? lut : 4));
0452       errcode = min(int((errcode / maxErr + 0.01) * 4), 4);
0453       cmsME.find("TrigGlbSummary")->second->setBinContent(sect, wh + wheelArrayShift, glbPerc[errcode]);
0454     }
0455   }
0456 
0457   if (!nSecReadout)
0458     cmsME.find("TrigGlbSummary")->second->Reset();  // white histo id TM is not RO
0459 
0460   string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsTrigger";
0461   MonitorElement* meProcEvts = igetter.get(nEvtsName);
0462 
0463   if (meProcEvts) {
0464     int nProcEvts = meProcEvts->getFloatValue();
0465     cmsME.find("TrigGlbSummary")->second->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
0466   } else {
0467     cmsME.find("TrigGlbSummary")->second->setEntries(nMinEvts + 1);
0468     LogVerbatim(category()) << "[" << testName << "Test]: ME: " << nEvtsName << " not found!" << endl;
0469   }
0470 }