ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PileUpEventLoopMgr Class Reference

The ATLAS event loop for pile-up applications. More...

#include <PileUpEventLoopMgr.h>

Inheritance diagram for PileUpEventLoopMgr:
Collaboration diagram for PileUpEventLoopMgr:

Public Member Functions

 PileUpEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc)
 Standard Constructor. More...
 
virtual ~PileUpEventLoopMgr ()
 Standard Destructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode nextEvent (int maxevt) override
 
virtual StatusCode executeEvent (EventContext &&ctx) override
 
virtual StatusCode seek (int evt) override
 
virtual int curEvent () const override
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

void modifyEventContext (EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
 
StatusCode setupStreams ()
 setup input and overlay selectors and iters More...
 
virtual StatusCode executeAlgorithms (const EventContext &ctx)
 Run the algorithms for the current event. More...
 
unsigned int getBCID (int bunchXing, unsigned int centralBCID) const
 return the 'fake BCID' corresponding to bunchXing More...
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

SmartIF< IAlgExecStateSvc > m_aess
 Reference to the Algorithm Execution State Svc. More...
 
ServiceHandle< IIncidentSvc > m_incidentSvc
 Incident Service. More...
 
PileUpStream m_origStream
 Input Stream. More...
 
ServiceHandle< StoreGateSvcm_evtStore
 output store More...
 
ServiceHandle< IEvtSelector > m_origSel
 
ServiceHandle< IEvtSelector > m_signalSel
 
ServiceHandle< IBeamIntensitym_beamInt
 
ServiceHandle< IBeamLuminositym_beamLumi
 
ServiceHandle< PileUpMergeSvcm_mergeSvc
 
ServiceHandle< IEvtIdModifierSvcm_evtIdModSvc
 
Gaudi::Property< unsigned int > m_maxBunchCrossingPerOrbit
 
Gaudi::Property< float > m_xingFreq
 
Gaudi::Property< int > m_firstXing
 
Gaudi::Property< int > m_lastXing
 
Gaudi::Property< float > m_maxCollPerXing
 
ToolHandleArray< IBkgStreamsCachem_caches
 
Gaudi::Property< bool > m_allowSubEvtsEOF
 
Gaudi::Property< bool > m_xingByXing
 
Gaudi::Property< int > m_failureMode
 
Gaudi::Property< bool > m_allowSerialAndMPToDiffer
 
Gaudi::Property< std::string > m_evinfName
 
Gaudi::Property< std::string > m_evinfContName
 
Gaudi::Property< uint32_t > m_mcChannelNumber
 
uint32_t m_currentRun {0}
 current run number More...
 
bool m_firstRun {true}
 
int m_nevt {0}
 
int m_ncurevt {0}
 
bool m_skipExecAlgs {false}
 
bool m_loadProxies {true}
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

The ATLAS event loop for pile-up applications.

Definition at line 45 of file PileUpEventLoopMgr.h.

Constructor & Destructor Documentation

◆ PileUpEventLoopMgr()

PileUpEventLoopMgr::PileUpEventLoopMgr ( const std::string &  nam,
ISvcLocator *  svcLoc 
)

Standard Constructor.

Definition at line 46 of file PileUpEventLoopMgr.cxx.

48  : base_class(name, svcLoc)
49  , AthMessaging (name)
50  , m_incidentSvc("IncidentSvc", name)
51  , m_evtStore("StoreGateSvc/StoreGateSvc", name)
52 {
53  // m_caches.push_back("BkgStreamsCache/MinBiasCache");
54 }

◆ ~PileUpEventLoopMgr()

PileUpEventLoopMgr::~PileUpEventLoopMgr ( )
virtual

Standard Destructor.

Definition at line 59 of file PileUpEventLoopMgr.cxx.

59 {}

Member Function Documentation

◆ curEvent()

int PileUpEventLoopMgr::curEvent ( ) const
overridevirtual

Definition at line 514 of file PileUpEventLoopMgr.cxx.

515 {
516  return m_nevt;
517 }

◆ executeAlgorithms()

StatusCode PileUpEventLoopMgr::executeAlgorithms ( const EventContext &  ctx)
privatevirtual

Run the algorithms for the current event.

Definition at line 555 of file PileUpEventLoopMgr.cxx.

556 {
557  // Call the execute() method of all top algorithms
558  for ( ListAlg::iterator ita = m_topAlgList.begin();
559  ita != m_topAlgList.end();
560  ++ita ) {
561  StatusCode sc = (*ita)->sysExecute( ctx );
562  // this duplicates what is already done in Algorithm::sysExecute, which
563  // calls Algorithm::setExecuted, but eventually we plan to remove that
564  // function
565  m_aess->algExecState(*ita, ctx ).setState(AlgExecState::State::Done, sc);
566  if ( !sc.isSuccess() ) {
567  ATH_MSG_INFO ( "Execution of algorithm " <<
568  (*ita)->name() << " failed with StatusCode::" << sc );
569  return sc;
570  }
571  }
572 
573  return StatusCode::SUCCESS;
574 }

◆ executeEvent()

StatusCode PileUpEventLoopMgr::executeEvent ( EventContext &&  ctx)
overridevirtual

Fire begin-Run incident if new run:

m_failureMode 1, RECOVERABLE: skip algorithms, but do not terminate job FAILURE: terminate job

m_failureMode 2: skip algorithms, but do not terminate job

Definition at line 580 of file PileUpEventLoopMgr.cxx.

581 {
583  if (m_firstRun || (m_currentRun != ctx.eventID().run_number())) {
584  // Fire EndRun incident unless this is the first run
585  if (!m_firstRun) {
586  m_incidentSvc->fireIncident(Incident(this->name(),IncidentType::EndRun));
587  }
588  m_firstRun = false;
589  m_currentRun = ctx.eventID().run_number();
590 
591  ATH_MSG_INFO ( " ===>>> start of run " << m_currentRun << " <<<===" );
592 
593  // Fire BeginRun "Incident"
594  m_incidentSvc->fireIncident(Incident(this->name(),IncidentType::BeginRun,ctx));
595  }
596 
597  bool eventFailed(false);
598  // Call the execute() method of all top algorithms
600 
601  if (!sc.isSuccess()) {
602  eventFailed = true;
603  m_aess->setEventStatus( EventStatus::AlgFail, ctx );
604 
608  if (m_failureMode == 1 && sc.isRecoverable()) {
609  ATH_MSG_WARNING ( "RECOVERABLE error returned by algorithm. " <<
610  "Skipping remaining algorithms." << std::endl <<
611  "\tNo output will be written for this event, " <<
612  "but job will continue to next event" );
613  eventFailed = false;
614  }
615 
617  if (m_failureMode >= 2) {
618  ATH_MSG_INFO ( "Skipping remaining algorithms." << std::endl <<
619  "\tNo output will be written for this event, " <<
620  "but job will continue to next event" );
621  eventFailed = false;
622  }
623  }
624  else {
625  m_aess->setEventStatus( EventStatus::Success, ctx );
626 
627  // Call the execute() method of all output streams
628  for (ListAlg::iterator ito = m_outStreamList.begin();
629  ito != m_outStreamList.end(); ++ito ) {
630  sc = (*ito)->sysExecute( ctx );
631  if ( !sc.isSuccess() ) {
632  eventFailed = true;
633  }
634  }
635  }
636 
637  //------------------------------------------------------------------------
638  // Check if there was an error processing current event
639  //------------------------------------------------------------------------
640  return eventFailed?StatusCode::FAILURE:StatusCode::SUCCESS;
641 }

◆ finalize()

StatusCode PileUpEventLoopMgr::finalize ( )
overridevirtual

Definition at line 138 of file PileUpEventLoopMgr.cxx.

139 {
140  ATH_MSG_INFO ( "Finalizing " << this->name() );
141 
142  //we need to release all our BkgStreamCaches
145  while (cacheIterator != endOfCaches) {
146  (*cacheIterator++)->release();
147  }
148  m_caches.clear();
149 
150  //and to clean up the store the stream owns
152 
154 }

◆ getBCID()

unsigned int PileUpEventLoopMgr::getBCID ( int  bunchXing,
unsigned int  centralBCID 
) const
inlineprivate

return the 'fake BCID' corresponding to bunchXing

Definition at line 80 of file PileUpEventLoopMgr.h.

80  {
81  //FIXME to be completely safe this should should probably depend on the bunch spacing too. Perhaps that concept should be deprecated though?
82  return static_cast<unsigned int>((((bunchXing + static_cast<int>(centralBCID)) % static_cast<int>(m_maxBunchCrossingPerOrbit)) + static_cast<int>(m_maxBunchCrossingPerOrbit) ) % static_cast<int>(m_maxBunchCrossingPerOrbit));
83  }

◆ initialize()

StatusCode PileUpEventLoopMgr::initialize ( )
overridevirtual

Definition at line 64 of file PileUpEventLoopMgr.cxx.

65 {
66  ATH_MSG_INFO ( "Initializing " << this->name() ) ;
68  ATH_MSG_WARNING ( "AllowSerialAndMPToDiffer=False! This will incur serious performance penalties! But Serial and MP output will be the same." );
69  }
70 
71  //locate the StoreGateSvc and initialize our local ptr
72  CHECK(m_evtStore.retrieve());
73 
74  //reset output store proxy provider: we don't want to have one!
75  m_evtStore->setProxyProviderSvc(nullptr);
76 
77  //locate the IncidentSvc and initialize our local ptr
78  CHECK(m_incidentSvc.retrieve());
79 
80  //locate the PileUpMergeSvc and initialize our local ptr
81  CHECK(m_mergeSvc.retrieve());
82 
83  //-------------------------------------------------------------------------
84  // Setup Event Selector
85  //-------------------------------------------------------------------------
86  CHECK(this->setupStreams());
87 
88  // Get the value of SkipEvents. It is needed for seeking
89  SmartIF<IProperty> prpMgr(serviceLocator());
90  SmartIF<IEvtSelector> evtSelector;
91  if (prpMgr.isValid()) {
92  // Get event selector name. Retrieve EventSelector
93  evtSelector = serviceLocator()->service(prpMgr->getProperty("EvtSel").toString());
94  CHECK(evtSelector.isValid());
95  }
96  else {
97  ATH_MSG_ERROR ( "IProperty interface not found in ApplicationMgr" );
98  return StatusCode::FAILURE;
99  }
100 
101  SmartIF<IProperty> prpMgr1(evtSelector);
102  if (prpMgr1.isValid()) {
103  std::string skipEventsStr = prpMgr1->getProperty("SkipEvents").toString();
104  m_ncurevt = std::atoi(skipEventsStr.c_str());
105  }
106  else {
107  ATH_MSG_ERROR ( "IProperty interface not found on the event selector" );
108  return StatusCode::FAILURE;
109  }
110 
111  // Get the AlgExecStateSvc
112  m_aess = serviceLocator()->service("AlgExecStateSvc");
113  if (!m_aess.isValid()) {
114  ATH_MSG_FATAL ( "Error retrieving AlgExecStateSvc" );
115  return StatusCode::FAILURE;
116  }
117 
118  //--------------------------------------------------------------------------
119  // Set up the EventID modifier Service
120  //--------------------------------------------------------------------------
121  if( m_evtIdModSvc.empty() ) {
122  ATH_MSG_DEBUG ( "EventID modifier Service not set. No run number, ... overrides will be applied." );
123  }
124  else if ( !m_evtIdModSvc.retrieve().isSuccess() ) {
125  ATH_MSG_INFO ( "Could not find EventID modifier Service. No run number, ... overrides will be applied." );
126  }
127 
128  //-------------------------------------------------------------------------
129  // Base class initialize (done at the end to allow algs to access stores)
130  //-------------------------------------------------------------------------
131 
133 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ modifyEventContext()

void PileUpEventLoopMgr::modifyEventContext ( EventContext &  ctx,
const EventID eID,
bool  consume_modifier_stream 
)
private

Definition at line 168 of file PileUpEventLoopMgr.cxx.

168  {
169 
170  if (m_evtIdModSvc.isSet()) {
171  EventID new_eID(eID);
172  // m_nevt - 1 because the PileUpEventLoopMgr increments it rather early
173  m_evtIdModSvc->modify_evtid(new_eID, m_ncurevt - 1, consume_modifier_stream);
174  if (msgLevel(MSG::DEBUG)) {
175  unsigned int oldrunnr=eID.run_number();
176  unsigned int oldLB=eID.lumi_block();
177  unsigned int oldTS=eID.time_stamp();
178  unsigned int oldTSno=eID.time_stamp_ns_offset();
179  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc runnr=" << oldrunnr << " -> " << new_eID.run_number() );
180  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc LB=" << oldLB << " -> " << new_eID.lumi_block() );
181  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp=" << oldTS << " -> " << new_eID.time_stamp() );
182  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp ns Offset=" << oldTSno << " -> " << new_eID.time_stamp_ns_offset() );
183  }
184  ctx.setEventID(new_eID);
185  return;
186  }
187 
188  ctx.setEventID( eID );
189 }

◆ msg() [1/4]

MsgStream & AthMessaging::msg
inline

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 92 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/4]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [3/4]

MsgStream & AthMessaging::msg
inline

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 99 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msg() [4/4]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl() [1/2]

bool AthMessaging::msgLvl
inline

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 86 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ msgLvl() [2/2]

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ nextEvent()

StatusCode PileUpEventLoopMgr::nextEvent ( int  maxevt)
overridevirtual

Is this correct, or should it be set to a pileup store?

ask the BeamLuminositySvc to check for a new scalefactor

Definition at line 195 of file PileUpEventLoopMgr.cxx.

196 {
197  // make nextEvent(0) a dummy call, as needed by athenaMP
198  if (0 == maxevt) {
199  return StatusCode::SUCCESS;
200  }
201 
202 
203  // These following two initialization loops are performed here in case new
204  // Top level Algorithms or Output Streams have been created interactively
205  // at run-time instead of configuration time. Note also that it is possible
206  // that some newly created Algorithms are still not initialized as a result
207  // of these loops (e.g. where the membership of an existing Sequencer is
208  // changed at run-time. In this case, the Algorithm::sysExecute() function
209  // will ensure that the Algorithm is correctly initialized. This mechanism
210  // actually makes loops redundant, but they do provide a well defined
211  // location for the initialization to take place in the non-interactive case.
212 
213  // Initialize the list of Algorithms. Note that existing Algorithms
214  // are protected against multiple initialization attempts.
215  ListAlg::iterator ita;
216  for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ++ita ) {
217  if( !((*ita)->sysInitialize()).isSuccess() ) {
218  ATH_MSG_ERROR ( "Unable to initialize Algorithm: " <<
219  (*ita)->name() );
220  return StatusCode::FAILURE;
221  }
222  }
223 
224  // Initialize the list of Output Streams. Note that existing Output Streams
225  // are protected against multiple initialization attempts.
226  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ++ita ) {
227  if( !((*ita)->sysInitialize()).isSuccess() ) {
228  ATH_MSG_ERROR ( "Unable to initialize Output Stream: " <<
229  (*ita)->name() );
230  return StatusCode::FAILURE;
231  }
232  }
233 
234  const xAOD::EventInfo *inputEventInfo{};
235 
236  // loop over events if the maxevt (received as input) is different from -1.
237  // if evtmax is -1 it means infinite loop
238  while( (maxevt == -1 || m_nevt < maxevt) &&
239  0 != (inputEventInfo = m_origStream.nextEventPre()) ) {
240  // Check if there is a scheduled stop issued by some algorithm/sevice
241  if ( m_scheduledStop ) {
242  m_scheduledStop = false;
243  ATH_MSG_ALWAYS ( "A stopRun was requested. Terminating event loop." );
244  break;
245  }
246  ++m_nevt; ++m_ncurevt;
247 
248  //-----------------------------------------------------------------------
249  // Setup overlaid event in the event store
250  //-----------------------------------------------------------------------
251 
252  auto upOverEvent = std::make_unique<xAOD::EventInfo>();
253  auto upOverEventAux = std::make_unique<xAOD::EventAuxInfo>();
254  upOverEvent->setStore( upOverEventAux.get() );
255  xAOD::EventInfo* pOverEvent = upOverEvent.get();
256  ATH_MSG_DEBUG(" #subevents in the signal event =" << inputEventInfo->subEvents().size());
257 
258  // Copy the eventInfo data from origStream event
259  *pOverEvent = *inputEventInfo;
260  pOverEvent->clearSubEvents(); // start clean without any subevents
261 
262  // Need to copy this explicitly as it may be marked as a decoration.
263  pOverEvent->setMCEventWeights(inputEventInfo->mcEventWeights());
264 
265  // Propagate MC metadata
266  if (pOverEvent->mcChannelNumber() == 0) {
267  if (m_mcChannelNumber.value() != 0) {
268  ATH_MSG_WARNING("Input mcChannelNumber is 0, setting it to " << m_mcChannelNumber.value());
269  pOverEvent->setMCChannelNumber(m_mcChannelNumber.value());
270  } else {
271  ATH_MSG_WARNING("Input mcChannelNumber is 0");
272  }
273  } else {
274  if (m_mcChannelNumber.value() != 0 && pOverEvent->mcChannelNumber() != m_mcChannelNumber.value()) {
275  ATH_MSG_WARNING("Input mcChannelNumber (" << pOverEvent->mcChannelNumber()
276  << ") and provided mcChannelNumber (" << m_mcChannelNumber.value() << ") do not match.");
277  }
278  }
279 
280  if (pOverEvent->mcEventNumber() == 0) {
281  if (pOverEvent->eventNumber() != 0) {
282  ATH_MSG_WARNING("Input mcEventNumber is 0, setting it to match the eventNumber (" << pOverEvent->eventNumber() << ")");
283  pOverEvent->setMCEventNumber(pOverEvent->eventNumber());
284  } else {
285  ATH_MSG_ERROR("Input eventNumber and mcEventNumber are 0");
286  return StatusCode::FAILURE;
287  }
288  }
289 
290  if (pOverEvent->mcEventWeights().empty()) {
291  ATH_MSG_ERROR("Input mcEventWeights are empty. This should not happen.");
292  return StatusCode::FAILURE;
293  }
294 
295  // Record the xAOD object(s):
296  CHECK( m_evtStore->record( std::move(upOverEventAux), m_evinfName + "Aux." ) );
297  CHECK( m_evtStore->record( std::move(upOverEvent), m_evinfName ) );
298  pOverEvent->setEvtStore( m_evtStore.get() );
299  // Create an EventInfoContainer for the pileup events:
302  puei->setStore( puaux );
303 
304  // Record the EI container object(s):
305  CHECK( m_evtStore->record( puei, m_evinfContName ) );
306  CHECK( m_evtStore->record( puaux, m_evinfContName+"Aux." ) );
307 
308  // Setup the EventContext.
309  // Ensure that the overridden run number etc. is being used
310  EventContext ctx;
311  EventID ev_id = eventIDFromxAOD( pOverEvent );
312  bool consume_modifier_stream = false; // FIXME/CHECK: was true inside TP converter and checks for active storegate
313  // kludge FIXME
315  if ( pAttrList != nullptr && pAttrList->size() > 6 ) {
316  // Ideally we would create the initial EventID from the TAG
317  // information, but not doing that (yet?). For now using the
318  // presence of TAG information in the HITS file to indicate that
319  // the EvtIdModifierSvc has not already been called for this
320  // Athena event.
321  consume_modifier_stream = true;
322  }
323  ctx.set(m_nevt,0);
324  modifyEventContext(ctx, ev_id, consume_modifier_stream);
326  ctx.setExtension( Atlas::ExtendedEventContext(m_evtStore->hiveProxyDict(),
327  ctx.eventID().run_number()) );
328  Gaudi::Hive::setCurrentContext( ctx );
329  m_aess->reset(ctx);
330  // make copy to std::move into store
331  auto puctx =std::make_unique<EventContext> ( ctx );
332  if (m_evtStore->record( std::move(puctx) ,"EventContext").isFailure()) {
333  ATH_MSG_ERROR ( "Error recording event context object" );
334  return StatusCode::FAILURE;
335  }
336 
337  //Update run number, event number, lumi block and timestamp from EventContext
338  pOverEvent->setRunNumber( ctx.eventID().run_number() );
339  pOverEvent->setEventNumber( ctx.eventID().event_number() );
340  pOverEvent->setLumiBlock( ctx.eventID().lumi_block() );
341  pOverEvent->setTimeStamp( ctx.eventID().time_stamp() );
342  ATH_MSG_DEBUG( "Updated pOverEvent " << *pOverEvent );
343 
344  ATH_MSG_INFO ( "nextEvent(): overlaying original event " <<
345  pOverEvent->runNumber() << '/' <<
346  pOverEvent->eventNumber() << '/' <<
347  pOverEvent->lumiBlock() );
348 
349  //ask the BeamIntensitySvc to choose (and remember)
350  //in which xing this event will be wrto the beam int distribution
351  m_beamInt->selectT0(ctx.eventID().run_number(), ctx.eventID().event_number());
352 
353  // Use the position in the beam intensity array to set a BCID-like quantity
354  pOverEvent->setBCID( m_beamInt->getCurrentT0BunchCrossing() );
355 
356  unsigned int t0BCID = pOverEvent->bcid();
357  ATH_MSG_VERBOSE ( "BCID =" << t0BCID );
358 
359  // pOvrEt->set_user_type("Overlaid"); //FIXME ?? MN: ?? what to do with that
360 
361  // Overlay RDO files should be treated like data for reco
362  // purposes, so only set this for SimHit level pile-up.
363  pOverEvent->setEventTypeBitmask( inputEventInfo->eventTypeBitmask() | xAOD::EventInfo::IS_SIMULATION );
364 
365  // register as sub event of the overlaid
366  bool addpEvent(true);
367 
368  ATH_MSG_DEBUG( "inputEventInfo->evtStore()="<<inputEventInfo->evtStore()<<", pOverEvent->evtStore()=" << pOverEvent->evtStore()<<", &m_origStream.store()="<<&m_origStream.store() );
369  if ( addpEvent ) {
370  xAOD::EventInfo* newEv=addSubEvent(pOverEvent, inputEventInfo, 0, xAOD::EventInfo::Signal, puei, m_evinfContName );
371  if(newEv->evtStore()==nullptr) newEv->setEvtStore(&m_origStream.store());
372  newEv->setRunNumber( ctx.eventID().run_number() );
373  newEv->setEventNumber( ctx.eventID().event_number() );
374  newEv->setLumiBlock( ctx.eventID().lumi_block() );
375  newEv->setTimeStamp( ctx.eventID().time_stamp() );
376  ATH_MSG_DEBUG( "Added inputEventInfo="<<inputEventInfo<<" as subEvent "<<newEv<<" to pOverEvent " << pOverEvent );
377  ATH_MSG_DEBUG( " afterwards: newEv->evtStore()="<<newEv->evtStore()<<", pOverEvent->evtStore()=" << pOverEvent->evtStore() );
378  ATH_MSG_DEBUG( " pOverEvent->subEvents()[0].ptr()="<<pOverEvent->subEvents()[0].ptr()<<" content="<<*pOverEvent->subEvents()[0].ptr()<<" store="<< pOverEvent->subEvents()[0].ptr()->evtStore() );
379  }
380 
381  ATH_MSG_INFO ( "set aliases" );
382  //add an alias to "OverlayEvent" (backward compatibility)
383  CHECK(m_evtStore->setAlias(pOverEvent, "OverlayEvent"));
384 
385  //FIXME at this point one may want to look into the original event
386  //FIXME to decide whether to skip it or to do the pile-up
387 
389  bool needupdate;
390  float sf = m_beamLumi->scaleFactor( pOverEvent->runNumber(), pOverEvent->lumiBlock(), needupdate );
391  float currentaveragemu(sf*m_maxCollPerXing);
392  pOverEvent->setAverageInteractionsPerCrossing(currentaveragemu);
393  //FIXME check whether actualInteractionsPerCrossing should be set
394  //to mu for the central bunch crossing, as below, or whether it
395  //should be set to the actual number of minbias piled-up in the
396  //central bunch crossing for this particular event.
397  pOverEvent->setActualInteractionsPerCrossing(m_beamInt->normFactor(0)*currentaveragemu);
398  ATH_MSG_DEBUG ( "BCID = "<< t0BCID <<
399  ", mu =" << pOverEvent->actualInteractionsPerCrossing() <<
400  ", <mu> =" << pOverEvent->averageInteractionsPerCrossing() );
403  while (cacheIterator != endOfCaches) {
404  if (needupdate) {
405  (*cacheIterator)->resetEvtsPerXingScaleFactor(sf);//set cache scale factor. some caches should ignore it?
406  }
407  (*cacheIterator++)->newEvent(); //inform cache we overlay a new event
408  }
409  //-----------------------------------------------------------------------
410  // loop over x-ings
411  //-----------------------------------------------------------------------
412  for (int iXing=m_firstXing; iXing<=m_lastXing; iXing++) {
413  // if (m_xingByXing.value()) test that PileUpToolsAlg is there?
414  //-----------------------------------------------------------------------
415  // Read input events in bkg stores and link them to overlay store
416  //-----------------------------------------------------------------------
417  int t0BinCenter((int)m_xingFreq*iXing);
418  unsigned int currentBCID = getBCID((t0BinCenter/25), t0BCID); //Should account for m_xingFreq>25. FIXME - hardcoded 25ns
419  ATH_MSG_VERBOSE ( "Background BCID =" << currentBCID );
420  cacheIterator = m_caches.begin();
421  while (cacheIterator != endOfCaches) {
422  // Now set the BCID for background events - also requires changes to PileUpEventInfo, SubEvent
423  if (((*cacheIterator)->addSubEvts(iXing-m_firstXing, pOverEvent, t0BinCenter, m_loadProxies, currentBCID)).isFailure()) {
424  //if (((*cacheIterator)->addSubEvts(iXing-m_firstXing, *pOverEvent, t0BinCenter)).isFailure()) {
425  if (maxevt == -1 && m_allowSubEvtsEOF) {
426  ATH_MSG_INFO ( "No more sub events for " << cacheIterator->name() );
427  return StatusCode::SUCCESS;
428  }
429  else {
430  ATH_MSG_FATAL ( "Error adding sub events to " << cacheIterator->name() );
431  return StatusCode::FAILURE;
432  }
433  }
434  ++cacheIterator;
435  }
436  } //loop over xings
437 
438  // Calculate/copy pile-up hash
439  PileUpHashHelper pileUpHashHelper;
440 
441  pileUpHashHelper.addToHashSource(pOverEvent);
442 
443  ATH_MSG_VERBOSE ( "Pile-up hash source:" << pileUpHashHelper.hashSource() );
444 
445  // Calculate and set hash
446  uuid_t pileUpHash;
447  pileUpHashHelper.calculateHash(pileUpHash);
448 
450 
451  ATH_MSG_DEBUG("PileUpMixtureID = " << pOverEvent->pileUpMixtureID());
452 
453  //set active store back to the overlaid one
454  m_evtStore->makeCurrent();
455 
456  // Execute event for all required algorithms. The overlaid event
457  // (PileUpEventInfo) is considered to be current
458  if (m_skipExecAlgs) {
459  ATH_MSG_INFO ( "Firing reseed incident (" << pOverEvent->eventNumber() << "," << pOverEvent->runNumber() << ")" );
460  m_incidentSvc->fireIncident(ContextIncident<std::pair<unsigned,unsigned> >(this->name(),"ReseedIncident",std::pair<unsigned,unsigned>(pOverEvent->eventNumber(),pOverEvent->runNumber())));
461  m_incidentSvc->fireIncident(Incident(this->name(),"AfterReseedIncident"));
462  ATH_MSG_INFO ( "Not going to process this event" );
463  }
464  else {
465  if ( !(executeEvent( std::move(ctx) ).isSuccess()) ) {
466  ATH_MSG_ERROR ( "Terminating event processing loop due to errors" );
467  return StatusCode::FAILURE;
468  }
469  else {
470  ATH_MSG_INFO ( "Event processing successful." );
471  }
472  }
473  //if we are not doing overlap xing by xing clean up all stores at the end
474  //the clean up is done object by object and controlled by
475  //PileUpXingFolder.CacheRefreshFrequency property
476  if (!m_xingByXing.value()) {
477  // FIXME test that PileUpToolsAlg is NOT there?
478  //clear all stores as configured in
479  CHECK(m_mergeSvc->clearDataCaches());
480  ATH_MSG_DEBUG ( "Cleared data caches" );
481  }
482  CHECK(m_evtStore->clearStore());
483  } //end of event loop
484 
485  if (m_skipExecAlgs) {
486  m_nevt--;
487  }
488 
489  return StatusCode::SUCCESS;
490 
491 }

◆ seek()

StatusCode PileUpEventLoopMgr::seek ( int  evt)
overridevirtual

Definition at line 493 of file PileUpEventLoopMgr.cxx.

494 {
495  int nevtsToAdvance = evt-m_ncurevt;
496  int nParam = m_nevt+1;
497  ATH_MSG_INFO ( "In PileUpEventLoopMgr::seek. m_ncurevt=" << m_ncurevt <<
498  " nevtsToAdvance=" << nevtsToAdvance );
499 
500  m_skipExecAlgs = true;
501  for (int i=0; i<nevtsToAdvance; ++i) {
503  m_loadProxies = (nevtsToAdvance==(i+1));
504  }
505  if (this->nextEvent(nParam).isFailure()) {
506  ATH_MSG_ERROR ( "Seek error! Failed to advance to evt=" << m_ncurevt+1 );
507  return StatusCode::FAILURE;
508  }
509  }
510  m_skipExecAlgs = false;
511  return StatusCode::SUCCESS;
512 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setupStreams()

StatusCode PileUpEventLoopMgr::setupStreams ( )
private

setup input and overlay selectors and iters

Definition at line 523 of file PileUpEventLoopMgr.cxx.

524 {
525  //OK now we can run
526  // retrieve selector and setup iterator (the selector has been setup as an ExtService)
527  CHECK(m_origSel.retrieve());
528 
529  m_origStream = PileUpStream("OriginalEvent", serviceLocator(), &*m_origSel);
530  if (!m_origStream.setupStore()) {
531  ATH_MSG_ERROR ( "Can not setup original evt store " << m_origSel );
532  return StatusCode::FAILURE;
533  }
534 
535  //now get the bkg stream caches, and set them up
536  CHECK(m_caches.retrieve());
537  ATH_MSG_DEBUG ( "retrieved BkgStreamsCaches " << m_caches );
538 
541  unsigned int nXings(m_lastXing-m_firstXing+1);
542  unsigned int firstStore(0);
543  StatusCode sc(StatusCode::SUCCESS);
544  while ((cacheIterator != endOfCaches) && sc.isSuccess()) {
545  sc = (*cacheIterator)->setup(m_firstXing, nXings, firstStore, &*m_beamInt);
546  firstStore += (*cacheIterator)->nStores() ;
547  ++cacheIterator;
548  }
549  return sc;
550 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_aess

SmartIF<IAlgExecStateSvc> PileUpEventLoopMgr::m_aess
private

Reference to the Algorithm Execution State Svc.

Definition at line 69 of file PileUpEventLoopMgr.h.

◆ m_allowSerialAndMPToDiffer

Gaudi::Property<bool> PileUpEventLoopMgr::m_allowSerialAndMPToDiffer
private
Initial value:
{this, "AllowSerialAndMPToDiffer", true,
"When set to False, this will allow the code to reproduce serial output in an "
"AthenaMP job, albeit with a significant performance penalty."}

Definition at line 130 of file PileUpEventLoopMgr.h.

◆ m_allowSubEvtsEOF

Gaudi::Property<bool> PileUpEventLoopMgr::m_allowSubEvtsEOF
private
Initial value:
{this, "AllowSubEvtsEOF", true,
"if true(default) an EOF condition in the BkgStreamsCaches is not considered "
"to be an error IF maxevt=-1 (loop over all available events)"}

Definition at line 119 of file PileUpEventLoopMgr.h.

◆ m_beamInt

ServiceHandle<IBeamIntensity> PileUpEventLoopMgr::m_beamInt
private
Initial value:
{this, "BeamInt", "FlatBM",
"The service providing the beam intensity distribution"}

Definition at line 98 of file PileUpEventLoopMgr.h.

◆ m_beamLumi

ServiceHandle<IBeamLuminosity> PileUpEventLoopMgr::m_beamLumi
private
Initial value:
{this, "BeamLuminosity", "LumiProfileSvc",
"The service providing the beam luminosity distribution vs. run"}

Definition at line 100 of file PileUpEventLoopMgr.h.

◆ m_caches

ToolHandleArray<IBkgStreamsCache> PileUpEventLoopMgr::m_caches
private
Initial value:
{this, "bkgCaches", {},
"list of tools managing bkg events"}

Definition at line 117 of file PileUpEventLoopMgr.h.

◆ m_currentRun

uint32_t PileUpEventLoopMgr::m_currentRun {0}
private

current run number

Definition at line 141 of file PileUpEventLoopMgr.h.

◆ m_evinfContName

Gaudi::Property<std::string> PileUpEventLoopMgr::m_evinfContName
private
Initial value:
{this, "EventInfoContName", c_pileUpEventInfoContName,
"SG key for the EventInfoContainer object"}

Definition at line 135 of file PileUpEventLoopMgr.h.

◆ m_evinfName

Gaudi::Property<std::string> PileUpEventLoopMgr::m_evinfName
private
Initial value:
{this, "EventInfoName", c_pileUpEventInfoObjName,
"SG key for the EventInfo object"}

Definition at line 133 of file PileUpEventLoopMgr.h.

◆ m_evtIdModSvc

ServiceHandle<IEvtIdModifierSvc> PileUpEventLoopMgr::m_evtIdModSvc
private
Initial value:
{this, "EvtIdModifierSvc", "",
"ServiceHandle for EvtIdModifierSvc"}

Definition at line 104 of file PileUpEventLoopMgr.h.

◆ m_evtStore

ServiceHandle<StoreGateSvc> PileUpEventLoopMgr::m_evtStore
private

output store

Definition at line 92 of file PileUpEventLoopMgr.h.

◆ m_failureMode

Gaudi::Property<int> PileUpEventLoopMgr::m_failureMode
private
Initial value:
{this, "FailureMode", 1,
"Controls behaviour of event loop depending on return code of"
" Algorithms. 0: all non-SUCCESSes terminate job. "
"1: RECOVERABLE skips to next event, FAILURE terminates job "
"(DEFAULT). 2: RECOVERABLE and FAILURE skip to next events"}

Definition at line 125 of file PileUpEventLoopMgr.h.

◆ m_firstRun

bool PileUpEventLoopMgr::m_firstRun {true}
private

Definition at line 142 of file PileUpEventLoopMgr.h.

◆ m_firstXing

Gaudi::Property<int> PileUpEventLoopMgr::m_firstXing
private
Initial value:
{this, "firstXing", -2,
"time of first xing / XingFrequency (0th xing is 1st after trigger)"}

Definition at line 111 of file PileUpEventLoopMgr.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> PileUpEventLoopMgr::m_incidentSvc
private

Incident Service.

Definition at line 86 of file PileUpEventLoopMgr.h.

◆ m_lastXing

Gaudi::Property<int> PileUpEventLoopMgr::m_lastXing
private
Initial value:
{this, "lastXing", 1,
"time of last xing / XingFrequency (0th xing is 1st after trigger)"}

Definition at line 113 of file PileUpEventLoopMgr.h.

◆ m_loadProxies

bool PileUpEventLoopMgr::m_loadProxies {true}
private

Definition at line 147 of file PileUpEventLoopMgr.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_maxBunchCrossingPerOrbit

Gaudi::Property<unsigned int> PileUpEventLoopMgr::m_maxBunchCrossingPerOrbit
private
Initial value:
{this, "MaxBunchCrossingPerOrbit", 3564,
"The number of slots in each LHC beam. Default: 3564."}

Definition at line 107 of file PileUpEventLoopMgr.h.

◆ m_maxCollPerXing

Gaudi::Property<float> PileUpEventLoopMgr::m_maxCollPerXing
private
Initial value:
{this, "MaxMinBiasCollPerXing", 23.0,
"Set to digitization numberOfCollisions prop. for variable-mu and RunDMC jobs."}

Definition at line 115 of file PileUpEventLoopMgr.h.

◆ m_mcChannelNumber

Gaudi::Property<uint32_t> PileUpEventLoopMgr::m_mcChannelNumber
private
Initial value:
{ this, "MCChannelNumber", 0,
"sample MC channel number" }

Definition at line 137 of file PileUpEventLoopMgr.h.

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> PileUpEventLoopMgr::m_mergeSvc
private
Initial value:
{this, "PileUpMergeSvc", "PileUpMergeSvc",
"PileUp Merge Service"}

Definition at line 102 of file PileUpEventLoopMgr.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_ncurevt

int PileUpEventLoopMgr::m_ncurevt {0}
private

Definition at line 145 of file PileUpEventLoopMgr.h.

◆ m_nevt

int PileUpEventLoopMgr::m_nevt {0}
private

Definition at line 144 of file PileUpEventLoopMgr.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_origSel

ServiceHandle<IEvtSelector> PileUpEventLoopMgr::m_origSel
private
Initial value:
{this, "OrigSelector", "EventSelector",
"EventSelector for original (physics) events stream"}

Definition at line 94 of file PileUpEventLoopMgr.h.

◆ m_origStream

PileUpStream PileUpEventLoopMgr::m_origStream
private

Input Stream.

Definition at line 89 of file PileUpEventLoopMgr.h.

◆ m_signalSel

ServiceHandle<IEvtSelector> PileUpEventLoopMgr::m_signalSel
private
Initial value:
{this, "SignalSelector", "",
"EventSelector for signal (hard-scatter) events stream"}

Definition at line 96 of file PileUpEventLoopMgr.h.

◆ m_skipExecAlgs

bool PileUpEventLoopMgr::m_skipExecAlgs {false}
private

Definition at line 146 of file PileUpEventLoopMgr.h.

◆ m_xingByXing

Gaudi::Property<bool> PileUpEventLoopMgr::m_xingByXing
private
Initial value:
{this, "XingByXing", false,
"if set to true we will not cache bkg events from one xing to then next. "
"This greatly increases the amount of I/O and greatly reduces the memory required to run a job"}

Definition at line 122 of file PileUpEventLoopMgr.h.

◆ m_xingFreq

Gaudi::Property<float> PileUpEventLoopMgr::m_xingFreq
private
Initial value:
{this, "XingFrequency", 25.0,
"ns"}

Definition at line 109 of file PileUpEventLoopMgr.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
c_pileUpEventInfoContName
const std::string c_pileUpEventInfoContName
default value for the EventInfoContainer storing subevents for PileUp
Definition: PileUpMisc.h:15
xAOD::EventInfo_v1::setActualInteractionsPerCrossing
void setActualInteractionsPerCrossing(float value)
Set average interactions per crossing for the current BCID.
Definition: EventInfo_v1.cxx:391
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAOD::EventInfo_v1::setEventNumber
void setEventNumber(uint64_t value)
Set the current event's event number.
PileUpEventLoopMgr::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Incident Service.
Definition: PileUpEventLoopMgr.h:86
PileUpEventLoopMgr::executeEvent
virtual StatusCode executeEvent(EventContext &&ctx) override
Definition: PileUpEventLoopMgr.cxx:580
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
xAOD::EventInfo_v1::mcEventWeights
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
PileUpEventLoopMgr::m_allowSerialAndMPToDiffer
Gaudi::Property< bool > m_allowSerialAndMPToDiffer
Definition: PileUpEventLoopMgr.h:130
initialize
void initialize()
Definition: run_EoverP.cxx:894
xAOD::EventInfo_v1::clearSubEvents
void clearSubEvents()
Clear all the currently held sub-events.
Definition: EventInfo_v1.cxx:647
PileUpEventLoopMgr::m_origSel
ServiceHandle< IEvtSelector > m_origSel
Definition: PileUpEventLoopMgr.h:94
PileUpHashHelper::uuidToPileUpMixtureId
static xAOD::EventInfo::PileUpMixtureID uuidToPileUpMixtureId(const uuid_t &hash)
Convert uuid_t to xAOD::EventInfo::PileUpMixtureID.
Definition: PileUpHashHelper.cxx:57
PileUpHashHelper
Definition: PileUpHashHelper.h:21
PileUpHashHelper::hashSource
std::string hashSource() const
Get the current hash base.
Definition: PileUpHashHelper.h:35
PileUpEventLoopMgr::m_xingFreq
Gaudi::Property< float > m_xingFreq
Definition: PileUpEventLoopMgr.h:109
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
PileUpEventLoopMgr::m_skipExecAlgs
bool m_skipExecAlgs
Definition: PileUpEventLoopMgr.h:146
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PileUpEventLoopMgr::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
output store
Definition: PileUpEventLoopMgr.h:92
PileUpEventLoopMgr::m_evinfName
Gaudi::Property< std::string > m_evinfName
Definition: PileUpEventLoopMgr.h:133
PileUpEventLoopMgr::executeAlgorithms
virtual StatusCode executeAlgorithms(const EventContext &ctx)
Run the algorithms for the current event.
Definition: PileUpEventLoopMgr.cxx:555
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
PileUpEventLoopMgr::m_origStream
PileUpStream m_origStream
Input Stream.
Definition: PileUpEventLoopMgr.h:89
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
xAOD::EventInfo_v1::pileUpMixtureID
PileUpMixtureID pileUpMixtureID() const
Unique pile-up mixture identifier.
Definition: EventInfo_v1.cxx:421
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
xAOD::EventInfo_v1::mcChannelNumber
uint32_t mcChannelNumber() const
The MC generator's channel number.
xAOD::EventInfo_v1::setPileUpMixtureID
void setPileUpMixtureID(const PileUpMixtureID &value)
Set unique pile-up mixture identifier.
Definition: EventInfo_v1.cxx:436
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
PileUpStream::nextEventPre
const xAOD::EventInfo * nextEventPre(bool readRecord=true)
return next Event, load store with next Event
Definition: PileUpStream.cxx:193
PileUpStream::finalize
StatusCode finalize()
finalize and release store. To be called on ... finalize()
Definition: PileUpStream.cxx:232
PileUpEventLoopMgr::m_ncurevt
int m_ncurevt
Definition: PileUpEventLoopMgr.h:145
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
PileUpEventLoopMgr::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: PileUpEventLoopMgr.h:102
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::EventInfo_v1::setMCEventNumber
void setMCEventNumber(uint64_t value)
Set the MC generator's event number.
xAOD::EventInfo_v1::setEventTypeBitmask
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
PileUpEventLoopMgr::m_allowSubEvtsEOF
Gaudi::Property< bool > m_allowSubEvtsEOF
Definition: PileUpEventLoopMgr.h:119
lumiFormat.i
int i
Definition: lumiFormat.py:85
PileUpStream::setupStore
bool setupStore()
setup input and overlay selectors and iters
Definition: PileUpStream.cxx:98
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PileUpEventLoopMgr::m_evtIdModSvc
ServiceHandle< IEvtIdModifierSvc > m_evtIdModSvc
Definition: PileUpEventLoopMgr.h:104
PileUpEventLoopMgr::m_beamInt
ServiceHandle< IBeamIntensity > m_beamInt
Definition: PileUpEventLoopMgr.h:98
PileUpHashHelper::addToHashSource
void addToHashSource(const std::string &string)
Add a plain string to the stream.
Definition: PileUpHashHelper.cxx:11
PileUpEventLoopMgr::m_nevt
int m_nevt
Definition: PileUpEventLoopMgr.h:144
PileUpEventLoopMgr::nextEvent
virtual StatusCode nextEvent(int maxevt) override
Definition: PileUpEventLoopMgr.cxx:195
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
PileUpStream
a triple selector/context/store defines a stream
Definition: PileUpStream.h:32
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
PileUpEventLoopMgr::m_evinfContName
Gaudi::Property< std::string > m_evinfContName
Definition: PileUpEventLoopMgr.h:135
PileUpEventLoopMgr::setupStreams
StatusCode setupStreams()
setup input and overlay selectors and iters
Definition: PileUpEventLoopMgr.cxx:523
xAOD::EventInfo_v1::setTimeStamp
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
xAOD::EventInfo_v1::setBCID
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
PileUpEventLoopMgr::m_mcChannelNumber
Gaudi::Property< uint32_t > m_mcChannelNumber
Definition: PileUpEventLoopMgr.h:137
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
PileUpStream::store
StoreGateSvc & store()
Definition: PileUpStream.h:57
PileUpEventLoopMgr::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpEventLoopMgr.h:111
xAOD::EventInfoAuxContainer_v1
Auxiliary information about the pileup events.
Definition: EventInfoAuxContainer_v1.h:31
PileUpEventLoopMgr::getBCID
unsigned int getBCID(int bunchXing, unsigned int centralBCID) const
return the 'fake BCID' corresponding to bunchXing
Definition: PileUpEventLoopMgr.h:80
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
PileUpEventLoopMgr::m_maxCollPerXing
Gaudi::Property< float > m_maxCollPerXing
Definition: PileUpEventLoopMgr.h:115
PileUpEventLoopMgr::m_firstRun
bool m_firstRun
Definition: PileUpEventLoopMgr.h:142
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAOD::EventInfo_v1::setAverageInteractionsPerCrossing
void setAverageInteractionsPerCrossing(float value)
Set average interactions per crossing for all BCIDs.
Definition: EventInfo_v1.cxx:408
PileUpEventLoopMgr::m_maxBunchCrossingPerOrbit
Gaudi::Property< unsigned int > m_maxBunchCrossingPerOrbit
Definition: PileUpEventLoopMgr.h:107
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve() const
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::EventInfo_v1::setMCChannelNumber
void setMCChannelNumber(uint32_t value)
Set the MC generator's channel number.
PileUpEventLoopMgr::m_caches
ToolHandleArray< IBkgStreamsCache > m_caches
Definition: PileUpEventLoopMgr.h:117
xAOD::EventInfo_v1::Signal
@ Signal
The signal event.
Definition: EventInfo_v1.h:266
PileUpEventLoopMgr::m_xingByXing
Gaudi::Property< bool > m_xingByXing
Definition: PileUpEventLoopMgr.h:122
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
xAOD::EventInfo_v1::setRunNumber
void setRunNumber(uint32_t value)
Set the current event's run number.
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
c_pileUpEventInfoObjName
const std::string c_pileUpEventInfoObjName
default value for the EventInfoContainer storing subevents for PileUp
Definition: PileUpMisc.h:12
PileUpEventLoopMgr::m_currentRun
uint32_t m_currentRun
current run number
Definition: PileUpEventLoopMgr.h:141
DEBUG
#define DEBUG
Definition: page_access.h:11
PileUpEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
Reference to the Algorithm Execution State Svc.
Definition: PileUpEventLoopMgr.h:69
PileUpHashHelper::calculateHash
void calculateHash(uuid_t &hash) const
Calculate the hash.
Definition: PileUpHashHelper.cxx:49
eventIDFromxAOD
EventID eventIDFromxAOD(const xAOD::EventInfo *xaod)
Create EventID object from xAOD::EventInfo.
Definition: EventInfoFromxAOD.cxx:16
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
PileUpEventLoopMgr::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpEventLoopMgr.h:113
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
xAOD::EventInfo_v1::setLumiBlock
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
xAOD::EventInfo_v1::subEvents
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
Definition: EventInfo_v1.cxx:596
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
PileUpEventLoopMgr::m_failureMode
Gaudi::Property< int > m_failureMode
Definition: PileUpEventLoopMgr.h:125
addSubEvent
xAOD::EventInfo * addSubEvent(xAOD::EventInfo *targetEv, const xAOD::EventInfo::SubEvent &subev, xAOD::EventInfoContainer *eiContainer, const std::string &eiContKey, StoreGateSvc *subev_store=nullptr)
Definition: PileUpMisc.cxx:18
PileUpEventLoopMgr::modifyEventContext
void modifyEventContext(EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
Definition: PileUpEventLoopMgr.cxx:168
xAOD::EventInfo_v1::mcEventNumber
uint64_t mcEventNumber() const
The MC generator's event number.
xAOD::EventInfo_v1::setMCEventWeights
void setMCEventWeights(const std::vector< float > &value)
Set the weights of all the MC events used in the simulation.
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
PileUpEventLoopMgr::m_beamLumi
ServiceHandle< IBeamLuminosity > m_beamLumi
Definition: PileUpEventLoopMgr.h:100
PileUpEventLoopMgr::m_loadProxies
bool m_loadProxies
Definition: PileUpEventLoopMgr.h:147
python.SystemOfUnits.ms
float ms
Definition: SystemOfUnits.py:148