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;
349 ibooker.setCurrentFolder(
"L1T/L1TSync");
350 m_ErrorMonitor = ibooker.book1D(
"ErrorMonitor",
"ErrorMonitor", 7, 0, 7);
355 "WARNING_DB_INCORRECT_NBUNCHES");
362 string tCategory = (*i).first;
363 string tTrigger = (*i).second;
370 ibooker.setCurrentFolder(
"L1T/L1TSync/AlgoVsBunchStructure/");
372 tCategory,
"min #Delta(" + tTrigger +
",Bunch)", maxNbins, -0.5,
double(maxNbins) - 0.5, 5, -2.5, 2.5);
375 ibooker.setCurrentFolder(
"L1T/L1TSync/Certification/");
377 ibooker.book1D(tCategory,
"fraction of in sync: " + tTrigger, maxNbins, -0.5,
double(maxNbins) - 0.5);
387 cout <<
"[L1TSync] Called beginLuminosityBlock." << endl;
394 cout <<
"[L1TSync] None consecutive: doFractionInSync() - LAST=" <<
m_currentLS
405 string theTriggerAlias = (*i).second;
422 cout <<
"[L1TSync] Called endLuminosityBlock." << endl;
432 string theTriggerAlias = (*i).second;
439 cout <<
"[L1TSync] Regular call: doFractionInSync()" << endl;
450 string theTriggerAlias = (*i).second;
469 string theTriggerAlias = (*i).second;
476 cout <<
"[L1TSync] Error call: doFractionInSync()" << endl;
484 cout <<
"[L1TSync] Called analyze." << endl;
498 if (gtEvmReadoutRecord.
isValid()) {
500 unsigned int lhcBeamMode = gtfeEvmWord.
beamMode();
507 if (lhcBeamMode !=
STABLE) {
530 if (gtReadoutRecordData.
isValid()) {
531 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
535 string tTrigger = (*i).second;
538 if (tTrigger !=
"Undefined" && tTrigger !=
"Undefined (Wrong Name)") {
539 bool beamSingleConfig =
false;
540 bool firedAlgo =
false;
544 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
546 if (gtFdlVectorData[
a].bxInEvent() == 0) {
547 eventBx = gtFdlVectorData[
a].localBxNr();
548 if (gtFdlVectorData[
a].gtDecisionWord()[
m_algoBit[tTrigger]]) {
556 beamSingleConfig =
true;
559 beamSingleConfig =
true;
566 if (firedAlgo && !beamSingleConfig) {
567 int DifAlgoVsBunchStructure = 9999;
569 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
570 int bxFDL = gtFdlVectorData[
a].localBxNr();
571 int bxInEvent = gtFdlVectorData[
a].bxInEvent();
574 DifAlgoVsBunchStructure = -1 * bxInEvent;
607 cout <<
"[L1TSync] Connected to DB with no error." << endl;
615 cout <<
"[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
621 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;
629 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;
637 cout <<
"[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;
648 cout <<
"[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;
656 cout <<
"[L1TSync] Connect to DB: UNKNOWN" << endl;
677 string theCategory = (*i).first;
678 string theTriggerAlias = (*i).second;
685 bool triggerAlias_isValid = theTriggerAlias !=
"Undefined" && theTriggerAlias !=
"Undefined (Wrong Name)";
686 bool lsBlock_exists = !(
fLS == 0 && lLS == 0);
687 bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
689 if (triggerAlias_isValid && lsBlock_exists && lsBlock_isValid) {
691 if (iForce && iBad) {
700 double CountSync = 0;
704 for (
unsigned int ls =
fLS;
ls <= lLS;
ls++) {
706 for (
int a = 1;
a < 6;
a++) {
712 cout <<
"Alias = " << theTriggerAlias <<
" InitLS=" <<
fLS <<
" EndLS=" << lLS <<
" Events=" << CountAll;
719 cout <<
" <--------------- Enough Statistics: ";
748 if (!triggerAlias_isValid) {
758 if (lsBlock_exists && !lsBlock_isValid) {
783 for (
int ls = binInit;
ls <= binEnd;
ls++) {