40 m_l1GtUtils(
pset, consumesCollector(),
false, *this) {
46 m_verbose =
pset.getUntrackedParameter<
bool>(
"verbose",
false);
74 if (CatMu.getParameter<
bool>(
"monitor")) {
79 if (CatEG.getParameter<
bool>(
"monitor")) {
84 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
89 if (CatJet.getParameter<
bool>(
"monitor")) {
94 if (CatCenJet.getParameter<
bool>(
"monitor")) {
99 if (CatForJet.getParameter<
bool>(
"monitor")) {
104 if (CatTauJet.getParameter<
bool>(
"monitor")) {
109 if (CatETM.getParameter<
bool>(
"monitor")) {
114 if (CatETT.getParameter<
bool>(
"monitor")) {
119 if (CatHTM.getParameter<
bool>(
"monitor")) {
124 if (CatHTT.getParameter<
bool>(
"monitor")) {
145 if (CatMu.getParameter<
bool>(
"monitor")) {
148 if (CatEG.getParameter<
bool>(
"monitor")) {
151 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
154 if (CatJet.getParameter<
bool>(
"monitor")) {
157 if (CatCenJet.getParameter<
bool>(
"monitor")) {
160 if (CatForJet.getParameter<
bool>(
"monitor")) {
163 if (CatTauJet.getParameter<
bool>(
"monitor")) {
166 if (CatETM.getParameter<
bool>(
"monitor")) {
169 if (CatETT.getParameter<
bool>(
"monitor")) {
172 if (CatHTM.getParameter<
bool>(
"monitor")) {
175 if (CatHTT.getParameter<
bool>(
"monitor")) {
182 if (CatBPTX.getParameter<
bool>(
"monitor")) {
186 if (CatMu.getParameter<
bool>(
"monitor")) {
195 if (CatEG.getParameter<
bool>(
"monitor")) {
204 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
213 if (CatJet.getParameter<
bool>(
"monitor")) {
222 if (CatCenJet.getParameter<
bool>(
"monitor")) {
223 m_algoAutoSelect[
"CenJet"] = CatCenJet.getParameter<
bool>(
"doAutoSelection");
231 if (CatForJet.getParameter<
bool>(
"monitor")) {
232 m_algoAutoSelect[
"CatForJet"] = CatForJet.getParameter<
bool>(
"doAutoSelection");
240 if (CatTauJet.getParameter<
bool>(
"monitor")) {
241 m_algoAutoSelect[
"TauJet"] = CatTauJet.getParameter<
bool>(
"doAutoSelection");
249 if (CatETM.getParameter<
bool>(
"monitor")) {
258 if (CatETT.getParameter<
bool>(
"monitor")) {
267 if (CatHTM.getParameter<
bool>(
"monitor")) {
276 if (CatHTT.getParameter<
bool>(
"monitor")) {
292 bool disable =
pset.getUntrackedParameter<
bool>(
"disableROOToutput",
false);
307 cout <<
"[L1TSync] Called beginRun." << endl;
325 for (
const auto&
algo :
menu.gtAlgorithmAliasMap()) {
353 "WARNING_DB_INCORRECT_NBUNCHES");
360 string tCategory = (*i).first;
361 string tTrigger = (*i).second;
370 tCategory,
"min #Delta(" + tTrigger +
",Bunch)", maxNbins, -0.5,
double(maxNbins) - 0.5, 5, -2.5, 2.5);
375 ibooker.
book1D(tCategory,
"fraction of in sync: " + tTrigger, maxNbins, -0.5,
double(maxNbins) - 0.5);
385 cout <<
"[L1TSync] Called beginLuminosityBlock." << endl;
392 cout <<
"[L1TSync] None consecutive: doFractionInSync() - LAST=" <<
m_currentLS 403 string theTriggerAlias = (*i).second;
420 cout <<
"[L1TSync] Called endLuminosityBlock." << endl;
430 string theTriggerAlias = (*i).second;
437 cout <<
"[L1TSync] Regular call: doFractionInSync()" << endl;
448 string theTriggerAlias = (*i).second;
467 string theTriggerAlias = (*i).second;
474 cout <<
"[L1TSync] Error call: doFractionInSync()" << endl;
482 cout <<
"[L1TSync] Called analyze." << endl;
496 if (gtEvmReadoutRecord.
isValid()) {
498 unsigned int lhcBeamMode = gtfeEvmWord.
beamMode();
505 if (lhcBeamMode !=
STABLE) {
528 if (gtReadoutRecordData.
isValid()) {
529 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
533 string tTrigger = (*i).second;
536 if (tTrigger !=
"Undefined" && tTrigger !=
"Undefined (Wrong Name)") {
537 bool beamSingleConfig =
false;
538 bool firedAlgo =
false;
542 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
544 if (gtFdlVectorData[
a].bxInEvent() == 0) {
545 eventBx = gtFdlVectorData[
a].localBxNr();
546 if (gtFdlVectorData[
a].gtDecisionWord()[
m_algoBit[tTrigger]]) {
554 beamSingleConfig =
true;
557 beamSingleConfig =
true;
564 if (firedAlgo && !beamSingleConfig) {
565 int DifAlgoVsBunchStructure = 9999;
567 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
568 int bxFDL = gtFdlVectorData[
a].localBxNr();
569 int bxInEvent = gtFdlVectorData[
a].bxInEvent();
572 DifAlgoVsBunchStructure = -1 * bxInEvent;
605 cout <<
"[L1TSync] Connected to DB with no error." << endl;
613 cout <<
"[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
619 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;
627 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;
635 cout <<
"[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;
646 cout <<
"[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;
654 cout <<
"[L1TSync] Connect to DB: UNKNOWN" << endl;
675 string theCategory = (*i).first;
676 string theTriggerAlias = (*i).second;
683 bool triggerAlias_isValid = theTriggerAlias !=
"Undefined" && theTriggerAlias !=
"Undefined (Wrong Name)";
684 bool lsBlock_exists = !(
fLS == 0 && lLS == 0);
685 bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
687 if (triggerAlias_isValid && lsBlock_exists && lsBlock_isValid) {
689 if (iForce && iBad) {
698 double CountSync = 0;
702 for (
unsigned int ls =
fLS;
ls <= lLS;
ls++) {
704 for (
int a = 1;
a < 6;
a++) {
710 cout <<
"Alias = " << theTriggerAlias <<
" InitLS=" <<
fLS <<
" EndLS=" << lLS <<
" Events=" << CountAll;
717 cout <<
" <--------------- Enough Statistics: ";
746 if (!triggerAlias_isValid) {
756 if (lsBlock_exists && !lsBlock_isValid) {
781 for (
int ls = binInit;
ls <= binEnd;
ls++) {
LuminosityBlockNumber_t luminosityBlock() const
T getParameter(std::string const &) const
void retrieveL1EventSetup(const edm::EventSetup &, bool isRun=true)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
const cms_uint16_t beamMode() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::map< TString, int > m_algoBit
virtual void setCurrentFolder(std::string const &fullpath)
void doFractionInSync(bool iForce=false, bool iBad=false)
L1TMenuHelper::Tokens m_helperTokens
L1TSync(const edm::ParameterSet &ps)
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
BeamConfiguration m_beamConfig
std::map< TString, MonitorElement * > m_algoVsBunchStructure
const std::vector< L1GtFdlWord > gtFdlVector() const
get the vector of L1GtFdlWord
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
const cms_uint32_t lhcFillNumber() const
Abs< T >::type abs(const T &t)
std::map< TString, unsigned int > m_certFirstLS
virtual 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)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
std::map< std::string, bool > m_algoAutoSelect
LuminosityBlockID id() const
edm::ParameterSet m_parameters
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
std::map< TString, MonitorElement * > m_algoCertification
std::map< TString, unsigned int > m_certLastLS
std::vector< bool > beam2
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * m_ErrorMonitor
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< bool > beam1
std::map< std::string, std::string > m_selectedTriggers
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
BeginRun.
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_menuToken