Class EMDoublePairProduction
Defined in File EMDoublePairProduction.h
Inheritance Relationships
Base Type
public Module(Class Module)
Class Documentation
-
class EMDoublePairProduction : public Module
Electron double pair production of photons with background photons.
This module simulates electron double pair production of photons with background photons for several photon fields. The secondary electrons from this interaction are optionally created (default = false). The module limits the propagation step size to a fraction of the mean free path (default = 0.1). Thinning is available. A thinning of 0 means that all particles are tracked. For the maximum thinning of 1, only a few representative particles are added to the list of secondaries. Note that for thinning>0 the output must contain the column “weights”, which should be included in the post-processing. The surface is defined to include the nodes of the grid contained within.
Public Functions
-
EMDoublePairProduction(ref_ptr<PhotonField> photonField, bool haveElectrons = false, double thinning = 0, double limit = 0.1, ref_ptr<Surface> surface = nullptr)
Constructor The object used to load, store and access to the interaction rates of the process is the interactionRates pointer.
- Parameters:
photonField – target photon field
haveElectrons – if true, add secondary electrons as candidates
thinning – weighted sampling of secondaries (0: all particles are tracked; 1: maximum thinning)
limit – step size limit as fraction of mean free path
surface – Grid will be confined to
surface->distance(pos)<0, so for example inside a closed surface
-
void setPhotonField(ref_ptr<PhotonField> photonField)
-
void setHaveElectrons(bool haveElectrons)
-
void setLimit(double limit)
Limit the propagation step to a fraction of the mean free path
- Parameters:
limit – fraction of the mean free path
-
void setThinning(double thinning)
Apply thinning with a given thinning factor
- Parameters:
thinning – factor of thinning (0: no thinning, 1: maximum thinning)
-
void setSurface(ref_ptr<Surface> surface)
Apply a surface that confine the position dependent photon field region. The rates are initialized only for distances smaller then 0, so
surface->distance(pos)<0- Parameters:
surface – Grid will be confined to
surface->distance(pos)<0, so for example inside a closed surface
-
void setInteractionRates(ref_ptr<InteractionRates> intRates)
set a custom interaction rate With this function you can change the type of interaction rate, if you would for example like to change from a homogeneous to a position dependent interaction rate.
- Parameters:
intRates – ref_ptr to a InteractionRates class
-
ref_ptr<InteractionRates> getInteractionRates() const
-
void setInteractionTag(std::string tag)
set a custom interaction tag to trace back this interaction
- Parameters:
tag – string that will be added to the candidate and output
-
std::string getInteractionTag() const
-
void initRate(std::string path)
Loads the interaction rate This function loads the interaction rate from a given file/folder.
- Parameters:
path – The name of the file/folder containing the interaction rates
-
double getRate(double E, const Vector3d &position = Vector3d(0.), double z = 0) const
Get the interaction rate for a given energy, position, and redshift. For now, this function uses a redshift scaling factor for the interaction rate. Future releases will include a more accurate treatment of the redshift evolution of the photon field.
- Parameters:
E – Energy of the primary particle
position – Position of the primary particle
z – Redshift of the primary particle
-
virtual void process(Candidate *candidate) const
Process function This is the main function to work with, it is called during every ModuleList::run step. Derived functions need to override this overload of process!
- Parameters:
candidate – Candidate raw pointer
-
virtual std::string getDescription() const
Returns description, can be overriden by derived class.
-
void setDescription(const std::string &description)
Sets description, can be used instead of getDescription in derived class
- Parameters:
description – Description string
-
inline void process(ref_ptr<Candidate> candidate) const
Process function Overload for process function to explicitly make a conversion from ref_ptr to a raw pointer
-
inline size_t addReference() const
-
inline size_t removeReference() const
-
inline int removeReferenceNoDelete() const
-
inline size_t getReferenceCount() const
Protected Attributes
-
mutable size_t _referenceCount
-
EMDoublePairProduction(ref_ptr<PhotonField> photonField, bool haveElectrons = false, double thinning = 0, double limit = 0.1, ref_ptr<Surface> surface = nullptr)