27constexpr int prop_per_nplet{6};
47 ISvcLocator* pSvcLocator)
48 : base_class(name, pSvcLocator) {
52 "(RunNumber,EvtNbr,TimeStamp,LumiBlock,Nevents,ModBit).");
55 "Name of the event store whose EventIDs will be modified.");
58 "Number of events to skip before modifying EventIDs.");
60 "Number of events skipped in the EventSelector.");
69 nplets_prop_count > 0) {
71 if (nplets_prop_count % prop_per_nplet != 0) {
73 << prop_per_nplet <<
")" <<
endmsg <<
"check your joboptions !");
74 return StatusCode::FAILURE;
77 m_evtNplets.reserve(nplets_prop_count / prop_per_nplet);
78 for (std::size_t i = 0; i < nplets_prop_count; i += prop_per_nplet) {
100 if (msgLvl(MSG::DEBUG)) {
102 <<
endmsg <<
"evtid-modifiers: [ ";
104 msg(MSG::DEBUG) <<
"[" << elem.runnbr <<
", " << elem.evtnbr <<
", "
105 << elem.timestamp <<
", " << elem.lbknbr <<
", "
106 << elem.nevts <<
", flags=0x" << std::hex << elem.flags
107 << std::dec <<
"], ";
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();
158 ATH_MSG_DEBUG(
"evtid before massaging: " <<
"(" << evt_id.run_number() <<
", "
159 << evt_id.event_number() <<
", "
160 << evt_id.time_stamp() <<
", "
161 << evt_id.lumi_block() <<
")");
167 ATH_MSG_DEBUG(
"Got event idx " << evt_index <<
" --(account for skipping)--> "
168 << idx <<
" --(modulo #modifiers)--> "
181 <<
" (LB: " << current.lbknbr <<
")");
188 if (current.flags & ModFlag::RUNNBR) {
189 evt_id.set_run_number(current.runnbr);
191 if (current.flags & ModFlag::EVTNBR) {
192 evt_id.set_event_number(current.evtnbr);
194 if (current.flags & ModFlag::TIMESTAMP) {
195 evt_id.set_time_stamp(current.timestamp);
197 if (current.flags & ModFlag::LBKNBR) {
198 evt_id.set_lumi_block(current.lbknbr);
201 ATH_MSG_DEBUG(
"evtid after massaging: " <<
"(" << evt_id.run_number() <<
", "
202 << evt_id.event_number() <<
", "
203 << evt_id.time_stamp() <<
", "
204 << evt_id.lumi_block() <<
")");
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