Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Types | 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 ()
 implementation of IAppMgrUI::initialize More...
 
virtual StatusCode finalize ()
 implementation of IAppMgrUI::finalize More...
 
virtual StatusCode nextEvent (int maxevt)
 implementation of IAppMgreUI::terminate More...
 
virtual StatusCode executeEvent (EventContext &&ctx)
 implementation of IEventProcessor::executeEvent(void* par) More...
 
virtual StatusCode seek (int evt)
 Seek to a given event. More...
 
virtual int curEvent () const
 Return the current event count. More...
 
virtual void modifyEventContext (EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
 
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 Types

typedef ServiceHandle< IEvtIdModifierSvcIEvtIdModifierSvc_t
 

Private Member Functions

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...
 
ServiceHandle< PileUpMergeSvcm_mergeSvc
 PileUp Merge Service. More...
 
PileUpStream m_origStream
 Input Stream. More...
 
ServiceHandle< StoreGateSvcm_evtStore
 output store More...
 
IEvtIdModifierSvc_t m_evtIdModSvc
 
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...
 
Properties
ServiceHandle< IEvtSelector > m_origSel
 Original (Physics) Event selector (background for overlay). More...
 
ServiceHandle< IEvtSelector > m_signalSel
 Signal Event selector (for overlay). More...
 
ToolHandleArray< IBkgStreamsCachem_caches
 BkgStreamsCaches managing background events. More...
 
Gaudi::Property< float > m_maxCollPerXing
 (max) minBias interactions per Xing, for setting MC luminosity More...
 
Gaudi::Property< float > m_xingFreq
 Xing frequency(ns);. More...
 
Gaudi::Property< int > m_firstXing
 first xing to be simulated (0th xing is 1st after trigger) More...
 
Gaudi::Property< int > m_lastXing
 last xing to be simulated (0th xing is 1st after trigger) More...
 
Gaudi::Property< bool > m_allowSubEvtsEOF
 property: allow sub evts EOF condition when maxevt==-1 More...
 
Gaudi::Property< bool > m_xingByXing
 property: process bkg events xing by xing without caching them More...
 
Gaudi::Property< int > m_failureMode
 property: control behaviour of event loop on algorithm failure More...
 
Gaudi::Property< std::string > m_evinfName
 SG key for the EventInfoContainer. More...
 
Gaudi::Property< std::string > m_evinfContName
 SG key for the EventInfoContainer. More...
 
ServiceHandle< IBeamIntensitym_beamInt
 property: beam intensity service handle for beam profile in local time More...
 
ServiceHandle< IBeamLuminositym_beamLumi
 property: beam intensity service handle for luminosity profile in iovtime More...
 
uint32_t m_currentRun
 current run number More...
 
bool m_firstRun
 
unsigned int m_maxBunchCrossingPerOrbit
 max bunch crossings per orbit More...
 
int m_nevt
 
int m_ncurevt
 
bool m_skipExecAlgs
 
bool m_loadProxies
 
Gaudi::Property< bool > m_allowSerialAndMPToDiffer
 property: Default true. More...
 
Gaudi::Property< uint32_t > m_mcChannelNumber { this, "MCChannelNumber", 0, "sample MC channel number" }
 

Detailed Description

The ATLAS event loop for pile-up applications.

Definition at line 43 of file PileUpEventLoopMgr.h.

Member Typedef Documentation

◆ IEvtIdModifierSvc_t

Definition at line 104 of file PileUpEventLoopMgr.h.

Constructor & Destructor Documentation

◆ PileUpEventLoopMgr()

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

Standard Constructor.

Definition at line 48 of file PileUpEventLoopMgr.cxx.

50  : base_class(name, svcLoc)
51  , AthMessaging (name)
52  , m_incidentSvc("IncidentSvc", name) //FIXME should this be configurable?
53  , m_mergeSvc("PileUpMergeSvc", name)
54  , m_evtStore("StoreGateSvc/StoreGateSvc", name)
55  , m_evtIdModSvc("", name)
56  , m_origSel("EventSelector", name)
57  , m_signalSel("", name)
58  , m_caches(this)
59  , m_maxCollPerXing(23.0)
60  , m_xingFreq(25)
61  , m_firstXing(-2)
62  , m_lastXing(+1)
63  , m_allowSubEvtsEOF(true)
64  , m_xingByXing(false)
65  , m_failureMode(1)
68  , m_beamInt("FlatBM", name)
69  , m_beamLumi("LumiProfileSvc", name)
70  , m_currentRun(0)
71  , m_firstRun(true)
73  , m_nevt(0)
74  , m_ncurevt(0)
75  , m_skipExecAlgs(false)
76  , m_loadProxies(true)
78 {
79  declareProperty("MaxBunchCrossingPerOrbit", m_maxBunchCrossingPerOrbit, "The number of slots in each LHC beam. Default: 3564.");
80  declareProperty("OrigSelector", m_origSel, "EventSelector for original (physics) events stream" );
81  declareProperty("SignalSelector", m_signalSel, "EventSelector for signal (hard-scatter) events stream" );
82  declareProperty("XingFrequency", m_xingFreq, "ns");
83  declareProperty("firstXing", m_firstXing, "time of first xing / XingFrequency (0th xing is 1st after trigger)");
84  declareProperty("lastXing", m_lastXing, "time of last xing / XingFrequency (0th xing is 1st after trigger)");
85  declareProperty("MaxMinBiasCollPerXing", m_maxCollPerXing, "Set to digitization numberOfCollisions prop. for variable-mu and RunDMC jobs.");
86  declareProperty("bkgCaches", m_caches, "list of tools managing bkg events");
87  declareProperty("AllowSubEvtsEOF", m_allowSubEvtsEOF, "if true(default) an EOF condition in the BkgStreamsCaches is not considered to be an error IF maxevt=-1 (loop over all available events)");
88  declareProperty("XingByXing", m_xingByXing, "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");
89  declareProperty("FailureMode", m_failureMode,
90  "Controls behaviour of event loop depending on return code of"
91  " Algorithms. 0: all non-SUCCESSes terminate job. "
92  "1: RECOVERABLE skips to next event, FAILURE terminates job "
93  "(DEFAULT). 2: RECOVERABLE and FAILURE skip to next events");
94 
95  declareProperty("BeamInt", m_beamInt,
96  "The service providing the beam intensity distribution");
97  declareProperty("BeamLuminosity", m_beamLumi,
98  "The service providing the beam luminosity distribution vs. run");
99  declareProperty("PileUpMergeSvc", m_mergeSvc, "PileUp Merge Service");
100  declareProperty("EvtIdModifierSvc", m_evtIdModSvc, "ServiceHandle for EvtIdModifierSvc");
101  declareProperty("AllowSerialAndMPToDiffer", m_allowSerialAndMPToDiffer, "When set to False, this will allow the code to reproduce serial output in an AthenaMP job, albeit with a significant performance penalty.");
102  declareProperty("EventInfoName", m_evinfName, "SG key for the EventInfo object");
103  declareProperty("EventInfoContName", m_evinfContName, "SG key for the EventInfoContainer object");
104  // m_caches.push_back("BkgStreamsCache/MinBiasCache");
105 }

◆ ~PileUpEventLoopMgr()

PileUpEventLoopMgr::~PileUpEventLoopMgr ( )
virtual

Standard Destructor.

Definition at line 110 of file PileUpEventLoopMgr.cxx.

110 {}

Member Function Documentation

◆ curEvent()

int PileUpEventLoopMgr::curEvent ( ) const
virtual

Return the current event count.

Definition at line 565 of file PileUpEventLoopMgr.cxx.

566 {
567  return m_nevt;
568 }

◆ executeAlgorithms()

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

Run the algorithms for the current event.

Definition at line 606 of file PileUpEventLoopMgr.cxx.

607 {
608  // Call the execute() method of all top algorithms
609  for ( ListAlg::iterator ita = m_topAlgList.begin();
610  ita != m_topAlgList.end();
611  ++ita ) {
612  StatusCode sc = (*ita)->sysExecute( ctx );
613  // this duplicates what is already done in Algorithm::sysExecute, which
614  // calls Algorithm::setExecuted, but eventually we plan to remove that
615  // function
616  m_aess->algExecState(*ita, ctx ).setState(AlgExecState::State::Done, sc);
617  if ( !sc.isSuccess() ) {
618  ATH_MSG_INFO ( "Execution of algorithm " <<
619  (*ita)->name() << " failed with StatusCode::" << sc );
620  return sc;
621  }
622  }
623 
624  return StatusCode::SUCCESS;
625 }

◆ executeEvent()

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

implementation of IEventProcessor::executeEvent(void* par)

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 631 of file PileUpEventLoopMgr.cxx.

632 {
634  if (m_firstRun || (m_currentRun != ctx.eventID().run_number())) {
635  // Fire EndRun incident unless this is the first run
636  if (!m_firstRun) {
637  m_incidentSvc->fireIncident(Incident(this->name(),IncidentType::EndRun));
638  }
639  m_firstRun = false;
640  m_currentRun = ctx.eventID().run_number();
641 
642  ATH_MSG_INFO ( " ===>>> start of run " << m_currentRun << " <<<===" );
643 
644  // Fire BeginRun "Incident"
645  m_incidentSvc->fireIncident(Incident(this->name(),IncidentType::BeginRun,ctx));
646  }
647 
648  bool eventFailed(false);
649  // Call the execute() method of all top algorithms
651 
652  if (!sc.isSuccess()) {
653  eventFailed = true;
654  m_aess->setEventStatus( EventStatus::AlgFail, ctx );
655 
659  if (m_failureMode == 1 && sc.isRecoverable()) {
660  ATH_MSG_WARNING ( "RECOVERABLE error returned by algorithm. " <<
661  "Skipping remaining algorithms." << std::endl <<
662  "\tNo output will be written for this event, " <<
663  "but job will continue to next event" );
664  eventFailed = false;
665  }
666 
668  if (m_failureMode >= 2) {
669  ATH_MSG_INFO ( "Skipping remaining algorithms." << std::endl <<
670  "\tNo output will be written for this event, " <<
671  "but job will continue to next event" );
672  eventFailed = false;
673  }
674  }
675  else {
676  m_aess->setEventStatus( EventStatus::Success, ctx );
677 
678  // Call the execute() method of all output streams
679  for (ListAlg::iterator ito = m_outStreamList.begin();
680  ito != m_outStreamList.end(); ++ito ) {
681  sc = (*ito)->sysExecute( ctx );
682  if ( !sc.isSuccess() ) {
683  eventFailed = true;
684  }
685  }
686  }
687 
688  //------------------------------------------------------------------------
689  // Check if there was an error processing current event
690  //------------------------------------------------------------------------
691  return eventFailed?StatusCode::FAILURE:StatusCode::SUCCESS;
692 }

◆ finalize()

StatusCode PileUpEventLoopMgr::finalize ( )
virtual

implementation of IAppMgrUI::finalize

Definition at line 190 of file PileUpEventLoopMgr.cxx.

191 {
192  ATH_MSG_INFO ( "Finalizing " << this->name() );
193 
194  //we need to release all our BkgStreamCaches
197  while (cacheIterator != endOfCaches) {
198  (*cacheIterator++)->release();
199  }
200  m_caches.clear();
201 
202  //and to clean up the store the stream owns
204 
206 }

◆ getBCID()

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

return the 'fake BCID' corresponding to bunchXing

Definition at line 87 of file PileUpEventLoopMgr.h.

87  {
88  //FIXME to be completely safe this should should probably depend on the bunch spacing too. Perhaps that concept should be deprecated though?
89  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));
90  }

◆ initialize()

StatusCode PileUpEventLoopMgr::initialize ( )
virtual

implementation of IAppMgrUI::initialize

Definition at line 115 of file PileUpEventLoopMgr.cxx.

116 {
117  ATH_MSG_INFO ( "Initializing " << this->name() ) ;
119  ATH_MSG_WARNING ( "AllowSerialAndMPToDiffer=False! This will incur serious performance penalties! But Serial and MP output will be the same." );
120  }
121 
122  //locate the StoreGateSvc and initialize our local ptr
123  CHECK(m_evtStore.retrieve());
124 
125  //reset output store proxy provider: we don't want to have one!
126  m_evtStore->setProxyProviderSvc(nullptr);
127 
128  //locate the IncidentSvc and initialize our local ptr
129  CHECK(m_incidentSvc.retrieve());
130 
131  //locate the PileUpMergeSvc and initialize our local ptr
132  CHECK(m_mergeSvc.retrieve());
133 
134  //-------------------------------------------------------------------------
135  // Setup Event Selector
136  //-------------------------------------------------------------------------
137  CHECK(this->setupStreams());
138 
139  // Get the value of SkipEvents. It is needed for seeking
140  SmartIF<IProperty> prpMgr(serviceLocator());
141  SmartIF<IEvtSelector> evtSelector;
142  if (prpMgr.isValid()) {
143  // Get event selector name. Retrieve EventSelector
144  std::string evtSelName = prpMgr->getProperty("EvtSel").toString();
145  evtSelector = serviceLocator()->service(evtSelName);
146  CHECK(evtSelector.isValid());
147  }
148  else {
149  ATH_MSG_ERROR ( "IProperty interface not found in ApplicationMgr" );
150  return StatusCode::FAILURE;
151  }
152 
153  SmartIF<IProperty> prpMgr1(evtSelector);
154  if (prpMgr1.isValid()) {
155  std::string skipEventsStr = prpMgr1->getProperty("SkipEvents").toString();
156  m_ncurevt = std::atoi(skipEventsStr.c_str());
157  }
158  else {
159  ATH_MSG_ERROR ( "IProperty interface not found on the event selector" );
160  return StatusCode::FAILURE;
161  }
162 
163  // Get the AlgExecStateSvc
164  m_aess = serviceLocator()->service("AlgExecStateSvc");
165  if (!m_aess.isValid()) {
166  ATH_MSG_FATAL ( "Error retrieving AlgExecStateSvc" );
167  return StatusCode::FAILURE;
168  }
169 
170  //--------------------------------------------------------------------------
171  // Set up the EventID modifier Service
172  //--------------------------------------------------------------------------
173  if( m_evtIdModSvc.empty() ) {
174  ATH_MSG_DEBUG ( "EventID modifier Service not set. No run number, ... overrides will be applied." );
175  }
176  else if ( !m_evtIdModSvc.retrieve().isSuccess() ) {
177  ATH_MSG_INFO ( "Could not find EventID modifier Service. No run number, ... overrides will be applied." );
178  }
179 
180  //-------------------------------------------------------------------------
181  // Base class initialize (done at the end to allow algs to access stores)
182  //-------------------------------------------------------------------------
183 
185 }

◆ 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 
)
virtual

Definition at line 220 of file PileUpEventLoopMgr.cxx.

220  {
221 
222  if (m_evtIdModSvc.isSet()) {
223  EventID new_eID(eID);
224  // m_nevt - 1 because the PileUpEventLoopMgr increments it rather early
225  m_evtIdModSvc->modify_evtid(new_eID, m_ncurevt - 1, consume_modifier_stream);
226  if (msgLevel(MSG::DEBUG)) {
227  unsigned int oldrunnr=eID.run_number();
228  unsigned int oldLB=eID.lumi_block();
229  unsigned int oldTS=eID.time_stamp();
230  unsigned int oldTSno=eID.time_stamp_ns_offset();
231  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc runnr=" << oldrunnr << " -> " << new_eID.run_number() );
232  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc LB=" << oldLB << " -> " << new_eID.lumi_block() );
233  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp=" << oldTS << " -> " << new_eID.time_stamp() );
234  ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp ns Offset=" << oldTSno << " -> " << new_eID.time_stamp_ns_offset() );
235  }
236  ctx.setEventID(new_eID);
237  return;
238  }
239 
240  ctx.setEventID( eID );
241 }

◆ 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)
virtual

implementation of IAppMgreUI::terminate

implementation of IAppMgrUI::nextEvent

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

ask the BeamLuminositySvc to check for a new scalefactor

Definition at line 247 of file PileUpEventLoopMgr.cxx.

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

◆ seek()

StatusCode PileUpEventLoopMgr::seek ( int  evt)
virtual

Seek to a given event.

Definition at line 544 of file PileUpEventLoopMgr.cxx.

545 {
546  int nevtsToAdvance = evt-m_ncurevt;
547  int nParam = m_nevt+1;
548  ATH_MSG_INFO ( "In PileUpEventLoopMgr::seek. m_ncurevt=" << m_ncurevt <<
549  " nevtsToAdvance=" << nevtsToAdvance );
550 
551  m_skipExecAlgs = true;
552  for (int i=0; i<nevtsToAdvance; ++i) {
554  m_loadProxies = (nevtsToAdvance==(i+1));
555  }
556  if (this->nextEvent(nParam).isFailure()) {
557  ATH_MSG_ERROR ( "Seek error! Failed to advance to evt=" << m_ncurevt+1 );
558  return StatusCode::FAILURE;
559  }
560  }
561  m_skipExecAlgs = false;
562  return StatusCode::SUCCESS;
563 }

◆ 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 574 of file PileUpEventLoopMgr.cxx.

575 {
576  //OK now we can run
577  // retrieve selector and setup iterator (the selector has been setup as an ExtService)
578  CHECK(m_origSel.retrieve());
579 
580  m_origStream = PileUpStream("OriginalEvent", serviceLocator(), &*m_origSel);
581  if (!m_origStream.setupStore()) {
582  ATH_MSG_ERROR ( "Can not setup original evt store " << m_origSel );
583  return StatusCode::FAILURE;
584  }
585 
586  //now get the bkg stream caches, and set them up
587  CHECK(m_caches.retrieve());
588  ATH_MSG_DEBUG ( "retrieved BkgStreamsCaches " << m_caches );
589 
592  unsigned int nXings(m_lastXing-m_firstXing+1);
593  unsigned int firstStore(0);
594  StatusCode sc(StatusCode::SUCCESS);
595  while ((cacheIterator != endOfCaches) && sc.isSuccess()) {
596  sc = (*cacheIterator)->setup(m_firstXing, nXings, firstStore, &*m_beamInt);
597  firstStore += (*cacheIterator)->nStores() ;
598  ++cacheIterator;
599  }
600  return sc;
601 }

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 78 of file PileUpEventLoopMgr.h.

◆ m_allowSerialAndMPToDiffer

Gaudi::Property<bool> PileUpEventLoopMgr::m_allowSerialAndMPToDiffer
private

property: Default 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 166 of file PileUpEventLoopMgr.h.

◆ m_allowSubEvtsEOF

Gaudi::Property<bool> PileUpEventLoopMgr::m_allowSubEvtsEOF
private

property: allow sub evts EOF condition when maxevt==-1

Definition at line 130 of file PileUpEventLoopMgr.h.

◆ m_beamInt

ServiceHandle<IBeamIntensity> PileUpEventLoopMgr::m_beamInt
private

property: beam intensity service handle for beam profile in local time

Definition at line 145 of file PileUpEventLoopMgr.h.

◆ m_beamLumi

ServiceHandle<IBeamLuminosity> PileUpEventLoopMgr::m_beamLumi
private

property: beam intensity service handle for luminosity profile in iovtime

Definition at line 147 of file PileUpEventLoopMgr.h.

◆ m_caches

ToolHandleArray<IBkgStreamsCache> PileUpEventLoopMgr::m_caches
private

BkgStreamsCaches managing background events.

Definition at line 118 of file PileUpEventLoopMgr.h.

◆ m_currentRun

uint32_t PileUpEventLoopMgr::m_currentRun
private

current run number

Definition at line 151 of file PileUpEventLoopMgr.h.

◆ m_evinfContName

Gaudi::Property<std::string> PileUpEventLoopMgr::m_evinfContName
private

SG key for the EventInfoContainer.

Definition at line 142 of file PileUpEventLoopMgr.h.

◆ m_evinfName

Gaudi::Property<std::string> PileUpEventLoopMgr::m_evinfName
private

SG key for the EventInfoContainer.

Definition at line 139 of file PileUpEventLoopMgr.h.

◆ m_evtIdModSvc

IEvtIdModifierSvc_t PileUpEventLoopMgr::m_evtIdModSvc
private

Definition at line 106 of file PileUpEventLoopMgr.h.

◆ m_evtStore

ServiceHandle<StoreGateSvc> PileUpEventLoopMgr::m_evtStore
private

output store

Definition at line 102 of file PileUpEventLoopMgr.h.

◆ m_failureMode

Gaudi::Property<int> PileUpEventLoopMgr::m_failureMode
private

property: control behaviour of event loop on algorithm failure

Definition at line 136 of file PileUpEventLoopMgr.h.

◆ m_firstRun

bool PileUpEventLoopMgr::m_firstRun
private

Definition at line 152 of file PileUpEventLoopMgr.h.

◆ m_firstXing

Gaudi::Property<int> PileUpEventLoopMgr::m_firstXing
private

first xing to be simulated (0th xing is 1st after trigger)

Definition at line 125 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 93 of file PileUpEventLoopMgr.h.

◆ m_lastXing

Gaudi::Property<int> PileUpEventLoopMgr::m_lastXing
private

last xing to be simulated (0th xing is 1st after trigger)

Definition at line 127 of file PileUpEventLoopMgr.h.

◆ m_loadProxies

bool PileUpEventLoopMgr::m_loadProxies
private

Definition at line 161 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

unsigned int PileUpEventLoopMgr::m_maxBunchCrossingPerOrbit
private

max bunch crossings per orbit

Definition at line 155 of file PileUpEventLoopMgr.h.

◆ m_maxCollPerXing

Gaudi::Property<float> PileUpEventLoopMgr::m_maxCollPerXing
private

(max) minBias interactions per Xing, for setting MC luminosity

Definition at line 120 of file PileUpEventLoopMgr.h.

◆ m_mcChannelNumber

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

Definition at line 168 of file PileUpEventLoopMgr.h.

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> PileUpEventLoopMgr::m_mergeSvc
private

PileUp Merge Service.

Definition at line 96 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
private

Definition at line 159 of file PileUpEventLoopMgr.h.

◆ m_nevt

int PileUpEventLoopMgr::m_nevt
private

Definition at line 157 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

Original (Physics) Event selector (background for overlay).

Definition at line 114 of file PileUpEventLoopMgr.h.

◆ m_origStream

PileUpStream PileUpEventLoopMgr::m_origStream
private

Input Stream.

Definition at line 99 of file PileUpEventLoopMgr.h.

◆ m_signalSel

ServiceHandle<IEvtSelector> PileUpEventLoopMgr::m_signalSel
private

Signal Event selector (for overlay).

Definition at line 116 of file PileUpEventLoopMgr.h.

◆ m_skipExecAlgs

bool PileUpEventLoopMgr::m_skipExecAlgs
private

Definition at line 160 of file PileUpEventLoopMgr.h.

◆ m_xingByXing

Gaudi::Property<bool> PileUpEventLoopMgr::m_xingByXing
private

property: process bkg events xing by xing without caching them

Definition at line 133 of file PileUpEventLoopMgr.h.

◆ m_xingFreq

Gaudi::Property<float> PileUpEventLoopMgr::m_xingFreq
private

Xing frequency(ns);.

Definition at line 123 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:93
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition: IEventInfoCnvTool.h:17
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
property: Default true.
Definition: PileUpEventLoopMgr.h:166
PileUpEventLoopMgr::m_signalSel
ServiceHandle< IEvtSelector > m_signalSel
Signal Event selector (for overlay).
Definition: PileUpEventLoopMgr.h:116
initialize
void initialize()
Definition: run_EoverP.cxx:894
xAOD::EventAuxInfo_v3
Auxiliary information about the event.
Definition: EventAuxInfo_v3.h:28
xAOD::EventInfo_v1::clearSubEvents
void clearSubEvents()
Clear all the currently held sub-events.
Definition: EventInfo_v1.cxx:647
PileUpEventLoopMgr::nextEvent
virtual StatusCode nextEvent(int maxevt)
implementation of IAppMgreUI::terminate
Definition: PileUpEventLoopMgr.cxx:247
PileUpEventLoopMgr::m_origSel
ServiceHandle< IEvtSelector > m_origSel
Original (Physics) Event selector (background for overlay).
Definition: PileUpEventLoopMgr.h:114
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
Xing frequency(ns);.
Definition: PileUpEventLoopMgr.h:123
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PileUpEventLoopMgr::m_skipExecAlgs
bool m_skipExecAlgs
Definition: PileUpEventLoopMgr.h:160
PileUpEventLoopMgr::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
output store
Definition: PileUpEventLoopMgr.h:102
PileUpEventLoopMgr::m_evinfName
Gaudi::Property< std::string > m_evinfName
SG key for the EventInfoContainer.
Definition: PileUpEventLoopMgr.h:139
PileUpEventLoopMgr::executeAlgorithms
virtual StatusCode executeAlgorithms(const EventContext &ctx)
Run the algorithms for the current event.
Definition: PileUpEventLoopMgr.cxx:606
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
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
PileUpEventLoopMgr::m_origStream
PileUpStream m_origStream
Input Stream.
Definition: PileUpEventLoopMgr.h:99
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.
PileUpEventLoopMgr::m_maxBunchCrossingPerOrbit
unsigned int m_maxBunchCrossingPerOrbit
max bunch crossings per orbit
Definition: PileUpEventLoopMgr.h:155
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:159
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
PileUpEventLoopMgr::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
PileUp Merge Service.
Definition: PileUpEventLoopMgr.h:96
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
property: allow sub evts EOF condition when maxevt==-1
Definition: PileUpEventLoopMgr.h:130
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::AuxElement::setStore
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
Definition: AuxElement.cxx:241
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_beamInt
ServiceHandle< IBeamIntensity > m_beamInt
property: beam intensity service handle for beam profile in local time
Definition: PileUpEventLoopMgr.h:145
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:157
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
SG key for the EventInfoContainer.
Definition: PileUpEventLoopMgr.h:142
PileUpEventLoopMgr::setupStreams
StatusCode setupStreams()
setup input and overlay selectors and iters
Definition: PileUpEventLoopMgr.cxx:574
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:168
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
PileUpStream::store
StoreGateSvc & store()
Definition: PileUpStream.h:57
xAOD::EventAuxInfo
EventAuxInfo_v3 EventAuxInfo
Definition of the latest event auxiliary info version.
Definition: EventAuxInfo.h:15
PileUpEventLoopMgr::m_firstXing
Gaudi::Property< int > m_firstXing
first xing to be simulated (0th xing is 1st after trigger)
Definition: PileUpEventLoopMgr.h:125
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:87
PileUpEventLoopMgr::executeEvent
virtual StatusCode executeEvent(EventContext &&ctx)
implementation of IEventProcessor::executeEvent(void* par)
Definition: PileUpEventLoopMgr.cxx:631
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
(max) minBias interactions per Xing, for setting MC luminosity
Definition: PileUpEventLoopMgr.h:120
PileUpEventLoopMgr::m_firstRun
bool m_firstRun
Definition: PileUpEventLoopMgr.h:152
PileUpEventLoopMgr::m_evtIdModSvc
IEvtIdModifierSvc_t m_evtIdModSvc
Definition: PileUpEventLoopMgr.h:106
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
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
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
BkgStreamsCaches managing background events.
Definition: PileUpEventLoopMgr.h:118
xAOD::EventInfo_v1::Signal
@ Signal
The signal event.
Definition: EventInfo_v1.h:266
PileUpEventLoopMgr::m_xingByXing
Gaudi::Property< bool > m_xingByXing
property: process bkg events xing by xing without caching them
Definition: PileUpEventLoopMgr.h:133
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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:151
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:78
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
last xing to be simulated (0th xing is 1st after trigger)
Definition: PileUpEventLoopMgr.h:127
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
property: control behaviour of event loop on algorithm failure
Definition: PileUpEventLoopMgr.h:136
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
virtual void modifyEventContext(EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
Definition: PileUpEventLoopMgr.cxx:220
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
property: beam intensity service handle for luminosity profile in iovtime
Definition: PileUpEventLoopMgr.h:147
PileUpEventLoopMgr::m_loadProxies
bool m_loadProxies
Definition: PileUpEventLoopMgr.h:161