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