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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase 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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 

Public Member Functions

 L1TSync (const edm::ParameterSet &ps)
 
virtual ~L1TSync ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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)
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
virtual void bookHistograms (DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 BeginRun. More...
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

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 DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 45 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 49 of file L1TSync.h.

49  {
50  NOMODE=1,
51  SETUP=2,
52  INJPILOT=3,
53  INJINTR=4,
54  INJNOMN=5,
55  PRERAMP=6,
56  RAMP=7,
57  FLATTOP=8,
58  QUEEZE=9,
59  ADJUST=10,
60  STABLE=11,
61  UNSTABLE=12,
62  BEAMDUMP=13,
63  RAMPDOWN=14,
64  RECOVERY=15,
65  INJDUMP=16,
66  CIRCDUMP=17,
67  ABORT=18,
68  CYCLING=19,
69  WBDUMP=20,
70  NOBEAM=21
71  };
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 73 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(), 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  m_outputFile = pset.getUntrackedParameter < std::string > ("outputFile","");
185 
186  if (m_outputFile.size() != 0) {
187  std::cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << std::endl;
188  }
189 
190  bool disable = pset.getUntrackedParameter < bool > ("disableROOToutput", false);
191  if (disable) {m_outputFile = "";}
192 
193 }
T getParameter(std::string const &) const
int m_refPrescaleSet
Definition: L1TSync.h:119
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
bool m_verbose
Definition: L1TSync.h:114
std::string m_outputFile
Definition: L1TSync.h:111
std::map< std::string, bool > m_algoAutoSelect
Definition: L1TSync.h:136
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TSync.h:144
edm::ParameterSet m_parameters
Definition: L1TSync.h:109
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
Definition: L1TSync.h:143
L1TSync::~L1TSync ( )
virtual

Definition at line 197 of file L1TSync.cc.

197 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 382 of file L1TSync.cc.

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

382  {
383 
384  if(m_verbose){cout << "[L1TSync] Called analyze." << endl;}
385 
386  // We only start analyzing if current LS is still valid
387  if(m_currentLSValid){
388 
389  if(m_verbose){cout << "[L1TSync] -> m_currentLSValid=" << m_currentLSValid << endl;}
390 
391  // Retriving information from GT
393  iEvent.getByToken(m_l1GtEvmSource, gtEvmReadoutRecord);
394 
395  // Determining beam mode and fill number
396  if(gtEvmReadoutRecord.isValid()){
397 
398  const L1GtfeExtWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
399  unsigned int lhcBeamMode = gtfeEvmWord.beamMode(); // Updating beam mode
400 
401  if(m_lhcFill == 0){
402  m_lhcFill = gtfeEvmWord.lhcFillNumber(); // Getting LHC Fill Number from GT
403  getBeamConfOMDS(); // Getting Beam Configuration from OMDS
404  }
405 
406  if(lhcBeamMode != STABLE){m_currentLSValid = false;} // If Beams are not stable we invalidate this LS
407 
408  }else{
409  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
410  eCount++;
411  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
412  }
413  }else{
414  if(m_verbose){cout << "[L1TSync] -> m_currentLSValid=" << m_currentLSValid << endl;}
415  }
416 
417  //------------------------------------------------------------------------------
418  // If current LS is valid and Beam Configuration is Valid we analyse this event
419  //------------------------------------------------------------------------------
421 
422  // Getting Final Decision Logic (FDL) Data from GT
423  edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
424  iEvent.getByToken(m_l1GtDataDaqInputTag, gtReadoutRecordData);
425 
426  if(gtReadoutRecordData.isValid()){
427 
428  const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
429 
430  // Running over selected triggers
431  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
432 
433  string tTrigger = (*i).second;
434 
435  // Analyse only defined triggers
436  if(tTrigger != "Undefined" && tTrigger != "Undefined (Wrong Name)"){
437 
438  bool beamSingleConfig = false; // Single beam configured for this event
439  bool firedAlgo = false; // Algo fired in this event
440  int eventBx = -1;
441 
442  // Running over FDL results to get which bits fired
443  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
444 
445  // Selecting the FDL that triggered
446  if(gtFdlVectorData[a].bxInEvent() == 0){
447  eventBx = gtFdlVectorData[a].localBxNr();
448  if(gtFdlVectorData[a].gtDecisionWord()[ m_algoBit[tTrigger] ]){firedAlgo = true;}
449  }
450  }
451 
452  // Checking beam configuration
453  if( m_beamConfig.beam1[eventBx] && !m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
454  if(!m_beamConfig.beam1[eventBx] && m_beamConfig.beam2[eventBx]){beamSingleConfig = true;}
455 
456  // Analyse only if this trigger fired in this event
457  // NOTE: Veto cases where a single beam is configured since
458  // for this cases this could be a real-satelite bunch collision
459  // -> Calculate the minimum bx diference between this event and a configured bx
460  if(firedAlgo && !beamSingleConfig){
461 
462  int DifAlgoVsBunchStructure = 9999; // Majorated
463 
464  for(unsigned int a=0 ; a<gtFdlVectorData.size() ; a++){
465 
466  int bxFDL = gtFdlVectorData[a].localBxNr();
467  int bxInEvent = gtFdlVectorData[a].bxInEvent();
468 
469  if(m_beamConfig.bxConfig(bxFDL) && abs(bxInEvent)<abs(DifAlgoVsBunchStructure)){
470  DifAlgoVsBunchStructure = -1*bxInEvent;
471  }
472  }
473 
474  m_algoVsBunchStructure[tTrigger]->Fill(m_currentLS,DifAlgoVsBunchStructure);
475 
476  }
477  }
478  }
479  }
480  else{
481  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT);
482  eCount++;
483  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_UNABLE_RETRIVE_PRODUCT,eCount);
484  }
485 
486  }
487 }
int i
Definition: DBlmapReader.cc:9
unsigned int m_lhcFill
Definition: L1TSync.h:122
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
BeamConfiguration m_beamConfig
Definition: L1TSync.h:125
bool m_verbose
Definition: L1TSync.h:114
int iEvent
Definition: GenABIO.cc:230
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:135
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:75
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TSync.h:144
const cms_uint32_t lhcFillNumber() const
void getBeamConfOMDS()
Definition: L1TSync.cc:494
bool m_currentLSValid
Definition: L1TSync.h:115
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:140
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
Definition: L1TSync.h:143
std::map< TString, int > m_algoBit
Definition: L1TSync.h:131
std::vector< bool > beam1
Definition: L1TOMDSHelper.h:37
const cms_uint16_t beamMode() const
unsigned int m_currentLS
Definition: L1TSync.h:120
void L1TSync::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 281 of file L1TSync.cc.

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

281  {
282 
283  if (m_verbose){cout << "[L1TSync] Called beginLuminosityBlock." << endl;}
284 
285  // If this LS is not the next to last one force closing of current LS blocks
286  // for certification
287  if(m_currentLS !=0 && m_currentLS+1 != lumiBlock.id().luminosityBlock()){
288 
289  if (m_verbose){
290  cout << "[L1TSync] None consecutive: doFractionInSync() - LAST="
291  << m_currentLS << " CURRENT=" << lumiBlock.id().luminosityBlock() << endl;
292  }
293  doFractionInSync(true,false);
294  }
295 
296  // Updating current LS number
297  m_currentLS = lumiBlock.id().luminosityBlock();
298 
299  // If this is the fist valid LS update first LS for certification
300  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
301 
302  string theTriggerAlias = (*i).second;
303  if(m_certFirstLS[theTriggerAlias]==0){m_certFirstLS[theTriggerAlias] = m_currentLS;}
304 
305  }
306 
307  // A LS will be valid if:
308  // * BeamMode == STABLE for all events monitored
309  m_currentLSValid = true;
310 
311 }
int i
Definition: DBlmapReader.cc:9
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:574
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:132
bool m_verbose
Definition: L1TSync.h:114
bool m_currentLSValid
Definition: L1TSync.h:115
tuple cout
Definition: gather_cfg.py:121
unsigned int m_currentLS
Definition: L1TSync.h:120
void L1TSync::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 207 of file L1TSync.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), edm::EventSetup::get(), L1TMenuHelper::getLUSOTrigger(), L1GtTriggerMenu::gtAlgorithmAliasMap(), i, relval_steps::menu, edm::ESHandle< class >::product(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), L1TMenuHelper::testAlgos(), and pat::UNKNOWN.

207  {
208 
209  // Initializing variables
210  int maxNbins = 2501;
211 
212  // Reseting run dependent variables
213  m_lhcFill = 0;
214  m_currentLS = 0;
215  m_certFirstLS.clear();
216  m_certLastLS .clear();
217 
218  // Getting Trigger menu from GT
220  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
221  const L1GtTriggerMenu* menu = menuRcd.product();
222 
223  // Filling Alias-Bit Map
224  for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo!=menu->gtAlgorithmAliasMap().end(); ++algo){
225  m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();
226  }
227 
228  // Getting fill number for this run
229  //Handle<ConditionsInRunBlock> runConditions;
230  //iRun.getByType(runConditions);
231  //int lhcFillNumber = runConditions->lhcFillNumber;
232 
233  //ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
234  //iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
235  //const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
236 
237  L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
238 
240 
241  map<string,string> tAutoSelTrig = myMenuHelper.getLUSOTrigger(m_algoAutoSelect,m_refPrescaleSet);
242  m_selectedTriggers.insert(tAutoSelTrig.begin(),tAutoSelTrig.end());
243 
244  // Initializing DQM Monitor Elements
245  ibooker.setCurrentFolder("L1T/L1TSync");
246  m_ErrorMonitor = ibooker.book1D("ErrorMonitor","ErrorMonitor",7,0,7);
247  m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN");
248  m_ErrorMonitor->setBinLabel(WARNING_DB_CONN_FAILED ,"WARNING_DB_CONN_FAILED"); // Errors from L1TOMDSHelper
249  m_ErrorMonitor->setBinLabel(WARNING_DB_QUERY_FAILED ,"WARNING_DB_QUERY_FAILED"); // Errors from L1TOMDSHelper
250  m_ErrorMonitor->setBinLabel(WARNING_DB_INCORRECT_NBUNCHES,"WARNING_DB_INCORRECT_NBUNCHES"); // Errors from L1TOMDSHelper
251  m_ErrorMonitor->setBinLabel(ERROR_UNABLE_RETRIVE_PRODUCT ,"ERROR_UNABLE_RETRIVE_PRODUCT");
252  m_ErrorMonitor->setBinLabel(ERROR_TRIGGERALIAS_NOTVALID ,"ERROR_TRIGGERALIAS_NOTVALID");
253  m_ErrorMonitor->setBinLabel(ERROR_LSBLOCK_NOTVALID ,"ERROR_LSBLOCK_NOTVALID");
254 
255  // Looping over selected triggers
256  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
257 
258  string tCategory = (*i).first;
259  string tTrigger = (*i).second;
260 
261  // Initializing LS blocks for certification
262  m_certFirstLS[(*i).second] = 0;
263  m_certLastLS [(*i).second] = 0;
264 
265  // Initializing DQM Monitors
266  ibooker.setCurrentFolder("L1T/L1TSync/AlgoVsBunchStructure/");
267  m_algoVsBunchStructure[tTrigger] = ibooker.book2D(tCategory,"min #Delta("+tTrigger+",Bunch)",maxNbins,-0.5,double(maxNbins)-0.5,5,-2.5,2.5);
268  m_algoVsBunchStructure[tTrigger] ->setAxisTitle("Lumi Section" ,1);
269 
270  ibooker.setCurrentFolder("L1T/L1TSync/Certification/");
271  m_algoCertification[tTrigger] = ibooker.book1D(tCategory, "fraction of in sync: "+tTrigger,maxNbins,-0.5,double(maxNbins)-0.5);
272  m_algoCertification[tTrigger] ->setAxisTitle("Lumi Section" ,1);
273 
274  }
275 
276 }
int m_refPrescaleSet
Definition: L1TSync.h:119
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:133
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:122
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:132
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::map< std::string, bool > m_algoAutoSelect
Definition: L1TSync.h:136
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:135
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 T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:140
std::map< TString, MonitorElement * > m_algoCertification
Definition: L1TSync.h:134
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
std::map< TString, int > m_algoBit
Definition: L1TSync.h:131
unsigned int m_currentLS
Definition: L1TSync.h:120
void L1TSync::certifyLSBlock ( std::string  iTrigger,
int  iInitLs,
int  iEndLs,
float  iValue 
)
private

Definition at line 685 of file L1TSync.cc.

References eostools::ls().

685  {
686 
687  // Finding correct bins in the histogram for this block
688  int binInit = m_algoCertification[iTrigger]->getTH1()->FindBin(iInitLs);
689  int binEnd = m_algoCertification[iTrigger]->getTH1()->FindBin(iEndLs);
690 
691  for(int ls=binInit ; ls<=binEnd ; ls++){
692  m_algoCertification[iTrigger]->setBinContent(ls,iValue);
693  }
694 
695 }
def ls
Definition: eostools.py:346
std::map< TString, MonitorElement * > m_algoCertification
Definition: L1TSync.h:134
void L1TSync::doFractionInSync ( bool  iForce = false,
bool  iBad = false 
)
private

Definition at line 574 of file L1TSync.cc.

References a, gather_cfg::cout, HLT_25ns14e33_v1_cff::fraction, edm::ParameterSet::getParameter(), i, and eostools::ls().

574  {
575 
576  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
577 
578  string theCategory = (*i).first;
579  string theTriggerAlias = (*i).second;
580 
581  // Caching frequently used values from maps
582  unsigned int fLS = m_certFirstLS[theTriggerAlias];
583  unsigned int lLS = m_certLastLS [theTriggerAlias];
584 
585  // Checking validity of the trigger alias and of the LS block
586  bool triggerAlias_isValid = theTriggerAlias != "Undefined" && theTriggerAlias != "Undefined (Wrong Name)";
587  bool lsBlock_exists = !(fLS == 0 && lLS == 0);
588  bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
589 
590  if(triggerAlias_isValid && lsBlock_exists && lsBlock_isValid){
591 
592  // If we are forced to close blocks and mark them bad
593  if(iForce && iBad){
594  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
595  m_certFirstLS[theTriggerAlias] = 0;
596  m_certLastLS [theTriggerAlias] = 0;
597  }
598 
599  // If we are not forced to mark bad, we check if we have enough statistics
600  else{
601 
602  // Getting events with 0 bx difference between BPTX and Algo for current LS
603  double CountSync = 0;
604  double CountAll = 0;
605 
606  // Adding all entries for current LS block
607  for(unsigned int ls=fLS ; ls<=lLS ; ls++){
608 
609  CountSync += m_algoVsBunchStructure[theTriggerAlias]->getBinContent(ls+1,3);
610  for(int a=1 ; a<6 ; a++){
611  CountAll += m_algoVsBunchStructure[theTriggerAlias]->getBinContent(ls+1,a);
612  }
613  }
614 
615  if(m_verbose){
616  cout << "Alias = " << theTriggerAlias
617  << " InitLS=" << fLS
618  << " EndLS=" << lLS
619  << " Events=" << CountAll ;
620  }
621 
622  if(iForce ||
623  CountAll >= m_parameters.getParameter<ParameterSet>("Categories")
624  .getParameter<ParameterSet>(theCategory)
625  .getParameter<int>("CertMinEvents")){
626 
627  if(m_verbose){cout << " <--------------- Enough Statistics: ";}
628 
629 
630  // Calculating fraction of in time
631  double fraction = 0;
632  if(CountAll >0){fraction = CountSync/CountAll;}
633 
634  // This is to avoid having an entry equal to zero and thus
635  // disregarded by the automatic tests
636  if(fraction==0){fraction=0.000001;}
637 
638  certifyLSBlock(theTriggerAlias,fLS,lLS,fraction);
639  m_certFirstLS[theTriggerAlias] = 0;
640  m_certLastLS [theTriggerAlias] = 0;
641  }
642 
643  if(m_verbose){cout << endl;}
644 
645  }
646  }
647 
648  // A problem was found. We report it and set a not physical vale (-1) to the certification plot
649  else{
650 
651  // If trigger alias is not valid report it to m_ErrorMonitor
652  if(!triggerAlias_isValid){
653  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_TRIGGERALIAS_NOTVALID);
654  eCount++;
655  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_TRIGGERALIAS_NOTVALID,eCount);
656  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
657  m_certFirstLS[theTriggerAlias] = 0;
658  m_certLastLS [theTriggerAlias] = 0;
659  }
660 
661  // If LS Block is not valid report it to m_ErrorMonitor
662  if(lsBlock_exists && !lsBlock_isValid){
663  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(ERROR_LSBLOCK_NOTVALID);
664  eCount++;
665  m_ErrorMonitor->getTH1()->SetBinContent(ERROR_LSBLOCK_NOTVALID,eCount);
666  certifyLSBlock(theTriggerAlias,fLS,lLS,-1);
667  m_certFirstLS[theTriggerAlias] = 0;
668  m_certLastLS [theTriggerAlias] = 0;
669  }
670 
671  }
672  }
673 
674 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:133
def ls
Definition: eostools.py:346
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:132
bool m_verbose
Definition: L1TSync.h:114
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
Definition: L1TSync.cc:685
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:135
TH1 * getTH1(void) const
edm::ParameterSet m_parameters
Definition: L1TSync.h:109
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:140
void L1TSync::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
protectedvirtual

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 202 of file L1TSync.cc.

References gather_cfg::cout.

202  {
203  //
204  if (m_verbose){cout << "[L1TSync] Called beginRun." << endl;}
205 }
bool m_verbose
Definition: L1TSync.h:114
tuple cout
Definition: gather_cfg.py:121
void L1TSync::endLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 317 of file L1TSync.cc.

References gather_cfg::cout, and i.

317  {
318 
319  if(m_verbose){cout << "[L1TSync] Called endLuminosityBlock." << endl;}
320 
321  if(m_verbose){
322  cout << "[L1TSync] m_currentLSValid : " << m_currentLSValid << endl;
323  cout << "[L1TSync] m_beamConfig.isValid(): " << m_beamConfig.isValid() << endl;
324  }
325 
326  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
327 
328  // Update last LS for certification
329  string theTriggerAlias = (*i).second;
330  m_certLastLS[theTriggerAlias] = m_currentLS;
331 
332  }
333 
334  // If this LS is valid (i.e. all events recorded with stable beams)
336 
337  if(m_verbose){cout << "[L1TSync] Regular call: doFractionInSync()" << endl;}
338  doFractionInSync(false,false);
339 
340  }
341  // If this LS is not valid it can be in the following context:
342  // * We still hadn't stable beam (no need to certify nothing
343  // * Beam just got unstable or dumped (we may have a complete block of data do certify)
344  else{
345 
346  //-> First we close all blocks from certFirstLS[] to m_currentLS-1
347  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
348 
349  string theTriggerAlias = (*i).second;
350 
351  int fLs = m_certFirstLS[theTriggerAlias];
352  int lLS = m_certLastLS [theTriggerAlias];
353 
354  // If this is a single LS block we do nothing (in this step)
355  if(fLs == lLS){
356  m_certFirstLS[theTriggerAlias] = 0;
357  m_certLastLS [theTriggerAlias] = 0;
358  }
359  // If block is multi LS then we remove the current LS
360  else{
361  m_certLastLS [theTriggerAlias] = m_currentLS-1;
362  }
363 
364  }
365  doFractionInSync(true,false);
366 
367  //-> Second we mark this single LS bad for all triggers
368  for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
369  string theTriggerAlias = (*i).second;
370  m_certFirstLS[theTriggerAlias] = m_currentLS;
371  m_certLastLS [theTriggerAlias] = m_currentLS;
372  }
373  doFractionInSync(true,true);
374 
375  if(m_verbose){cout << "[L1TSync] Error call: doFractionInSync()" << endl;}
376 
377  }
378 
379 }
int i
Definition: DBlmapReader.cc:9
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:133
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:574
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:137
BeamConfiguration m_beamConfig
Definition: L1TSync.h:125
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:132
bool m_verbose
Definition: L1TSync.h:114
bool m_currentLSValid
Definition: L1TSync.h:115
tuple cout
Definition: gather_cfg.py:121
unsigned int m_currentLS
Definition: L1TSync.h:120
void L1TSync::getBeamConfOMDS ( )
private

Definition at line 494 of file L1TSync.cc.

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

494  {
495 
496  //Getting connection paremeters
497  string oracleDB = m_parameters.getParameter<string>("oracleDB");
498  string pathCondDB = m_parameters.getParameter<string>("pathCondDB");
499 
500  // Connecting to OMDS
501  L1TOMDSHelper myOMDSHelper = L1TOMDSHelper();
502  int conError;
503  myOMDSHelper.connect(oracleDB,pathCondDB,conError);
504 
505  if(conError == L1TOMDSHelper::NO_ERROR){
506 
507  if(m_verbose){cout << "[L1TSync] Connected to DB with no error." << endl;}
508 
509  int errorRetrive;
510  m_beamConfig = myOMDSHelper.getBeamConfiguration(m_lhcFill,errorRetrive);
511 
512  if(errorRetrive == L1TOMDSHelper::NO_ERROR){
513  if(m_verbose){
514  cout << "[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
515  cout << "[L1TSync] -> LHC Bunch Structure valid=" << m_beamConfig.m_valid << " nBunches=" << m_beamConfig.nCollidingBunches << endl;
516  }
517  }
518  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_CONN_FAILED){
519 
520  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;}
521 
522  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_INCORRECT_NBUNCHES);
523  eCount++;
524  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_INCORRECT_NBUNCHES,eCount);
525  }
526  else if(errorRetrive == L1TOMDSHelper::WARNING_DB_QUERY_FAILED){
527 
528  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;}
529 
530  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_QUERY_FAILED);
531  eCount++;
532  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_QUERY_FAILED,eCount);
533  }
534  else{
535 
536  if(m_verbose){cout << "[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;}
537 
538  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
539  eCount++;
540  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
541  }
542 
543  }else{
544 
546 
547  if(m_verbose){cout << "[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;}
548 
549  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_DB_CONN_FAILED);
550  eCount++;
551  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_DB_CONN_FAILED,eCount);
552  }else{
553 
554  if(m_verbose){cout << "[L1TSync] Connect to DB: UNKNOWN" << endl;}
555 
556  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(UNKNOWN);
557  eCount++;
558  m_ErrorMonitor->getTH1()->SetBinContent(UNKNOWN,eCount);
559  }
560 
561  }
562 
563 }
T getParameter(std::string const &) const
unsigned int m_lhcFill
Definition: L1TSync.h:122
BeamConfiguration m_beamConfig
Definition: L1TSync.h:125
bool m_verbose
Definition: L1TSync.h:114
TH1 * getTH1(void) const
edm::ParameterSet m_parameters
Definition: L1TSync.h:109
tuple cout
Definition: gather_cfg.py:121
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:140

Member Data Documentation

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

Definition at line 128 of file L1TSync.h.

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

Definition at line 136 of file L1TSync.h.

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

Definition at line 131 of file L1TSync.h.

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

Definition at line 134 of file L1TSync.h.

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

Definition at line 135 of file L1TSync.h.

BeamConfiguration L1TSync::m_beamConfig
private

Definition at line 125 of file L1TSync.h.

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

Definition at line 132 of file L1TSync.h.

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

Definition at line 133 of file L1TSync.h.

unsigned int L1TSync::m_currentLS
private

Definition at line 120 of file L1TSync.h.

bool L1TSync::m_currentLSValid
private

Definition at line 115 of file L1TSync.h.

MonitorElement* L1TSync::m_ErrorMonitor
private

Definition at line 140 of file L1TSync.h.

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

Definition at line 144 of file L1TSync.h.

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

Definition at line 143 of file L1TSync.h.

unsigned int L1TSync::m_lhcFill
private

Definition at line 122 of file L1TSync.h.

std::string L1TSync::m_outputFile
private

Definition at line 111 of file L1TSync.h.

edm::ParameterSet L1TSync::m_parameters
private

Definition at line 109 of file L1TSync.h.

bool* L1TSync::m_processedLS
private

Definition at line 116 of file L1TSync.h.

int L1TSync::m_refPrescaleSet
private

Definition at line 119 of file L1TSync.h.

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

Definition at line 137 of file L1TSync.h.

bool L1TSync::m_verbose
private

Definition at line 114 of file L1TSync.h.