OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Decay Class Referenceabstract

Abstract base class for particle decay processes. More...

#include <Decay.h>

Inheritance diagram for Decay:
Inheritance graph
Collaboration diagram for Decay:
Collaboration graph

Classes

struct  DecayedParentViews
 

Public Member Functions

 Decay (double restLifetimeSeconds, std::size_t containerIndex, double parentMassGeV, int parentChargeSign)
 
 ~Decay () override=default
 
void setDaughterContainer (std::shared_ptr< ParticleContainer< double, 3 > > daughterPC, double daughterMassGeV)
 Set the daughter particle container and its rest mass.
 
size_t apply (ParticleContainer< double, 3 > &pc, double dt, long long globalTrackStep, size_t containerIdx) override
 
virtual void createDaughterParticles (std::size_t localDestroyNum, std::size_t oldDaughterLocal, const Kokkos::View< ippl::Vector< double, 3 > * > &parentR, const Kokkos::View< ippl::Vector< double, 3 > * > &parentP, const Kokkos::View< double * > &parentDt, const Kokkos::View< ippl::Vector< float, 3 > * > &parentPol)=0
 Create daughter particles from collected parent data.
 
ippl::detail::size_type markDecayedParticles (ippl::detail::size_type nLocal, double dt, Kokkos::View< ippl::Vector< double, 3 > * > Pview, Kokkos::View< bool * > decayed)
 Mark particles for decay using the relativistic exponential law.
 
DecayedParentViews collectDecayedParents (ippl::detail::size_type nLocal, ippl::detail::size_type localDestroyNum, Kokkos::View< bool * > decayed, Kokkos::View< ippl::Vector< double, 3 > * > Rview, Kokkos::View< ippl::Vector< double, 3 > * > Pview, Kokkos::View< double * > dtView, Kokkos::View< ippl::Vector< float, 3 > * > PolView)
 Gather R/P/dt of parents marked for decay into compact views.
 

Protected Attributes

double tau0_m
 Mean lifetime at rest [s].
 
Kokkos::Random_XorShift64_Pool randPool_m
 Random pool for decay sampling.
 
std::shared_ptr< ParticleContainer< double, 3 > > daughterPC_m
 Daughter container for decay products (nullptr = destroy-only mode).
 
short allowedDaughterSpecies_m = -1
 
double daughterMassGeV_m = 0.0
 Rest mass of the daughter particle [GeV].
 
double parentMassGeV_m
 Rest mass of the parent particle [GeV].
 
int parentChargeSign_m
 

Detailed Description

Abstract base class for particle decay processes.

Note
Handles the shared mechanics of relativistic decay:
  1. Mark particles as decayed (exponential law with time dilation)
  2. Collect parent kinematics into compact temporary views
  3. Delegate daughter creation to the subclass via createDaughterParticles()
  4. Leave parent deletion to ParticleContainer::deleteInvalidParticles()

Subclasses implement the physics-specific daughter momentum sampling (e.g. Michel spectrum for muon decay, fixed two-body kinematics for pion decay). If no daughter container is set, decayed particles are simply marked for deletion.

Definition at line 28 of file Decay.h.


Class Documentation

◆ Decay::DecayedParentViews

struct Decay::DecayedParentViews

Compact views of the kinematics of parents marked for decay. Pol is length-0 when the parent container does not track spin.

Definition at line 67 of file Decay.h.

Collaboration diagram for Decay::DecayedParentViews:
Collaboration graph
Class Members
View< double * > dt
View< Vector< double, 3 > * > P
View< Vector< float, 3 > * > Pol
View< Vector< double, 3 > * > R

Constructor & Destructor Documentation

◆ Decay()

Decay::Decay ( double  restLifetimeSeconds,
std::size_t  containerIndex,
double  parentMassGeV,
int  parentChargeSign 
)

Definition at line 25 of file Decay.cpp.

◆ ~Decay()

Decay::~Decay ( )
overridedefault

Member Function Documentation

◆ apply()

◆ collectDecayedParents()

Decay::DecayedParentViews Decay::collectDecayedParents ( ippl::detail::size_type  nLocal,
ippl::detail::size_type  localDestroyNum,
Kokkos::View< bool * >  decayed,
Kokkos::View< ippl::Vector< double, 3 > * >  Rview,
Kokkos::View< ippl::Vector< double, 3 > * >  Pview,
Kokkos::View< double * >  dtView,
Kokkos::View< ippl::Vector< float, 3 > * >  PolView 
)

Gather R/P/dt of parents marked for decay into compact views.

Note
Uses no class state, so no capture shields are needed; still a member for organizational grouping with markDecayedParticles.

Definition at line 115 of file Decay.cpp.

Referenced by apply().

◆ createDaughterParticles()

virtual void Decay::createDaughterParticles ( std::size_t  localDestroyNum,
std::size_t  oldDaughterLocal,
const Kokkos::View< ippl::Vector< double, 3 > * > &  parentR,
const Kokkos::View< ippl::Vector< double, 3 > * > &  parentP,
const Kokkos::View< double * > &  parentDt,
const Kokkos::View< ippl::Vector< float, 3 > * > &  parentPol 
)
pure virtual

Create daughter particles from collected parent data.

Note
Called only when daughterPC_m is set and localDestroyNum > 0. Subclasses implement the physics-specific momentum sampling here. Must be public because device compilers require that a Kokkos lambda's enclosing member function has public access.

Implemented in MuonDecay, and PionDecay.

Referenced by apply().

◆ markDecayedParticles()

ippl::detail::size_type Decay::markDecayedParticles ( ippl::detail::size_type  nLocal,
double  dt,
Kokkos::View< ippl::Vector< double, 3 > * >  Pview,
Kokkos::View< bool * >  decayed 
)

Mark particles for decay using the relativistic exponential law.

Note
tau0_m and randPool_m are copied into locals before the device kernel so the KOKKOS_LAMBDA captures values — never this.

Definition at line 86 of file Decay.cpp.

References randPool_m, and tau0_m.

Referenced by apply().

◆ setDaughterContainer()

void Decay::setDaughterContainer ( std::shared_ptr< ParticleContainer< double, 3 > >  daughterPC,
double  daughterMassGeV 
)

Set the daughter particle container and its rest mass.

Parameters
daughterPCContainer that receives decay products.
daughterMassGeVRest mass of the daughter particle [GeV].
Note
When set, decayed particles spawn a daughter in daughterPC. When not set (default), decayed particles are marked for deletion.

Definition at line 161 of file Decay.cpp.

References allowedDaughterSpecies_m, daughterMassGeV_m, daughterPC_m, and ParticleProperties::getParticleTypeString().

Here is the call graph for this function:

Member Data Documentation

◆ allowedDaughterSpecies_m

short Decay::allowedDaughterSpecies_m = -1
protected

Physically allowed daughter species (short value of ParticleType enum). Subclasses should set this in their constructor; default = ParticleType::UNNAMED (-1).

Definition at line 108 of file Decay.h.

Referenced by MuonDecay::MuonDecay(), PionDecay::PionDecay(), and setDaughterContainer().

◆ daughterMassGeV_m

double Decay::daughterMassGeV_m = 0.0
protected

Rest mass of the daughter particle [GeV].

Definition at line 111 of file Decay.h.

Referenced by MuonDecay::createDaughterParticles(), PionDecay::createDaughterParticles(), and setDaughterContainer().

◆ daughterPC_m

std::shared_ptr<ParticleContainer<double, 3> > Decay::daughterPC_m
protected

Daughter container for decay products (nullptr = destroy-only mode).

Definition at line 104 of file Decay.h.

Referenced by apply(), MuonDecay::createDaughterParticles(), PionDecay::createDaughterParticles(), and setDaughterContainer().

◆ parentChargeSign_m

int Decay::parentChargeSign_m
protected

Sign of parent particle. Either +1, 0, -1. Necessary because the Muon decay is charge dependent.

Definition at line 118 of file Decay.h.

Referenced by MuonDecay::createDaughterParticles(), and PionDecay::createDaughterParticles().

◆ parentMassGeV_m

double Decay::parentMassGeV_m
protected

Rest mass of the parent particle [GeV].

Definition at line 114 of file Decay.h.

Referenced by MuonDecay::createDaughterParticles(), and PionDecay::createDaughterParticles().

◆ randPool_m

Kokkos::Random_XorShift64_Pool Decay::randPool_m
protected

Random pool for decay sampling.

Definition at line 101 of file Decay.h.

Referenced by MuonDecay::createDaughterParticles(), PionDecay::createDaughterParticles(), and markDecayedParticles().

◆ tau0_m

double Decay::tau0_m
protected

Mean lifetime at rest [s].

Definition at line 98 of file Decay.h.

Referenced by apply(), and markDecayedParticles().


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