Skip to content

Commit

Permalink
Merge pull request #37395 from Sam-Harper/L1PSLumiSecFix_1230pre6
Browse files Browse the repository at this point in the history
Adding option to disable resetting L1 PS counters on ls change
  • Loading branch information
cmsbuild committed Apr 5, 2022
2 parents 8827930 + ef923ca commit cb97260
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions L1Trigger/L1TGlobal/interface/GlobalBoard.h
Expand Up @@ -193,6 +193,8 @@ namespace l1t {
void setBxFirst(int bx);
void setBxLast(int bx);

void setResetPSCountersEachLumiSec(bool val) { m_resetPSCountersEachLumiSec = val; }

public:
inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }

Expand Down Expand Up @@ -263,6 +265,9 @@ namespace l1t {
// Information about board
int m_uGtBoardNumber;
bool m_uGtFinalBoard;

//whether we reset the prescales each lumi or not
bool m_resetPSCountersEachLumiSec = true;
};

} // namespace l1t
Expand Down
4 changes: 3 additions & 1 deletion L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.cc
Expand Up @@ -68,7 +68,7 @@ void L1TGlobalProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip

// switch for muon showers in Run-3
desc.add<bool>("useMuonShowers", false);

desc.add<bool>("resetPSCountersEachLumiSec", true);
// These parameters have well defined default values and are not currently
// part of the L1T/HLT interface. They can be cleaned up or updated at will:
desc.add<bool>("ProduceL1GtDaqRecord", true);
Expand Down Expand Up @@ -115,6 +115,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
m_getPrescaleColumnFromData(parSet.getParameter<bool>("GetPrescaleColumnFromData")),
m_requireMenuToMatchAlgoBlkInput(parSet.getParameter<bool>("RequireMenuToMatchAlgoBlkInput")),
m_algoblkInputTag(parSet.getParameter<edm::InputTag>("AlgoBlkInputTag")),
m_resetPSCountersEachLumiSec(parSet.getParameter<bool>("resetPSCountersEachLumiSec")),
m_useMuonShowers(parSet.getParameter<bool>("useMuonShowers")) {
m_egInputToken = consumes<BXVector<EGamma>>(m_egInputTag);
m_tauInputToken = consumes<BXVector<Tau>>(m_tauInputTag);
Expand Down Expand Up @@ -195,6 +196,7 @@ L1TGlobalProducer::L1TGlobalProducer(const edm::ParameterSet& parSet)
// create new uGt Board
m_uGtBrd = std::make_unique<GlobalBoard>();
m_uGtBrd->setVerbosity(m_verbosity);
m_uGtBrd->setResetPSCountersEachLumiSec(m_resetPSCountersEachLumiSec);

// initialize cached IDs

Expand Down
2 changes: 2 additions & 0 deletions L1Trigger/L1TGlobal/plugins/L1TGlobalProducer.h
Expand Up @@ -186,6 +186,8 @@ class L1TGlobalProducer : public edm::stream::EDProducer<> {
edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> m_l1GtMenuToken;
edm::ESGetToken<L1TGlobalPrescalesVetosFract, L1TGlobalPrescalesVetosFractRcd> m_l1GtPrescaleVetosToken;

//disables reseting the prescale counters each lumisection (needed for offline)
bool m_resetPSCountersEachLumiSec;
// switch to load muon showers in the global board
bool m_useMuonShowers;
};
Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/L1TGlobal/src/GlobalBoard.cc
Expand Up @@ -981,12 +981,11 @@ void l1t::GlobalBoard::runFDL(edm::Event& iEvent,
}

// update and clear prescales at the beginning of the luminosity segment
if (m_firstEvLumiSegment || m_currentLumi != iEvent.luminosityBlock()) {
if (m_firstEvLumiSegment || (m_currentLumi != iEvent.luminosityBlock() && m_resetPSCountersEachLumiSec)) {
m_prescaleCounterAlgoTrig.clear();
for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
}

m_firstEvLumiSegment = false;
m_currentLumi = iEvent.luminosityBlock();
}
Expand Down

0 comments on commit cb97260

Please sign in to comment.