|
CORSIKA
@c8_version@
The framework to simulate particle cascades for astroparticle physics
|
Class to switch between two process branches. More...
#include <SwitchProcessSequence.hpp>

Public Member Functions | |
| SwitchProcessSequence (SwitchProcessSequence const &)=default | |
| SwitchProcessSequence (SwitchProcessSequence &&)=default | |
| SwitchProcessSequence & | operator= (SwitchProcessSequence const &)=default |
| SwitchProcessSequence (TCondition sel, TSequence in_A, USequence 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 > | |
| ProcessReturn | doContinuous (Step< TParticle > &particle, ContinuousProcessIndex const limitId) |
| template<typename TSecondaries > | |
| void | doSecondaries (TSecondaries &vS) |
| template<typename TParticle , typename TTrack > | |
| ContinuousProcessStepLength | getMaxStepLength (TParticle &particle, TTrack &vTrack) |
| template<typename TParticle > | |
| CrossSectionType | getCrossSection (TParticle const &projectile, Code const targetId, FourMomentum const &targetP4) const |
| template<typename TSecondaryView , typename TRNG > | |
| ProcessReturn | selectInteraction (TSecondaryView &view, FourMomentum const &projectileP4, NuclearComposition const &composition, TRNG &rng, CrossSectionType const cx_select, CrossSectionType cx_sum=CrossSectionType::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 bool const | is_switch_process_sequence = true |
Static Public Attributes inherited from corsika::BaseProcess< SwitchProcessSequence< TCondition, TSequence, USequence > > | |
| static bool const | is_process_sequence |
| static bool const | is_switch_process_sequence |
Additional Inherited Members | |
Public Types inherited from corsika::BaseProcess< SwitchProcessSequence< TCondition, TSequence, USequence > > | |
| using | process_type = SwitchProcessSequence< TCondition, TSequence, USequence > |
| Base processor type for use in other template classes. | |
Protected Member Functions inherited from corsika::BaseProcess< SwitchProcessSequence< TCondition, TSequence, USequence > > | |
| SwitchProcessSequence< TCondition, TSequence, USequence > & | getRef () |
| const SwitchProcessSequence< TCondition, TSequence, USequence > & | getRef () const |
Protected Attributes inherited from corsika::BaseProcess< SwitchProcessSequence< TCondition, TSequence, USequence > > | |
| friend | TDerived |
Class to switch between two process branches.
A compile-time static list of processes that uses an internal TCondition class to switch between different versions of processes (or process sequence).
TSequence and USequence must 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 SwitchProcessSequence. Please use the corsika::make_select(condition, sequence, alt_sequence) factory function for best results.
TCondition has to implement a bool operator()(Particle const&). Note: TCondition may absolutely also use random numbers to sample between its results. This can be used to achieve arbitrarily smooth transition or mixtures of processes.
Warning: do not put StackProcess into a SwitchProcessSequence since this makes no sense. The StackProcess acts on an entire particle stack and not on indiviidual particles.
Template parameters:
| TCondition | selector functor/function |
| TSequence | is of type BaseProcess, either a dedicatd process, or a ProcessSequence |
| USequence | is of type BaseProcess, either a dedicatd process, or a ProcessSequence |
| IndexFirstProcess | to count and index each Process in the entire process-chain |
| IndexOfProcess1 | index of TSequence (counting of Process) |
| IndexOfProcess2 | index of USequence (counting of Process) |
See also class ProcessSequence.
Definition at line 80 of file SwitchProcessSequence.hpp.
|
inline |
Only valid user constructor will create fully initialized object.
SwitchProcessSequence supports and encourages move semantics. You can use object, l-value references or r-value references to construct sequences.
| sel | functor to switch between branch A and B |
| in_A | process branch A |
| in_B | process branch B |
Definition at line 131 of file SwitchProcessSequence.hpp.