28constexpr int prop_per_nplet{6};
48 ISvcLocator* pSvcLocator)
49 : base_class(name, pSvcLocator) {
53 "(RunNumber,EvtNbr,TimeStamp,LumiBlock,Nevents,ModBit).");
56 "Name of the event store whose EventIDs will be modified.");
59 "Number of events to skip before modifying EventIDs.");
61 "Number of events skipped in the EventSelector.");
70 nplets_prop_count > 0) {
72 if (nplets_prop_count % prop_per_nplet != 0) {
73 ATH_MSG_ERROR(
"invalid list of n-plets (not divisible by {})\ncheck your joboptions !",
75 return StatusCode::FAILURE;
78 m_evtNplets.reserve(nplets_prop_count / prop_per_nplet);
79 for (std::size_t i = 0; i < nplets_prop_count; i += prop_per_nplet) {
101 if (msgLvl(MSG::DEBUG)) {
103 std::ostringstream mods;
105 std::print (mods,
"[{}, {}, {}, {}, {}, flags={:#x}], ",
106 elem.runnbr, elem.evtnbr, elem.timestamp, elem.lbknbr,
107 elem.nevts, elem.flags);
112 return StatusCode::SUCCESS;
122 std::set<number_type> runs;
125 if (elem.flags & ModFlag::RUNNBR) {
126 runs.insert(elem.runnbr);
129 return std::vector(runs.begin(), runs.end());
139 bool consume_stream) {
144 if (consume_stream) {
147 ATH_MSG_INFO(
"could not retrieve the active evtstore - bailing out");
151 const std::string& evtStoreName = active->name();
159 evt_id.run_number(), evt_id.event_number(), evt_id.time_stamp(),
160 evt_id.lumi_block());
166 ATH_MSG_DEBUG(
"Got event idx {} --(account for skipping)--> {} --(modulo #modifiers)--> {}",
167 evt_index, idx, idx_looped);
178 ATH_MSG_DEBUG(
"Unique modifier index {} (LB: {})", mod_idx, current.lbknbr);
185 if (current.flags & ModFlag::RUNNBR) {
186 evt_id.set_run_number(current.runnbr);
188 if (current.flags & ModFlag::EVTNBR) {
189 evt_id.set_event_number(current.evtnbr);
191 if (current.flags & ModFlag::TIMESTAMP) {
192 evt_id.set_time_stamp(current.timestamp);
194 if (current.flags & ModFlag::LBKNBR) {
195 evt_id.set_lumi_block(current.lbknbr);
199 evt_id.run_number(), evt_id.event_number(), evt_id.time_stamp(),
200 evt_id.lumi_block());
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventIDBase::event_number_t event_number_t
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
event_number_t m_firstEvtIdx
(prop) first event number at which we begin to modify event ids
EvtIdModifierSvc()
Default constructor:
event_number_t m_skippedEvents
(prop) number of events skipped in the event selector
virtual void modify_evtid(EventID &evt_id, event_number_t evt_index, bool consume_stream) override
modify an EventID's lumi block content.
std::vector< uint64_t > m_evtNpletsProp
(prop) list of n-plets (run-nbr, evt-nbr, time-stamp, lbk-nbr, nbr-of-events-per-lbk,...
std::vector< event_number_t > m_numEvtTotals
Running total of numEvts before each modifier.
virtual StatusCode initialize() override
Gaudi Service Implementation.
std::vector< ItemModifier > m_evtNplets
db of list of ItemModifiers: (run-nbr, evt-nbr, time-stamp, lbk-nbr, nbr-of-events-per-lbk,...
std::string m_evtStoreName
(prop) Name of the event store whose EventIDs will be modified.
virtual std::vector< number_type > run_number_list() const override
return the (sorted) list of run-numbers which will be modified.
EventIDBase::number_type number_type
The Athena Transient Store API.
static StoreGateSvc * currentStoreGate()
get current StoreGate