59 std::map<edm::EventNumber_t, long long>
_offsets;
76 : _l1abccollectionToken(
79 _forceNoOffset(iConfig.getUntrackedParameter<
bool>(
"forceNoOffset",
false)),
80 _forceSCAL(iConfig.getParameter<
bool>(
"forceSCAL")),
85 edm::LogWarning(
"NoOffsetComputation") <<
"Orbit and BX offset will NOT be computed: Be careful!";
87 produces<EventWithHistory>();
105 if (
iEvent.run() < 110878) {
116 const auto* tcdsRecord = useTCDS ? tcds_pIn.
product() :
nullptr;
119 long long orbitoffset = 0;
124 if (tcdsRecord->getL1aHistoryEntry(0).getIndex() == 0) {
125 orbitoffset = (
long long)tcdsRecord->
getOrbitNr() - (
long long)
iEvent.orbitNumber();
126 bxoffset = tcdsRecord->getBXID() -
iEvent.bunchCrossing();
131 for (L1AcceptBunchCrossingCollection::const_iterator l1abc = pIn->begin(); l1abc != pIn->end(); ++l1abc) {
132 if (l1abc->l1AcceptOffset() == 0) {
133 orbitoffset = (
long long)l1abc->orbitNumber() - (
long long)
iEvent.orbitNumber();
134 bxoffset = l1abc->bunchCrossing() -
iEvent.bunchCrossing();
140 std::unique_ptr<EventWithHistory> pOut(useTCDS ?
new EventWithHistory(
iEvent, *tcdsRecord, orbitoffset, bxoffset)
146 long long absbxoffset = orbitoffset * 3564 + bxoffset;
156 <<
"Absolute BX offset changed from " <<
_curroffset <<
" to " << absbxoffset <<
" at orbit "
157 <<
iEvent.orbitNumber() <<
" and BX " <<
iEvent.bunchCrossing();
161 for (L1AcceptBunchCrossingCollection::const_iterator l1abc = pIn->begin(); l1abc != pIn->end(); ++l1abc) {
179 edm::LogInfo(
"AbsoluteBXOffsetReset") <<
"Absolute BX offset map reset";
185 edm::LogInfo(
"AbsoluteBXOffsetSummary") <<
"Absolute BX offset summary:";