Events

Standalone inputs must specify how the primary particles are generated. These events can be generated internally or read from an external file.

Core events

struct Events

Events for tracking.

Public Members

Generator generator

Event generation mechanism.

bool merge = {false}

Whether to run all events at once on a single stream.

The generator field in Events selects one of the supported event sources.

using celeritas::inp::Generator = std::variant<CorePrimaryGenerator, SampleFileEvents, ReadFileEvents>

Mechanism for generating events for tracking.

In the JSON representation, a "_type" field selects the variant alternative using one of the following values:

  • “primary”: CorePrimaryGenerator

  • ”sample”: SampleFileEvents

  • ”read”: ReadFileEvents

struct PrimaryGenerator

Generate from a hardcoded distribution of primary particles.

Subclassed by celeritas::inp::CorePrimaryGenerator, celeritas::inp::OpticalPrimaryGenerator

Public Members

ShapeDistribution shape

Distribution for sampling spatial component (position)

AngleDistribution angle

Distribution for sampling angular component (direction)

EnergyDistribution energy

Distribution for sampling source energy.

struct SampleFileEvents

Sample random events from an input file.

Todo:

move num_events to StandaloneInput

Public Members

size_type num_events = {}

Total number of events to sample.

size_type num_merged = {}

File events per sampled event.

std::string event_file

ROOT file input.

unsigned int seed = {}

Random number generator seed.

struct ReadFileEvents

Read all events from the given file.

Optical events

Optical photons can be generated through several different mechanisms.

using celeritas::inp::OpticalGenerator = std::variant<OpticalEmGenerator, OpticalOffloadGenerator, OpticalPrimaryGenerator, OpticalDirectGenerator>

Mechanism for generating optical photons.

In the JSON representation, a "_type" field selects the variant alternative using one of the following values:

  • “em”: OpticalEmGenerator

  • ”offload”: OpticalOffloadGenerator

  • ”primary”: OpticalPriimaryGenerator

  • ”direct”: OpticalDirectGenerator

struct OpticalPrimaryGenerator : public celeritas::inp::PrimaryGenerator

Generate optical photon primary particles.

Note

The sampled optical photon primaries are unpolarized.

Public Functions

inline explicit operator bool() const

True if there’s at least one primary.

Public Members

size_type primaries = {}

Total number of primaries.

struct OpticalEmGenerator

Generate optical photons from EM particles in Celeritas.

struct OpticalOffloadGenerator

Generate optical photons from offloaded distribution data.

struct OpticalDirectGenerator

Generate optical photons directly from optical track initializers.

The standalone optical application celer-optical currently supports photon generation though a primary generator or from offloaded distribution data read from a file.

Primary generators

The CorePrimaryGenerator and OpticalPrimaryGenerator are analogous to Geant4’s particle gun and provide distributions for sampling the initial particle direction, energy, and position.

using celeritas::inp::AngleDistribution = std::variant<MonodirectionalDistribution, IsotropicDistribution>

Choose an angular distribution for the primary generator.

In the JSON representation, a "_type" field selects the variant alternative using one of the following values:

  • “delta”: MonodirectionalDistribution

  • ”isotropic”: IsotropicDistribution

using celeritas::inp::EnergyDistribution = std::variant<MonoenergeticDistribution, NormalDistribution, TruncatedDistribution<NormalDistribution>>

Choose an energy distribution for the primary generator.

In the JSON representation, a "_type" field selects the variant alternative using one of the following values:

  • “delta”: MonoenergeticDistribution

  • ”normal”: NormalDistribution

  • ”truncated”: TruncatedDistribution<NormalDistribution>>

using celeritas::inp::ShapeDistribution = std::variant<PointDistribution, UniformBoxDistribution>

Choose a spatial distribution for the primary generator.

In the JSON representation, a "_type" field selects the variant alternative using one of the following values:

  • “delta”: PointDistribution

  • ”uniform_box”: UniformBoxDistribution

The fixed-value delta distributions for angle, energy, and position are aliased by the following types:

using celeritas::inp::MonodirectionalDistribution = DeltaDistribution<Array<double, 3>>

Generate angles in a single direction.

using celeritas::inp::MonoenergeticDistribution = DeltaDistribution<double>

Generate at a single energy value [MeV].

using celeritas::inp::PointDistribution = DeltaDistribution<Array<double, 3>>

Generate at a single point.

Distributions

The following distribution types can be used for sampling values. A distribution can optionally be truncated to a specified interval, while a delta distribution represents a fixed value rather than a sampled quantity.

template<class Distribution>
struct TruncatedDistribution

Sample from a truncated distribution.

template<class T>
struct DeltaDistribution

“Sample” the given value

struct NormalDistribution

Sample from a Gaussian (normal) distribution.

struct UniformBoxDistribution

Sample uniformly in a box.

struct IsotropicDistribution

Sample a point uniformly on the surface of a unit sphere.