CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TSync Class Reference

#include <L1TSync.h>

Inheritance diagram for L1TSync:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

enum  BeamMode {
  NOMODE =1, SETUP =2, INJPILOT =3, INJINTR =4,
  INJNOMN =5, PRERAMP =6, RAMP =7, FLATTOP =8,
  QUEEZE =9, ADJUST =10, STABLE =11, UNSTABLE =12,
  BEAMDUMP =13, RAMPDOWN =14, RECOVERY =15, INJDUMP =16,
  CIRCDUMP =17, ABORT =18, CYCLING =19, WBDUMP =20,
  NOBEAM =21
}
 
enum  Errors {
  UNKNOWN = 1, WARNING_DB_CONN_FAILED = 2, WARNING_DB_QUERY_FAILED = 3, WARNING_DB_INCORRECT_NBUNCHES = 4,
  ERROR_UNABLE_RETRIVE_PRODUCT = 5, ERROR_TRIGGERALIAS_NOTVALID = 6, ERROR_LSBLOCK_NOTVALID = 7
}
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 

Public Member Functions

 L1TSync (const edm::ParameterSet &ps)
 
virtual ~L1TSync ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &iSetup)
 BeginRun. More...
 
void endJob (void)
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &iSetup)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void certifyLSBlock (std::string iTrigger, int iInitLs, int iEndLs, float iValue)
 
void doFractionInSync (bool iForce=false, bool iBad=false)
 
void getBeamConfOMDS ()
 

Private Attributes

DQMStoredbe
 
const std::vector< std::vector
< int > > * 
ListsPrescaleFactors
 
std::map< std::string, bool > m_algoAutoSelect
 
std::map< TString, int > m_algoBit
 
std::map< TString,
MonitorElement * > 
m_algoCertification
 
std::map< TString,
MonitorElement * > 
m_algoVsBunchStructure
 
BeamConfiguration m_beamConfig
 
std::map< TString, unsigned int > m_certFirstLS
 
std::map< TString, unsigned int > m_certLastLS
 
unsigned int m_currentLS
 
bool m_currentLSValid
 
MonitorElementm_ErrorMonitor
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
m_l1GtDataDaqInputTag
 
edm::EDGetTokenT
< L1GlobalTriggerEvmReadoutRecord
m_l1GtEvmSource
 
unsigned int m_lhcFill
 
std::string m_outputFile
 
edm::ParameterSet m_parameters
 
bool * m_processedLS
 
int m_refPrescaleSet
 
std::map< std::string,
std::string > 
m_selectedTriggers
 
bool m_verbose
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 43 of file L1TSync.h.

Member Enumeration Documentation

Enumerator
NOMODE 
SETUP 
INJPILOT 
INJINTR 
INJNOMN 
PRERAMP 
RAMP 
FLATTOP 
QUEEZE 
ADJUST 
STABLE 
UNSTABLE 
BEAMDUMP 
RAMPDOWN 
RECOVERY 
INJDUMP 
CIRCDUMP 
ABORT 
CYCLING 
WBDUMP 
NOBEAM 

Definition at line 47 of file L1TSync.h.

47  {
48  NOMODE=1,
49  SETUP=2,
50  INJPILOT=3,
51  INJINTR=4,
52  INJNOMN=5,
53  PRERAMP=6,
54  RAMP=7,
55  FLATTOP=8,
56  QUEEZE=9,
57  ADJUST=10,
58  STABLE=11,
59  UNSTABLE=12,
60  BEAMDUMP=13,
61  RAMPDOWN=14,
62  RECOVERY=15,
63  INJDUMP=16,
64  CIRCDUMP=17,
65  ABORT=18,
66  CYCLING=19,
67  WBDUMP=20,
68  NOBEAM=21
69  };
Enumerator
UNKNOWN 
WARNING_DB_CONN_FAILED 
WARNING_DB_QUERY_FAILED 
WARNING_DB_INCORRECT_NBUNCHES 
ERROR_UNABLE_RETRIVE_PRODUCT 
ERROR_TRIGGERALIAS_NOTVALID 
ERROR_LSBLOCK_NOTVALID 

Definition at line 71 of file L1TSync.h.

Constructor & Destructor Documentation

L1TSync::L1TSync ( const edm::ParameterSet ps)

Definition at line 40 of file L1TSync.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), NULL, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

40  {
41 
42  m_parameters = pset;
43 
44  // Mapping parameter input variables
45  m_l1GtDataDaqInputTag = consumes<L1GlobalTriggerReadoutRecord>(pset.getParameter <InputTag>("inputTagL1GtDataDaq"));
46  m_l1GtEvmSource = consumes<L1GlobalTriggerEvmReadoutRecord>(pset.getParameter <InputTag>("inputTagtEvmSource"));
47  m_verbose = pset.getUntrackedParameter<bool> ("verbose",false);
48  m_refPrescaleSet = pset.getParameter <int> ("refPrescaleSet");
49 
50  // Getting which categories to monitor
51  ParameterSet Categories = pset.getParameter< ParameterSet >("Categories");
52 
53  bool forceGlobalParameters = Categories.getParameter<bool>("forceGlobalParameters");
54  bool doGlobalAutoSelection = Categories.getParameter<bool>("doGlobalAutoSelection");
55 
56  ParameterSet CatBPTX = Categories.getParameter<ParameterSet>("BPTX");
57  ParameterSet CatMu = Categories.getParameter<ParameterSet>("Mu");
58  ParameterSet CatEG = Categories.getParameter<ParameterSet>("EG");
59  ParameterSet CatIsoEG = Categories.getParameter<ParameterSet>("IsoEG");
60  ParameterSet CatJet = Categories.getParameter<ParameterSet>("Jet");
61  ParameterSet CatCenJet = Categories.getParameter<ParameterSet>("CenJet");
62  ParameterSet CatForJet = Categories.getParameter<ParameterSet>("ForJet");
63  ParameterSet CatTauJet = Categories.getParameter<ParameterSet>("TauJet");
64  ParameterSet CatETM = Categories.getParameter<ParameterSet>("ETT");
65  ParameterSet CatETT = Categories.getParameter<ParameterSet>("ETM");
66  ParameterSet CatHTT = Categories.getParameter<ParameterSet>("HTT");
67  ParameterSet CatHTM = Categories.getParameter<ParameterSet>("HTM");
68 
69  // --> Setting parameters related to which algos to monitor
70  // If global parameters are forced they take precedence over algo-by-algo parameters
71  if(forceGlobalParameters){
72 
73  // If global automatic selection if enable all categories set to be monitored will have
74  // their algos auto selected (the lowest prescale algo will be selected)
75  if(doGlobalAutoSelection){
76 
77  if(CatMu .getParameter<bool>("monitor")){m_algoAutoSelect["Mu"] = true;}else{m_algoAutoSelect["Mu"] = false;}
78  if(CatEG .getParameter<bool>("monitor")){m_algoAutoSelect["EG"] = true;}else{m_algoAutoSelect["EG"] = false;}
79  if(CatIsoEG .getParameter<bool>("monitor")){m_algoAutoSelect["IsoEG"] = true;}else{m_algoAutoSelect["IsoEG"] = false;}
80  if(CatJet .getParameter<bool>("monitor")){m_algoAutoSelect["Jet"] = true;}else{m_algoAutoSelect["Jet"] = false;}
81  if(CatCenJet.getParameter<bool>("monitor")){m_algoAutoSelect["CenJet"] = true;}else{m_algoAutoSelect["CenJet"] = false;}
82  if(CatForJet.getParameter<bool>("monitor")){m_algoAutoSelect["ForJet"] = true;}else{m_algoAutoSelect["ForJet"] = false;}
83  if(CatTauJet.getParameter<bool>("monitor")){m_algoAutoSelect["TauJet"] = true;}else{m_algoAutoSelect["TauJet"] = false;}
84  if(CatETM .getParameter<bool>("monitor")){m_algoAutoSelect["ETM"] = true;}else{m_algoAutoSelect["ETM"] = false;}
85  if(CatETT .getParameter<bool>("monitor")){m_algoAutoSelect["ETT"] = true;}else{m_algoAutoSelect["ETT"] = false;}
86  if(CatHTM .getParameter<bool>("monitor")){m_algoAutoSelect["HTM"] = true;}else{m_algoAutoSelect["HTM"] = false;}
87  if(CatHTT .getParameter<bool>("monitor")){m_algoAutoSelect["HTT"] = true;}else{m_algoAutoSelect["HTT"] = false;}
88 
89  // If global non-automatic selection is enable all categories set to be monitored will use
90  // user defined algos
91  }else{
92 
93  m_algoAutoSelect["Mu"] = false;
94  m_algoAutoSelect["EG"] = false;
95  m_algoAutoSelect["IsoEG"] = false;
96  m_algoAutoSelect["Jet"] = false;
97  m_algoAutoSelect["CenJet"] = false;
98  m_algoAutoSelect["ForJet"] = false;
99  m_algoAutoSelect["TauJet"] = false;
100  m_algoAutoSelect["ETM"] = false;
101  m_algoAutoSelect["ETT"] = false;
102  m_algoAutoSelect["HTM"] = false;
103  m_algoAutoSelect["HTT"] = false;
104 
105  if(CatMu .getParameter<bool>("monitor")){m_selectedTriggers["Mu"] = CatMu .getParameter<string>("algo");}
106  if(CatEG .getParameter<bool>("monitor")){m_selectedTriggers["EG"] = CatEG .getParameter<string>("algo");}
107  if(CatIsoEG .getParameter<bool>("monitor")){m_selectedTriggers["IsoEG"] = CatIsoEG .getParameter<string>("algo");}
108  if(CatJet .getParameter<bool>("monitor")){m_selectedTriggers["Jet"] = CatJet .getParameter<string>("algo");}
109  if(CatCenJet.getParameter<bool>("monitor")){m_selectedTriggers["CenJet"] = CatCenJet.getParameter<string>("algo");}
110  if(CatForJet.getParameter<bool>("monitor")){m_selectedTriggers["CatForJet"] = CatForJet.getParameter<string>("algo");}
111  if(CatTauJet.getParameter<bool>("monitor")){m_selectedTriggers["TauJet"] = CatTauJet.getParameter<string>("algo");}
112  if(CatETM .getParameter<bool>("monitor")){m_selectedTriggers["ETM"] = CatETM .getParameter<string>("algo");}
113  if(CatETT .getParameter<bool>("monitor")){m_selectedTriggers["ETT"] = CatETT .getParameter<string>("algo");}
114  if(CatHTM .getParameter<bool>("monitor")){m_selectedTriggers["HTM"] = CatHTM .getParameter<string>("algo");}
115  if(CatHTT .getParameter<bool>("monitor")){m_selectedTriggers["HTT"] = CatHTT .getParameter<string>("algo");}
116 
117  }
118 
119  // If we are using algo-by-algo parametes we get them and set what is needed
120  }else{
121 
122  if(CatBPTX.getParameter<bool>("monitor")){
123  m_selectedTriggers["BPTX"] = CatBPTX.getParameter<string>("algo");
124  }
125 
126  if(CatMu.getParameter<bool>("monitor")){
127  m_algoAutoSelect["Mu"] = CatMu.getParameter<bool>("doAutoSelection");
128  if(!m_algoAutoSelect["Mu"]){m_selectedTriggers["Mu"] = CatMu.getParameter<string>("algo");}
129  }else{m_algoAutoSelect["Mu"] = false;}
130 
131  if(CatEG.getParameter<bool>("monitor")){
132  m_algoAutoSelect["EG"] = CatEG.getParameter<bool>("doAutoSelection");
133  if(!m_algoAutoSelect["EG"]){m_selectedTriggers["EG"] = CatEG.getParameter<string>("algo");}
134  }else{m_algoAutoSelect["EG"] = false;}
135 
136  if(CatIsoEG.getParameter<bool>("monitor")){
137  m_algoAutoSelect["IsoEG"] = CatIsoEG.getParameter<bool>("doAutoSelection");
138  if(!m_algoAutoSelect["IsoEG"]){m_selectedTriggers["IsoEG"] = CatIsoEG.getParameter<string>("algo");}
139  }else{m_algoAutoSelect["IsoEG"] = false;}
140 
141  if(CatJet.getParameter<bool>("monitor")){
142  m_algoAutoSelect["Jet"] = CatJet.getParameter<bool>("doAutoSelection");
143  if(!m_algoAutoSelect["Jet"]){m_selectedTriggers["Jet"] = CatJet.getParameter<string>("algo");}
144  }else{m_algoAutoSelect["Jet"] = false;}
145 
146  if(CatCenJet.getParameter<bool>("monitor")){
147  m_algoAutoSelect["CenJet"] = CatCenJet.getParameter<bool>("doAutoSelection");
148  if(!m_algoAutoSelect["CenJet"]){m_selectedTriggers["CenJet"] = CatCenJet.getParameter<string>("algo");}
149  }else{m_algoAutoSelect["CenJet"] = false;}
150 
151  if(CatForJet.getParameter<bool>("monitor")){
152  m_algoAutoSelect["CatForJet"] = CatForJet.getParameter<bool>("doAutoSelection");
153  if(!m_algoAutoSelect["CatForJet"]){m_selectedTriggers["CatForJet"] = CatForJet.getParameter<string>("algo");}
154  }else{m_algoAutoSelect["CatForJet"] = false;}
155 
156  if(CatTauJet.getParameter<bool>("monitor")){
157  m_algoAutoSelect["TauJet"] = CatTauJet.getParameter<bool>("doAutoSelection");
158  if(!m_algoAutoSelect["TauJet"]){m_selectedTriggers["TauJet"] = CatTauJet.getParameter<string>("algo");}
159  }else{m_algoAutoSelect["TauJet"] = false;}
160 
161  if(CatETM.getParameter<bool>("monitor")){
162  m_algoAutoSelect["ETM"] = CatETM.getParameter<bool>("doAutoSelection");
163  if(!m_algoAutoSelect["ETM"]){m_selectedTriggers["ETM"] = CatETM.getParameter<string>("algo");}
164  }else{m_algoAutoSelect["ETM"] = false;}
165 
166  if(CatETT.getParameter<bool>("monitor")){
167  m_algoAutoSelect["ETT"] = CatETT.getParameter<bool>("doAutoSelection");
168  if(!m_algoAutoSelect["ETT"]){m_selectedTriggers["ETT"] = CatETT.getParameter<string>("algo");}
169  }else{m_algoAutoSelect["ETT"] = false;}
170 
171  if(CatHTM.getParameter<bool>("monitor")){
172  m_algoAutoSelect["HTM"] = CatHTM.getParameter<bool>("doAutoSelection");
173  if(!m_algoAutoSelect["HTM"]){m_selectedTriggers["HTM"] = CatHTM.getParameter<string>("algo");}
174  }else{m_algoAutoSelect["HTM"] = false;}
175 
176  if(CatHTT.getParameter<bool>("monitor")){
177  m_algoAutoSelect["HTT"] = CatHTT.getParameter<bool>("doAutoSelection");
178  if(!m_algoAutoSelect["HTT"]){m_selectedTriggers["HTT"] = CatHTT.getParameter<string>("algo");}
179  }else{m_algoAutoSelect["HTT"] = false;}
180 
181  }
182 
183 
184  if (pset.getUntrackedParameter < bool > ("dqmStore", false)) {
186  dbe->setVerbose(0);
187  }
188 
189  m_outputFile = pset.getUntrackedParameter < std::string > ("outputFile","");
190 
191  if (m_outputFile.size() != 0) {
192  std::cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << std::endl;
193  }
194 
195  bool disable = pset.getUntrackedParameter < bool > ("disableROOToutput", false);
196  if (disable) {m_outputFile = "";}
197 
198  if (dbe != NULL) {dbe->setCurrentFolder("L1T/L1TSync");}
199 
200 }
T getParameter(std::string const &) const
int m_refPrescaleSet
Definition: L1TSync.h:121
#define NULL
Definition: scimark2.h:8
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
DQMStore * dbe
Definition: L1TSync.h:109
bool m_verbose
Definition: L1TSync.h:116
std::string m_outputFile
Definition: L1TSync.h:113
std::map< std::string, bool > m_algoAutoSelect
Definition: L1TSync.h:138
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TSync.h:146
edm::ParameterSet m_parameters
Definition: L1TSync.h:111
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
Definition: L1TSync.h:145
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
L1TSync::~L1TSync ( )
virtual

Definition at line 204 of file L1TSync.cc.

204 {}

Member Function Documentation

void L1TSync::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 427 of file L1TSync.cc.

References a, funct::abs(), L1GtfeExtWord::beamMode(), gather_cfg::cout, edm::Event::getByToken(), i, edm::HandleBase::isValid(), and L1GtfeExtWord::lhcFillNumber().

427  {
428 
429  if(m_verbose){cout << "[L1TSync] Called analyze." << endl;}
430 
431  // We only start analyzing if current LS is still valid
432  if(m_currentLSValid){
433 
434  if(m_verbose){cout << "[L1TSync] -> m_currentLSValid=" << m_currentLSValid << endl;}
435 
436  // Retriving information from GT
438  iEvent.getByToken(m_l1GtEvmSource, gtEvmReadoutRecord);
439 
440  // Determining beam mode and fill number
441  if(gtEvmReadoutRecord.isValid()){
442 
443  const L1GtfeExtWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
444  unsigned int lhcBeamMode = gtfeEvmWord.beamMode(); // Updating beam mode
445 
446  if(m_lhcFill == 0){
447  m_lhcFill = gtfeEvmWord.lhcFillNumber(); // Getting LHC Fill Number from GT
448  getBeamConfOMDS(); // Getting Beam Configuration from OMDS
449  }
450 
451  if(lhcBeamMode != STABLE){m_currentLSValid = false;} // If Beams are not stable we invalidate this LS
452 
453  }else{
454  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
455  eCount++;
456  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
457  }
458  }else{
459  if(m_verbose){cout << "[L1TSync] -> m_currentLSValid=" << m_currentLSValid << endl;}
460  }
461 
462  //------------------------------------------------------------------------------
463  // If current LS is valid and Beam Configuration is Valid we analyse this event
464  //------------------------------------------------------------------------------
466 
467  // Getting Final Decision Logic (FDL) Data from GT
468  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
469  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
470 
471  if(gtReadoutRecordData.isValid()){
472 
473  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
474 
475  // Running over selected triggers
476  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
477 
478  string tTrigger = (*i).second;
479 
480  // Analyse only defined triggers
481  if(tTrigger != "Undefined" && tTrigger != "Undefined (Wrong Name)"){
482 
483  bool beamSingleConfig = false; // Single beam configured for this event
484  bool firedAlgo = false; // Algo fired in this event
485  int eventBx = -1;
486 
487  // Running over FDL results to get which bits fired
488  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
489 
490  // Selecting the FDL that triggered
491  if(gtFdlVectorData[a].bxInEvent() == 0){
492  eventBx = gtFdlVectorData[a].localBxNr();
493  if(gtFdlVectorData[a].gtDecisionWord()[ m_algoBit[tTrigger] ]){firedAlgo = true;}
494  }
495  }
496 
497  // Checking beam configuration
498  if( m_beamConfig.beam1[eventBx] && !m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
499  if(!m_beamConfig.beam1[eventBx] && m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
500 
501  // Analyse only if this trigger fired in this event
502  // NOTE: Veto cases where a single beam is configured since
503  // for this cases this could be a real-satelite bunch collision
504  // -> Calculate the minimum bx diference between this event and a configured bx
505  if(firedAlgo && !beamSingleConfig){
506 
507  int DifAlgoVsBunchStructure = 9999; // Majorated
508 
509  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
510 
511  int bxFDL = gtFdlVectorData[a].localBxNr();
512  int bxInEvent = gtFdlVectorData[a].bxInEvent();
513 
514  if(m_beamConfig.bxConfig(bxFDL) && abs(bxInEvent)<abs(DifAlgoVsBunchStructure)){
515  DifAlgoVsBunchStructure = -1*bxInEvent;
516  }
517  }
518 
519  m_algoVsBunchStructure[tTrigger]->Fill(m_currentLS,DifAlgoVsBunchStructure);
520 
521  }
522  }
523  }
524  }
525  else{
526  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
527  eCount++;
528  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
529  }
530 
531  }
532 }
int i
Definition: DBlmapReader.cc:9
unsigned int m_lhcFill
Definition: L1TSync.h:124
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
BeamConfiguration m_beamConfig
Definition: L1TSync.h:127
bool m_verbose
Definition: L1TSync.h:116
int iEvent
Definition: GenABIO.cc:230
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1 * getTH1(void) const
bool bxConfig(int iBx)
Definition: L1TOMDSHelper.h:28
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TSync.h:146
const cms_uint32_t lhcFillNumber() const
void getBeamConfOMDS()
Definition: L1TSync.cc:539
bool m_currentLSValid
Definition: L1TSync.h:117
double a
Definition: hdecay.h:121
std::vector< bool > beam2
Definition: L1TOMDSHelper.h:38
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:142
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
Definition: L1TSync.h:145
std::map< TString, int > m_algoBit
Definition: L1TSync.h:133
std::vector< bool > beam1
Definition: L1TOMDSHelper.h:37
const cms_uint16_t beamMode() const
unsigned int m_currentLS
Definition: L1TSync.h:122
void L1TSync::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 208 of file L1TSync.cc.

References gather_cfg::cout, cppFunctionSkipper::operator, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

208  {
209 
210  if (m_verbose){cout << "[L1TSync] Called beginJob." << endl;}
211 
212  // get hold of back-end interface
213  DQMStore *dbe = 0;
214  dbe = Service < DQMStore > ().operator->();
215 
216  if (dbe) {
217  dbe->setCurrentFolder("L1T/L1TSync");
218  dbe->rmdir("L1T/L1TSync");
219  }
220 
221 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3051
DQMStore * dbe
Definition: L1TSync.h:109
bool m_verbose
Definition: L1TSync.h:116
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void L1TSync::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 315 of file L1TSync.cc.

References gather_cfg::cout, i, edm::LuminosityBlockBase::id(), and edm::LuminosityBlockID::luminosityBlock().

315  {
316 
317  if (m_verbose){cout << "[L1TSync] Called beginLuminosityBlock." << endl;}
318 
319  // If this LS is not the next to last one force closing of current LS blocks
320  // for certification
321  if(m_currentLS !=0 && m_currentLS+1 != lumiBlock.id().luminosityBlock()){
322 
323  if (m_verbose){
324  cout << "[L1TSync] None consecutive: doFractionInSync() - LAST="
325  << m_currentLS << " CURRENT=" << lumiBlock.id().luminosityBlock() << endl;
326  }
327  doFractionInSync(true,false);
328  }
329 
330  // Updating current LS number
331  m_currentLS = lumiBlock.id().luminosityBlock();
332 
333  // If this is the fist valid LS update first LS for certification
334  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
335 
336  string theTriggerAlias = (*i).second;
337  if(m_certFirstLS[theTriggerAlias]==0){m_certFirstLS[theTriggerAlias] = m_currentLS;}
338 
339  }
340 
341  // A LS will be valid if:
342  // * BeamMode == STABLE for all events monitored
343  m_currentLSValid = true;
344 
345 }
int i
Definition: DBlmapReader.cc:9
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:619
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:134
bool m_verbose
Definition: L1TSync.h:116
bool m_currentLSValid
Definition: L1TSync.h:117
tuple cout
Definition: gather_cfg.py:121
unsigned int m_currentLS
Definition: L1TSync.h:122
void L1TSync::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 239 of file L1TSync.cc.

References gather_cfg::cout, edm::EventSetup::get(), L1TMenuHelper::getLUSOTrigger(), L1GtTriggerMenu::gtAlgorithmAliasMap(), i, relval_steps::menu, edm::ESHandle< class >::product(), L1TMenuHelper::testAlgos(), and pat::UNKNOWN.

239  {
240 
241  if (m_verbose){cout << "[L1TSync] Called beginRun." << endl;}
242 
243  // Initializing variables
244  int maxNbins = 2501;
245 
246  // Reseting run dependent variables
247  m_lhcFill = 0;
248  m_currentLS = 0;
249  m_certFirstLS.clear();
250  m_certLastLS .clear();
251 
252  // Getting Trigger menu from GT
254  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
255  const L1GtTriggerMenu* menu = menuRcd.product();
256 
257  // Filling Alias-Bit Map
258  for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo!=menu->gtAlgorithmAliasMap().end(); ++algo){
259  m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();
260  }
261 
262  // Getting fill number for this run
263  //Handle<ConditionsInRunBlock> runConditions;
264  //iRun.getByType(runConditions);
265  //int lhcFillNumber = runConditions->lhcFillNumber;
266  //
267  //ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
268  //iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
269  //const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
270 
271  L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
272 
274 
275  map<string,string> tAutoSelTrig = myMenuHelper.getLUSOTrigger(m_algoAutoSelect,m_refPrescaleSet);
276  m_selectedTriggers.insert(tAutoSelTrig.begin(),tAutoSelTrig.end());
277 
278  // Initializing DQM Monitor Elements
279  dbe->setCurrentFolder("L1T/L1TSync");
280  m_ErrorMonitor = dbe->book1D("ErrorMonitor","ErrorMonitor",7,0,7);
281  m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN");
282  m_ErrorMonitor->setBinLabel(WARNING_DB_CONN_FAILED ,"WARNING_DB_CONN_FAILED"); // Errors from L1TOMDSHelper
283  m_ErrorMonitor->setBinLabel(WARNING_DB_QUERY_FAILED ,"WARNING_DB_QUERY_FAILED"); // Errors from L1TOMDSHelper
284  m_ErrorMonitor->setBinLabel(WARNING_DB_INCORRECT_NBUNCHES,"WARNING_DB_INCORRECT_NBUNCHES"); // Errors from L1TOMDSHelper
285  m_ErrorMonitor->setBinLabel(ERROR_UNABLE_RETRIVE_PRODUCT ,"ERROR_UNABLE_RETRIVE_PRODUCT");
286  m_ErrorMonitor->setBinLabel(ERROR_TRIGGERALIAS_NOTVALID ,"ERROR_TRIGGERALIAS_NOTVALID");
287  m_ErrorMonitor->setBinLabel(ERROR_LSBLOCK_NOTVALID ,"ERROR_LSBLOCK_NOTVALID");
288 
289  // Looping over selected triggers
290  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
291 
292  string tCategory = (*i).first;
293  string tTrigger = (*i).second;
294 
295  // Initializing LS blocks for certification
296  m_certFirstLS[(*i).second] = 0;
297  m_certLastLS [(*i).second] = 0;
298 
299  // Initializing DQM Monitors
300  dbe->setCurrentFolder("L1T/L1TSync/AlgoVsBunchStructure/");
301  m_algoVsBunchStructure[tTrigger] = dbe->book2D(tCategory,"min #Delta("+tTrigger+",Bunch)",maxNbins,-0.5,double(maxNbins)-0.5,5,-2.5,2.5);
302  m_algoVsBunchStructure[tTrigger] ->setAxisTitle("Lumi Section" ,1);
303 
304  dbe->setCurrentFolder("L1T/L1TSync/Certification/");
305  m_algoCertification[tTrigger] = dbe->book1D(tCategory, "fraction of in sync: "+tTrigger,maxNbins,-0.5,double(maxNbins)-0.5);
306  m_algoCertification[tTrigger] ->setAxisTitle("Lumi Section" ,1);
307 
308  }
309 
310 }
int m_refPrescaleSet
Definition: L1TSync.h:121
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:135
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
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)
unsigned int m_lhcFill
Definition: L1TSync.h:124
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
DQMStore * dbe
Definition: L1TSync.h:109
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:134
bool m_verbose
Definition: L1TSync.h:116
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors)
std::map< std::string, bool > m_algoAutoSelect
Definition: L1TSync.h:138
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:137
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:142
std::map< TString, MonitorElement * > m_algoCertification
Definition: L1TSync.h:136
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
std::map< TString, int > m_algoBit
Definition: L1TSync.h:133
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
unsigned int m_currentLS
Definition: L1TSync.h:122
void L1TSync::certifyLSBlock ( std::string  iTrigger,
int  iInitLs,
int  iEndLs,
float  iValue 
)
private

Definition at line 730 of file L1TSync.cc.

References python.rootplot.utilities::ls().

730  {
731 
732  // Finding correct bins in the histogram for this block
733  int binInit = m_algoCertification[iTrigger]->getTH1()->FindBin(iInitLs);
734  int binEnd = m_algoCertification[iTrigger]->getTH1()->FindBin(iEndLs);
735 
736  for(int ls=binInit ; ls<=binEnd ; ls++){
737  m_algoCertification[iTrigger]->setBinContent(ls,iValue);
738  }
739 
740 }
std::map< TString, MonitorElement * > m_algoCertification
Definition: L1TSync.h:136
void L1TSync::doFractionInSync ( bool  iForce = false,
bool  iBad = false 
)
private

Definition at line 619 of file L1TSync.cc.

References a, gather_cfg::cout, edm::ParameterSet::getParameter(), i, and python.rootplot.utilities::ls().

619  {
620 
621  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
622 
623  string theCategory = (*i).first;
624  string theTriggerAlias = (*i).second;
625 
626  // Caching frequently used values from maps
627  unsigned int fLS = m_certFirstLS[theTriggerAlias];
628  unsigned int lLS = m_certLastLS [theTriggerAlias];
629 
630  // Checking validity of the trigger alias and of the LS block
631  bool triggerAlias_isValid = theTriggerAlias != "Undefined" && theTriggerAlias != "Undefined (Wrong Name)";
632  bool lsBlock_exists = !(fLS == 0 && lLS == 0);
633  bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
634 
635  if(triggerAlias_isValid && lsBlock_exists && lsBlock_isValid){
636 
637  // If we are forced to close blocks and mark them bad
638  if(iForce && iBad){
639  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
640  m_certFirstLS[theTriggerAlias] = 0;
641  m_certLastLS [theTriggerAlias] = 0;
642  }
643 
644  // If we are not forced to mark bad, we check if we have enough statistics
645  else{
646 
647  // Getting events with 0 bx difference between BPTX and Algo for current LS
648  double CountSync = 0;
649  double CountAll = 0;
650 
651  // Adding all entries for current LS block
652  for(unsigned int ls=fLS ; ls<=lLS ; ls++){
653 
654  CountSync += m_algoVsBunchStructure[theTriggerAlias]->getBinContent(ls+1,3);
655  for(int a=1 ; a<6 ; a++){
656  CountAll += m_algoVsBunchStructure[theTriggerAlias]->getBinContent(ls+1,a);
657  }
658  }
659 
660  if(m_verbose){
661  cout << "Alias = " << theTriggerAlias
662  << " InitLS=" << fLS
663  << " EndLS=" << lLS
664  << " Events=" << CountAll ;
665  }
666 
667  if(iForce ||
668  CountAll >= m_parameters.getParameter<ParameterSet>("Categories")
669  .getParameter<ParameterSet>(theCategory)
670  .getParameter<int>("CertMinEvents")){
671 
672  if(m_verbose){cout << " <--------------- Enough Statistics: ";}
673 
674 
675  // Calculating fraction of in time
676  double fraction = 0;
677  if(CountAll >0){fraction = CountSync/CountAll;}
678 
679  // This is to avoid having an entry equal to zero and thus
680  // disregarded by the automatic tests
681  if(fraction==0){fraction=0.000001;}
682 
683  certifyLSBlock(theTriggerAlias,fLS,lLS,fraction);
684  m_certFirstLS[theTriggerAlias] = 0;
685  m_certLastLS [theTriggerAlias] = 0;
686  }
687 
688  if(m_verbose){cout << endl;}
689 
690  }
691  }
692 
693  // A problem was found. We report it and set a not physical vale (-1) to the certification plot
694  else{
695 
696  // If trigger alias is not valid report it to m_ErrorMonitor
697  if(!triggerAlias_isValid){
698  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_TRIGGERALIAS_NOTVALID);
699  eCount++;
700  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_TRIGGERALIAS_NOTVALID,eCount);
701  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
702  m_certFirstLS[theTriggerAlias] = 0;
703  m_certLastLS [theTriggerAlias] = 0;
704  }
705 
706  // If LS Block is not valid report it to m_ErrorMonitor
707  if(lsBlock_exists && !lsBlock_isValid){
708  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_LSBLOCK_NOTVALID);
709  eCount++;
710  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_LSBLOCK_NOTVALID,eCount);
711  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
712  m_certFirstLS[theTriggerAlias] = 0;
713  m_certLastLS [theTriggerAlias] = 0;
714  }
715 
716  }
717  }
718 
719 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:135
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:134
bool m_verbose
Definition: L1TSync.h:116
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
Definition: L1TSync.cc:730
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:137
TH1 * getTH1(void) const
edm::ParameterSet m_parameters
Definition: L1TSync.h:111
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:142
void L1TSync::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 225 of file L1TSync.cc.

References gather_cfg::cout.

225  {
226 
227  if (m_verbose){cout << "[L1TSync] Called endJob." << endl;}
228 
229  if (m_outputFile.size() != 0 && dbe)
231 
232  return;
233 
234 }
DQMStore * dbe
Definition: L1TSync.h:109
bool m_verbose
Definition: L1TSync.h:116
std::string m_outputFile
Definition: L1TSync.h:113
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2490
tuple cout
Definition: gather_cfg.py:121
void L1TSync::endLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 351 of file L1TSync.cc.

References gather_cfg::cout, and i.

351  {
352 
353  if(m_verbose){cout << "[L1TSync] Called endLuminosityBlock." << endl;}
354 
355  if(m_verbose){
356  cout << "[L1TSync] m_currentLSValid : " << m_currentLSValid << endl;
357  cout << "[L1TSync] m_beamConfig.isValid(): " << m_beamConfig.isValid() << endl;
358  }
359 
360  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
361 
362  // Update last LS for certification
363  string theTriggerAlias = (*i).second;
364  m_certLastLS[theTriggerAlias] = m_currentLS;
365 
366  }
367 
368  // If this LS is valid (i.e. all events recorded with stable beams)
370 
371  if(m_verbose){cout << "[L1TSync] Regular call: doFractionInSync()" << endl;}
372  doFractionInSync(false,false);
373 
374  }
375  // If this LS is not valid it can be in the following context:
376  // * We still hadn't stable beam (no need to certify nothing
377  // * Beam just got unstable or dumped (we may have a complete block of data do certify)
378  else{
379 
380  //-> First we close all blocks from certFirstLS[] to m_currentLS-1
381  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
382 
383  string theTriggerAlias = (*i).second;
384 
385  int fLs = m_certFirstLS[theTriggerAlias];
386  int lLS = m_certLastLS [theTriggerAlias];
387 
388  // If this is a single LS block we do nothing (in this step)
389  if(fLs == lLS){
390  m_certFirstLS[theTriggerAlias] = 0;
391  m_certLastLS [theTriggerAlias] = 0;
392  }
393  // If block is multi LS then we remove the current LS
394  else{
395  m_certLastLS [theTriggerAlias] = m_currentLS-1;
396  }
397 
398  }
399  doFractionInSync(true,false);
400 
401  //-> Second we mark this single LS bad for all triggers
402  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
403  string theTriggerAlias = (*i).second;
404  m_certFirstLS[theTriggerAlias] = m_currentLS;
405  m_certLastLS [theTriggerAlias] = m_currentLS;
406  }
407  doFractionInSync(true,true);
408 
409  if(m_verbose){cout << "[L1TSync] Error call: doFractionInSync()" << endl;}
410 
411  }
412 
413 }
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:135
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:619
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:139
BeamConfiguration m_beamConfig
Definition: L1TSync.h:127
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:134
bool m_verbose
Definition: L1TSync.h:116
bool m_currentLSValid
Definition: L1TSync.h:117
tuple cout
Definition: gather_cfg.py:121
unsigned int m_currentLS
Definition: L1TSync.h:122
void L1TSync::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 416 of file L1TSync.cc.

References gather_cfg::cout.

416  {
417 
418  if(m_verbose){cout << "[L1TSync] Called endRun." << endl;}
419 
420  // When the run end for closing of the LS certification blocks and evaluation
421  // of synchronization for that block
422  doFractionInSync(true,false);
423 
424 }
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:619
bool m_verbose
Definition: L1TSync.h:116
tuple cout
Definition: gather_cfg.py:121
void L1TSync::getBeamConfOMDS ( )
private

Definition at line 539 of file L1TSync.cc.

References gather_cfg::cout, L1TOMDSHelper::NO_ERROR, pat::UNKNOWN, L1TOMDSHelper::WARNING_DB_CONN_FAILED, and L1TOMDSHelper::WARNING_DB_QUERY_FAILED.

539  {
540 
541  //Getting connection paremeters
542  string oracleDB = m_parameters.getParameter<string>("oracleDB");
543  string pathCondDB = m_parameters.getParameter<string>("pathCondDB");
544 
545  // Connecting to OMDS
546  L1TOMDSHelper myOMDSHelper = L1TOMDSHelper();
547  int conError;
548  myOMDSHelper.connect(oracleDB,pathCondDB,conError);
549 
550  if(conError == L1TOMDSHelper::NO_ERROR){
551 
552  if(m_verbose){cout << "[L1TSync] Connected to DB with no error." << endl;}
553 
554  int errorRetrive;
555  m_beamConfig = myOMDSHelper.getBeamConfiguration(m_lhcFill,errorRetrive);
556 
557  if(errorRetrive == L1TOMDSHelper::NO_ERROR){
558  if(m_verbose){
559  cout << "[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
560  cout << "[L1TSync] -> LHC Bunch Structure valid=" << m_beamConfig.m_valid << " nBunches=" << m_beamConfig.nCollidingBunches << endl;
561  }
562  }
563  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_CONN_FAILED){
564 
565  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;}
566 
567  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_INCORRECT_NBUNCHES);
568  eCount++;
569  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_INCORRECT_NBUNCHES,eCount);
570  }
571  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_QUERY_FAILED){
572 
573  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;}
574 
575  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_QUERY_FAILED);
576  eCount++;
577  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_QUERY_FAILED,eCount);
578  }
579  else{
580 
581  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;}
582 
583  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
584  eCount++;
585  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
586  }
587 
588  }else{
589 
591 
592  if(m_verbose){cout << "[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;}
593 
594  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_CONN_FAILED);
595  eCount++;
596  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_CONN_FAILED,eCount);
597  }else{
598 
599  if(m_verbose){cout << "[L1TSync] Connect to DB: UNKNOWN" << endl;}
600 
601  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
602  eCount++;
603  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
604  }
605 
606  }
607 
608 }
T getParameter(std::string const &) const
unsigned int m_lhcFill
Definition: L1TSync.h:124
BeamConfiguration m_beamConfig
Definition: L1TSync.h:127
bool m_verbose
Definition: L1TSync.h:116
TH1 * getTH1(void) const
edm::ParameterSet m_parameters
Definition: L1TSync.h:111
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:142

Member Data Documentation

DQMStore* L1TSync::dbe
private

Definition at line 109 of file L1TSync.h.

const std::vector< std::vector<int> >* L1TSync::ListsPrescaleFactors
private

Definition at line 130 of file L1TSync.h.

std::map<std::string,bool> L1TSync::m_algoAutoSelect
private

Definition at line 138 of file L1TSync.h.

std::map<TString,int> L1TSync::m_algoBit
private

Definition at line 133 of file L1TSync.h.

std::map<TString,MonitorElement*> L1TSync::m_algoCertification
private

Definition at line 136 of file L1TSync.h.

std::map<TString,MonitorElement*> L1TSync::m_algoVsBunchStructure
private

Definition at line 137 of file L1TSync.h.

BeamConfiguration L1TSync::m_beamConfig
private

Definition at line 127 of file L1TSync.h.

std::map<TString,unsigned int> L1TSync::m_certFirstLS
private

Definition at line 134 of file L1TSync.h.

std::map<TString,unsigned int> L1TSync::m_certLastLS
private

Definition at line 135 of file L1TSync.h.

unsigned int L1TSync::m_currentLS
private

Definition at line 122 of file L1TSync.h.

bool L1TSync::m_currentLSValid
private

Definition at line 117 of file L1TSync.h.

MonitorElement* L1TSync::m_ErrorMonitor
private

Definition at line 142 of file L1TSync.h.

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> L1TSync::m_l1GtDataDaqInputTag
private

Definition at line 146 of file L1TSync.h.

edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> L1TSync::m_l1GtEvmSource
private

Definition at line 145 of file L1TSync.h.

unsigned int L1TSync::m_lhcFill
private

Definition at line 124 of file L1TSync.h.

std::string L1TSync::m_outputFile
private

Definition at line 113 of file L1TSync.h.

edm::ParameterSet L1TSync::m_parameters
private

Definition at line 111 of file L1TSync.h.

bool* L1TSync::m_processedLS
private

Definition at line 118 of file L1TSync.h.

int L1TSync::m_refPrescaleSet
private

Definition at line 121 of file L1TSync.h.

std::map<std::string,std::string> L1TSync::m_selectedTriggers
private

Definition at line 139 of file L1TSync.h.

bool L1TSync::m_verbose
private

Definition at line 116 of file L1TSync.h.