59 std::map<edm::EventNumber_t, long long>
_offsets;
76 : _l1abccollectionToken(
78 _tcdsRecordToken(mayConsume<
TCDSRecord>(iConfig.getParameter<edm::
InputTag>(
"tcdsRecordLabel"))),
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();
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();
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 "
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:";
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< TCDSRecord > _tcdsRecordToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~EventWithHistoryProducerFromL1ABC() override
#define DEFINE_FWK_MODULE(type)
int bunchCrossing() const
unsigned long long EventNumber_t
edm::EventNumber_t _curroffevent
const bool _forceNoOffset
EventWithHistoryProducerFromL1ABC(const edm::ParameterSet &)
Class to contain information from TCDS FED.
std::map< edm::EventNumber_t, long long > _offsets
_forceSCAL(iConfig.getParameter< bool >("forceSCAL"))
void endRun(const edm::Run &, const edm::EventSetup &) override
void beginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< L1AcceptBunchCrossing > L1AcceptBunchCrossingCollection
Log< level::Info, false > LogInfo
T const * product() const
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< L1AcceptBunchCrossingCollection > _l1abccollectionToken
Log< level::Warning, false > LogWarning