Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <gparticle.h>
Public Member Functions | |
gparticle ()=default | |
Default constructor. | |
gparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time) | |
Constructor. | |
virtual | ~gparticle () |
Destructor. | |
virtual void | fly (std::vector< gparticle * > &secondaries) |
Transport the particle. | |
virtual void | fly (std::vector< gparticle * > &secondaries, const bool one_step) |
void | set_step_limits (const vfloat fmax_range, const vfloat frad_for_straight, const vfloat fmax_straight_arange, const vfloat fmax_circ_arange) |
Set limits/parameters for trajectory steps. | |
const vec & | position () const |
Get the current position of the particle. | |
vfloat | time () const |
Get the current time of the particle. | |
const vec & | direction () const |
Get the current direction of the particle. | |
bool | alive () const |
virtual void | print (std::ostream &file, int l) const |
Print-out. | |
virtual gparticle * | copy () const |
Clone the particle. | |
Protected Member Functions | |
virtual void | step (std::vector< gparticle * > &secondaries) |
virtual void | change_vol () |
Move from one volume to another. | |
virtual void | curvature (bool &curved, vec &frelcen, vfloat &fmrange, vfloat prec) |
virtual void | physics_after_new_speed (std::vector< gparticle * > &) |
Apply any other processes (turn the trajectory, kill the particle, ...). | |
virtual void | physics (std::vector< gparticle * > &) |
Apply any other processes (turn the trajectory, kill the particle, ...). | |
virtual void | physics_mrange (double &fmrange) |
virtual stvpoint | calc_step_to_bord () |
Determine next position. | |
stvpoint | switch_new_vol () |
Generate next position in new volume. | |
Protected Attributes | |
bool | m_alive = false |
Status flag whether the particle is active. | |
long | m_nstep = 0 |
Step number. | |
long | m_nzero_step = 0 |
Number of previous steps with zero range (including this step). | |
stvpoint | m_origin |
Original point. | |
double | m_total_range_from_origin = 0. |
Range from origin to current position. | |
stvpoint | m_prevpos |
Previous point. | |
stvpoint | m_currpos |
Current point. | |
stvpoint | m_nextpos |
Next point. | |
Static Protected Attributes | |
static constexpr long | m_max_qzero_step = 100 |
Max. number of zero-steps allowed. | |
"Geometric particle" (particle that does not interact with materials). It moves along a polyline or circle from one volume to another. Classes for interacting particles should be derived from this base class.
Definition at line 144 of file gparticle.h.
|
default |
Default constructor.
Referenced by copy().
Heed::gparticle::gparticle | ( | manip_absvol * | primvol, |
const point & | pt, | ||
const vec & | vel, | ||
vfloat | time | ||
) |
Constructor.
Definition at line 40 of file gparticle.cpp.
|
inlinevirtual |
|
inline |
Definition at line 192 of file gparticle.h.
Referenced by Heed::HeedParticle::physics(), and Heed::HeedParticle_BGM::physics().
|
protectedvirtual |
Determine next position.
Definition at line 110 of file gparticle.cpp.
Referenced by step(), and Heed::mparticle::step().
|
inlineprotectedvirtual |
Move from one volume to another.
Definition at line 211 of file gparticle.h.
Referenced by step(), and Heed::mparticle::step().
|
inlinevirtual |
Clone the particle.
Reimplemented in Heed::HeedDeltaElectron, Heed::HeedParticle, Heed::HeedParticle_BGM, Heed::HeedPhoton, Heed::mparticle, and Heed::eparticle.
Definition at line 197 of file gparticle.h.
|
protectedvirtual |
Set curvature. Can also change the direction at the current position.
curved | flag whether the trajectory is curved |
frelcen | position of the centre of rotation relative to currpos. |
fmrange | step range |
prec | tolerance for checking if the force is parallel or antiparallel to dir. In the latter case, the range is restricted by the end point. In calc_step_to_bord() it is set to m_max_straight_arange. |
Reimplemented in Heed::mparticle.
Definition at line 89 of file gparticle.cpp.
Referenced by calc_step_to_bord().
|
inline |
Get the current direction of the particle.
Definition at line 190 of file gparticle.h.
|
inlinevirtual |
Transport the particle.
Definition at line 155 of file gparticle.h.
Referenced by Garfield::TrackHeed::GetCluster(), Garfield::TrackHeed::NewTrack(), Garfield::TrackHeed::TransportDeltaElectron(), and Garfield::TrackHeed::TransportPhoton().
|
inlinevirtual |
|
inlineprotectedvirtual |
Apply any other processes (turn the trajectory, kill the particle, ...).
Reimplemented in Heed::HeedParticle, Heed::HeedParticle_BGM, and Heed::HeedPhoton.
Definition at line 232 of file gparticle.h.
Referenced by fly().
|
inlineprotectedvirtual |
Apply any other processes (turn the trajectory, kill the particle, ...).
Reimplemented in Heed::HeedDeltaElectron, and Heed::HeedPhoton.
Definition at line 229 of file gparticle.h.
Referenced by step(), and Heed::mparticle::step().
|
protectedvirtual |
Reduce the maximal possible range due to continuous processes. Called from calc_step_to_bord after the call of curvature. but before considering the crossing with volumes. Therefore mrange may be reduced after this.
Reimplemented in Heed::HeedDeltaElectron.
Definition at line 108 of file gparticle.cpp.
Referenced by calc_step_to_bord().
|
inline |
Get the current position of the particle.
Definition at line 186 of file gparticle.h.
Referenced by Garfield::TrackHeed::GetCluster().
|
virtual |
Print-out.
Reimplemented in Heed::HeedDeltaElectron, Heed::HeedParticle, Heed::HeedParticle_BGM, Heed::HeedPhoton, Heed::mparticle, and Heed::eparticle.
Definition at line 192 of file gparticle.cpp.
Referenced by Heed::HeedPhoton::print(), and Heed::mparticle::print().
|
inline |
Set limits/parameters for trajectory steps.
Definition at line 175 of file gparticle.h.
Referenced by Garfield::TrackHeed::NewTrack().
|
protectedvirtual |
Assign prevpos = currpos and currpos = nextpos, call change_vol if necessary and update nextpos = calc_step_to_bord(). Derived versions can also recalculate the direction at currpos right after updating currpos = nextpos. This is especially important in the case when the motion is approximated by straight-line steps, but there is a (magnetic) field which slightly
deflects the trajectory. In this case, the velocity is corrected at the end point of each interval, but the position is not.
Reimplemented in Heed::mparticle.
Definition at line 68 of file gparticle.cpp.
Referenced by fly().
|
protected |
Generate next position in new volume.
Definition at line 152 of file gparticle.cpp.
Referenced by calc_step_to_bord().
|
inline |
Get the current time of the particle.
Definition at line 188 of file gparticle.h.
Referenced by Garfield::TrackHeed::GetCluster().
|
protected |
Status flag whether the particle is active.
Definition at line 247 of file gparticle.h.
Referenced by alive(), fly(), gparticle(), Heed::HeedDeltaElectron::physics_after_new_speed(), Heed::HeedPhoton::physics_after_new_speed(), print(), step(), Heed::mparticle::step(), and switch_new_vol().
|
protected |
Current point.
Definition at line 264 of file gparticle.h.
Referenced by calc_step_to_bord(), change_vol(), Heed::mparticle::curvature(), direction(), gparticle(), Heed::mparticle::mparticle(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), Heed::HeedPhoton::physics(), Heed::HeedDeltaElectron::physics_after_new_speed(), Heed::HeedPhoton::physics_after_new_speed(), Heed::HeedDeltaElectron::physics_mrange(), position(), print(), step(), Heed::mparticle::step(), switch_new_vol(), and time().
|
staticconstexprprotected |
Max. number of zero-steps allowed.
Definition at line 252 of file gparticle.h.
Referenced by step(), and Heed::mparticle::step().
|
protected |
Next point.
Definition at line 266 of file gparticle.h.
Referenced by gparticle(), Heed::HeedPhoton::physics(), print(), step(), and Heed::mparticle::step().
|
protected |
Step number.
Definition at line 250 of file gparticle.h.
Referenced by print(), step(), and Heed::mparticle::step().
|
protected |
Number of previous steps with zero range (including this step).
Definition at line 254 of file gparticle.h.
Referenced by print(), step(), and Heed::mparticle::step().
|
protected |
Original point.
Definition at line 257 of file gparticle.h.
Referenced by gparticle(), Heed::mparticle::mparticle(), and print().
|
protected |
Previous point.
Definition at line 262 of file gparticle.h.
Referenced by Heed::mparticle::mparticle(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), print(), step(), and Heed::mparticle::step().
|
protected |
Range from origin to current position.
Definition at line 259 of file gparticle.h.
Referenced by print(), step(), and Heed::mparticle::step().