Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:27

0001 // Class:      L1TScalersSCAL
0002 // user include files
0003 
0004 #include <sstream>
0005 #include <vector>
0006 
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/ServiceRegistry/interface/Service.h"
0009 
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 
0013 #include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
0014 #include "DataFormats/Scalers/interface/Level1TriggerRates.h"
0015 #include "DataFormats/Scalers/interface/LumiScalers.h"
0016 #include "DataFormats/Scalers/interface/L1AcceptBunchCrossing.h"
0017 #include "DataFormats/Scalers/interface/ScalersRaw.h"
0018 #include "DataFormats/Scalers/interface/TimeSpec.h"
0019 
0020 #include "DQM/TrigXMonitor/interface/L1TScalersSCAL.h"
0021 #include "DataFormats/Common/interface/Handle.h"
0022 #include "DQMServices/Core/interface/DQMStore.h"
0023 
0024 const double SECS_PER_LUMI = 23.31040958083832;
0025 
0026 using namespace edm;
0027 using namespace std;
0028 
0029 L1TScalersSCAL::L1TScalersSCAL(const edm::ParameterSet& ps)
0030     : l1triggerscalers_(consumes<Level1TriggerScalersCollection>(ps.getParameter<edm::InputTag>("scalersResults"))),
0031       lumiscalers_(consumes<LumiScalersCollection>(ps.getParameter<edm::InputTag>("scalersResults"))),
0032       l1acceptBX_(consumes<L1AcceptBunchCrossingCollection>(ps.getParameter<edm::InputTag>("scalersResults"))),
0033       verbose_(ps.getUntrackedParameter<bool>("verbose", false)),
0034       denomIsTech_(ps.getUntrackedParameter<bool>("denomIsTech", true)),
0035       denomBit_(ps.getUntrackedParameter<unsigned int>("denomBit", 40)),
0036       muonBit_(ps.getUntrackedParameter<unsigned int>("muonBit", 55)),
0037       egammaBit_(ps.getUntrackedParameter<unsigned int>("egammaBit", 46)),
0038       jetBit_(ps.getUntrackedParameter<unsigned int>("jetBit", 15)) {
0039   LogDebug("Status") << "constructor";
0040 
0041   for (int i = 0; i < Level1TriggerScalers::nLevel1Triggers; i++) {
0042     bufferAlgoRates_.push_back(0);
0043     algorithmRates_.push_back(0);
0044     integral_algo_.push_back(0.);
0045   }
0046   for (int i = 0; i < Level1TriggerScalers::nLevel1TestTriggers; i++) {
0047     bufferTechRates_.push_back(0);
0048     technicalRates_.push_back(0);
0049     integral_tech_.push_back(0.);
0050   }
0051 
0052   buffertime_ = 0;
0053   reftime_ = 0;
0054   nev_ = 0;
0055   integral_tech_42_OR_43_ = 0;
0056   bufferLumi_ = 0;
0057 }
0058 
0059 L1TScalersSCAL::~L1TScalersSCAL() {}
0060 
0061 void L1TScalersSCAL::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const&, edm::EventSetup const&) {
0062   int maxNbins = 2001;
0063   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerScalers");
0064   orbitNum = iBooker.book1D("Orbit_Number", "Orbit_Number", maxNbins, -0.5, double(maxNbins) - 0.5);
0065   trigNum = iBooker.book1D("Number_of_Triggers", "Number_of_Triggers", 1000, 0, 4E4);
0066   trigNum->setAxisTitle("Time [sec]", 1);
0067   eventNum = iBooker.book1D("Number_of_Events", "Number_of_Events", maxNbins, -0.5, double(maxNbins) - 0.5);
0068 
0069   physTrig = iBooker.book1D("Physics_Triggers", "Physics_Triggers", maxNbins, -0.5, double(maxNbins) - 0.5);
0070   physTrig->setAxisTitle("Lumi Section", 1);
0071 
0072   randTrig = iBooker.book1D("Random_Triggers", "Random_Triggers", maxNbins, -0.5, double(maxNbins) - 0.5);
0073   randTrig->setAxisTitle("Lumi Section", 1);
0074   numberResets = iBooker.book1D("Number_Resets", "Number_Resets", maxNbins, -0.5, double(maxNbins) - 0.5);
0075   deadTime = iBooker.book1D("DeadTime", "DeadTime", maxNbins, -0.5, double(maxNbins) - 0.5);
0076   lostFinalTriggers =
0077       iBooker.book1D("Lost_Final_Trigger", "Lost_Final_Trigger", maxNbins, -0.5, double(maxNbins) - 0.5);
0078 
0079   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates");
0080   physRate = iBooker.book1D("Physics_Trigger_Rate", "Physics_Trigger_Rate", maxNbins, -0.5, double(maxNbins) - 0.5);
0081   randRate = iBooker.book1D("Random_Trigger_Rate", "Random_Trigger_Rate", maxNbins, -0.5, double(maxNbins) - 0.5);
0082   deadTimePercent = iBooker.book1D("Deadtime_Percent", "Deadtime_Percent", maxNbins, -0.5, double(maxNbins) - 0.5);
0083   lostPhysRate =
0084       iBooker.book1D("Lost_Physics_Trigger_Rate", "Lost_Physics_Trigger_Rate", maxNbins, -0.5, double(maxNbins) - 0.5);
0085   lostPhysRateBeamActive = iBooker.book1D("Lost_Physics_Trigger_Rate_Beam_Active",
0086                                           "Lost_Physics_Trigger_Rate_Beam_Active",
0087                                           maxNbins,
0088                                           -0.5,
0089                                           double(maxNbins) - 0.5);
0090   instTrigRate = iBooker.book1D("instTrigRate", "instTrigRate", 1000, 0, 4E4);
0091   instTrigRate->setAxisTitle("Time [sec]", 1);
0092   instEventRate = iBooker.book1D("instEventRate", "instEventRate", 1000, 0, 4E4);
0093   instEventRate->setAxisTitle("Time [sec]", 1);
0094 
0095   char hname[40];   // histo name
0096   char mename[40];  // ME name
0097 
0098   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates/AlgorithmRates");
0099   for (int i = 0; i < Level1TriggerScalers::nLevel1Triggers; i++) {
0100     sprintf(hname, "Rate_AlgoBit_%03d", i);
0101     sprintf(mename, "Rate_AlgoBit _%03d", i);
0102     algoRate[i] = iBooker.book1D(hname, mename, maxNbins, -0.5, double(maxNbins) - 0.5);
0103     algoRate[i]->setAxisTitle("Lumi Section", 1);
0104   }
0105 
0106   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates/AlgorithmRates/Integrated");
0107   for (int i = 0; i < Level1TriggerScalers::nLevel1Triggers; i++) {
0108     sprintf(hname, "Integral_AlgoBit_%03d", i);
0109     sprintf(mename, "Integral_AlgoBit _%03d", i);
0110     integralAlgo[i] = iBooker.book1D(hname, mename, maxNbins, -0.5, double(maxNbins) - 0.5);
0111     integralAlgo[i]->setAxisTitle("Lumi Section", 1);
0112   }
0113 
0114   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates/TechnicalRates");
0115   for (int i = 0; i < Level1TriggerScalers::nLevel1TestTriggers; i++) {
0116     sprintf(hname, "Rate_TechBit_%03d", i);
0117     sprintf(mename, "Rate_TechBit _%03d", i);
0118     techRate[i] = iBooker.book1D(hname, mename, maxNbins, -0.5, double(maxNbins) - 0.5);
0119     techRate[i]->setAxisTitle("Lumi Section", 1);
0120   }
0121 
0122   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates/TechnicalRates/Integrated");
0123   for (int i = 0; i < Level1TriggerScalers::nLevel1TestTriggers; i++) {
0124     sprintf(hname, "Integral_TechBit_%03d", i);
0125     sprintf(mename, "Integral_TechBit _%03d", i);
0126     integralTech[i] = iBooker.book1D(hname, mename, maxNbins, -0.5, double(maxNbins) - 0.5);
0127     integralTech[i]->setAxisTitle("Lumi Section", 1);
0128   }
0129   integralTech_42_OR_43 = iBooker.book1D(
0130       "Integral_TechBit_042_OR_043", "Integral_TechBit _042_OR_043", maxNbins, -0.5, double(maxNbins) - 0.5);
0131   integralTech_42_OR_43->setAxisTitle("Lumi Section", 1);
0132 
0133   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/Level1TriggerRates/Ratios");
0134   std::stringstream smu, seg, sjet, sdenom;
0135   // denominator string
0136   if (denomIsTech_)
0137     sdenom << "_TechBit_";
0138   else
0139     sdenom << "_AlgoBit_";
0140   sdenom << denomBit_;
0141   // Muon ratio
0142   smu << muonBit_;
0143   rateRatio_mu = iBooker.book1D("Rate_Ratio_mu_PhysBit_" + smu.str() + sdenom.str(),
0144                                 "Rate_Ratio_mu_PhysBit_" + smu.str() + sdenom.str(),
0145                                 maxNbins,
0146                                 -0.5,
0147                                 double(maxNbins) - 0.5);
0148   // rateRatio_mu->setAxisTitle("Lumi Section" , 1);
0149   // Egamma ratio
0150   seg << egammaBit_;
0151   rateRatio_egamma = iBooker.book1D("Rate_Ratio_egamma_PhysBit_" + seg.str() + sdenom.str(),
0152                                     "Rate_Ratio_egamma_PhysBit_" + seg.str() + sdenom.str(),
0153                                     maxNbins,
0154                                     -0.5,
0155                                     double(maxNbins) - 0.5);
0156   // rateRatio_egamma->setAxisTitle("Lumi Section" , 1);
0157   // Jet ratio
0158   sjet << jetBit_;
0159   rateRatio_jet = iBooker.book1D("Rate_Ratio_jet_PhysBit_" + sjet.str() + sdenom.str(),
0160                                  "Rate_Ratio_jet_PhysBit_" + sjet.str() + sdenom.str(),
0161                                  maxNbins,
0162                                  -0.5,
0163                                  double(maxNbins) - 0.5);
0164   // rateRatio_jet->setAxisTitle("Lumi Section" , 1);
0165 
0166   // HF bit ratios
0167   techRateRatio_8 = iBooker.book1D("Rate_Ratio_TechBit_8" + sdenom.str(),
0168                                    "Rate_Ratio_TechBit_8" + sdenom.str(),
0169                                    maxNbins,
0170                                    -0.5,
0171                                    double(maxNbins) - 0.5);
0172   techRateRatio_9 = iBooker.book1D("Rate_Ratio_TechBit_9" + sdenom.str(),
0173                                    "Rate_Ratio_TechBit_9" + sdenom.str(),
0174                                    maxNbins,
0175                                    -0.5,
0176                                    double(maxNbins) - 0.5);
0177   techRateRatio_10 = iBooker.book1D("Rate_Ratio_TechBit_10" + sdenom.str(),
0178                                     "Rate_Ratio_TechBit_10" + sdenom.str(),
0179                                     maxNbins,
0180                                     -0.5,
0181                                     double(maxNbins) - 0.5);
0182   // Other tech bit ratios
0183   techRateRatio_33_over_32 = iBooker.book1D(
0184       "Rate_Ratio_TechBits_33_over_32", "Rate_Ratio_TechBits_33_over_32", maxNbins, -0.5, double(maxNbins) - 0.5);
0185   techRateRatio_36 = iBooker.book1D("Rate_Ratio_TechBit_36" + sdenom.str(),
0186                                     "Rate_Ratio_TechBit_36" + sdenom.str(),
0187                                     maxNbins,
0188                                     -0.5,
0189                                     double(maxNbins) - 0.5);
0190   techRateRatio_37 = iBooker.book1D("Rate_Ratio_TechBit_37" + sdenom.str(),
0191                                     "Rate_Ratio_TechBit_37" + sdenom.str(),
0192                                     maxNbins,
0193                                     -0.5,
0194                                     double(maxNbins) - 0.5);
0195   techRateRatio_38 = iBooker.book1D("Rate_Ratio_TechBit_38" + sdenom.str(),
0196                                     "Rate_Ratio_TechBit_38" + sdenom.str(),
0197                                     maxNbins,
0198                                     -0.5,
0199                                     double(maxNbins) - 0.5);
0200   techRateRatio_39 = iBooker.book1D("Rate_Ratio_TechBit_39" + sdenom.str(),
0201                                     "Rate_Ratio_TechBit_39" + sdenom.str(),
0202                                     maxNbins,
0203                                     -0.5,
0204                                     double(maxNbins) - 0.5);
0205   techRateRatio_40 = iBooker.book1D("Rate_Ratio_TechBit_40" + sdenom.str(),
0206                                     "Rate_Ratio_TechBit_40" + sdenom.str(),
0207                                     maxNbins,
0208                                     -0.5,
0209                                     double(maxNbins) - 0.5);
0210   techRateRatio_41 = iBooker.book1D("Rate_Ratio_TechBit_41" + sdenom.str(),
0211                                     "Rate_Ratio_TechBit_41" + sdenom.str(),
0212                                     maxNbins,
0213                                     -0.5,
0214                                     double(maxNbins) - 0.5);
0215   techRateRatio_42 = iBooker.book1D("Rate_Ratio_TechBit_42" + sdenom.str(),
0216                                     "Rate_Ratio_TechBit_42" + sdenom.str(),
0217                                     maxNbins,
0218                                     -0.5,
0219                                     double(maxNbins) - 0.5);
0220   techRateRatio_43 = iBooker.book1D("Rate_Ratio_TechBit_43" + sdenom.str(),
0221                                     "Rate_Ratio_TechBit_43" + sdenom.str(),
0222                                     maxNbins,
0223                                     -0.5,
0224                                     double(maxNbins) - 0.5);
0225 
0226   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/LumiScalers");
0227   instLumi = iBooker.book1D("Instant_Lumi", "Instant_Lumi", maxNbins, -0.5, double(maxNbins) - 0.5);
0228   instLumiErr = iBooker.book1D("Instant_Lumi_Err", "Instant_Lumi_Err", maxNbins, -0.5, double(maxNbins) - 0.5);
0229   instLumiQlty = iBooker.book1D("Instant_Lumi_Qlty", "Instant_Lumi_Qlty", maxNbins, -0.5, double(maxNbins) - 0.5);
0230   instEtLumi = iBooker.book1D("Instant_Et_Lumi", "Instant_Et_Lumi", maxNbins, -0.5, double(maxNbins) - 0.5);
0231   instEtLumiErr = iBooker.book1D("Instant_Et_Lumi_Err", "Instant_Et_Lumi_Err", maxNbins, -0.5, double(maxNbins) - 0.5);
0232   instEtLumiQlty =
0233       iBooker.book1D("Instant_Et_Lumi_Qlty", "Instant_Et_Lumi_Qlty", maxNbins, -0.5, double(maxNbins) - 0.5);
0234   startOrbit = iBooker.book1D("Start_Orbit", "Start_Orbit", maxNbins, -0.5, double(maxNbins) - 0.5);
0235   numOrbits = iBooker.book1D("Num_Orbits", "Num_Orbits", maxNbins, -0.5, double(maxNbins) - 0.5);
0236 
0237   iBooker.setCurrentFolder("L1T/L1TScalersSCAL/L1AcceptBunchCrossing");
0238   for (int i = 0; i < 4; i++) {
0239     sprintf(hname, "OrbitNumber_L1A_%d", i + 1);
0240     sprintf(mename, "OrbitNumber_L1A_%d", i + 1);
0241     orbitNumL1A[i] = iBooker.book1D(hname, mename, 200, 0, 10E8);
0242     sprintf(hname, "Bunch_Crossing_L1A_%d", i + 1);
0243     sprintf(mename, "Bunch_Crossing_L1A_%d", i + 1);
0244     bunchCrossingL1A[i] = iBooker.book1D(hname, mename, 3564, -0.5, 3563.5);
0245   }
0246   orbitNumL1A[0]->setAxisTitle("Current BX", 1);
0247   orbitNumL1A[1]->setAxisTitle("Previous BX", 1);
0248   orbitNumL1A[2]->setAxisTitle("Second Previous BX", 1);
0249   orbitNumL1A[3]->setAxisTitle("Third Previous BX", 1);
0250 
0251   bunchCrossingL1A[0]->setAxisTitle("Current BX", 1);
0252   bunchCrossingL1A[1]->setAxisTitle("Previous BX", 1);
0253   bunchCrossingL1A[2]->setAxisTitle("Second Previous BX", 1);
0254   bunchCrossingL1A[3]->setAxisTitle("Third Previous BX", 1);
0255 
0256   for (int j = 0; j < 3; j++) {
0257     sprintf(hname, "BX_Correlation_%d", j + 1);
0258     sprintf(mename, "BX_Correlation_%d", j + 1);
0259     bunchCrossingCorr[j] = iBooker.book2D(hname, mename, 99, -0.5, 3563.5, 99, -0.5, 3563.5);
0260     bunchCrossingCorr[j]->setAxisTitle("Current Event", 1);
0261     sprintf(hname, "Bunch_Crossing_Diff_%d", j + 1);
0262     sprintf(mename, "Bunch_Crossing_Diff_%d", j + 1);
0263     bunchCrossingDiff[j] = iBooker.book1D(hname, mename, 1000, 0, 1E6);
0264     sprintf(hname, "Bunch_Crossing_Diff_small_%d", j + 1);
0265     sprintf(mename, "Bunch_Crossing_Diff_small_%d", j + 1);
0266     bunchCrossingDiff_small[j] = iBooker.book1D(hname, mename, 1000, 0, 1000);
0267   }
0268   bunchCrossingCorr[0]->setAxisTitle("Previous Event", 2);
0269   bunchCrossingCorr[1]->setAxisTitle("Second Previous Event", 2);
0270   bunchCrossingCorr[2]->setAxisTitle("Third Previous Event", 2);
0271 
0272   bunchCrossingDiff[0]->setAxisTitle("BX_Current - BX_Previous", 1);
0273   bunchCrossingDiff[1]->setAxisTitle("BX_Current - BX_SecondPrevious", 1);
0274   bunchCrossingDiff[2]->setAxisTitle("BX_Current - BX_ThirdPrevious", 1);
0275 
0276   bunchCrossingDiff_small[0]->setAxisTitle("BX_Current - BX_Previous", 1);
0277   bunchCrossingDiff_small[1]->setAxisTitle("BX_Current - BX_SecondPrevious", 1);
0278   bunchCrossingDiff_small[2]->setAxisTitle("BX_Current - BX_ThirdPrevious", 1);
0279 }
0280 
0281 void L1TScalersSCAL::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0282   nev_++;
0283   // access SCAL info
0284   edm::Handle<Level1TriggerScalersCollection> triggerScalers;
0285   bool a = iEvent.getByToken(l1triggerscalers_, triggerScalers);
0286   edm::Handle<LumiScalersCollection> lumiScalers;
0287   bool c = iEvent.getByToken(lumiscalers_, lumiScalers);
0288   edm::Handle<L1AcceptBunchCrossingCollection> bunchCrossings;
0289   bool d = iEvent.getByToken(l1acceptBX_, bunchCrossings);
0290 
0291   double evtLumi = iEvent.luminosityBlock();
0292   int run = iEvent.id().run();
0293 
0294   if (!(a && c && d)) {
0295     LogInfo("Status") << "getByToken failed";
0296   } else {  // we have the data
0297     Level1TriggerScalersCollection::const_iterator it = triggerScalers->begin();
0298     if (!triggerScalers->empty()) {
0299       unsigned int lumisection = it->lumiSegmentNr();
0300       struct timespec thetime = it->collectionTime();
0301       long currenttime;
0302       // cout << "lumisection = " << lumisection << endl;
0303       if (nev_ == 1)
0304         reftime_ = thetime.tv_sec;
0305       // cout << "reftime = " << reftime_ << endl;
0306       if (lumisection) {
0307         orbitNum->setBinContent(lumisection + 1, it->orbitNr());
0308         eventNum->setBinContent(lumisection + 1, it->gtEvents());
0309         physTrig->setBinContent(lumisection + 1, it->l1AsPhysics());
0310         randTrig->setBinContent(lumisection + 1, it->l1AsRandom());
0311         numberResets->setBinContent(lumisection + 1, it->gtResets());
0312         deadTime->setBinContent(lumisection + 1, it->deadtime());
0313         lostFinalTriggers->setBinContent(lumisection + 1, it->triggersPhysicsLost());
0314 
0315         if (buffertime_ < thetime.tv_sec) {
0316           buffertime_ = thetime.tv_sec;
0317           currenttime = thetime.tv_sec - reftime_;
0318           int timebin = (int)(currenttime / 30) + 1;
0319           trigNum->setBinContent((int)timebin, it->gtTriggers());
0320           instTrigRate->setBinContent((int)timebin, it->gtTriggersRate());
0321           instEventRate->setBinContent((int)timebin, it->gtEventsRate());
0322         }
0323 
0324         Level1TriggerRates trigRates(*it, run);
0325         Level1TriggerRates* triggerRates = &trigRates;
0326         if (triggerRates) {
0327           algorithmRates_ = triggerRates->gtAlgoCountsRate();
0328           technicalRates_ = triggerRates->gtTechCountsRate();
0329           if (((bufferLumi_ != lumisection) && (bufferLumi_ < lumisection) &&
0330                (evtLumi > 1 || evtLumi == lumisection + 1))) {
0331             bufferLumi_ = lumisection;
0332             if (bufferAlgoRates_ != algorithmRates_) {
0333               bufferAlgoRates_ = algorithmRates_;
0334               for (unsigned int i = 0; i < algorithmRates_.size(); i++) {
0335                 integral_algo_[i] += (algorithmRates_[i] * SECS_PER_LUMI);
0336                 algoRate[i]->setBinContent(lumisection + 1, algorithmRates_[i]);
0337                 integralAlgo[i]->setBinContent(lumisection + 1, integral_algo_[i]);
0338               }
0339             }
0340             if (bufferTechRates_ != technicalRates_) {
0341               bufferTechRates_ = technicalRates_;
0342               for (unsigned int i = 0; i < technicalRates_.size(); i++) {
0343                 integral_tech_[i] += (technicalRates_[i] * SECS_PER_LUMI);
0344                 techRate[i]->setBinContent(lumisection + 1, technicalRates_[i]);
0345                 integralTech[i]->setBinContent(lumisection + 1, integral_tech_[i]);
0346                 if ((i == 42 || i == 43))
0347                   integral_tech_42_OR_43_ += (technicalRates_[i] * SECS_PER_LUMI);
0348               }
0349               // fill rate ratio plots
0350               if (denomIsTech_) {
0351                 if (denomBit_ < technicalRates_.size()) {
0352                   if (technicalRates_[denomBit_]) {
0353                     if (muonBit_ < algorithmRates_.size())
0354                       rateRatio_mu->setBinContent(lumisection + 1,
0355                                                   algorithmRates_[muonBit_] / technicalRates_[denomBit_]);
0356                     if (egammaBit_ < algorithmRates_.size())
0357                       rateRatio_egamma->setBinContent(lumisection + 1,
0358                                                       algorithmRates_[egammaBit_] / technicalRates_[denomBit_]);
0359                     if (jetBit_ < algorithmRates_.size())
0360                       rateRatio_jet->setBinContent(lumisection + 1,
0361                                                    algorithmRates_[jetBit_] / technicalRates_[denomBit_]);
0362 
0363                     techRateRatio_8->setBinContent(lumisection + 1, technicalRates_[8] / technicalRates_[denomBit_]);
0364                     techRateRatio_9->setBinContent(lumisection + 1, technicalRates_[9] / technicalRates_[denomBit_]);
0365                     techRateRatio_10->setBinContent(lumisection + 1, technicalRates_[10] / technicalRates_[denomBit_]);
0366 
0367                     techRateRatio_36->setBinContent(lumisection + 1, technicalRates_[36] / technicalRates_[denomBit_]);
0368                     techRateRatio_37->setBinContent(lumisection + 1, technicalRates_[37] / technicalRates_[denomBit_]);
0369                     techRateRatio_38->setBinContent(lumisection + 1, technicalRates_[38] / technicalRates_[denomBit_]);
0370                     techRateRatio_39->setBinContent(lumisection + 1, technicalRates_[39] / technicalRates_[denomBit_]);
0371                     techRateRatio_40->setBinContent(lumisection + 1, technicalRates_[40] / technicalRates_[denomBit_]);
0372                     techRateRatio_41->setBinContent(lumisection + 1, technicalRates_[41] / technicalRates_[denomBit_]);
0373                     techRateRatio_42->setBinContent(lumisection + 1, technicalRates_[42] / technicalRates_[denomBit_]);
0374                     techRateRatio_43->setBinContent(lumisection + 1, technicalRates_[43] / technicalRates_[denomBit_]);
0375                   }
0376                 }
0377               }
0378               if (technicalRates_[32] != 0)
0379                 techRateRatio_33_over_32->setBinContent(lumisection + 1, technicalRates_[33] / technicalRates_[32]);
0380               integralTech_42_OR_43->setBinContent(lumisection + 1, integral_tech_42_OR_43_);
0381             }
0382 
0383             physRate->setBinContent(lumisection + 1, triggerRates->l1AsPhysicsRate());
0384             randRate->setBinContent(lumisection + 1, triggerRates->l1AsRandomRate());
0385             lostPhysRate->setBinContent(lumisection + 1, triggerRates->triggersPhysicsLostRate());
0386             lostPhysRateBeamActive->setBinContent(lumisection + 1, triggerRates->triggersPhysicsLostBeamActiveRate());
0387             deadTimePercent->setBinContent(lumisection + 1, triggerRates->deadtimePercent());
0388           }  // bufferLumi test
0389         }    // triggerRates
0390       }      // lumisection
0391     }        // triggerScalers->size()
0392 
0393     LumiScalersCollection::const_iterator it3 = lumiScalers->begin();
0394     if (!lumiScalers->empty()) {
0395       unsigned int lumisection = it3->sectionNumber();
0396       if (lumisection) {
0397         instLumi->setBinContent(lumisection + 1, it3->instantLumi());
0398         instLumiErr->setBinContent(lumisection + 1, it3->instantLumiErr());
0399         instLumiQlty->setBinContent(lumisection + 1, it3->instantLumiQlty());
0400         instEtLumi->setBinContent(lumisection + 1, it3->instantETLumi());
0401         instEtLumiErr->setBinContent(lumisection + 1, it3->instantETLumiErr());
0402         instEtLumiQlty->setBinContent(lumisection + 1, it3->instantETLumiQlty());
0403         startOrbit->setBinContent(lumisection + 1, it3->startOrbit());
0404         numOrbits->setBinContent(lumisection + 1, it3->numOrbits());
0405       }
0406     }
0407 
0408     int l1accept;
0409     unsigned int bx_current = 0, orbitnumber_current = 0, bxdiff = 0;
0410 
0411     for (L1AcceptBunchCrossingCollection::const_iterator it4 = bunchCrossings->begin(); it4 != bunchCrossings->end();
0412          ++it4) {
0413       l1accept = std::abs(it4->l1AcceptOffset());
0414       if (l1accept == 0) {
0415         orbitnumber_current = it4->orbitNumber();
0416         orbitNumL1A[l1accept]->Fill(orbitnumber_current);
0417 
0418         bx_current = it4->bunchCrossing();
0419         bunchCrossingL1A[l1accept]->Fill(bx_current);
0420       } else if (l1accept == 1 || l1accept == 2 || l1accept == 3) {
0421         orbitNumL1A[l1accept]->Fill(it4->orbitNumber());
0422         bunchCrossingL1A[l1accept]->Fill(it4->bunchCrossing());
0423         bunchCrossingCorr[l1accept - 1]->Fill(bx_current, it4->bunchCrossing());
0424         bxdiff = 3564 * (orbitnumber_current - it4->orbitNumber()) + bx_current - it4->bunchCrossing();
0425         bunchCrossingDiff[l1accept - 1]->Fill(bxdiff);
0426         bunchCrossingDiff_small[l1accept - 1]->Fill(bxdiff);
0427       }
0428     }
0429   }  // getByToken succeeds for scalers
0430 }