CMS 3D CMS Logo

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