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++) {