Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Fatras/include/ActsFatras/Kernel/Simulation.hpp>
Public Member Functions | |
Simulation (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 |
Select if the particle should be simulated at all. | |
template<typename particles_t , typename hits_t > | |
void | copyOutputs (const SimulationResult &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) |
Multi-particle/event simulation.
charged_selector_t | Callable selector type for charged particles |
charged_simulator_t | Single particle simulator for charged particles |
neutral_selector_t | Callable selector type for neutral particles |
neutral_simulator_t | Single particle simulator for neutral particles |
The selector types for charged and neutral particles do not need to check for the particle charge. This is done automatically by the simulator to ensure consistency.
Definition at line 138 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 138 of file Simulation.hpp
|
inline |
Construct from the single charged/neutral particle simulators.
Definition at line 145 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 145 of file Simulation.hpp
|
inlineprivate |
Copy results to output containers.
particles_t | is a SequenceContainer for particles |
hits_t | is a SequenceContainer for hits |
Definition at line 277 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 277 of file Simulation.hpp
References ActsFatras::SimulationResult::generatedParticles, ActsFatras::SimulationResult::hits, ActsFatras::SimulationResult::particle, particle, and ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle().
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().
|
inlinestaticprivate |
Renumber particle ids in the tail of the container.
Ensures particle ids are unique by modifying the sub-particle number within each generation.
particles | particle container in which particles are renumbered |
lastValid | index of the last particle with a valid particle id |
particles_t | is a SequenceContainer for particles |
Definition at line 306 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 306 of file Simulation.hpp
References j, and physmon_ckf_tracking::u.
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().
|
inlineprivate |
Select if the particle should be simulated at all.
Definition at line 264 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 264 of file Simulation.hpp
References ActsFatras::Particle::charge(), ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectCharged, and ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectNeutral.
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::copyOutputs(), and ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().
|
inline |
Simulate multiple particles and generated secondaries.
geoCtx | is the geometry context to access surface geometries |
magCtx | is the magnetic field context to access field values |
generator | is the random number generator |
inputParticles | contains all particles that should be simulated |
simulatedParticlesInitial | contains initial particle states |
simulatedParticlesFinal | contains final particle states |
hits | contains all generated hits |
Acts::Result::Error | if there is a fundamental issue |
Acts::Result::Success | with all particles that failed to simulate |
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.
generator_t | is the type of the random number generator |
input_particles_t | is a Container for particles |
output_particles_t | is a SequenceContainer for particles |
hits_t | is a SequenceContainer for hits |
Definition at line 186 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 186 of file Simulation.hpp
References assert, ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::charged, ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::copyOutputs(), ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::neutral, next, ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::renumberTailParticleIds(), ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle(), and physmon_ckf_tracking::u.
charged_simulator_t ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::charged |
Definition at line 141 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 141 of file Simulation.hpp
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().
neutral_simulator_t ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::neutral |
Definition at line 142 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 142 of file Simulation.hpp
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::simulate().
charged_selector_t ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectCharged |
Definition at line 139 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 139 of file Simulation.hpp
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle().
neutral_selector_t ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectNeutral |
Definition at line 140 of file Simulation.hpp.
View newest version in sPHENIX GitHub at line 140 of file Simulation.hpp
Referenced by ActsFatras::Simulation< charged_selector_t, charged_simulator_t, neutral_selector_t, neutral_simulator_t >::selectParticle().