CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TSync_Offline.cc
Go to the documentation of this file.
1 
22 //
23 
24 // This class header
26 
27 // System include files
28 // --
29 
30 // User include files
32 
36 
37 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
38 
46 // Luminosity Information
47 //#include "DataFormats/Luminosity/interface/LumiDetails.h"
48 //#include "DataFormats/Luminosity/interface/LumiSummary.h"
49 
50 // L1TMonitor includes
52 //#include "DQMOffline/L1Trigger/interface/L1TMenuHelper.h"
53 
54 #include "TList.h"
55 
56 using namespace edm;
57 using namespace std;
58 
59 //-------------------------------------------------------------------------------------
60 //-------------------------------------------------------------------------------------
62 
63  m_parameters = pset;
64 
65  // Mapping parameter input variables
66  m_l1GtDataDaqInputTag = consumes<L1GlobalTriggerReadoutRecord>(pset.getParameter <InputTag>("inputTagL1GtDataDaq"));
67  m_l1GtEvmSource = consumes<L1GlobalTriggerEvmReadoutRecord>(pset.getParameter <InputTag>("inputTagtEvmSource"));
68  m_verbose = pset.getUntrackedParameter<bool> ("verbose",false);
69  m_refPrescaleSet = pset.getParameter <int> ("refPrescaleSet");
70 
71  // Getting which categories to monitor
72  ParameterSet Categories = pset.getParameter< ParameterSet >("Categories");
73 
74  bool forceGlobalParameters = Categories.getParameter<bool>("forceGlobalParameters");
75  bool doGlobalAutoSelection = Categories.getParameter<bool>("doGlobalAutoSelection");
76 
77  ParameterSet CatBPTX = Categories.getParameter<ParameterSet>("BPTX");
78  ParameterSet CatMu = Categories.getParameter<ParameterSet>("Mu");
79  ParameterSet CatEG = Categories.getParameter<ParameterSet>("EG");
80  ParameterSet CatIsoEG = Categories.getParameter<ParameterSet>("IsoEG");
81  ParameterSet CatJet = Categories.getParameter<ParameterSet>("Jet");
82  ParameterSet CatCenJet = Categories.getParameter<ParameterSet>("CenJet");
83  ParameterSet CatForJet = Categories.getParameter<ParameterSet>("ForJet");
84  ParameterSet CatTauJet = Categories.getParameter<ParameterSet>("TauJet");
85  ParameterSet CatETM = Categories.getParameter<ParameterSet>("ETT");
86  ParameterSet CatETT = Categories.getParameter<ParameterSet>("ETM");
87  ParameterSet CatHTT = Categories.getParameter<ParameterSet>("HTT");
88  ParameterSet CatHTM = Categories.getParameter<ParameterSet>("HTM");
89 
90  // --> Setting parameters related to which algos to monitor
91  // If global parameters are forced they take precedence over algo-by-algo parameters
92  if(forceGlobalParameters){
93 
94  // If global automatic selection if enable all categories set to be monitored will have
95  // their algos auto selected (the lowest prescale algo will be selected)
96  if(doGlobalAutoSelection){
97 
98  if(CatMu .getParameter<bool>("monitor")){m_algoAutoSelect["Mu"] = true;}else{m_algoAutoSelect["Mu"] = false;}
99  if(CatEG .getParameter<bool>("monitor")){m_algoAutoSelect["EG"] = true;}else{m_algoAutoSelect["EG"] = false;}
100  if(CatIsoEG .getParameter<bool>("monitor")){m_algoAutoSelect["IsoEG"] = true;}else{m_algoAutoSelect["IsoEG"] = false;}
101  if(CatJet .getParameter<bool>("monitor")){m_algoAutoSelect["Jet"] = true;}else{m_algoAutoSelect["Jet"] = false;}
102  if(CatCenJet.getParameter<bool>("monitor")){m_algoAutoSelect["CenJet"] = true;}else{m_algoAutoSelect["CenJet"] = false;}
103  if(CatForJet.getParameter<bool>("monitor")){m_algoAutoSelect["ForJet"] = true;}else{m_algoAutoSelect["ForJet"] = false;}
104  if(CatTauJet.getParameter<bool>("monitor")){m_algoAutoSelect["TauJet"] = true;}else{m_algoAutoSelect["TauJet"] = false;}
105  if(CatETM .getParameter<bool>("monitor")){m_algoAutoSelect["ETM"] = true;}else{m_algoAutoSelect["ETM"] = false;}
106  if(CatETT .getParameter<bool>("monitor")){m_algoAutoSelect["ETT"] = true;}else{m_algoAutoSelect["ETT"] = false;}
107  if(CatHTM .getParameter<bool>("monitor")){m_algoAutoSelect["HTM"] = true;}else{m_algoAutoSelect["HTM"] = false;}
108  if(CatHTT .getParameter<bool>("monitor")){m_algoAutoSelect["HTT"] = true;}else{m_algoAutoSelect["HTT"] = false;}
109 
110  // If global non-automatic selection is enable all categories set to be monitored will use
111  // user defined algos
112  }else{
113 
114  m_algoAutoSelect["Mu"] = false;
115  m_algoAutoSelect["EG"] = false;
116  m_algoAutoSelect["IsoEG"] = false;
117  m_algoAutoSelect["Jet"] = false;
118  m_algoAutoSelect["CenJet"] = false;
119  m_algoAutoSelect["ForJet"] = false;
120  m_algoAutoSelect["TauJet"] = false;
121  m_algoAutoSelect["ETM"] = false;
122  m_algoAutoSelect["ETT"] = false;
123  m_algoAutoSelect["HTM"] = false;
124  m_algoAutoSelect["HTT"] = false;
125 
126  if(CatMu .getParameter<bool>("monitor")){m_selectedTriggers["Mu"] = CatMu .getParameter<string>("algo");}
127  if(CatEG .getParameter<bool>("monitor")){m_selectedTriggers["EG"] = CatEG .getParameter<string>("algo");}
128  if(CatIsoEG .getParameter<bool>("monitor")){m_selectedTriggers["IsoEG"] = CatIsoEG .getParameter<string>("algo");}
129  if(CatJet .getParameter<bool>("monitor")){m_selectedTriggers["Jet"] = CatJet .getParameter<string>("algo");}
130  if(CatCenJet.getParameter<bool>("monitor")){m_selectedTriggers["CenJet"] = CatCenJet.getParameter<string>("algo");}
131  if(CatForJet.getParameter<bool>("monitor")){m_selectedTriggers["CatForJet"] = CatForJet.getParameter<string>("algo");}
132  if(CatTauJet.getParameter<bool>("monitor")){m_selectedTriggers["TauJet"] = CatTauJet.getParameter<string>("algo");}
133  if(CatETM .getParameter<bool>("monitor")){m_selectedTriggers["ETM"] = CatETM .getParameter<string>("algo");}
134  if(CatETT .getParameter<bool>("monitor")){m_selectedTriggers["ETT"] = CatETT .getParameter<string>("algo");}
135  if(CatHTM .getParameter<bool>("monitor")){m_selectedTriggers["HTM"] = CatHTM .getParameter<string>("algo");}
136  if(CatHTT .getParameter<bool>("monitor")){m_selectedTriggers["HTT"] = CatHTT .getParameter<string>("algo");}
137 
138  }
139 
140  // If we are using algo-by-algo parametes we get them and set what is needed
141  }else{
142 
143  if(CatBPTX.getParameter<bool>("monitor")){
144  m_selectedTriggers["BPTX"] = CatBPTX.getParameter<string>("algo");
145  }
146 
147  if(CatMu.getParameter<bool>("monitor")){
148  m_algoAutoSelect["Mu"] = CatMu.getParameter<bool>("doAutoSelection");
149  if(!m_algoAutoSelect["Mu"]){m_selectedTriggers["Mu"] = CatMu.getParameter<string>("algo");}
150  }else{m_algoAutoSelect["Mu"] = false;}
151 
152  if(CatEG.getParameter<bool>("monitor")){
153  m_algoAutoSelect["EG"] = CatEG.getParameter<bool>("doAutoSelection");
154  if(!m_algoAutoSelect["EG"]){m_selectedTriggers["EG"] = CatEG.getParameter<string>("algo");}
155  }else{m_algoAutoSelect["EG"] = false;}
156 
157  if(CatIsoEG.getParameter<bool>("monitor")){
158  m_algoAutoSelect["IsoEG"] = CatIsoEG.getParameter<bool>("doAutoSelection");
159  if(!m_algoAutoSelect["IsoEG"]){m_selectedTriggers["IsoEG"] = CatIsoEG.getParameter<string>("algo");}
160  }else{m_algoAutoSelect["IsoEG"] = false;}
161 
162  if(CatJet.getParameter<bool>("monitor")){
163  m_algoAutoSelect["Jet"] = CatJet.getParameter<bool>("doAutoSelection");
164  if(!m_algoAutoSelect["Jet"]){m_selectedTriggers["Jet"] = CatJet.getParameter<string>("algo");}
165  }else{m_algoAutoSelect["Jet"] = false;}
166 
167  if(CatCenJet.getParameter<bool>("monitor")){
168  m_algoAutoSelect["CenJet"] = CatCenJet.getParameter<bool>("doAutoSelection");
169  if(!m_algoAutoSelect["CenJet"]){m_selectedTriggers["CenJet"] = CatCenJet.getParameter<string>("algo");}
170  }else{m_algoAutoSelect["CenJet"] = false;}
171 
172  if(CatForJet.getParameter<bool>("monitor")){
173  m_algoAutoSelect["CatForJet"] = CatForJet.getParameter<bool>("doAutoSelection");
174  if(!m_algoAutoSelect["CatForJet"]){m_selectedTriggers["CatForJet"] = CatForJet.getParameter<string>("algo");}
175  }else{m_algoAutoSelect["CatForJet"] = false;}
176 
177  if(CatTauJet.getParameter<bool>("monitor")){
178  m_algoAutoSelect["TauJet"] = CatTauJet.getParameter<bool>("doAutoSelection");
179  if(!m_algoAutoSelect["TauJet"]){m_selectedTriggers["TauJet"] = CatTauJet.getParameter<string>("algo");}
180  }else{m_algoAutoSelect["TauJet"] = false;}
181 
182  if(CatETM.getParameter<bool>("monitor")){
183  m_algoAutoSelect["ETM"] = CatETM.getParameter<bool>("doAutoSelection");
184  if(!m_algoAutoSelect["ETM"]){m_selectedTriggers["ETM"] = CatETM.getParameter<string>("algo");}
185  }else{m_algoAutoSelect["ETM"] = false;}
186 
187  if(CatETT.getParameter<bool>("monitor")){
188  m_algoAutoSelect["ETT"] = CatETT.getParameter<bool>("doAutoSelection");
189  if(!m_algoAutoSelect["ETT"]){m_selectedTriggers["ETT"] = CatETT.getParameter<string>("algo");}
190  }else{m_algoAutoSelect["ETT"] = false;}
191 
192  if(CatHTM.getParameter<bool>("monitor")){
193  m_algoAutoSelect["HTM"] = CatHTM.getParameter<bool>("doAutoSelection");
194  if(!m_algoAutoSelect["HTM"]){m_selectedTriggers["HTM"] = CatHTM.getParameter<string>("algo");}
195  }else{m_algoAutoSelect["HTM"] = false;}
196 
197  if(CatHTT.getParameter<bool>("monitor")){
198  m_algoAutoSelect["HTT"] = CatHTT.getParameter<bool>("doAutoSelection");
199  if(!m_algoAutoSelect["HTT"]){m_selectedTriggers["HTT"] = CatHTT.getParameter<string>("algo");}
200  }else{m_algoAutoSelect["HTT"] = false;}
201 
202  }
203 
204  m_outputFile = pset.getUntrackedParameter < std::string > ("outputFile","");
205 
206  if (m_outputFile.size() != 0) {
207  std::cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << std::endl;
208  }
209 
210  bool disable = pset.getUntrackedParameter < bool > ("disableROOToutput", false);
211  if (disable) {m_outputFile = "";}
212 }
213 
214 //-------------------------------------------------------------------------------------
215 //-------------------------------------------------------------------------------------
217 
218 //-------------------------------------------------------------------------------------
219 
221 
222 }
223 //-------------------------------------------------------------------------------------
225 //-------------------------------------------------------------------------------------
227 
228  if (m_verbose){cout << "[L1TSync_Offline] Called beginRun." << endl;}
229 
230  // Initializing variables
231  int maxNbins = 2501;
232 
233  // Reseting run dependent variables
234  m_lhcFill = 0;
235  m_currentLS = 0;
236  m_certFirstLS.clear();
237  m_certLastLS .clear();
238 
239  // Getting Trigger menu from GT
241  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
242  const L1GtTriggerMenu* menu = menuRcd.product();
243 
244  // Filling Alias-Bit Map
245  for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo!=menu->gtAlgorithmAliasMap().end(); ++algo){
246  m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();
247  }
248 
249  // Getting fill number for this run
250  //Handle<ConditionsInRunBlock> runConditions;
251  //iRun.getByType(runConditions);
252  //int lhcFillNumber = runConditions->lhcFillNumber;
253  //
254  //ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
255  //iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
256  //const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
257 
258  L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
259 
260  m_selectedTriggers = myMenuHelper.testAlgos(m_selectedTriggers);
261 
262  map<string,string> tAutoSelTrig = myMenuHelper.getLUSOTrigger(m_algoAutoSelect,m_refPrescaleSet);
263  m_selectedTriggers.insert(tAutoSelTrig.begin(),tAutoSelTrig.end());
264 
265  // Initializing DQM Monitor Elements
266  ibooker.setCurrentFolder("L1T/L1TSync");
267  m_ErrorMonitor = ibooker.book1D("ErrorMonitor","ErrorMonitor",7,0,7);
268  m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN");
269  m_ErrorMonitor->setBinLabel(WARNING_DB_CONN_FAILED ,"WARNING_DB_CONN_FAILED"); // Errors from L1TOMDSHelper
270  m_ErrorMonitor->setBinLabel(WARNING_DB_QUERY_FAILED ,"WARNING_DB_QUERY_FAILED"); // Errors from L1TOMDSHelper
271  m_ErrorMonitor->setBinLabel(WARNING_DB_INCORRECT_NBUNCHES,"WARNING_DB_INCORRECT_NBUNCHES"); // Errors from L1TOMDSHelper
272  m_ErrorMonitor->setBinLabel(ERROR_UNABLE_RETRIVE_PRODUCT ,"ERROR_UNABLE_RETRIVE_PRODUCT");
273  m_ErrorMonitor->setBinLabel(ERROR_TRIGGERALIAS_NOTVALID ,"ERROR_TRIGGERALIAS_NOTVALID");
274  m_ErrorMonitor->setBinLabel(ERROR_LSBLOCK_NOTVALID ,"ERROR_LSBLOCK_NOTVALID");
275 
276  // Looping over selected triggers
277  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
278 
279  string tCategory = (*i).first;
280  string tTrigger = (*i).second;
281 
282  // Initializing LS blocks for certification
283  m_certFirstLS[(*i).second] = 0;
284  m_certLastLS [(*i).second] = 0;
285 
286  // Initializing DQM Monitors
287  ibooker.setCurrentFolder("L1T/L1TSync/AlgoVsBunchStructure/");
288  m_algoVsBunchStructure[tTrigger] = ibooker.book2D(tCategory,"min #Delta("+tTrigger+",Bunch)",maxNbins,-0.5,double(maxNbins)-0.5,5,-2.5,2.5);
289  m_algoVsBunchStructure[tTrigger] ->setAxisTitle("Lumi Section" ,1);
290 
291  ibooker.setCurrentFolder("L1T/L1TSync/Certification/");
292  m_algoCertification[tTrigger] = ibooker.book1D(tCategory, "fraction of in sync: "+tTrigger,maxNbins,-0.5,double(maxNbins)-0.5);
293  m_algoCertification[tTrigger] ->setAxisTitle("Lumi Section" ,1);
294 
295  }
296 }
297 
298  //_____________________________________________________________________
299  // Function: beginLuminosityBlock
300  //_____________________________________________________________________
302 
303  if (m_verbose){cout << "[L1TSync_Offline] Called beginLuminosityBlock." << endl;}
304 
305  m_currentLSValid = true;
306 
307  }
308 
309 //_____________________________________________________________________
310 void L1TSync_Offline::analyze(const Event & iEvent, const EventSetup & eventSetup){
311 
312 
313  if(m_verbose){cout << "[L1TSync_Offline] Called analyze." << endl;}
314 
315  // We only start analyzing if current LS is still valid
316  if(m_currentLSValid){
317 
318  if(m_verbose){cout << "[L1TSync_Offline] -> m_currentLSValid=" << m_currentLSValid << endl;}
319 
320  // Retriving information from GT
322  iEvent.getByToken(m_l1GtEvmSource, gtEvmReadoutRecord);
323 
324  // Determining beam mode and fill number
325  if(gtEvmReadoutRecord.isValid()){
326 
327  const L1GtfeExtWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
328  unsigned int lhcBeamMode = gtfeEvmWord.beamMode(); // Updating beam mode
329 
330  if(m_lhcFill == 0){
331  m_lhcFill = gtfeEvmWord.lhcFillNumber(); // Getting LHC Fill Number from GT
332 
333  //I AM HERE
334  getBeamConfOffline(iEvent); // Getting Beam Configuration from OMDS
335  // no OMDS //
336  /* (Savannah ticket https://savannah.cern.ch/task/?31857 )
337  Purged the OMDS helper from the module, since apparently we don't have access to that information from Offline.
338  The comparison with the closest BPTX trigger will be performed via conditions objects which are being implemented by Joao Pela.
339  In the meantime, for being able to test the module, he suggested to pass the correct bunch structure by hand for the specific run which is run during the test.
340  The idea of the temporary fix is setting the vector variable that stores the bunch structure either by hand or filling it with the BPTX fires (that is check for the event the BX's where tech0 fired and set those as true in the vector.
341  */
342  // no OMDS // m_beamConfig = myOMDSHelper.getBeamConfiguration(m_lhcFill,errorRetrieve); Yuhuuu!!!OB asked Joao Pela how to fetch that
343 
344 
345 
346 
347  }
348 
349  if(lhcBeamMode != STABLE){m_currentLSValid = false;
350  if(m_verbose){cout << "[L1TSync_Offline] -> m_currentLSValid=" << m_currentLSValid << "because beams mode not stable, being " << lhcBeamMode << endl;}
351  } // If Beams are not stable we invalidate this LS
352  }else{
353  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
354  eCount++;
355  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
356  }
357  }else{
358  if(m_verbose){cout << "[L1TSync_Offline] -> m_currentLSValid=" << m_currentLSValid << endl;}
359  }
360 
361  // Commenting out un-necessary print outs (S.Dutta)
362  /* for(size_t l=0; l<m_beamConfig.beam1.size(); l++){
363  cout << "Beam 1: element " << l << " is in state " << m_beamConfig.beam1[l] << " --- Beam 2: element " << l << " is in state " << m_beamConfig.beam2[l] << endl;
364  }*/
365  //------------------------------------------------------------------------------
366  // If current LS is valid and Beam Configuration is Valid we analyse this event
367  //------------------------------------------------------------------------------
368  if(m_currentLSValid && m_beamConfig.isValid()){
369 
370  // Getting Final Decision Logic (FDL) Data from GT
371  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
372  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
373 
374  if(gtReadoutRecordData.isValid()){
375 
376  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
377 
378  // Running over selected triggers
379  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
380 
381  string tTrigger = (*i).second;
382 
383  // Analyse only defined triggers
384  if(tTrigger != "Undefined" && tTrigger != "Undefined (Wrong Name)"){
385 
386  bool beamSingleConfig = false; // Single beam configured for this event
387  bool firedAlgo = false; // Algo fired in this event
388  unsigned int eventBx = ~0;
389 
390  // Running over FDL results to get which bits fired
391  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
392 
393  // Selecting the FDL that triggered
394  if(gtFdlVectorData[a].bxInEvent() == 0){
395  eventBx = gtFdlVectorData[a].localBxNr();
396  if(gtFdlVectorData[a].gtDecisionWord()[ m_algoBit[tTrigger] ]){firedAlgo = true;}
397  }
398  }
399 
400  // Checking beam configuration
401  if ( m_beamConfig.beam1.size() > eventBx && m_beamConfig.beam2.size() > eventBx) {
402  if( m_beamConfig.beam1[eventBx] && !m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
403  if(!m_beamConfig.beam1[eventBx] && m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
404  }
405  // Analyse only if this trigger fired in this event
406  // NOTE: Veto cases where a single beam is configured since
407  // for this cases this could be a real-satelite bunch collision
408  // -> Calculate the minimum bx diference between this event and a configured bx
409  if(firedAlgo && !beamSingleConfig){
410 
411  int DifAlgoVsBunchStructure = 9999; // Majorated
412 
413  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
414 
415  int bxFDL = gtFdlVectorData[a].localBxNr();
416  int bxInEvent = gtFdlVectorData[a].bxInEvent();
417 
418  if(m_beamConfig.bxConfig(bxFDL) && abs(bxInEvent)<abs(DifAlgoVsBunchStructure)){
419  DifAlgoVsBunchStructure = -1*bxInEvent;
420  }
421  }
422 
423  m_algoVsBunchStructure[tTrigger]->Fill(m_currentLS,DifAlgoVsBunchStructure);
424 
425  }
426  }
427  }
428  }
429  else{
430  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
431  eCount++;
432  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
433  }
434 
435  }
436 }
437 
438 //_____________________________________________________________________
439 // Method: getBunchStructureOffline
440 // Description: Attempt to retrive Beam Configuration from Offline and if
441 // we find error handle it
442 //_____________________________________________________________________
444 
445  //Getting connection parameters
446  // [11:21:35] Pietro Vischia: pathCondDB and oracleDB are available in offline?
447  // [11:21:51] Joao Pela: no
448  // [11:21:56] Pietro Vischia: cool
449  // [11:21:58] Pietro Vischia: tks
450  // [11:22:00] Joao Pela: well
451  // [11:22:02] Joao Pela: maybe
452  // [11:22:05] Joao Pela: but assume no
453  // [11:22:22] Joao Pela: definitely assume no
454  // *** UPDATE: now we have a DB for Rate parameters, it would be useful to have s.th also for L1TSync
455 
456  // string oracleDB = m_parameters.getParameter<string>("oracleDB");
457  // string pathCondDB = m_parameters.getParameter<string>("pathCondDB");
458 
459  // m_beamConfig = myOMDSHelper.getBeamConfiguration(m_lhcFill,errorRetrieve);
460  // m_lhcFill -> lhcFillNumber
461  // errorRetrieve -> error
462  // m_beamConfig -> bConfig
463 
464 
465  // No error codes at the moment. Taking info from BPTX fires
466  // int errorRetrieve = 0; // NO_ERROR;
467  m_beamConfig.m_valid = true;
468 
469 
470 
471  // bool beamSingleConfig = false; // Single beam configured for this event
472  bool firedAlgo = false; // Algo fired in this event
473  // int eventBx = -1;
474 
475  // Running over FDL results to get which bits fired for BPTX (temporary fix Savannah ticket https://savannah.cern.ch/task/?31857 )
476  // Getting Final Decision Logic (FDL) Data from GT
477  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
478  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
479 
480  if(gtReadoutRecordData.isValid()){
481 
482  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
483 
484  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
485  // Selecting the FDL that triggered
486  if(gtFdlVectorData[a].bxInEvent() == 0){
487  //eventBx = gtFdlVectorData[a].localBxNr();
488  if(gtFdlVectorData[a].gtDecisionWord()[ m_algoBit[ m_selectedTriggers["BPTX"] ] ]){firedAlgo = true;}
489  }
490 
491  // Fill beam status with BPTX fires
492  if(firedAlgo){
493  m_beamConfig.beam1.push_back(true);
494  m_beamConfig.beam2.push_back(true);
495  }
496  else {
497  m_beamConfig.beam1.push_back(false);
498  m_beamConfig.beam2.push_back(false);
499  }
500  // End fill beam status with BPTX fires
501  } // End loop on FDL
502  } // End if readout is valid
503 
504 }
505 
506 
507 
508 //_____________________________________________________________________
509 // Method: doFractionInSync
510 // Description: Produce plot with the fraction of in sync trigger for
511 // LS blocks with enough statistics.
512 // Variable: iForce - Forces closing of all blocks and calculation of
513 // the respective fractions
514 // Variable: iBad - (Only works with iForce=true) Forces the current
515 // all current blocks to be marked as bad
516 //_____________________________________________________________________
517 //void L1TSync_Offline::doFractionInSync(bool iForce,bool iBad){
518 //
617 //}
618 
619 
620 //_____________________________________________________________________
621 // Method: certifyLSBlock
622 // Description: Fill the trigger certification plot by blocks
623 // Variable: iTrigger - Which trigger to certify
624 // Variable: iInitLs - Blocks initial LS
625 // Variable: iEndLs - Blocks end LS
626 // Variable: iValue - Value to be used to fill
627 //_____________________________________________________________________
628 //void L1TSync_Offline::certifyLSBlock(string iTrigger, int iInitLs, int iEndLs ,float iValue){
629 //
637 //
638 //}
639 
640 //define this as a plug-in
T getParameter(std::string const &) const
void getBeamConfOffline(const edm::Event &)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
L1TSync_Offline(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
0: Unidentified isolated particle
Definition: ParticleCode.h:19
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)
virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
BeginRun.
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
int iEvent
Definition: GenABIO.cc:230
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:75
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors)
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
const cms_uint32_t lhcFillNumber() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
virtual ~L1TSync_Offline()
void analyze(const edm::Event &e, const edm::EventSetup &c)
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const cms_uint16_t beamMode() const
Definition: Run.h:41