ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ISF::SimKernel Class Reference

#include <SimKernel.h>

Inheritance diagram for ISF::SimKernel:
Collaboration diagram for ISF::SimKernel:

Public Member Functions

 SimKernel (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters. More...
 
virtual ~SimKernel ()
 Destructor. More...
 
StatusCode initialize ()
 Athena algorithm's interface method initialize() More...
 
StatusCode execute ()
 Athena algorithm's interface method execute() More...
 
StatusCode finalize ()
 Athena algorithm's interface method finalize() More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode initSimSvcs (SimSelectorToolArray &simSelectorTools)
 
StatusCode prepareInput (SG::ReadHandle< McEventCollection > &inputTruth, SG::WriteHandle< McEventCollection > &outputTruth, std::unique_ptr< McEventCollection > &shadowTruth, ISFParticleContainer &simParticles) const
 Convert input generator particles to ISFParticles and copy input generator truth collection into output simulation truth collection. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandle< McEventCollectionm_inputHardScatterEvgen
 Input/output truth collections and input conversion. More...
 
SG::ReadHandle< McEventCollectionm_inputPileupEvgen
 input pileup collection More...
 
SG::WriteHandle< McEventCollectionm_outputHardScatterTruth
 output hard scatter truth collection More...
 
SG::WriteHandle< McEventCollectionm_outputPileupTruth
 output pileup truth collection More...
 
ServiceHandle< IInputConverterm_inputConverter
 input->ISFParticle converter More...
 
ToolHandle< IGenEventFilterm_truthPreselectionTool {this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"}
 
BooleanProperty m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" }
 
ServiceHandle< IParticleBrokerm_particleBroker
 Central particle broker service. More...
 
ServiceHandle< ITruthSvcm_truthRecordSvc
 Central truth service. More...
 
ToolHandleArray< ISimulationSelectorm_simSelectors [AtlasDetDescr::fNumAtlasRegions]
 The Simulation Selector Chains. More...
 
ServiceHandle< Simulation::IZeroLifetimePatcherm_qspatcher
 Quasi-Stable Particle Simulation Patcher. More...
 
ToolHandleArray< IEventFilterToolm_eventFilters
 The Event Filters. More...
 
bool m_doMemMon
 The Memory Info Tool. More...
 
ToolHandle< IMonitoringToolm_memMon
 
unsigned int m_memUsageEvts
 
std::vector< ISimulationSvc * > m_simSvcs
 Simulators to be used. More...
 
std::vector< std::string > m_simSvcNames
 SimSvc names. More...
 
ISF::SimSvcID m_numSimSvcs
 total number of SimSvcs used More...
 
unsigned int m_numISFEvents
 keep track of the number of events processed More...
 
bool m_doCPUMon
 CPU Benchmarking. More...
 
PMonUtils::CustomBenchmarkm_benchSimID
 
long int m_numParticles
 Statistics. More...
 
size_t m_maxParticleVectorSize
 tuning More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

This is the purely sequential simulation kernel, executed once per event. The ISF::SimKernel is configured by providing:

The AthAlgorithm::initialize() framework call triggers:

The AthAlgorithm::execute() framework call triggers the following sequence of calls :

Author
Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch

Definition at line 68 of file SimKernel.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SimKernel()

ISF::SimKernel::SimKernel ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructor with parameters.

Definition at line 35 of file SimKernel.cxx.

35  :
36  ::AthAlgorithm( name, pSvcLocator ),
42  m_particleBroker("ISF_ParticleBroker", name),
43  m_truthRecordSvc("ISF_TruthRecordSvc", name),
44  m_qspatcher("", name),
45  m_doMemMon(true),
46  m_memMon("MemMonitoringTool"),
47  m_memUsageEvts(1000),
50  m_numSimSvcs(ISF::fFirstAtlasSimID), // ==1 since UndefinedSimID is always there
51  m_numISFEvents(0),
52  m_doCPUMon(true),
53  //m_benchPDGCode(0), TODO: implement this if feasible
54  //m_benchGeoID(0), TODO: implement this if feasible
55  m_benchSimID(0),
56  m_numParticles(0),
58 {
59  declareProperty("InputHardScatterCollection",
61  "Input Hard Scatter EVGEN collection.");
62  declareProperty("InputPileupCollection",
64  "Input Pileup EVGEN collection.");
65  declareProperty("OutputHardScatterTruthCollection",
67  "Output Hard Scatter Truth collection.");
68  declareProperty("OutputPileupTruthCollection",
70  "Output Pileup Truth collection.");
71  declareProperty("InputConverter",
73  "Input McEventCollection->ISFParticleContainer conversion service.");
74 
75  // the general services and tools needed
76  declareProperty("ParticleBroker" , m_particleBroker );
77  declareProperty("TruthRecordService" , m_truthRecordSvc );
78  declareProperty("DoCPUMonitoring" , m_doCPUMon );
79  declareProperty("DoMemoryMonitoring" , m_doMemMon );
80  declareProperty("MemoryMonitoringTool" , m_memMon );
81  declareProperty("SummarizeMemUsageEveryNEvts", m_memUsageEvts );
82  // routing tool
83  declareProperty("BeamPipeSimulationSelectors", m_simSelectors[AtlasDetDescr::fAtlasForward] );
84  declareProperty("IDSimulationSelectors" , m_simSelectors[AtlasDetDescr::fAtlasID] );
85  declareProperty("CaloSimulationSelectors" , m_simSelectors[AtlasDetDescr::fAtlasCalo] );
86  declareProperty("MSSimulationSelectors" , m_simSelectors[AtlasDetDescr::fAtlasMS] );
87  declareProperty("CavernSimulationSelectors" , m_simSelectors[AtlasDetDescr::fAtlasCavern] );
88  // Quasi-stable particle sim
89  declareProperty("QuasiStablePatcher", m_qspatcher);
90  // event filter
91  declareProperty("EventFilterTools" , m_eventFilters );
92  // tuning parameters
93  declareProperty("MaximumParticleVectorSize" , m_maxParticleVectorSize );
94 }

◆ ~SimKernel()

ISF::SimKernel::~SimKernel ( )
virtual

Destructor.

Definition at line 98 of file SimKernel.cxx.

99 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode ISF::SimKernel::execute ( )

Athena algorithm's interface method execute()

Definition at line 325 of file SimKernel.cxx.

326 {
327 
328  ATH_MSG_DEBUG ("Executing ...");
329 
330  // dump and record current memory stats
331  if ( m_doMemMon && (m_numISFEvents==0) ) {
332  m_memMon->dumpCurrent( "before 1st event", false );
333  m_memMon->recordCurrent("before 1st event");
334  }
335 
336  // read and convert input
337  // a. hard-scatter
338  ISFParticleContainer simParticles{}; // particles for ISF simulation
339  std::unique_ptr<McEventCollection> shadowTruth{};
340  std::unique_ptr<McEventCollection> shadowPileUpTruth{};
342  // b. pileup
343  if (!m_inputPileupEvgen.key().empty()) {
344  ATH_CHECK( prepareInput(m_inputPileupEvgen, m_outputPileupTruth, shadowPileUpTruth, simParticles) );
345  }
346 
347  // -----------------------------------------------------------------------------------------------
348  // Step 1: Initialize the particle stack and the TruthManager, ABORT if failure
349  ATH_CHECK ( m_particleBroker->initializeEvent( std::move(simParticles) ) );
350 
351  const int largestGeneratedParticleBC = (m_outputHardScatterTruth->empty()) ? HepMC::UNDEFINED_ID
352  : HepMC::maxGeneratedParticleBarcode(m_outputHardScatterTruth->at(0)); // TODO make this more robust
353  const int largestGeneratedVertexBC = (m_outputHardScatterTruth->empty()) ? HepMC::UNDEFINED_ID
354  : HepMC::maxGeneratedVertexBarcode(m_outputHardScatterTruth->at(0)); // TODO make this more robust
355  // tell TruthService we're starting a new event
356  ATH_CHECK( m_truthRecordSvc->initializeTruthCollection(largestGeneratedParticleBC, largestGeneratedVertexBC) );
357  // -----------------------------------------------------------------------------------------------
358 
359 
360  // -----------------------------------------------------------------------------------------------
361  // Step 2: Initialize the Event
362  {
364  std::vector<ISimulationSvc*>::iterator fSimSvcIterEnd = m_simSvcs.end();
365  for ( ; fSimSvcIter != fSimSvcIterEnd; ++fSimSvcIter ){
366  ISimulationSvc *curSimSvc = (*fSimSvcIter);
367  // if simulation with current flavour is registered
368  // -> setupEvent
369  if ( curSimSvc){
370  if( curSimSvc->setupEvent().isFailure() ) {
371  ATH_MSG_WARNING( "Event setup failed for "
372  << curSimSvc->simSvcDescriptor() );
373  } else {
374  ATH_MSG_DEBUG ( "Event setup done for "
375  << curSimSvc->simSvcDescriptor() );
376  }
377  }
378  }
379  }
380  // -----------------------------------------------------------------------------------------------
381 
382 
383 
384  // -----------------------------------------------------------------------------------------------
385  // Step 3: ISimulation KERNEL : loop over particle stack, until empty
386  unsigned int loopCounter{0};
387  ATH_MSG_DEBUG( "Starting simulation loop, initial particle stack size: " << m_particleBroker->numParticles());
388  while ( m_particleBroker->numParticles() ) {
389  ++loopCounter;
390  ATH_MSG_VERBOSE("Main Loop pass no. " << loopCounter);
391  ATH_MSG_VERBOSE("Queue starts with " << m_particleBroker->numParticles() << " particles.");
392  // get next vector of particles for simulation
394  const unsigned int numParticlesLeftInBroker = m_particleBroker->numParticles();
395  int numParticles = particles.size();
396 
397  // particle vector empty -> end simulation
398  if (numParticles==0) break;
399 
400  // for job statistics
401  m_numParticles += numParticles;
402 
403  // retrieve the particle destination simulator (and geoID)
404  const ISFParticle *firstP = particles.front();
405  ISF::SimSvcID simID = firstP->nextSimID();
406  //AtlasDetDescr::AtlasRegion geoID = firstP->nextGeoID();
407 
408  ATH_MSG_DEBUG ( "Took " << numParticles << " particles from queue (remaining: " << m_particleBroker->numParticles() << ")" );
409  ATH_MSG_VERBOSE( " -> All particles will be sent to '" << m_simSvcNames[simID] << "' simulator (SimSvcID=" << simID << ")" );
410 
411  #ifdef ISFDEBUG
412  if (loopCounter>100 && numParticles<3) {
413  ATH_MSG_INFO("Main Loop pass no. " << loopCounter);
414  ATH_MSG_INFO("Selected " << numParticles << " particles to be processed by " << m_simSvcNames[simID]);
415  for ( const ISFParticle *particle : particles ) {
417  }
418  }
419  #endif // ISFDEBUG
420 
421  // ensure that all particles in the vector have the same SimID
422  for ( const ISFParticle *particle : particles ) {
423  if ( particle->nextSimID() != simID ) {
424  ATH_MSG_WARNING( "Particle with SimID " << particle->nextSimID() << " found in vector with expected ID " << simID );
425  }
426  }
427 
428  // block defines scope for Benchmarks
429  // -> benchmarks will be stared/stopped automatically via the CustomBenchmarkGuard
430  // constructor and destructor, respectively
431  {
432  // setup sim svc benchmarks
433  PMonUtils::CustomBenchmarkGuard benchSimID( m_benchSimID , simID , numParticles );
434 
435  // ===> simulate particle
436  // NB Passing only the hard-scatter McEventCollection is not
437  // correct if Geant4 simulation were to be used for pile-up Hits
438  // in Fast Chain.
439  ATH_MSG_VERBOSE("Selected " << particles.size() << " particles to be processed by " << m_simSvcNames[simID]);
440  if (m_simSvcs[simID]->simulateVector(particles, m_outputHardScatterTruth.ptr(), shadowTruth.get()).isFailure()) {
441  ATH_MSG_WARNING( "Simulation of particles failed in Simulator: " << m_simSvcNames[simID]);
442  }
443  ATH_MSG_VERBOSE(m_simSvcNames[simID] << " returned " << m_particleBroker->numParticles()-numParticlesLeftInBroker << " new particles to be added to the queue." );
444  }
445 
446  }
447  ATH_MSG_VERBOSE("Final status: queue contains " << m_particleBroker->numParticles() << " particles.");
448  // -----------------------------------------------------------------------------------------------
449 
450 
451 
452  // Step 4: Finalize the Event
453  // -> stack service
454  if ( m_particleBroker->finalizeEvent().isFailure()) {
455  ATH_MSG_WARNING( "ParticleBroker returned with an error in event finalization." );
456  }
457  // -> simulator services
458  {
460  std::vector<ISimulationSvc*>::iterator fSimSvcIterEnd = m_simSvcs.end();
461  for ( ; fSimSvcIter != fSimSvcIterEnd; ++fSimSvcIter ){
462  ISimulationSvc *curSimSvc = (*fSimSvcIter);
463  // if simulation with current flavour is registered
464  // -> releaseEvent()
465  if ( curSimSvc){
466  if( curSimSvc->releaseEvent().isFailure() ) {
467  ATH_MSG_WARNING( "Event release failed for "
468  << curSimSvc->simSvcDescriptor() );
469  } else {
470  ATH_MSG_DEBUG ( "Event release done for "
471  << curSimSvc->simSvcDescriptor() );
472  }
473  }
474  } // -> loop over SimSvcs
475  }
476 
477  if ( m_truthRecordSvc->releaseEvent().isFailure() ){
478  ATH_MSG_FATAL( "Event finalize failed for TruthService. Abort." );
479  return StatusCode::FAILURE;
480  }
481 
482  // Step 4a: Remove QS patch if required
483  if(!m_qspatcher.empty()) {
484  for (HepMC::GenEvent* currentGenEvent : *m_outputHardScatterTruth ) {
485  ATH_CHECK(m_qspatcher->removeWorkaround(*currentGenEvent));
486  }
487  }
488 
489  // Step 5: Check Any Filters
491  const ToolHandleArray<IEventFilterTool>::iterator endOfEventFilters(m_eventFilters.end());
492  while (eventFilter != endOfEventFilters) {
493  if (!((**eventFilter).eventPassesFilter())) {
494  setFilterPassed(false);
495  ATH_MSG_INFO("This event failed the " << (**eventFilter).name() << " Filter. Therefore it will not be recorded.");
496  break;
497  }
498  ++eventFilter;
499  }
500 
501 
502  // -----------------------------------------------------------------------------------------------
503 
504  // dump current memory monitoring information
505  if (m_doMemMon) {
506  std::string evtStr = std::to_string( m_numISFEvents );
507  std::string descr("after event " + evtStr);
508  m_memMon->dumpCurrent( descr.c_str(), true);
509 
510  // ISF internal event counting
511  m_numISFEvents++;
512 
513  // memory monitoring records for the final summary
514  if ( !(m_numISFEvents%m_memUsageEvts) ) m_memMon->recordCurrent( descr.c_str() );
515  else if ( m_numISFEvents==1) m_memMon->recordCurrent("after 1st event");
516  else if ( m_numISFEvents==2) m_memMon->recordCurrent("after 2nd event");
517  else if ( m_numISFEvents==10) m_memMon->recordCurrent("after 10th event");
518  else if ( m_numISFEvents==100) m_memMon->recordCurrent("after 100th event");
519  }
520 
521  return StatusCode::SUCCESS;
522 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode ISF::SimKernel::finalize ( )

Athena algorithm's interface method finalize()

Definition at line 191 of file SimKernel.cxx.

192 {
193  ATH_MSG_INFO ( "Finalizing ..." );
194 
195  // record current memory usage
196  if (m_doMemMon) m_memMon->recordCurrent("at beginning of ISF SimKernel finalize()");
197 
198  // statistics: number of particles handled
199  ATH_MSG_INFO(" Number of particles handled by the ISF SimKernel: " << m_numParticles );
200 
201  ATH_MSG_INFO(" ========================= ISF Timing Stats =========================");
202  // Benchmarking: by SimID
203  if (m_benchSimID) {
204  ATH_MSG_INFO("Breakdown of simulation loop by SimulatorID:");
205  //TODO: for (unsigned simID=0;simID<m_benchSimID->size();++simID) {
206  for (unsigned simID=0;simID<ISF::fMaxNumAtlasSimIDs;++simID) {
207  uint64_t count;
208  double time_ms;
209  m_benchSimID->getData(simID, count, time_ms);
210  if (count>0)
211  ATH_MSG_INFO(" "<<std::setprecision(4)
212  <<m_simSvcNames[simID]<<" (id="<<simID<<")"
213  <<"\t\tn="<<count<<"\t\tt=" <<time_ms<<" ms\t\tt/n="<<time_ms/count<<" ms"
214  <<std::setprecision(-1) );
215  }
216 
217  delete m_benchSimID;
218  m_benchSimID=0;
219  }
220 
221  //TODO: implement this if feasible
222  // Benchmarking: by GeoID
223  //if (m_benchGeoID) {
224  // ATH_MSG_INFO("Breakdown of simulation loop by GeoID:");
225  // //TODO: for (unsigned geoID=0;geoID<m_benchGeoID->size();++simID) {
226  // for (unsigned geoID=AtlasDetDescr::fFirstAtlasRegion;geoID<AtlasDetDescr::fNumAtlasRegions;++geoID) {
227  // uint64_t count;
228  // double time_ms;
229  // m_benchGeoID->getData(geoID, count, time_ms);
230  // if (count>0)
231  // ATH_MSG_INFO(" "<<std::setprecision(4)
232  // <<AtlasDetDescr::AtlasRegionHelper::getName(geoID)<<" (id="<<geoID<<")"
233  // <<"\t\tn="<<count<<"\t\tt=" <<time_ms<<" ms\t\tt/n="<<time_ms/count<<" ms"
234  // <<std::setprecision(-1) );
235  // }
236 
237  // delete m_benchGeoID;
238  // m_benchGeoID=0;
239  //}
240 
241  //TODO: implement this if feasible
242  // Benchmarking: by PDGCode
243  //if (m_benchPDGCode) {
244  // ATH_MSG_INFO("Breakdown of simulation loop by PDG Particle Code:");
245  // //TODO: for (unsigned geoID=0;geoID<m_benchGeoID->size();++simID) {
246  // for (int pdgCode=ISF::fUndefinedPDGCode;pdgCode<ISF::fMaxBenchmarkPDGCode;++pdgCode) {
247  // uint64_t count;
248  // double time_ms;
249  // m_benchPDGCode->getData(pdgCode, count, time_ms);
250  // if (count>0)
251  // ATH_MSG_INFO( std::setprecision(4)
252  // << " |PDGCode|="<<pdgCode<<", n="
253  // <<count<<", t="<<time_ms<<" ms, t/n="<<time_ms/count<<" ms"
254  // <<std::setprecision(-1) );
255  // }
256 
257  // delete m_benchPDGCode;
258  // m_benchPDGCode=0;
259  //}
260 
261  // call the memory monitoring tool to print some memory stats
262  if (m_doMemMon) {
263  ATH_MSG_INFO(" ====================== ISF Memory Usage Stats =======================");
264  m_memMon->dumpSummary("end of ISF event");
265  }
266 
267  ATH_MSG_INFO(" =====================================================================");
268 
269  return StatusCode::SUCCESS;
270 }

◆ initialize()

StatusCode ISF::SimKernel::initialize ( )

Athena algorithm's interface method initialize()

Definition at line 103 of file SimKernel.cxx.

104 {
105 
106  ATH_MSG_VERBOSE ( "--------------------------------------------------------" );
107  ATH_MSG_INFO( "Initializing the ISF KERNEL " );
108 
109  // setup memory monitoring Tool
110  if ( m_doMemMon) {
111  // memory monitoring tool given -> do memory monitoring
112  ATH_CHECK( m_memMon.retrieve() );
113  ATH_MSG_INFO( "- MemoryMonitoring : " << m_memMon.typeAndName() );
114  // record current memory usage
115  m_memMon->recordCurrent("at beginning of SimKernel initialize()");
116  }
117 
118 
119  // setup CPU Benchmarks
120  if (m_doCPUMon) {
121  //if (!m_benchPDGCode)
122  // m_benchPDGCode = new PMonUtils::CustomBenchmark(ISF::fMaxBenchmarkPDGCode);
123  //if (!m_benchGeoID)
124  // m_benchGeoID = new PMonUtils::CustomBenchmark(AtlasDetDescr::fNumAtlasRegions );
125  if (!m_benchSimID)
127  }
128 
129  // retrieve the stack service
130  ATH_CHECK ( m_particleBroker.retrieve() );
131  ATH_MSG_INFO( "- ParticleBroker : " << m_particleBroker.typeAndName() );
132 
133  // the truth service
134  ATH_CHECK ( m_truthRecordSvc.retrieve() );
135  ATH_MSG_INFO( "- TruthRecordSvc : " << m_truthRecordSvc.typeAndName() );
136 
137  // initialize all SimulationServices
138  //
139  for ( short geoID=AtlasDetDescr::fFirstAtlasRegion; geoID<AtlasDetDescr::fNumAtlasRegions ; ++geoID) {
141  }
142 
143  ATH_CHECK( m_inputConverter.retrieve() );
144  if ( not m_truthPreselectionTool.empty() ) {
146  }
147 
148  if(!m_qspatcher.empty()) {
149  ATH_CHECK(m_qspatcher.retrieve());
150  }
151 
152  // initialize all the EventFilterTools
153  ATH_CHECK ( m_eventFilters.retrieve() );
154  ATH_MSG_INFO( "The following Event Filters are defined:");
156 
157  // free unused space
158  m_simSvcs.resize( m_numSimSvcs);
159  m_simSvcNames.resize( m_numSimSvcs);
160  // some screen output
161  ATH_MSG_INFO ( "The following SimulationSvc are registered to ISF:");
162  for (SimSvcID id=ISF::fFirstAtlasSimID; id<m_numSimSvcs; id++)
163  ATH_MSG_INFO ( "ID: " << id << "\t Name: '" << m_simSvcNames[id]
164  << "'");
165 
166  // setup the simulation selectors
167  //
168  for ( short geoID=AtlasDetDescr::fFirstAtlasRegion; geoID<AtlasDetDescr::fNumAtlasRegions ; ++geoID) {
169  ATH_CHECK ( m_particleBroker->registerSimSelector( m_simSelectors[geoID], (AtlasDetDescr::AtlasRegion)geoID) );
170  }
171  // screen output
172  ATH_MSG_INFO( "The following routing chains are defined:");
173  for ( short geoID = 0; geoID<AtlasDetDescr::fNumAtlasRegions ; ++geoID) {
175  << " (GeoID=" << geoID << "): \t" << m_simSelectors[geoID]);
176  }
177 
178  // record current memory usage
179  if (m_doMemMon) m_memMon->recordCurrent("at end of ISF SimKernel initialize()");
180 
185 
186  // intialziation successful
187  return StatusCode::SUCCESS;
188 }

◆ initSimSvcs()

StatusCode ISF::SimKernel::initSimSvcs ( SimSelectorToolArray simSelectorTools)
private

Definition at line 273 of file SimKernel.cxx.

274 {
275  // (1.) retrieve all SimulationSelector tools in the array
276  if ( simSelectorTools.retrieve().isFailure() ) {
277  ATH_MSG_FATAL( "Could not retrieve SimulatorSelector Tool Array. Abort." );
278  return StatusCode::FAILURE;
279  }
280 
281  // (2.) loop over SimulationSelector tool array and retrieve simulators
282  SimSelectorToolArray::iterator fSimSelectorIter = simSelectorTools.begin();
283  SimSelectorToolArray::iterator fSimSelectorIterEnd = simSelectorTools.end();
284  for ( ; fSimSelectorIter != fSimSelectorIterEnd; ++fSimSelectorIter ) {
285 
286  // take the simulator from the current SimulationSelector
287  ServiceHandle<ISimulationSvc> *curSimulator = (*fSimSelectorIter)->simulator();
288 
289  if ( (*curSimulator).retrieve().isFailure() ){
290  ATH_MSG_FATAL( "Could not retrieve SimulatorSelector Tool. Abort." );
291  return StatusCode::FAILURE;
292  } else
293  ATH_MSG_INFO( "- SimulationSelector : " << fSimSelectorIter->typeAndName() );
294 
295  // hand over particle broker to simulator
296  if ( (*curSimulator)->setParticleBroker( &*m_particleBroker).isFailure() ){
297  ATH_MSG_FATAL( "Unable to register ParticleService to SimulationService "
298  << *curSimulator );
299  return StatusCode::FAILURE;
300  }
301 
302  // get the unique ID assigned to the Simulation Service
303  SimSvcID curID = (*curSimulator)->simSvcID();
304  // if no ID assigned yet -> new simulator
305  if ( curID == ISF::fUndefinedSimID) {
306  // assign a new new ID to the simulator
307  (*curSimulator)->assignSimSvcID( m_numSimSvcs);
308  // register current simulator to the simulatorArray
309  m_simSvcs[m_numSimSvcs] = (&**curSimulator);
310  m_simSvcNames[m_numSimSvcs] = (*curSimulator)->simSvcDescriptor();
311  ATH_MSG_DEBUG( "Assigned SimSvcID=" << m_numSimSvcs
312  << " to simulator '" << m_simSvcNames[m_numSimSvcs]
313  << "'");
314  // increment the total number of simulators registered (=used as IDs)
315  ++m_numSimSvcs;
316  }
317 
318  } // loop over simulation Selectors
319 
320 
321  return StatusCode::SUCCESS;
322 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepareInput()

StatusCode ISF::SimKernel::prepareInput ( SG::ReadHandle< McEventCollection > &  inputTruth,
SG::WriteHandle< McEventCollection > &  outputTruth,
std::unique_ptr< McEventCollection > &  shadowTruth,
ISFParticleContainer simParticles 
) const
private

Convert input generator particles to ISFParticles and copy input generator truth collection into output simulation truth collection.

Definition at line 527 of file SimKernel.cxx.

530  {
531 
532  if (!inputTruth.isValid()) {
533  ATH_MSG_FATAL("Unable to read input GenEvent collection '" << inputTruth.key() << "'");
534  return StatusCode::FAILURE;
535  }
536 
537  if (m_useShadowEvent) {
538  outputTruth = std::make_unique<McEventCollection>();
539  // copy input Evgen collection to shadow Truth collection
540  shadowTruth = std::make_unique<McEventCollection>(*inputTruth);
541  for (HepMC::GenEvent* currentGenEvent : *shadowTruth ) {
542  // Apply QS patch if required
543  if ( not m_qspatcher.empty() ) {
544  ATH_CHECK(m_qspatcher->applyWorkaround(*currentGenEvent));
545  }
546  // Copy GenEvent and remove daughters of quasi-stable particles to be simulated
547  std::unique_ptr<HepMC::GenEvent> outputEvent = m_truthPreselectionTool->filterGenEvent(*currentGenEvent);
548  outputTruth->push_back(outputEvent.release());
549  }
550  }
551  else {
552  // copy input Evgen collection to output Truth collection
553  outputTruth = std::make_unique<McEventCollection>(*inputTruth);
554 
555  // Apply QS patch if required
556  if(!m_qspatcher.empty()) {
557  for (HepMC::GenEvent* currentGenEvent : *outputTruth ) {
558  ATH_CHECK(m_qspatcher->applyWorkaround(*currentGenEvent));
559  }
560  }
561  }
562  ATH_CHECK( m_inputConverter->convert(*outputTruth, simParticles) );
563 
564  return StatusCode::SUCCESS;
565 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_benchSimID

PMonUtils::CustomBenchmark* ISF::SimKernel::m_benchSimID
private

Definition at line 137 of file SimKernel.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doCPUMon

bool ISF::SimKernel::m_doCPUMon
private

CPU Benchmarking.

whether we use PMonUtils or not

Definition at line 134 of file SimKernel.h.

◆ m_doMemMon

bool ISF::SimKernel::m_doMemMon
private

The Memory Info Tool.

Definition at line 121 of file SimKernel.h.

◆ m_eventFilters

ToolHandleArray<IEventFilterTool> ISF::SimKernel::m_eventFilters
private

The Event Filters.

Definition at line 118 of file SimKernel.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_inputConverter

ServiceHandle<IInputConverter> ISF::SimKernel::m_inputConverter
private

input->ISFParticle converter

Definition at line 100 of file SimKernel.h.

◆ m_inputHardScatterEvgen

SG::ReadHandle<McEventCollection> ISF::SimKernel::m_inputHardScatterEvgen
private

Input/output truth collections and input conversion.

input hard scatter collection

Definition at line 96 of file SimKernel.h.

◆ m_inputPileupEvgen

SG::ReadHandle<McEventCollection> ISF::SimKernel::m_inputPileupEvgen
private

input pileup collection

Definition at line 97 of file SimKernel.h.

◆ m_maxParticleVectorSize

size_t ISF::SimKernel::m_maxParticleVectorSize
private

tuning

number of particles simultaneously sent to simulator

Definition at line 143 of file SimKernel.h.

◆ m_memMon

ToolHandle<IMonitoringTool> ISF::SimKernel::m_memMon
private

Definition at line 122 of file SimKernel.h.

◆ m_memUsageEvts

unsigned int ISF::SimKernel::m_memUsageEvts
private

Definition at line 123 of file SimKernel.h.

◆ m_numISFEvents

unsigned int ISF::SimKernel::m_numISFEvents
private

keep track of the number of events processed

Definition at line 131 of file SimKernel.h.

◆ m_numParticles

long int ISF::SimKernel::m_numParticles
private

Statistics.

total number of particles handled by ISF

Definition at line 140 of file SimKernel.h.

◆ m_numSimSvcs

ISF::SimSvcID ISF::SimKernel::m_numSimSvcs
private

total number of SimSvcs used

Definition at line 128 of file SimKernel.h.

◆ m_outputHardScatterTruth

SG::WriteHandle<McEventCollection> ISF::SimKernel::m_outputHardScatterTruth
private

output hard scatter truth collection

Definition at line 98 of file SimKernel.h.

◆ m_outputPileupTruth

SG::WriteHandle<McEventCollection> ISF::SimKernel::m_outputPileupTruth
private

output pileup truth collection

Definition at line 99 of file SimKernel.h.

◆ m_particleBroker

ServiceHandle<IParticleBroker> ISF::SimKernel::m_particleBroker
private

Central particle broker service.

Definition at line 107 of file SimKernel.h.

◆ m_qspatcher

ServiceHandle<Simulation::IZeroLifetimePatcher> ISF::SimKernel::m_qspatcher
private

Quasi-Stable Particle Simulation Patcher.

Definition at line 115 of file SimKernel.h.

◆ m_simSelectors

ToolHandleArray<ISimulationSelector> ISF::SimKernel::m_simSelectors[AtlasDetDescr::fNumAtlasRegions]
private

The Simulation Selector Chains.

Definition at line 112 of file SimKernel.h.

◆ m_simSvcNames

std::vector<std::string> ISF::SimKernel::m_simSvcNames
private

SimSvc names.

Definition at line 127 of file SimKernel.h.

◆ m_simSvcs

std::vector<ISimulationSvc*> ISF::SimKernel::m_simSvcs
private

Simulators to be used.

SimSvc handles

Definition at line 126 of file SimKernel.h.

◆ m_truthPreselectionTool

ToolHandle<IGenEventFilter> ISF::SimKernel::m_truthPreselectionTool {this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"}
private

Definition at line 102 of file SimKernel.h.

◆ m_truthRecordSvc

ServiceHandle<ITruthSvc> ISF::SimKernel::m_truthRecordSvc
private

Central truth service.

Definition at line 109 of file SimKernel.h.

◆ m_useShadowEvent

BooleanProperty ISF::SimKernel::m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" }
private

Definition at line 104 of file SimKernel.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
ISF::SimKernel::m_qspatcher
ServiceHandle< Simulation::IZeroLifetimePatcher > m_qspatcher
Quasi-Stable Particle Simulation Patcher.
Definition: SimKernel.h:115
ISF::ISFParticleContainer
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
Definition: ISFParticleContainer.h:23
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::SimKernel::m_outputPileupTruth
SG::WriteHandle< McEventCollection > m_outputPileupTruth
output pileup truth collection
Definition: SimKernel.h:99
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ISF::SimKernel::m_truthRecordSvc
ServiceHandle< ITruthSvc > m_truthRecordSvc
Central truth service.
Definition: SimKernel.h:109
ISF::SimKernel::m_numSimSvcs
ISF::SimSvcID m_numSimSvcs
total number of SimSvcs used
Definition: SimKernel.h:128
ISF::SimKernel::m_numISFEvents
unsigned int m_numISFEvents
keep track of the number of events processed
Definition: SimKernel.h:131
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
AtlasDetDescr::fAtlasForward
@ fAtlasForward
Definition: AtlasRegion.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::SimKernel::m_doCPUMon
bool m_doCPUMon
CPU Benchmarking.
Definition: SimKernel.h:134
HepMC::maxGeneratedVertexBarcode
int maxGeneratedVertexBarcode(const HepMC::GenEvent *genEvent)
Definition: MagicNumbers.h:377
ISF::SimKernel::m_useShadowEvent
BooleanProperty m_useShadowEvent
Definition: SimKernel.h:104
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
DataVector::get
const T * get(size_type n) const
Access an element, as an rvalue.
ISF::SimKernel::m_simSvcs
std::vector< ISimulationSvc * > m_simSvcs
Simulators to be used.
Definition: SimKernel.h:126
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::SimKernel::m_inputHardScatterEvgen
SG::ReadHandle< McEventCollection > m_inputHardScatterEvgen
Input/output truth collections and input conversion.
Definition: SimKernel.h:96
AtlasDetDescr::AtlasRegionHelper::getName
static const char * getName(int region)
Definition: AtlasRegionHelper.cxx:13
ISF::SimKernel::m_simSvcNames
std::vector< std::string > m_simSvcNames
SimSvc names.
Definition: SimKernel.h:127
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ISF::SimKernel::m_simSelectors
ToolHandleArray< ISimulationSelector > m_simSelectors[AtlasDetDescr::fNumAtlasRegions]
The Simulation Selector Chains.
Definition: SimKernel.h:112
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
ISF::SimKernel::m_memUsageEvts
unsigned int m_memUsageEvts
Definition: SimKernel.h:123
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AtlasDetDescr::fAtlasMS
@ fAtlasMS
Definition: AtlasRegion.h:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ISF::ISFParticleVector
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Definition: ISFParticleContainer.h:26
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
ISF::SimKernel::m_numParticles
long int m_numParticles
Statistics.
Definition: SimKernel.h:140
PMonUtils::CustomBenchmarkGuard
Definition: CustomBenchmark.h:118
ISF::SimKernel::prepareInput
StatusCode prepareInput(SG::ReadHandle< McEventCollection > &inputTruth, SG::WriteHandle< McEventCollection > &outputTruth, std::unique_ptr< McEventCollection > &shadowTruth, ISFParticleContainer &simParticles) const
Convert input generator particles to ISFParticles and copy input generator truth collection into outp...
Definition: SimKernel.cxx:527
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
PMonUtils::CustomBenchmark::getData
void getData(unsigned id, uint64_t &count, double &time_ms) const
Definition: CustomBenchmark.h:81
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
ISF::SimKernel::m_inputPileupEvgen
SG::ReadHandle< McEventCollection > m_inputPileupEvgen
input pileup collection
Definition: SimKernel.h:97
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlasDetDescr::fAtlasCavern
@ fAtlasCavern
Definition: AtlasRegion.h:37
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
AtlasDetDescr::fAtlasID
@ fAtlasID
Definition: AtlasRegion.h:33
ISF::SimKernel::m_memMon
ToolHandle< IMonitoringTool > m_memMon
Definition: SimKernel.h:122
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
AtlasDetDescr::fAtlasCalo
@ fAtlasCalo
Definition: AtlasRegion.h:35
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
ISF::SimKernel::m_truthPreselectionTool
ToolHandle< IGenEventFilter > m_truthPreselectionTool
Definition: SimKernel.h:102
a
TList * a
Definition: liststreamerinfos.cxx:10
h
HepMC::maxGeneratedParticleBarcode
int maxGeneratedParticleBarcode(const HepMC::GenEvent *genEvent)
Definition: MagicNumbers.h:361
ISF::SimSvcID
uint8_t SimSvcID
Simulation service ID datatype.
Definition: SimSvcID.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::initialize
StatusCode initialize(bool used=true)
Verify that the handle has been configured properly.
Definition: StoreGate/src/VarHandleBase.cxx:465
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
ISF::SimKernel::m_maxParticleVectorSize
size_t m_maxParticleVectorSize
tuning
Definition: SimKernel.h:143
ISF::SimKernel::m_outputHardScatterTruth
SG::WriteHandle< McEventCollection > m_outputHardScatterTruth
output hard scatter truth collection
Definition: SimKernel.h:98
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
ISF::SimKernel::m_eventFilters
ToolHandleArray< IEventFilterTool > m_eventFilters
The Event Filters.
Definition: SimKernel.h:118
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
ISF::SimKernel::m_particleBroker
ServiceHandle< IParticleBroker > m_particleBroker
Central particle broker service.
Definition: SimKernel.h:107
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
ISF::SimKernel::m_inputConverter
ServiceHandle< IInputConverter > m_inputConverter
input->ISFParticle converter
Definition: SimKernel.h:100
ISF::SimKernel::initSimSvcs
StatusCode initSimSvcs(SimSelectorToolArray &simSelectorTools)
Definition: SimKernel.cxx:273
ISF::SimKernel::m_benchSimID
PMonUtils::CustomBenchmark * m_benchSimID
Definition: SimKernel.h:137
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
ISF::fUndefinedSimID
@ fUndefinedSimID
Definition: SimSvcID.h:32
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
ISF::fMaxNumAtlasSimIDs
@ fMaxNumAtlasSimIDs
Definition: SimSvcID.h:39
ISF::SimKernel::m_doMemMon
bool m_doMemMon
The Memory Info Tool.
Definition: SimKernel.h:121
AtlasDetDescr::fFirstAtlasRegion
@ fFirstAtlasRegion
Definition: AtlasRegion.h:31
fitman.k
k
Definition: fitman.py:528
PMonUtils::CustomBenchmark
Definition: CustomBenchmark.h:30
ISF::fFirstAtlasSimID
@ fFirstAtlasSimID
Definition: SimSvcID.h:36
ServiceHandle
Definition: ClusterMakerTool.h:37