41 m_l1GtUtils(pset, consumesCollector(),
false, *this){
54 bool forceGlobalParameters = Categories.
getParameter<
bool>(
"forceGlobalParameters");
55 bool doGlobalAutoSelection = Categories.getParameter<
bool>(
"doGlobalAutoSelection");
72 if(forceGlobalParameters){
76 if(doGlobalAutoSelection){
106 if(CatMu .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"Mu"] = CatMu .getParameter<
string>(
"algo");}
107 if(CatEG .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"EG"] = CatEG .getParameter<
string>(
"algo");}
108 if(CatIsoEG .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"IsoEG"] = CatIsoEG .getParameter<
string>(
"algo");}
109 if(CatJet .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"Jet"] = CatJet .getParameter<
string>(
"algo");}
110 if(CatCenJet.getParameter<
bool>(
"monitor")){
m_selectedTriggers[
"CenJet"] = CatCenJet.getParameter<
string>(
"algo");}
111 if(CatForJet.getParameter<
bool>(
"monitor")){
m_selectedTriggers[
"CatForJet"] = CatForJet.getParameter<
string>(
"algo");}
112 if(CatTauJet.getParameter<
bool>(
"monitor")){
m_selectedTriggers[
"TauJet"] = CatTauJet.getParameter<
string>(
"algo");}
113 if(CatETM .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"ETM"] = CatETM .getParameter<
string>(
"algo");}
114 if(CatETT .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"ETT"] = CatETT .getParameter<
string>(
"algo");}
115 if(CatHTM .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"HTM"] = CatHTM .getParameter<
string>(
"algo");}
116 if(CatHTT .getParameter<bool>(
"monitor")){
m_selectedTriggers[
"HTT"] = CatHTT .getParameter<
string>(
"algo");}
123 if(CatBPTX.getParameter<
bool>(
"monitor")){
127 if(CatMu.getParameter<
bool>(
"monitor")){
132 if(CatEG.getParameter<
bool>(
"monitor")){
137 if(CatIsoEG.getParameter<
bool>(
"monitor")){
142 if(CatJet.getParameter<
bool>(
"monitor")){
147 if(CatCenJet.getParameter<
bool>(
"monitor")){
148 m_algoAutoSelect[
"CenJet"] = CatCenJet.getParameter<
bool>(
"doAutoSelection");
152 if(CatForJet.getParameter<
bool>(
"monitor")){
153 m_algoAutoSelect[
"CatForJet"] = CatForJet.getParameter<
bool>(
"doAutoSelection");
157 if(CatTauJet.getParameter<
bool>(
"monitor")){
158 m_algoAutoSelect[
"TauJet"] = CatTauJet.getParameter<
bool>(
"doAutoSelection");
162 if(CatETM.getParameter<
bool>(
"monitor")){
167 if(CatETT.getParameter<
bool>(
"monitor")){
172 if(CatHTM.getParameter<
bool>(
"monitor")){
177 if(CatHTT.getParameter<
bool>(
"monitor")){
205 if (
m_verbose){
cout <<
"[L1TSync] Called beginRun." << endl;}
260 string tCategory = (*i).first;
261 string tTrigger = (*i).second;
269 m_algoVsBunchStructure[tTrigger] = ibooker.
book2D(tCategory,
"min #Delta("+tTrigger+
",Bunch)",maxNbins,-0.5,
double(maxNbins)-0.5,5,-2.5,2.5);
273 m_algoCertification[tTrigger] = ibooker.
book1D(tCategory,
"fraction of in sync: "+tTrigger,maxNbins,-0.5,
double(maxNbins)-0.5);
285 if (
m_verbose){
cout <<
"[L1TSync] Called beginLuminosityBlock." << endl;}
292 cout <<
"[L1TSync] None consecutive: doFractionInSync() - LAST="
304 string theTriggerAlias = (*i).second;
321 if(
m_verbose){
cout <<
"[L1TSync] Called endLuminosityBlock." << endl;}
331 string theTriggerAlias = (*i).second;
339 if(
m_verbose){
cout <<
"[L1TSync] Regular call: doFractionInSync()" << endl;}
351 string theTriggerAlias = (*i).second;
371 string theTriggerAlias = (*i).second;
377 if(
m_verbose){
cout <<
"[L1TSync] Error call: doFractionInSync()" << endl;}
398 if(gtEvmReadoutRecord.
isValid()){
400 const L1GtfeExtWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
401 unsigned int lhcBeamMode = gtfeEvmWord.
beamMode();
428 if(gtReadoutRecordData.
isValid()){
430 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
435 string tTrigger = (*i).second;
438 if(tTrigger !=
"Undefined" && tTrigger !=
"Undefined (Wrong Name)"){
440 bool beamSingleConfig =
false;
441 bool firedAlgo =
false;
445 for(
unsigned int a=0 ;
a<gtFdlVectorData.size() ;
a++){
448 if(gtFdlVectorData[
a].bxInEvent() == 0){
449 eventBx = gtFdlVectorData[
a].localBxNr();
450 if(gtFdlVectorData[
a].gtDecisionWord()[
m_algoBit[tTrigger] ]){firedAlgo =
true;}
462 if(firedAlgo && !beamSingleConfig){
464 int DifAlgoVsBunchStructure = 9999;
466 for(
unsigned int a=0 ;
a<gtFdlVectorData.size() ;
a++){
468 int bxFDL = gtFdlVectorData[
a].localBxNr();
469 int bxInEvent = gtFdlVectorData[
a].bxInEvent();
472 DifAlgoVsBunchStructure = -1*bxInEvent;
505 myOMDSHelper.connect(oracleDB,pathCondDB,conError);
509 if(
m_verbose){
cout <<
"[L1TSync] Connected to DB with no error." << endl;}
516 cout <<
"[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
522 if(
m_verbose){
cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;}
530 if(
m_verbose){
cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;}
538 if(
m_verbose){
cout <<
"[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;}
549 if(
m_verbose){
cout <<
"[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;}
556 if(
m_verbose){
cout <<
"[L1TSync] Connect to DB: UNKNOWN" << endl;}
580 string theCategory = (*i).first;
581 string theTriggerAlias = (*i).second;
588 bool triggerAlias_isValid = theTriggerAlias !=
"Undefined" && theTriggerAlias !=
"Undefined (Wrong Name)";
589 bool lsBlock_exists = !(fLS == 0 && lLS == 0);
590 bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
592 if(triggerAlias_isValid && lsBlock_exists && lsBlock_isValid){
605 double CountSync = 0;
609 for(
unsigned int ls=fLS ;
ls<=lLS ;
ls++){
612 for(
int a=1 ;
a<6 ;
a++){
618 cout <<
"Alias = " << theTriggerAlias
621 <<
" Events=" << CountAll ;
629 if(
m_verbose){
cout <<
" <--------------- Enough Statistics: ";}
634 if(CountAll >0){fraction = CountSync/CountAll;}
638 if(fraction==0){fraction=0.000001;}
654 if(!triggerAlias_isValid){
664 if(lsBlock_exists && !lsBlock_isValid){
693 for(
int ls=binInit ;
ls<=binEnd ;
ls++){
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< TString, unsigned int > m_certLastLS
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void doFractionInSync(bool iForce=false, bool iBad=false)
L1TSync(const edm::ParameterSet &ps)
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)
std::map< std::string, std::string > m_selectedTriggers
BeamConfiguration m_beamConfig
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::map< TString, unsigned int > m_certFirstLS
std::map< std::string, bool > m_algoAutoSelect
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
BeginRun.
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
MonitorElement * book1D(Args &&...args)
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Abs< T >::type abs(const T &t)
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
virtual void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
const cms_uint32_t lhcFillNumber() const
edm::ParameterSet m_parameters
T const * product() const
LuminosityBlockNumber_t luminosityBlock() const
std::vector< bool > beam2
MonitorElement * m_ErrorMonitor
std::map< TString, MonitorElement * > m_algoCertification
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
volatile std::atomic< bool > shutdown_flag false
std::map< TString, int > m_algoBit
std::vector< bool > beam1
const cms_uint16_t beamMode() const