CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 > Class Template Reference

 Definition of a static process list/sequence
More...

#include <ProcessSequence.hpp>

Inheritance diagram for corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 >:

Public Member Functions

 ProcessSequence (ProcessSequence const &)=default
 
 ProcessSequence (ProcessSequence &&)=default
 
ProcessSequenceoperator= (ProcessSequence const &)=default
 
 ProcessSequence (TProcess1 in_A, TProcess2 in_B)
 Only valid user constructor will create fully initialized object. More...
 
template<typename TParticle >
ProcessReturn doBoundaryCrossing (TParticle &particle, typename TParticle::node_type const &from, typename TParticle::node_type const &to)
 
template<typename TParticle , typename TTrack >
ProcessReturn doContinuous (TParticle &particle, TTrack &vT, ContinuousProcessIndex const limitID)
 
template<typename TSecondaries >
void doSecondaries (TSecondaries &vS)
 
bool checkStep ()
 The processes of type StackProcess do have an internal counter, so they can be exectuted only each N steps. More...
 
template<typename TStack >
void doStack (TStack &stack)
 Execute the StackProcess-es in the ProcessSequence.
 
template<typename TParticle , typename TTrack >
ContinuousProcessStepLength getMaxStepLength (TParticle &particle, TTrack &vTrack)
 Calculate the maximum allowed length of the next tracking step, based on all ContinuousProcess-es. More...
 
template<typename TParticle >
GrammageType getInteractionLength (TParticle &&particle)
 
template<typename TParticle >
InverseGrammageType getInverseInteractionLength (TParticle &&particle)
 
template<typename TSecondaryView >
ProcessReturn selectInteraction (TSecondaryView &view, [[maybe_unused]] InverseGrammageType lambda_inv_select, [[maybe_unused]] InverseGrammageType lambda_inv_sum=InverseGrammageType::zero())
 
template<typename TParticle >
TimeType getLifetime (TParticle &particle)
 
template<typename TParticle >
InverseTimeType getInverseLifetime (TParticle &&particle)
 
template<typename TSecondaryView >
ProcessReturn selectDecay (TSecondaryView &view, [[maybe_unused]] InverseTimeType decay_inv_select, [[maybe_unused]] InverseTimeType decay_inv_sum=InverseTimeType::zero())
 

Static Public Attributes

static bool const is_process_sequence = true
 
- Static Public Attributes inherited from corsika::BaseProcess< ProcessSequence< TProcess1, TProcess2 > >
static bool const is_process_sequence
 
static bool const is_switch_process_sequence
 

Additional Inherited Members

- Public Types inherited from corsika::BaseProcess< ProcessSequence< TProcess1, TProcess2 > >
using process_type = ProcessSequence< TProcess1, TProcess2 >
 Base processor type for use in other template classes.
 
- Protected Member Functions inherited from corsika::BaseProcess< ProcessSequence< TProcess1, TProcess2 > >
ProcessSequence< TProcess1, TProcess2 > & ref ()
 
const ProcessSequence< TProcess1, TProcess2 > & ref () const
 
- Protected Attributes inherited from corsika::BaseProcess< ProcessSequence< TProcess1, TProcess2 > >
friend TDerived
 

Detailed Description

template<typename TProcess1, typename TProcess2 = NullModel, int ProcessIndexOffset = 0, int IndexOfProcess1 = corsika::count_processes< TProcess1, corsika::count_processes<TProcess2, ProcessIndexOffset>::count>::count, int IndexOfProcess2 = corsika::count_processes<TProcess2, ProcessIndexOffset>::count>
class corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 >

 Definition of a static process list/sequence

A compile time static list of processes. The compiler will generate a new type based on template logic containing all the elements provided by the user.

TProcess1 and TProcess2 must both be derived from BaseProcess, and are both references if possible (lvalue), otherwise (rvalue) they are just classes. This allows us to handle both, rvalue as well as lvalue Processes in the ProcessSequence.

(For your potential interest, the static version of the ProcessSequence and all Process types are based on the CRTP C++ design pattern)

Template parameters:

Template Parameters
TProcess1is of type BaseProcess, either a dedicatd process, or a ProcessSequence
TProcess2is of type BaseProcess, either a dedicatd process, or a ProcessSequence
IndexFirstProcessto count and index each Process in the entire process-chain. The offset is the starting value for this ProcessSequence
IndexOfProcess1index of TProcess1 (counting of Process)
IndexOfProcess2index of TProcess2 (counting of Process)

Definition at line 157 of file ProcessSequence.hpp.

Constructor & Destructor Documentation

◆ ProcessSequence()

template<typename TProcess1, typename TProcess2 = NullModel, int ProcessIndexOffset = 0, int IndexOfProcess1 = corsika::count_processes< TProcess1, corsika::count_processes<TProcess2, ProcessIndexOffset>::count>::count, int IndexOfProcess2 = corsika::count_processes<TProcess2, ProcessIndexOffset>::count>
corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 >::ProcessSequence ( TProcess1  in_A,
TProcess2  in_B 
)

Only valid user constructor will create fully initialized object.

ProcessSequence supports and encourages move semantics. You can use object, l-value references or r-value references to construct sequences.

Parameters
in_ABaseProcess or switch/process list
in_BBaseProcess or switch/process list

Member Function Documentation

◆ checkStep()

template<typename TProcess1, typename TProcess2 = NullModel, int ProcessIndexOffset = 0, int IndexOfProcess1 = corsika::count_processes< TProcess1, corsika::count_processes<TProcess2, ProcessIndexOffset>::count>::count, int IndexOfProcess2 = corsika::count_processes<TProcess2, ProcessIndexOffset>::count>
bool corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 >::checkStep ( )

The processes of type StackProcess do have an internal counter, so they can be exectuted only each N steps.

Often these are "maintenacne processes" that do not need to run after each single step of the simulations. In the CheckStep function it is tested if either A_ or B_ are StackProcess and if they are due for execution.

◆ getMaxStepLength()

template<typename TProcess1, typename TProcess2 = NullModel, int ProcessIndexOffset = 0, int IndexOfProcess1 = corsika::count_processes< TProcess1, corsika::count_processes<TProcess2, ProcessIndexOffset>::count>::count, int IndexOfProcess2 = corsika::count_processes<TProcess2, ProcessIndexOffset>::count>
template<typename TParticle , typename TTrack >
ContinuousProcessStepLength corsika::ProcessSequence< TProcess1, TProcess2, ProcessIndexOffset, IndexOfProcess1, IndexOfProcess2 >::getMaxStepLength ( TParticle &  particle,
TTrack &  vTrack 
)

Calculate the maximum allowed length of the next tracking step, based on all ContinuousProcess-es.

The maximum allowed step length is the minimum of the allowed track lenght over all ContinuousProcess-es in the ProcessSequence.

Returns
ContinuousProcessStepLength which contains the step length itself in LengthType, and a unique identifier of the related ContinuousProcess.

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