CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TBPTX.cc
Go to the documentation of this file.
2 
4 
7 
8 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
9 
17 
18 // Luminosity Information
19 //#include "DataFormats/Luminosity/interface/LumiDetails.h"
20 //#include "DataFormats/Luminosity/interface/LumiSummary.h"
21 
22 // L1TMonitor includes
24 
25 #include "TList.h"
26 
27 using namespace edm;
28 using namespace std;
29 
30 //-------------------------------------------------------------------------------------
31 //-------------------------------------------------------------------------------------
33 
34  m_parameters = pset;
35 
36  // Mapping parameter input variables
37  m_scalersSource = consumes<Level1TriggerScalersCollection>(pset.getParameter <InputTag>("inputTagScalersResults"));
38  m_l1GtDataDaqInputTag = consumes<L1GlobalTriggerReadoutRecord>(pset.getParameter <InputTag>("inputTagL1GtDataDaq"));
39  m_l1GtEvmSource = consumes<L1GlobalTriggerEvmReadoutRecord>(pset.getParameter <InputTag>("inputTagtEvmSource"));
40  m_verbose = pset.getUntrackedParameter<bool> ("verbose",false);
41 // m_refPrescaleSet = pset.getParameter <int> ("refPrescaleSet");
42 
43  m_monitorBits = pset.getParameter< vector<ParameterSet> >("MonitorBits");
44 
45  for(unsigned i=0; i<m_monitorBits.size(); i++){
46 
47  // Algorithms
48  if(m_monitorBits[i].getParameter<bool>("bitType")){
49 
50  int bit = m_monitorBits[i].getParameter<int>("bitNumber");
51  int offset = m_monitorBits[i].getParameter<int>("bitOffset");
52  m_selAlgoBit.push_back( pair<int,int>(bit,offset) );
53  }
54  // Tech
55  else{
56  int bit = m_monitorBits[i].getParameter<int>("bitNumber");
57  int offset = m_monitorBits[i].getParameter<int>("bitOffset");
58  m_selTechBit.push_back( pair<int,int>(bit,offset) );
59  }
60  }
61 
62  m_monitorRates = pset.getParameter< vector<ParameterSet> >("MonitorRates");
63 
64  if (pset.getUntrackedParameter < bool > ("dqmStore", false)) {
65  dbe = Service < DQMStore > ().operator->();
66  dbe->setVerbose(0);
67  }
68 
69 }
70 
71 //-------------------------------------------------------------------------------------
72 //-------------------------------------------------------------------------------------
74 
75 //-------------------------------------------------------------------------------------
76 //-------------------------------------------------------------------------------------
77 void L1TBPTX::beginJob(void){
78 
79  if (m_verbose){cout << "[L1TBPTX] Called beginJob." << endl;}
80 
81  // get hold of back-end interface
82  DQMStore *dbe = 0;
83  dbe = Service < DQMStore > ().operator->();
84 
85  if (dbe) {
86  dbe->setCurrentFolder("L1T/L1TBPTX");
87  dbe->rmdir("L1T/L1TBPTX");
88  }
89 
90 }
91 
92 //-------------------------------------------------------------------------------------
93 //-------------------------------------------------------------------------------------
94 void L1TBPTX::endJob(void){
95 
96  if (m_verbose){cout << "[L1TBPTX] Called endJob." << endl;}
97 
98  if (m_outputFile.size() != 0 && dbe)
99  dbe->save(m_outputFile);
100 
101  return;
102 
103 }
104 
105 //-------------------------------------------------------------------------------------
107 //-------------------------------------------------------------------------------------
108 void L1TBPTX::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup){
109 
110  if (m_verbose){cout << "[L1TBPTX] Called beginRun." << endl;}
111 
112  // Initializing variables
113  int maxNbins = 2501;
114 
115  // Reseting run dependent variables
116  m_lhcFill = 0;
117  m_currentLS = 0;
118 
119  // Getting Trigger menu from GT
121  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
122  const L1GtTriggerMenu* menu = menuRcd.product();
123 
124  // Filling Alias-Bit Map
125  for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo!=menu->gtAlgorithmAliasMap().end(); ++algo){
126  m_algoBit_Alias[(algo->second).algoBitNumber()] = (algo->second).algoAlias();
127  }
128 
129  for (CItAlgo algo = menu->gtTechnicalTriggerMap().begin(); algo!=menu->gtTechnicalTriggerMap().end(); ++algo){
130  m_techBit_Alias[(algo->second).algoBitNumber()] = (algo->second).algoName();
131  }
132 
133  // Initializing DQM Monitor Elements
134  dbe->setCurrentFolder("L1T/L1TBPTX");
135  m_ErrorMonitor = dbe->book1D("ErrorMonitor","ErrorMonitor",7,0,7);
136  m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN");
137  m_ErrorMonitor->setBinLabel(WARNING_DB_CONN_FAILED ,"WARNING_DB_CONN_FAILED"); // Errors from L1TOMDSHelper
138  m_ErrorMonitor->setBinLabel(WARNING_DB_QUERY_FAILED ,"WARNING_DB_QUERY_FAILED"); // Errors from L1TOMDSHelper
139  m_ErrorMonitor->setBinLabel(WARNING_DB_INCORRECT_NBUNCHES,"WARNING_DB_INCORRECT_NBUNCHES"); // Errors from L1TOMDSHelper
140  m_ErrorMonitor->setBinLabel(ERROR_UNABLE_RETRIVE_PRODUCT ,"ERROR_UNABLE_RETRIVE_PRODUCT");
141  m_ErrorMonitor->setBinLabel(ERROR_TRIGGERALIAS_NOTVALID ,"ERROR_TRIGGERALIAS_NOTVALID");
142  m_ErrorMonitor->setBinLabel(ERROR_LSBLOCK_NOTVALID ,"ERROR_LSBLOCK_NOTVALID");
143 
144  for(unsigned i=0; i<m_monitorBits.size(); i++){
145 
146  bool isAlgo = m_monitorBits[i].getParameter<bool> ("bitType");
147  TString testName = m_monitorBits[i].getParameter<string>("testName");
148  int bit = m_monitorBits[i].getParameter<int> ("bitNumber");
149 
150  TString meTitle = "";
151  dbe->setCurrentFolder("L1T/L1TBPTX/Efficiency/");
152  if(isAlgo){
153  meTitle="Algo ";meTitle+=bit; meTitle+=" - "; meTitle+=m_algoBit_Alias[bit]; meTitle+=" Efficiency";
154  m_meAlgoEfficiency[bit] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
155  m_meAlgoEfficiency[bit]->setAxisTitle("Lumi Section" ,1);
156  }
157  else{
158  meTitle="Tech "; meTitle+=bit; meTitle+=" - "; meTitle+=m_techBit_Alias[bit]; meTitle+=" Efficiency";
159  m_meTechEfficiency[bit] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
160  m_meTechEfficiency[bit]->setAxisTitle("Lumi Section" ,1);
161  }
162 
163  meTitle = "";
164  dbe->setCurrentFolder("L1T/L1TBPTX/MissFire/");
165  if(isAlgo){
166  meTitle="Algo "; meTitle+=bit; meTitle+=" - "; meTitle+=m_algoBit_Alias[bit]; meTitle+="(1 - Miss Fire Rate)";
167  m_meAlgoMissFire[bit] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
168  m_meAlgoMissFire[bit]->setAxisTitle("Lumi Section" ,1);
169  m_meAlgoMissFire[bit]->setAxisTitle("1 - Miss Fire Rate",2);
170  }
171  else{
172  meTitle="Tech "; meTitle+=bit; meTitle+=" - "; meTitle+=m_techBit_Alias[bit]; meTitle+="(1 - Miss Fire Rate)";
173  m_meTechMissFire[bit] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
174  m_meTechMissFire[bit]->setAxisTitle("Lumi Section" ,1);
175  m_meTechMissFire[bit]->setAxisTitle("1 - Miss Fire Rate",2);
176  }
177  }
178 
179  for(unsigned i=0; i<m_monitorRates.size(); i++){
180 
181  TString testName = m_monitorRates[i].getParameter<string>("testName");
182  bool isAlgo = m_monitorRates[i].getParameter<bool> ("bitType");
183  int bit = m_monitorRates[i].getParameter<int> ("bitNumber");
184 
185  pair<bool,int> refME = pair<bool,int>(isAlgo,bit);
186 
187  TString meTitle = "";
188  dbe->setCurrentFolder("L1T/L1TBPTX/Rate/");
189  if(isAlgo){
190  meTitle="Algo "+bit; meTitle+=" - "; meTitle+=m_algoBit_Alias[bit]; meTitle+=" Rate";
191  m_meRate[refME] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
192  m_meRate[refME]->setAxisTitle("Lumi Section" ,1);
193  m_meRate[refME]->setAxisTitle("Rate (unprescaled) [Hz]",2);
194  }
195  else{
196  meTitle="Tech "+bit; meTitle+=" - "; meTitle+=m_techBit_Alias[bit]; meTitle+=" Rate";
197  m_meRate[refME] = dbe->book1D(testName,meTitle,maxNbins,-0.5,double(maxNbins)-0.5);
198  m_meRate[refME]->setAxisTitle("Lumi Section" ,1);
199  m_meRate[refME]->setAxisTitle("Rate (unprescaled) [Hz]",2);
200  }
201  }
202 
203 
204 
205  //_____________________________________________________________________
206  // Getting the prescale columns definition for this run
209 
210  iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
211  iSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
212 
213  if(l1GtPfAlgo.isValid()){
214  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
215  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors());
216  }else{
217  //TODO: Some error handling
218  }
219 
220  if(l1GtPfAlgo.isValid()){
221  const L1GtPrescaleFactors* m_l1GtPfTech = l1GtPfTech.product();
222  m_prescaleFactorsTechTrig = &(m_l1GtPfTech->gtPrescaleFactors());
223  }else{
224  //TODO: Some error handling
225  }
226 
227 }
228 
229 //_____________________________________________________________________
230 // Function: beginLuminosityBlock
231 //_____________________________________________________________________
233 
234  if (m_verbose){cout << "[L1TBPTX] Called beginLuminosityBlock." << endl;}
235 
236  // Updating current LS number
237  m_currentLS = lumiBlock.id().luminosityBlock();
238 
239  // A LS will be valid if BeamMode==STABLE for all events monitored
240  m_currentLSValid = true;
241 
242  for(unsigned i=0; i<m_monitorBits.size(); i++){
243 
244  TString triggerName = "";
245  if(m_monitorBits[i].getParameter<bool>("bitType")){
246  triggerName = "algo_"+m_monitorBits[i].getParameter<int>("bitNumber");
247  }else{
248  triggerName = "tech_"+m_monitorBits[i].getParameter<int>("bitNumber");
249  }
250 
251  m_effNumerator [triggerName] = 0;
252  m_effDenominator [triggerName] = 0;
253  m_missFireNumerator [triggerName] = 0;
254  m_missFireDenominator[triggerName] = 0;
255 
256  }
257 
258 }
259 
260 //_____________________________________________________________________
261 // Function: endLuminosityBlock
262 // * Fills LS by LS ration of trigger out of sync
263 //_____________________________________________________________________
264 void L1TBPTX::endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) {
265 
266  //______________________________________________________________________________
267  // Monitoring efficiencies
268  //______________________________________________________________________________
269  if(m_verbose){cout << "[L1TBPTX] Called endLuminosityBlock." << endl;}
270 
271  // If this LS is valid (i.e. all events recorded with stable beams)
272  if(m_currentLSValid && m_beamConfig.isValid()){
273 
274  for(unsigned i=0; i<m_monitorBits.size(); i++){
275 
276  bool isAlgo = m_monitorBits[i].getParameter<bool> ("bitType");
277  TString testName = m_monitorBits[i].getParameter<string>("testName");
278  int bit = m_monitorBits[i].getParameter<int> ("bitNumber");
279 
280  TString triggerName;
281  if(isAlgo){triggerName = "algo_"+bit;}
282  else {triggerName = "tech_"+bit;}
283 
284  double valEff;
285  double valMiss;
286  if(m_effDenominator[triggerName]!=0) {valEff = (double)m_effNumerator[triggerName]/m_effDenominator[triggerName];}
287  else {valEff = 0;}
288  if(m_missFireDenominator[triggerName]!=0){valMiss = (double)m_missFireNumerator[triggerName]/m_missFireDenominator[triggerName];}
289  else {valMiss = 0;}
290 
291  if(isAlgo){
292  int bin = m_meAlgoEfficiency[bit]->getTH1()->FindBin(m_currentLS);
293  m_meAlgoEfficiency[bit]->setBinContent(bin,valEff);
294  m_meAlgoMissFire[bit] ->setBinContent(bin,1-valMiss);
295  }
296  else{
297  int bin = m_meTechEfficiency[bit]->getTH1()->FindBin(m_currentLS);
298  m_meTechEfficiency[bit]->setBinContent(bin,valEff);
299  m_meTechMissFire[bit] ->setBinContent(bin,1-valMiss);
300  }
301  }
302  }
303 
304  //______________________________________________________________________________
305  // Monitoring rates
306  //______________________________________________________________________________
307  // We are only interested in monitoring lumisections where the the LHC state is
308  // RAMP, FLATTOP, SQUEEZE, ADJUST or STABLE since the bunch configuration and
309  // therefore the BPTX rate will not change.
310 
311  if(m_currentLSValid){
312 
313  const vector<int>& currentPFAlgo = (*m_prescaleFactorsAlgoTrig).at(m_currentPrescalesIndex);
314  const vector<int>& currentPFTech = (*m_prescaleFactorsTechTrig).at(m_currentPrescalesIndex);
315 
316  for(unsigned i=0; i<m_monitorRates.size(); i++){
317 
318  bool isAlgo = m_monitorRates[i].getParameter<bool> ("bitType");
319  int bit = m_monitorRates[i].getParameter<int> ("bitNumber");
320 
321  pair<bool,int> refME = pair<bool,int>(isAlgo,bit);
322 
323  if(isAlgo){
324  int bin = m_meRate[refME]->getTH1()->FindBin(m_currentGTLS);
325  int trigPS = currentPFAlgo[bit];
326  double trigRate = (double) trigPS*m_l1Rate[refME];
327  m_meRate[refME]->setBinContent(bin,trigRate);
328 
329  }else{
330  int bin = m_meRate[refME]->getTH1()->FindBin(m_currentGTLS);
331  int trigPS = currentPFTech[bit];
332  double trigRate = (double) trigPS*m_l1Rate[refME];
333  m_meRate[refME]->setBinContent(bin,trigRate);
334  }
335  }
336  }
337 }
338 
339 //_____________________________________________________________________
340 void L1TBPTX::endRun(const edm::Run& run, const edm::EventSetup& iSetup){
341 
342  if(m_verbose){cout << "[L1TBPTX] Called endRun." << endl;}
343 
344 
345 }
346 
347 //_____________________________________________________________________
348 void L1TBPTX::analyze(const Event & iEvent, const EventSetup & eventSetup){
349 
350  if(m_verbose){cout << "[L1TBPTX] Called analyze." << endl;}
351 
352  // We only start analyzing if current LS is still valid
353  if(m_currentLSValid){
354 
355  if(m_verbose){cout << "[L1TBPTX] -> m_currentLSValid=" << m_currentLSValid << endl;}
356 
357  // Retriving information from GT
359  iEvent.getByToken(m_l1GtEvmSource, gtEvmReadoutRecord);
360 
361  // Determining beam mode and fill number
362  if(gtEvmReadoutRecord.isValid()){
363 
364  const L1GtfeExtWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
365  unsigned int lhcBeamMode = gtfeEvmWord.beamMode(); // Updating beam mode
366 
367  if(m_verbose){cout << "[L1TBPTX] Beam mode: "<< lhcBeamMode << endl;}
368 
369  if(lhcBeamMode==RAMP || lhcBeamMode==FLATTOP || lhcBeamMode==SQUEEZE || lhcBeamMode==ADJUST || lhcBeamMode==STABLE){
370 
371  if(m_lhcFill==0){
372 
373  if(m_verbose){cout << "[L1TBPTX] No valid bunch structure yet retrived. Attemptting to retrive..." << endl;}
374 
375  m_lhcFill = gtfeEvmWord.lhcFillNumber(); // Getting LHC Fill Number from GT
376 
377  getBeamConfOMDS(); // Getting Beam Configuration from OMDS
378 
379  // We are between RAMP and STABLE so there should be some colliding bunches
380  // in the machine. If 0 colliding bunched are found might be due to a delay
381  // of the update of the database. So we declare this LS as invalid and try
382  // again on the next one.
383  if(m_beamConfig.nCollidingBunches<=0){
384  m_lhcFill=0;
385  m_currentLSValid=false;
386  }
387  }
388  }
389  else{m_currentLSValid=false;}
390 
391  }else{
392  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
393  eCount++;
394  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
395  }
396  }
397 
398  //______________________________________________________________________________
399  // If current LS is valid and Beam Configuration is Valid we analyse this event
400  //______________________________________________________________________________
401  if(m_currentLSValid && m_beamConfig.isValid()){
402 
403  if(m_verbose){cout << "Current event in valid LS and beam config" << endl;}
404 
405  // Getting Final Decision Logic (FDL) Data from GT
406  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
407  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
408 
409  if(gtReadoutRecordData.isValid()){
410 
411  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
412 
413  // Getting the index for the fdl data for this event
414  int eventFDL=0;
415  for(unsigned int i=0; i<gtFdlVectorData.size(); i++){
416  if(gtFdlVectorData[i].bxInEvent()==0){eventFDL=i; break;}
417  }
418 
419  m_currentPrescalesIndex = gtFdlVectorData[eventFDL].gtPrescaleFactorIndexAlgo();
420 
421  for(unsigned i=0; i<m_monitorBits.size(); i++){
422 
423  TString triggerName = "";
424  bool isAlgo = m_monitorBits[i].getParameter<bool>("bitType");
425  int bit = m_monitorBits[i].getParameter<int> ("bitNumber");
426  int offset = m_monitorBits[i].getParameter<int> ("bitOffset");
427 
428  if(isAlgo){triggerName = "algo_"+bit;}
429  else {triggerName = "tech_"+bit;}
430 
431  int evBxStart = -2;
432  int evBxEnd = 2;
433 
434  if(offset<0){evBxStart+=-1*offset;}
435  if(offset>0){evBxEnd +=-1*offset;}
436 
437  for(unsigned a=0; a<gtFdlVectorData.size(); a++){
438 
439  int testBx = gtFdlVectorData[a].localBxNr()-offset;
440  bool lhcBxFilled = m_beamConfig.beam1[testBx] && m_beamConfig.beam2[testBx];
441  bool algoFired = false;
442 
443  if(isAlgo){
444  if(gtFdlVectorData[a].gtDecisionWord()[bit]){algoFired=true;}
445 
446  }
447  else{
448  if(gtFdlVectorData[a].gtTechnicalTriggerWord()[bit]){algoFired=true;}
449  }
450 
451  if(lhcBxFilled) {m_effDenominator[triggerName]++;}
452  if(lhcBxFilled && algoFired){m_effNumerator [triggerName]++;}
453 
454  if(algoFired) {m_missFireNumerator[triggerName]++;}
455  if(algoFired && !lhcBxFilled){m_missFireNumerator[triggerName]++;}
456 
457  }
458  }
459  }
460  }
461 
462  //______________________________________________________________________________
463  // Rate calculation
464  //______________________________________________________________________________
466  iEvent.getByToken(m_scalersSource,triggerScalers);
467 
468  if(triggerScalers.isValid()){
469 
470  Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin();
471  Level1TriggerRates trigRates(*itL1TScalers,iEvent.id().run());
472 
473  m_currentGTLS= (*itL1TScalers).lumiSegmentNr();
474 
475  for(unsigned i=0; i<m_monitorRates.size(); i++){
476 
477  bool isAlgo = m_monitorRates[i].getParameter<bool>("bitType");
478  int bit = m_monitorRates[i].getParameter<int> ("bitNumber");
479 
480  pair<bool,int> refTrig = pair<bool,int>(isAlgo,bit);
481 
482  if(isAlgo){m_l1Rate[refTrig] = trigRates.gtAlgoCountsRate()[bit];}
483  else {m_l1Rate[refTrig] = trigRates.gtTechCountsRate()[bit];}
484  }
485  }
486 
487 }
488 
489 //_____________________________________________________________________
490 // Method: getBunchStructureOMDS
491 // Description: Attempt to retrive Beam Configuration from OMDS and if
492 // we find error handle it
493 //_____________________________________________________________________
495 
496  if(m_verbose){cout << "[L1TBPTX] Called getBeamConfOMDS()" << endl;}
497 
498  //Getting connection paremeters
499  string oracleDB = m_parameters.getParameter<string>("oracleDB");
500  string pathCondDB = m_parameters.getParameter<string>("pathCondDB");
501 
502  // Connecting to OMDS
503  L1TOMDSHelper myOMDSHelper = L1TOMDSHelper();
504  int conError;
505  myOMDSHelper.connect(oracleDB,pathCondDB,conError);
506 
507  if(conError == L1TOMDSHelper::NO_ERROR){
508 
509  if(m_verbose){cout << "[L1TBPTX] Connected to DB with no error." << endl;}
510 
511  int errorRetrive;
512  m_beamConfig = myOMDSHelper.getBeamConfiguration(m_lhcFill,errorRetrive);
513 
514  if(errorRetrive == L1TOMDSHelper::NO_ERROR){
515  if(m_verbose){
516  cout << "[L1TBPTX] Retriving LHC Bunch Structure: NO_ERROR" << endl;
517  cout << "[L1TSync] -> LHC Bunch Structure valid=" << m_beamConfig.m_valid << " nBunches=" << m_beamConfig.nCollidingBunches << endl;
518  }
519  }
520  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_QUERY_FAILED){
521  if(m_verbose){cout << "[L1TBPTX] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;}
522 
523  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_QUERY_FAILED);
524  eCount++;
525  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_QUERY_FAILED,eCount);
526  }
527  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_INCORRECT_NBUNCHES){
528  if(m_verbose){cout << "[L1TBPTX] Retriving LHC Bunch Structure: WARNING_DB_INCORRECT_NBUNCHES" << endl;}
529 
530  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_INCORRECT_NBUNCHES);
531  eCount++;
532  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_INCORRECT_NBUNCHES,eCount);
533  }
534  else{
535  if(m_verbose){cout << "[L1TBPTX] Retriving LHC Bunch Structure: UNKNOWN" << endl;}
536  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
537  eCount++;
538  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
539  }
540 
541  }
542  else if(conError == L1TOMDSHelper::WARNING_DB_CONN_FAILED){
543  if(m_verbose){cout << "[L1TBPTX] Connection to DB: WARNING_DB_CONN_FAILED" << endl;}
544  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_CONN_FAILED);
545  eCount++;
546  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_CONN_FAILED,eCount);
547  }
548  else{
549  if(m_verbose){cout << "[L1TBPTX] Connection to DB: UNKNOWN" << endl;}
550  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
551  eCount++;
552  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
553  }
554 }
555 
556 //_____________________________________________________________________
557 // Method: doFractionInSync
558 // Description: Produce plot with the fraction of in sync trigger for
559 // LS blocks with enough statistics.
560 // Variable: iForce - Forces closing of all blocks and calculation of
561 // the respective fractions
562 // Variable: iBad - (Only works with iForce=true) Forces the current
563 // all current blocks to be marked as bad
564 //_____________________________________________________________________
565 void L1TBPTX::doFractionInSync(bool iForce,bool iBad){
566 
567 }
568 
569 
570 //_____________________________________________________________________
571 // Method: certifyLSBlock
572 // Description: Fill the trigger certification plot by blocks
573 // Variable: iTrigger - Which trigger to certify
574 // Variable: iInitLs - Blocks initial LS
575 // Variable: iEndLs - Blocks end LS
576 // Variable: iValue - Value to be used to fill
577 //_____________________________________________________________________
578 void L1TBPTX::certifyLSBlock(string iTrigger, int iInitLs, int iEndLs ,float iValue){
579 
580 }
581 
582 //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
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: L1TBPTX.cc:348
int i
Definition: DBlmapReader.cc:9
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TBPTX.cc:565
virtual void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
Definition: L1TBPTX.cc:264
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3051
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
Definition: L1TBPTX.cc:232
0: Unidentified isolated particle
Definition: ParticleCode.h:19
L1TBPTX(const edm::ParameterSet &ps)
Definition: L1TBPTX.cc:32
DEFINE_FWK_MODULE(HiMixingModule)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::vector< double > gtAlgoCountsRate() const
void beginJob()
Definition: L1TBPTX.cc:77
virtual ~L1TBPTX()
Definition: L1TBPTX.cc:73
int iEvent
Definition: GenABIO.cc:230
unsigned int offset(bool)
bool isValid() const
Definition: HandleBase.h:76
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
Definition: L1TBPTX.cc:578
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
void endRun(const edm::Run &run, const edm::EventSetup &iSetup)
Definition: L1TBPTX.cc:340
const cms_uint32_t lhcFillNumber() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
LuminosityBlockNumber_t luminosityBlock() const
edm::EventID id() const
Definition: EventBase.h:56
double a
Definition: hdecay.h:121
void getBeamConfOMDS()
Definition: L1TBPTX.cc:494
tuple cout
Definition: gather_cfg.py:121
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
bool isValid() const
Definition: ESHandle.h:37
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup)
BeginRun.
Definition: L1TBPTX.cc:108
const cms_uint16_t beamMode() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void endJob(void)
Definition: L1TBPTX.cc:94
Definition: Run.h:41