ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t > Struct Template Reference

#include <acts/blob/master/Fatras/include/ActsFatras/Kernel/Simulator.hpp>

Classes

struct  FailedParticle
 A particle that failed to simulate. More...
 

Public Member Functions

 Simulator (charged_simulator_t &&charged_, neutral_simulator_t &&neutral_)
 Construct from the single charged/neutral particle simulators.
 
template<typename generator_t , typename input_particles_t , typename output_particles_t , typename hits_t >
Acts::Result< std::vector
< FailedParticle > > 
simulate (const Acts::GeometryContext &geoCtx, const Acts::MagneticFieldContext &magCtx, generator_t &generator, const input_particles_t &inputParticles, output_particles_t &simulatedParticlesInitial, output_particles_t &simulatedParticlesFinal, hits_t &hits) const
 

Public Attributes

charged_selector_t selectCharged
 
neutral_selector_t selectNeutral
 
charged_simulator_t charged
 
neutral_simulator_t neutral
 

Private Member Functions

bool selectParticle (const Particle &particle) const
 
template<typename particles_t , typename hits_t >
void copyOutputs (const InteractorResult &result, particles_t &particlesInitial, particles_t &particlesFinal, hits_t &hits) const
 

Static Private Member Functions

template<typename particles_t >
static void renumberTailParticleIds (particles_t &particles, std::size_t lastValid)
 

Detailed Description

template<typename charged_selector_t, typename charged_simulator_t, typename neutral_selector_t, typename neutral_simulator_t>
struct ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >

Fatras multi-particle simulator.

Template Parameters
charged_selector_tCallable selector type for charged particles
charged_simulator_tSingle particle simulator for charged particles
neutral_selector_tCallable selector type for neutral particles
neutral_simulator_tSingle particle simulator for neutral particles

Definition at line 132 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 132 of file Simulator.hpp

Constructor & Destructor Documentation

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::Simulator ( charged_simulator_t &&  charged_,
neutral_simulator_t &&  neutral_ 
)
inline

Construct from the single charged/neutral particle simulators.

Definition at line 151 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 151 of file Simulator.hpp

Member Function Documentation

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
template<typename particles_t , typename hits_t >
void ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::copyOutputs ( const InteractorResult result,
particles_t &  particlesInitial,
particles_t &  particlesFinal,
hits_t &  hits 
) const
inlineprivate

Copy Interactor results to output containers.

Template Parameters
particles_tis a SequenceContainer for particles
hits_tis a SequenceContainer for hits

Definition at line 285 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 285 of file Simulator.hpp

References field_utils::copy(), ActsFatras::InteractorResult::generatedParticles, ActsFatras::InteractorResult::hits, particle, ActsFatras::InteractorResult::particle, and ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle().

Referenced by ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
template<typename particles_t >
static void ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::renumberTailParticleIds ( particles_t &  particles,
std::size_t  lastValid 
)
inlinestaticprivate

Renumber particle ids in the tail of the container.

Ensures particle ids are unique by modifying the sub-particle number within each generation.

Parameters
particlesparticle container in which particles are renumbered
lastValidindex of the last particle with a valid particle id
Template Parameters
particles_tis a SequenceContainer for particles
Note
This function assumes that all particles in the tail have the same vertex numbers (primary/secondary) and particle number and are ordered according to their generation number.

Definition at line 314 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 314 of file Simulator.hpp

References Acts::UnitConstants::u.

Referenced by ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().

+ Here is the caller graph for this function:

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
bool ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle ( const Particle particle) const
inlineprivate

Select if the particle should be simulated at all.

This also enforces mutual-exclusivity of the two charge selections. If both charge selections evaluate true, they are probably not setup correctly and not simulating them at all is a reasonable fall-back.

Definition at line 272 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 272 of file Simulator.hpp

References ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectCharged, and ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectNeutral.

Referenced by ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::copyOutputs(), and ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().

+ Here is the caller graph for this function:

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
template<typename generator_t , typename input_particles_t , typename output_particles_t , typename hits_t >
Acts::Result<std::vector<FailedParticle> > ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate ( const Acts::GeometryContext geoCtx,
const Acts::MagneticFieldContext magCtx,
generator_t &  generator,
const input_particles_t &  inputParticles,
output_particles_t &  simulatedParticlesInitial,
output_particles_t &  simulatedParticlesFinal,
hits_t &  hits 
) const
inline

Simulate multiple particles and generated secondaries.

Parameters
geoCtxis the geometry context to access surface geometries
magCtxis the magnetic field context to access field values
inputParticlescontains all particles that should be simulated
simulatedParticlesInitialcontains initial particle states
simulatedParticlesFinalcontains final particle states
hitscontains all generated hits
Return values
Acts::Result::Errorif there is a fundamental issue
Acts::Result::Successwith all particles that failed to simulate
Warning
Particle-hit association is based on particle ids generated during the simulation. This requires that all input particles must have generation and sub-particle number set to zero.
Note
Parameter edge-cases can lead to errors in the underlying propagator and thus to particles that fail to simulate. Here, full events are simulated and the failure to simulate one particle should not be considered a general failure of the simulator. Instead, a list of particles that fail to simulate is provided to the user. It is the users responsibility to handle them.
Failed particles are removed from the regular output, i.e. they do not appear in the simulated particles containers nor do they generate hits.

This takes all input particles and simulates those passing the selection using the appropriate simulator. All selected particle states including additional ones generated from interactions are stored in separate output containers; both the initial state at the production vertex and the final state after propagation are stored. Hits generated from selected input and generated particles are stored in the hit container.

Template Parameters
generator_tis the type of the random number generator
input_particles_tis a Container for particles
output_particles_tis a SequenceContainer for particles
hits_tis a SequenceContainer for hits

Definition at line 191 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 191 of file Simulator.hpp

References ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::charged, ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::copyOutputs(), hits(), ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::neutral, ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::renumberTailParticleIds(), ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectCharged, ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle(), and Acts::UnitConstants::u.

+ Here is the call graph for this function:

Member Data Documentation

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
charged_simulator_t ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::charged

Definition at line 147 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 147 of file Simulator.hpp

Referenced by ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
neutral_simulator_t ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::neutral

Definition at line 148 of file Simulator.hpp.

View newest version in sPHENIX GitHub at line 148 of file Simulator.hpp

Referenced by ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().

template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
charged_selector_t ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectCharged
template<typename charged_selector_t , typename charged_simulator_t , typename neutral_selector_t , typename neutral_simulator_t >
neutral_selector_t ActsFatras::Simulator< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectNeutral

The documentation for this struct was generated from the following file: