63 m_l1GtUtils(
pset, consumesCollector(),
false, *this) {
69 m_verbose =
pset.getUntrackedParameter<
bool>(
"verbose",
false);
97 if (CatMu.getParameter<
bool>(
"monitor")) {
102 if (CatEG.getParameter<
bool>(
"monitor")) {
107 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
112 if (CatJet.getParameter<
bool>(
"monitor")) {
117 if (CatCenJet.getParameter<
bool>(
"monitor")) {
122 if (CatForJet.getParameter<
bool>(
"monitor")) {
127 if (CatTauJet.getParameter<
bool>(
"monitor")) {
132 if (CatETM.getParameter<
bool>(
"monitor")) {
137 if (CatETT.getParameter<
bool>(
"monitor")) {
142 if (CatHTM.getParameter<
bool>(
"monitor")) {
147 if (CatHTT.getParameter<
bool>(
"monitor")) {
168 if (CatMu.getParameter<
bool>(
"monitor")) {
171 if (CatEG.getParameter<
bool>(
"monitor")) {
174 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
177 if (CatJet.getParameter<
bool>(
"monitor")) {
180 if (CatCenJet.getParameter<
bool>(
"monitor")) {
183 if (CatForJet.getParameter<
bool>(
"monitor")) {
186 if (CatTauJet.getParameter<
bool>(
"monitor")) {
189 if (CatETM.getParameter<
bool>(
"monitor")) {
192 if (CatETT.getParameter<
bool>(
"monitor")) {
195 if (CatHTM.getParameter<
bool>(
"monitor")) {
198 if (CatHTT.getParameter<
bool>(
"monitor")) {
205 if (CatBPTX.getParameter<
bool>(
"monitor")) {
209 if (CatMu.getParameter<
bool>(
"monitor")) {
218 if (CatEG.getParameter<
bool>(
"monitor")) {
227 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
236 if (CatJet.getParameter<
bool>(
"monitor")) {
245 if (CatCenJet.getParameter<
bool>(
"monitor")) {
246 m_algoAutoSelect[
"CenJet"] = CatCenJet.getParameter<
bool>(
"doAutoSelection");
254 if (CatForJet.getParameter<
bool>(
"monitor")) {
255 m_algoAutoSelect[
"CatForJet"] = CatForJet.getParameter<
bool>(
"doAutoSelection");
263 if (CatTauJet.getParameter<
bool>(
"monitor")) {
264 m_algoAutoSelect[
"TauJet"] = CatTauJet.getParameter<
bool>(
"doAutoSelection");
272 if (CatETM.getParameter<
bool>(
"monitor")) {
281 if (CatETT.getParameter<
bool>(
"monitor")) {
290 if (CatHTM.getParameter<
bool>(
"monitor")) {
299 if (CatHTT.getParameter<
bool>(
"monitor")) {
322 cout <<
"[L1TSync_Offline] Called beginRun." << endl;
337 for (
const auto&
algo :
menu.gtAlgorithmAliasMap()) {
365 "WARNING_DB_INCORRECT_NBUNCHES");
372 string tCategory = (*i).first;
373 string tTrigger = (*i).second;
382 tCategory,
"min #Delta(" + tTrigger +
",Bunch)", maxNbins, -0.5,
double(maxNbins) - 0.5, 5, -2.5, 2.5);
387 ibooker.
book1D(tCategory,
"fraction of in sync: " + tTrigger, maxNbins, -0.5,
double(maxNbins) - 0.5);
398 cout <<
"[L1TSync_Offline] Called beginLuminosityBlock." << endl;
401 return std::make_shared<ltso::LSValid>();
407 cout <<
"[L1TSync_Offline] Called analyze." << endl;
411 auto& currentLSValid = luminosityBlockCache(
iEvent.getLuminosityBlock().index())->lsIsValid;
412 if (currentLSValid) {
414 cout <<
"[L1TSync_Offline] -> currentLSValid=" << currentLSValid << endl;
422 if (gtEvmReadoutRecord.
isValid()) {
424 unsigned int lhcBeamMode = gtfeEvmWord.
beamMode();
441 if (lhcBeamMode !=
STABLE) {
442 currentLSValid =
false;
444 cout <<
"[L1TSync_Offline] -> currentLSValid=" << currentLSValid <<
"because beams mode not stable, being "
445 << lhcBeamMode << endl;
455 cout <<
"[L1TSync_Offline] -> currentLSValid=" << currentLSValid << endl;
471 if (gtReadoutRecordData.
isValid()) {
472 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
476 string tTrigger = (*i).second;
479 if (tTrigger !=
"Undefined" && tTrigger !=
"Undefined (Wrong Name)") {
480 bool beamSingleConfig =
false;
481 bool firedAlgo =
false;
482 unsigned int eventBx = ~0;
485 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
487 if (gtFdlVectorData[
a].bxInEvent() == 0) {
488 eventBx = gtFdlVectorData[
a].localBxNr();
489 if (gtFdlVectorData[
a].gtDecisionWord()[
m_algoBit[tTrigger]]) {
498 beamSingleConfig =
true;
501 beamSingleConfig =
true;
508 if (firedAlgo && !beamSingleConfig) {
509 int DifAlgoVsBunchStructure = 9999;
511 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
512 int bxFDL = gtFdlVectorData[
a].localBxNr();
513 int bxInEvent = gtFdlVectorData[
a].bxInEvent();
516 DifAlgoVsBunchStructure = -1 * bxInEvent;
562 bool firedAlgo =
false;
570 if (gtReadoutRecordData.
isValid()) {
571 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
573 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
575 if (gtFdlVectorData[
a].bxInEvent() == 0) {