Celeritas 0.6.0-dev.115+3b60a5fd
|
Generate a vector of primaries. More...
#include <PrimaryGenerator.hh>
Public Types | |
Type aliases | |
using | PrimaryGeneratorEngine = std::mt19937 |
using | EnergySampler = std::function< real_type(PrimaryGeneratorEngine &)> |
using | PositionSampler = std::function< Real3(PrimaryGeneratorEngine &)> |
using | DirectionSampler = std::function< Real3(PrimaryGeneratorEngine &)> |
using | SPConstParticles = std::shared_ptr< ParticleParams const > |
using | result_type = std::vector< Primary > |
using | Input = inp::PrimaryGenerator |
![]() | |
using | VecPrimary = std::vector< Primary > |
using | result_type = VecPrimary |
Public Member Functions | |
PrimaryGenerator (Input const &, ParticleParams const &particles) | |
Construct with options and shared particle data. | |
CELER_DELETE_COPY_MOVE (PrimaryGenerator) | |
Prevent copying and moving. | |
result_type | operator() () final |
Generate primary particles from a single event. | |
size_type | num_events () const override |
Get total number of events. | |
void | seed (UniqueEventId) |
Reseed RNG for interaction with celer-g4. | |
Static Public Member Functions | |
static PrimaryGenerator | from_options (SPConstParticles, PrimaryGeneratorOptions const &) |
Construct from user input. | |
Additional Inherited Members | |
![]() | |
CELER_DEFAULT_COPY_MOVE (EventReaderInterface) | |
Generate a vector of primaries.
This simple helper class can be used to generate primary particles of one or more particle types with the energy, position, and direction sampled from distributions. If more than one PDG number is specified, an equal number of each particle type will be produced. Each operator()
call will return a single event until num_events
events have been generated.
|
static |
Construct from user input.
This creates a PrimaryGenerator
from options read from a JSON input using a few predefined energy, spatial, and angular distributions (that can be extended as needed).
|
inlineoverridevirtual |
Get total number of events.
Implements celeritas::EventReaderInterface.
|
finalvirtual |
Generate primary particles from a single event.
Implements celeritas::EventReaderInterface.