Basic Interface
The core of this library is two abstract classes, Particle
and Medium
. Users who
want to implement their own dark matter and medium models only need to inherit them and
implement all virtual functions. We show all the abstract classes below.
class Medium
-
template<typename Vector3, typename Value>
class Medium Base abstract Medium class.
Subclassed by darkprop::MediumBall< Vector3d< double >, double >, darkprop::MediumBall< Vector3, Value >
Public Functions
-
virtual Value propagate(Particle<Vector3, Value> &particle, RandomNumber<Value> &rn) = 0
Propagate a particle.
Sample a free path and propagate the particle and determine whether the particle is in the Medium or not. Set
Particle::in_medium
to false if the simulation should stop.
-
virtual Value propagate(Particle<Vector3, Value> &particle, RandomNumber<Value> &rn) = 0
-
template<typename Vector3 = Vector3d<double>, typename Value = double>
class MediumBall : public darkprop::Medium<Vector3d<double>, double> Base class for spherical medium.
Subclassed by darkprop::Earth< Vector3d< double >, double >, darkprop::Earth< Vector3, Value >, darkprop::Sun< Vector3, Value >
-
template<typename Vector3 = Vector3d<double>, typename Value = double>
class Earth : public darkprop::MediumBall<Vector3d<double>, double> Abstract Earth class.
Subclassed by darkprop::HomoEarth< Vector3, Value >, darkprop::HomoElectronEarth< Vector3, Value >, darkprop::PREMEarth< Vector3, Value >
class Particle
-
template<typename Vector3, typename Value>
class Particle Base abstract Particle class.
Subclassed by darkprop::ParticleElastic< Vector3d< double >, double >, darkprop::GENIEBDM< Vector3, Value >, darkprop::ParticleElastic< Vector3, Value >, darkprop::SolarDM< Vector3, Value >
Public Functions
-
virtual Value totalCrossSection(const Target &t) const = 0
Total cross section scattering with Target
t
.Use current
this->T
as initial kinetic energy. Return the statistical weight.
-
virtual Value scatter(const Target &t, RandomNumber<Value> &rn) = 0
Sample final state DM particle.
The changes are made directly. Return the statistical weight.
-
inline Event<Vector3, Value> toEvent(Value weight = 1.0, bool kmsec = true)
Generate a Event from the current state.
- Parameters:
weight – The statistical weight.
kmsec – If
true
the quantitiest
andr
will be in unit of second and kilometer, respectively, otherwise remain natural unit with GeV = 1.
-
virtual Value totalCrossSection(const Target &t) const = 0
Interface Functions: propagate and scatter
-
template<typename Vector3, typename Value>
Value darkprop::propagate(Particle<Vector3, Value> &p, Medium<Vector3, Value> &m, RandomNumber<Value> &rn) Basic interface for
Particle
propagating in theMedium
.It simply wraps
Medium::propagate
. Return the statistical weight.
-
template<typename Vector3, typename Value>
Value darkprop::scatter(Particle<Vector3, Value> &p, Medium<Vector3, Value> &m, RandomNumber<Value> &rn) Basic interface for Particle scattering in the Medium.
Update
T
,p3
,v
,ep
of the particlep
after a scattering. It simply wrapsMedium::sampleTarget
andParticle::scatter
. Return the statistical weight.
Other Ingredients
-
template<typename Value = double>
class RandomNumber Random number generator.
Public Functions
-
template<typename Vector3, typename Value>
struct Event Store particle information for dump.