CMS 3D CMS Logo

L1TRate.cc
Go to the documentation of this file.
1 /*
2  * \file L1TRate.cc
3  *
4  * \author J. Pela, P. Musella
5  *
6  */
7 
8 // L1TMonitor includes
12 
14 
15 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
16 #include "DataFormats/Luminosity/interface/LumiDetails.h" // Luminosity Information
17 #include "DataFormats/Luminosity/interface/LumiSummary.h" // Luminosity Information
18 
26 
27 #include "TList.h"
28 
29 using namespace edm;
30 using namespace std;
31 
32 //_____________________________________________________________________
34  m_l1GtUtils(ps, consumesCollector(), false, *this) {
35 
36  m_maxNbins = 2500; // Maximum LS for each run (for binning purposes)
37  m_parameters = ps;
38 
39  // Mapping parameter input variables
40  m_scalersSource_colLScal = consumes<LumiScalersCollection> (m_parameters.getParameter<InputTag>("inputTagScalersResults"));
41  m_scalersSource_triggerScalers = consumes<Level1TriggerScalersCollection> (m_parameters.getParameter<InputTag>("inputTagScalersResults"));
42  m_l1GtDataDaqInputTag = consumes<L1GlobalTriggerReadoutRecord> (m_parameters.getParameter<InputTag>("inputTagL1GtDataDaq"));
43  m_verbose = m_parameters.getUntrackedParameter<bool> ("verbose",false);
44  m_refPrescaleSet = m_parameters.getParameter <int> ("refPrescaleSet");
45  m_lsShiftGTRates = m_parameters.getUntrackedParameter<int> ("lsShiftGTRates",0);
46 
47  // Getting which categories to monitor
48  ParameterSet Categories = ps.getParameter<ParameterSet>("categories");
49  m_inputCategories["Mu"] = Categories.getUntrackedParameter<bool>("Mu");
50  m_inputCategories["EG"] = Categories.getUntrackedParameter<bool>("EG");
51  m_inputCategories["IsoEG"] = Categories.getUntrackedParameter<bool>("IsoEG");
52  m_inputCategories["Jet"] = Categories.getUntrackedParameter<bool>("Jet");
53  m_inputCategories["CenJet"] = Categories.getUntrackedParameter<bool>("CenJet");
54  m_inputCategories["ForJet"] = Categories.getUntrackedParameter<bool>("ForJet");
55  m_inputCategories["TauJet"] = Categories.getUntrackedParameter<bool>("TauJet");
56  m_inputCategories["ETM"] = Categories.getUntrackedParameter<bool>("ETM");
57  m_inputCategories["ETT"] = Categories.getUntrackedParameter<bool>("ETT");
58  m_inputCategories["HTT"] = Categories.getUntrackedParameter<bool>("HTT");
59  m_inputCategories["HTM"] = Categories.getUntrackedParameter<bool>("HTM");
60 
61 
62  // What to do if we want our output to be saved to a external file
63  m_outputFile = ps.getUntrackedParameter < string > ("outputFile", "");
64 
65  if (!m_outputFile.empty()) {
66  cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << endl;
67  }
68 
69  bool disable = ps.getUntrackedParameter < bool > ("disableROOToutput", false);
70  if (disable) {m_outputFile = "";}
71 
72 }
73 
74 //_____________________________________________________________________
76 
77 //_____________________________________________________________________
78 // BeginRun
79 //_____________________________________________________________________
80 void L1TRate::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run&, const edm::EventSetup& iSetup){
81 
82 
85 
86  iSetup.get<L1GtTriggerMenuRcd>() .get(menuRcd);
87  iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
88 
89  const L1GtTriggerMenu* menu = menuRcd .product();
90  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
91 
92  // Initializing DQM Monitor Elements
93  ibooker.setCurrentFolder("L1T/L1TRate");
94  m_ErrorMonitor = ibooker.book1D("ErrorMonitor", "ErrorMonitor",5,0,5);
95  m_ErrorMonitor->setBinLabel(1,"WARNING_DB_CONN_FAILED"); // Errors from L1TOMDSHelper
96  m_ErrorMonitor->setBinLabel(2,"WARNING_DB_QUERY_FAILED"); // Errors from L1TOMDSHelper
97  m_ErrorMonitor->setBinLabel(3,"WARNING_DB_INCORRECT_NBUNCHES"); // Errors from L1TOMDSHelper
98  m_ErrorMonitor->setBinLabel(4,"WARNING_PY_MISSING_FIT");
99  m_ErrorMonitor->setBinLabel(5,"UNKNOWN");
100 
101  // Retriving the list of prescale sets
102  m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors());
103 
104  // Getting Lowest Prescale Single Object Triggers from the menu
105  L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
108 
109  //-> Getting template fits for the algLo cross sections
110  int srcAlgoXSecFit = m_parameters.getParameter<int>("srcAlgoXSecFit");
111  if (srcAlgoXSecFit == 0){getXSexFitsOMDS (m_parameters);}
112  else if(srcAlgoXSecFit == 1){getXSexFitsPython(m_parameters);}
113 
114  for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo!=menu->gtAlgorithmMap().end(); ++algo){
115  m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();
116  }
117 
118  double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity");
119  double maxInstantLuminosity = m_parameters.getParameter<double>("maxInstantLuminosity");
120 
121  // Initializing DQM Monitor Elements
122  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
123 
124  TString tCategory = (*i).first;
125  TString tTrigger = (*i).second;
126 
127  TString tErrorMessage = "";
128  TF1* tTestFunction;
129 
130  if(tTrigger != "Undefined" && m_templateFunctions.find(tTrigger) != m_templateFunctions.end()){
131  tTestFunction = m_templateFunctions[tTrigger];
132  }
133  else if(tTrigger == "Undefined"){
134  TString tFunc = "-1";
135  tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
136  }
137  else if(m_templateFunctions.find(tTrigger) == m_templateFunctions.end()){
138  TString tFunc = "-1";
139  tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
140  tErrorMessage = " (Undefined Test Function)";
141  }
142  else{
143  TString tFunc = "-1";
144  tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
145  }
146 
147  if(tTrigger != "Undefined"){
148 
149  if(myMenuHelper.getPrescaleByAlias(tCategory,tTrigger) != 1){
150  tErrorMessage += " WARNING: Default Prescale = ";
151  tErrorMessage += myMenuHelper.getPrescaleByAlias(tCategory,tTrigger);
152  }
153 
154  if (tCategory == "Mu" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 4294967295){
155  tErrorMessage += " WARNING: Eta Range = ";
156  tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
157  }
158  else if(tCategory == "EG" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
159  tErrorMessage += " WARNING: Eta Range = ";
160  tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
161  }
162  else if(tCategory == "IsoEG" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
163  tErrorMessage += " WARNING: Eta Range = ";
164  tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
165  }
166 
167  if(tCategory == "Mu" && myMenuHelper.getQualityAlias(tCategory,tTrigger) != 240){
168  tErrorMessage += " WARNING: Quality = ";
169  tErrorMessage += myMenuHelper.getQualityAlias(tCategory,tTrigger);
170  }
171 
172  }
173 
174 
175 
176  ibooker.setCurrentFolder("L1T/L1TRate/TriggerCrossSections");
177  m_xSecVsInstLumi[tTrigger] = ibooker.bookProfile(tCategory,
178  "Cross Sec. vs Inst. Lumi Algo: "+tTrigger+tErrorMessage,
179  m_maxNbins,
180  minInstantLuminosity,
181  maxInstantLuminosity,0,500);
182  m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Instantaneous Luminosity [10^{30}cm^{-2}s^{-1}]" ,1);
183  m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Algorithm #sigma [#mu b]" ,2);
184  m_xSecVsInstLumi[tTrigger] ->getTProfile()->GetListOfFunctions()->Add(tTestFunction);
185  m_xSecVsInstLumi[tTrigger] ->getTProfile()->SetMarkerStyle(23);
186 
187  ibooker.setCurrentFolder("L1T/L1TRate/Certification");
188  m_xSecObservedToExpected[tTrigger] = ibooker.book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5);
189  m_xSecObservedToExpected[tTrigger] ->setAxisTitle("Lumi Section" ,1);
190  m_xSecObservedToExpected[tTrigger] ->setAxisTitle("#sigma_{obs} / #sigma_{exp}" ,2);
191 
192  }
193 
194 }
195 
197  //
198  if (m_verbose) {cout << "[L1TRate:] Called beginRun." << endl;}
199 }
200 //_____________________________________________________________________
202 
203  if (m_verbose) {cout << "[L1TRate:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;}
204 
205 }
206 
207 //_____________________________________________________________________
208 void L1TRate::endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) {
209 
210  int eventLS = lumiBlock.id().luminosityBlock();
211  if (m_verbose) {cout << "[L1TRate:] Called endLuminosityBlock at LS=" << eventLS << endl;}
212 
213  // We can certify LS -1 since we should have available:
214  // gt rates: (current LS)-1
215  // prescale: current LS
216  // lumi : current LS
217  //eventLS--;
218 
219  // Checking if all necessary quantities are defined for our calculations
220  bool isDefRate,isDefLumi,isDefPrescaleIndex;
221  map<TString,double>* rates=nullptr;
222  double lumi=0;
223  int prescalesIndex=0;
224 
225  // Reseting MonitorElements so we can refill them
226  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
227  string tTrigger = (*i).second;
228  m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE");
229  m_xSecVsInstLumi [tTrigger]->getTH1()->Reset("ICE");
230  }
231 
232  for(map<int,map<TString,double> >::iterator i=m_lsRates.begin() ; i!=m_lsRates.end() ; i++){
233 
234  unsigned int ls = (*i).first;
235  rates = &(*i).second;
236  isDefRate=true;
237 
238  if(m_lsLuminosity.find(ls)==m_lsLuminosity.end()){isDefLumi=false;}
239  else{
240  isDefLumi=true;
241  lumi=m_lsLuminosity[ls];
242  }
243 
244  if(m_lsPrescaleIndex.find(ls)==m_lsPrescaleIndex.end()){isDefPrescaleIndex=false;}
245  else{
246  isDefPrescaleIndex=true;
247  prescalesIndex=m_lsPrescaleIndex[ls];
248  }
249 
250  if(isDefRate && isDefLumi && isDefPrescaleIndex){
251 
252  const vector<int>& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex);
253 
254  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
255 
256  string tTrigger = (*i).second;
257  TF1* tTestFunction = (TF1*) m_xSecVsInstLumi[tTrigger]->getTProfile()->GetListOfFunctions()->First();
258 
259  // If trigger name is defined we get the rate fit parameters
260  if(tTrigger != "Undefined"){
261 
262  unsigned int trigBit = m_algoBit[tTrigger];
263  double trigPrescale = currentPrescaleFactors[trigBit];
264  double trigRate = (*rates)[tTrigger];
265 
266  if(lumi!=0 && trigPrescale!=0 && trigRate!=0){
267 
268  double AlgoXSec = (trigPrescale*trigRate)/lumi;
269  double TemplateFunctionValue = tTestFunction->Eval(lumi);
270 
271  // Checking against Template function
272  int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(ls);
273  m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue);
274  m_xSecVsInstLumi [tTrigger]->Fill(lumi,AlgoXSec);
275 
276  if(m_verbose){cout<<"[L1TRate:] ls="<<ls<<" Algo="<<tTrigger<<" XSec="<<AlgoXSec<<" Test="<<AlgoXSec/TemplateFunctionValue<<endl;}
277 
278  }
279  else{
280  int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(ls);
281  m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,0.000001);
282  if(m_verbose){cout << "[L1TRate:] Algo="<< tTrigger<< " XSec=Failed" << endl;}
283  }
284  }
285  }
286  }
287  }
288 }
289 
290 //_____________________________________________________________________
291 void L1TRate::analyze(const Event & iEvent, const EventSetup & eventSetup){
292 
293  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
296 
297  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
298  iEvent.getByToken(m_scalersSource_colLScal, colLScal);
299  iEvent.getByToken(m_scalersSource_triggerScalers, triggerScalers);
300 
301  // Integers
302  int EventRun = iEvent.id().run();
303  unsigned int eventLS = iEvent.id().luminosityBlock();
304 
305  // Getting the trigger trigger rates from GT and buffering it
306  if(triggerScalers.isValid()){
307 
308  Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin();
309  Level1TriggerRates trigRates(*itL1TScalers,EventRun);
310 
311  int gtLS = (*itL1TScalers).lumiSegmentNr()+m_lsShiftGTRates;
312 
313  // If we haven't got the data from this LS yet get it
314  if(m_lsRates.find(gtLS)==m_lsRates.end()){
315 
316  if (m_verbose) {cout << "[L1TRate:] Buffering GT Rates for LS=" << gtLS << endl;}
317  map<TString,double> bufferRate;
318 
319  // Buffer the rate informations for all selected bits
320  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
321 
322  string tTrigger = (*i).second;
323 
324  // If trigger name is defined we store the rate
325  if(tTrigger != "Undefined"){
326 
327  unsigned int trigBit = m_algoBit[tTrigger];
328  double trigRate = trigRates.gtAlgoCountsRate()[trigBit];
329 
330  bufferRate[tTrigger] = trigRate;
331  }
332  }
333  m_lsRates[gtLS] = bufferRate;
334  }
335  }
336 
337  // Getting from the SCAL the luminosity information and buffering it
338  if(colLScal.isValid() && !colLScal->empty()){
339 
340  LumiScalersCollection::const_iterator itLScal = colLScal->begin();
341  unsigned int scalLS = itLScal->sectionNumber();
342 
343  // If we haven't got the data from this SCAL LS yet get it
344  if(m_lsLuminosity.find(scalLS)==m_lsLuminosity.end()){
345 
346  if (m_verbose) {cout << "[L1TRate:] Buffering SCAL-HF Lumi for LS=" << scalLS << endl;}
347  double instLumi = itLScal->instantLumi(); // Getting Instant Lumi from HF (via SCAL)
348  double deadTimeNormHF = itLScal->deadTimeNormalization(); // Getting Dead Time Normalization from HF (via SCAL)
349 
350  // If HF Dead Time Corrections is requested we apply it
351  // NOTE: By default this is assumed false since for now WbM fits do NOT assume this correction
352  if(m_parameters.getUntrackedParameter<bool>("useHFDeadTimeNormalization",false)){
353 
354  // Protecting for deadtime = 0
355  if(deadTimeNormHF==0){instLumi = 0;}
356  else {instLumi = instLumi/deadTimeNormHF;}
357  }
358  // Buffering the luminosity information
359  m_lsLuminosity[scalLS]=instLumi;
360  }
361  }
362 
363  // Getting the prescale index used when this event was triggered
364  if(gtReadoutRecordData.isValid()){
365 
366  // If we haven't got the data from this LS yet get it
367  if(m_lsPrescaleIndex.find(eventLS)==m_lsPrescaleIndex.end()){
368 
369  if (m_verbose) {cout << "[L1TRate:] Buffering Prescale Index for LS=" << eventLS << endl;}
370 
371  // Getting Final Decision Logic (FDL) Data from GT
372  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
373 
374  // Getting the index for the fdl data for this event
375  int indexFDL=0;
376  for(unsigned int i=0; i<gtFdlVectorData.size(); i++){
377  if(gtFdlVectorData[i].bxInEvent()==0){indexFDL=i; break;}
378  }
379 
380  int CurrentPrescalesIndex = gtFdlVectorData[indexFDL].gtPrescaleFactorIndexAlgo();
381  m_lsPrescaleIndex[eventLS] = CurrentPrescalesIndex;
382  }
383  }
384 }
385 
386 //_____________________________________________________________________
387 // function: getXSexFitsOMDS
388 // Imputs:
389 // * const edm::ParameterSet& ps = ParameterSet contaning necessary
390 // information for the OMDS data extraction
391 // Outputs:
392 // * int error = Number of algos where you did not find a
393 // corresponding fit
394 //_____________________________________________________________________
396 
397  bool noError = true;
398 
399  string oracleDB = ps.getParameter<string>("oracleDB");
400  string pathCondDB = ps.getParameter<string>("pathCondDB");
401 
402  L1TOMDSHelper myOMDSHelper;
403  int conError;
404  myOMDSHelper.connect(oracleDB,pathCondDB,conError);
405 
406  map<string,WbMTriggerXSecFit> wbmFits;
407 
408  if(conError == L1TOMDSHelper::NO_ERROR){
409  int errorRetrive;
410  wbmFits = myOMDSHelper.getWbMAlgoXsecFits(errorRetrive);
411 
412  // Filling errors if they exist
413  if(errorRetrive != L1TOMDSHelper::NO_ERROR){
414  noError = false;
415  string eName = myOMDSHelper.enumToStringError(errorRetrive);
416  m_ErrorMonitor->Fill(eName);
417  }
418  }else{
419  noError = false;
420  string eName = myOMDSHelper.enumToStringError(conError);
421  m_ErrorMonitor->Fill(eName);
422  }
423 
424  double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity");
425  double maxInstantLuminosity = m_parameters.getParameter<double>("maxInstantLuminosity");
426 
427  // Getting rate fit parameters for all input triggers
428  for(map<string,string>::const_iterator a=m_selectedTriggers.begin() ; a!=m_selectedTriggers.end() ; a++){
429 
430  string tTrigger = (*a).second;
431 
432  // If trigger name is defined we get the rate fit parameters
433  if(tTrigger != "Undefined"){
434 
435  if(wbmFits.find(tTrigger) != wbmFits.end()){
436 
437  WbMTriggerXSecFit tWbMParameters = wbmFits[tTrigger];
438 
439  vector<double> tParameters;
440  tParameters.push_back(tWbMParameters.pm1);
441  tParameters.push_back(tWbMParameters.p0);
442  tParameters.push_back(tWbMParameters.p1);
443  tParameters.push_back(tWbMParameters.p2);
444 
445  // Retriving and populating the m_templateFunctions array
446  m_templateFunctions[tTrigger] = new TF1("FitParametrization_"+tWbMParameters.bitName,
447  tWbMParameters.fitFunction,
448  minInstantLuminosity,maxInstantLuminosity);
449  m_templateFunctions[tTrigger] ->SetParameters(&tParameters[0]);
450  m_templateFunctions[tTrigger] ->SetLineWidth(1);
451  m_templateFunctions[tTrigger] ->SetLineColor(kRed);
452 
453  }else{noError = false;}
454  }
455  }
456 
457  return noError;
458 
459 }
460 
461 //_____________________________________________________________________
462 // function: getXSexFitsPython
463 // Imputs:
464 // * const edm::ParameterSet& ps = ParameterSet contaning the fit
465 // functions and parameters for the selected triggers
466 // Outputs:
467 // * int error = Number of algos where you did not find a
468 // corresponding fit
469 //_____________________________________________________________________
471 
472  // error meaning
473  bool noError = true;
474 
475  // Getting fit parameters
476  std::vector<edm::ParameterSet> m_fitParameters = ps.getParameter< vector<ParameterSet> >("fitParameters");
477 
478  double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity");
479  double maxInstantLuminosity = m_parameters.getParameter<double>("maxInstantLuminosity");
480 
481  // Getting rate fit parameters for all input triggers
482  for(map<string,string>::const_iterator a=m_selectedTriggers.begin() ; a!=m_selectedTriggers.end() ; a++){
483 
484  string tTrigger = (*a).second;
485 
486  // If trigger name is defined we get the rate fit parameters
487  if(tTrigger != "Undefined"){
488 
489  bool foundFit = false;
490 
491  for(unsigned int b=0 ; b<m_fitParameters.size() ; b++){
492 
493  if(tTrigger == m_fitParameters[b].getParameter<string>("AlgoName")){
494 
495  TString tAlgoName = m_fitParameters[b].getParameter< string > ("AlgoName");
496  TString tTemplateFunction = m_fitParameters[b].getParameter< string > ("TemplateFunction");
497  vector<double> tParameters = m_fitParameters[b].getParameter< vector<double> >("Parameters");
498 
499  // Retriving and populating the m_templateFunctions array
500  m_templateFunctions[tTrigger] = new TF1("FitParametrization_"+tAlgoName,tTemplateFunction,
501  minInstantLuminosity,maxInstantLuminosity);
502  m_templateFunctions[tTrigger] ->SetParameters(&tParameters[0]);
503  m_templateFunctions[tTrigger] ->SetLineWidth(1);
504  m_templateFunctions[tTrigger] ->SetLineColor(kRed);
505 
506  foundFit = true;
507  break;
508  }
509 
510  if(!foundFit){
511  noError = false;
512  string eName = "WARNING_PY_MISSING_FIT";
513  m_ErrorMonitor->Fill(eName);
514  }
515  }
516  }
517  }
518 
519  return noError;
520 
521 }
RunNumber_t run() const
Definition: EventID.h:39
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_colLScal
Definition: L1TRate.h:103
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_triggerScalers
Definition: L1TRate.h:104
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:201
std::map< int, std::map< TString, double > > m_lsRates
Definition: L1TRate.h:94
bool connect(std::string iOracleDB, std::string iPathCondDB, int &error)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::map< TString, MonitorElement * > m_xSecObservedToExpected
Definition: L1TRate.h:98
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TRate.h:105
const std::vector< L1GtFdlWord > gtFdlVector() const
get the vector of L1GtFdlWord
edm::ParameterSet m_parameters
Definition: L1TRate.h:108
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< TString, TF1 * > m_templateFunctions
Definition: L1TRate.h:100
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
bool m_verbose
Definition: L1TRate.h:78
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:208
void Fill(long long x)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
L1GtUtils m_l1GtUtils
Definition: L1TRate.h:116
std::vector< double > gtAlgoCountsRate() const
int m_lsShiftGTRates
Definition: L1TRate.h:83
int iEvent
Definition: GenABIO.cc:230
bool getXSexFitsPython(const edm::ParameterSet &ps)
Definition: L1TRate.cc:470
int m_maxNbins
Definition: L1TRate.h:82
std::map< int, double > m_lsLuminosity
Definition: L1TRate.h:93
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< TString, int > m_algoBit
Definition: L1TRate.h:95
int m_refPrescaleSet
Definition: L1TRate.h:81
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:121
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
L1TRate(const edm::ParameterSet &ps)
Definition: L1TRate.cc:33
bool getXSexFitsOMDS(const edm::ParameterSet &ps)
Definition: L1TRate.cc:395
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TRate.cc:291
bool isValid() const
Definition: HandleBase.h:74
std::string m_outputFile
Definition: L1TRate.h:86
def ls(path, rec=False)
Definition: eostools.py:348
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const std::vector< std::vector< int > > * m_listsPrescaleFactors
Definition: L1TRate.h:89
const T & get() const
Definition: EventSetup.h:59
double b
Definition: hdecay.h:120
LuminosityBlockNumber_t luminosityBlock() const
~L1TRate() override
Definition: L1TRate.cc:75
std::map< TString, MonitorElement * > m_xSecVsInstLumi
Definition: L1TRate.h:99
std::map< std::string, bool > m_inputCategories
Definition: L1TRate.h:96
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
double a
Definition: hdecay.h:121
MonitorElement * m_ErrorMonitor
Definition: L1TRate.h:111
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
unsigned int getEtaRangeByAlias(const TString &iCategory, const TString &iAlias)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TRate.cc:196
int getPrescaleByAlias(const TString &iCategory, const TString &iAlias)
T const * product() const
Definition: ESHandle.h:86
std::map< int, int > m_lsPrescaleIndex
Definition: L1TRate.h:92
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TRate.h:97
Definition: Run.h:43
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Definition: L1TRate.cc:80