Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Massive particle. A force can be applied. More...
#include <mparticle.h>
Public Member Functions | |
mparticle ()=default | |
Default constructor. | |
mparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat ftime, double fmass) | |
Constructor, calculated from the from velocity vector. | |
virtual | ~mparticle () |
Destructor. | |
double | kinetic_energy () const |
Get the current kinetic energy. | |
void | print (std::ostream &file, int l) const override |
Print-out. | |
mparticle * | copy () const override |
Clone the particle. | |
Public Member Functions inherited from Heed::gparticle | |
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. | |
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. | |
virtual void | print (std::ostream &file, int l) const |
Print-out. | |
virtual gparticle * | copy () const |
Clone the particle. | |
Protected Member Functions | |
void | step (std::vector< gparticle * > &secondaries) override |
void | curvature (bool &curved, vec &frelcen, vfloat &fmrange, vfloat prec) override |
virtual int | force (const point &pt, vec &f, vec &f_perp, vfloat &mrange) |
Protected Member Functions inherited from Heed::gparticle | |
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 | |
double | m_mass = 0. |
Mass (not mass * speed_of_light^2) | |
double | m_curr_ekin = 0. |
Current kinetic energy. | |
double | m_orig_ekin = 0. |
Original kinetic energy. | |
double | m_prev_ekin = 0. |
Previous kinetic energy. | |
double | m_curr_gamma_1 = 0. |
Current . | |
double | m_orig_gamma_1 = 0. |
Original . | |
double | m_prev_gamma_1 = 0. |
Previous . | |
Protected Attributes inherited from Heed::gparticle | |
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. | |
Additional Inherited Members | |
Static Protected Attributes inherited from Heed::gparticle | |
static constexpr long | m_max_qzero_step = 100 |
Max. number of zero-steps allowed. | |
Massive particle. A force can be applied.
Definition at line 23 of file mparticle.h.
|
default |
Default constructor.
Referenced by copy().
Heed::mparticle::mparticle | ( | manip_absvol * | primvol, |
const point & | pt, | ||
const vec & | vel, | ||
vfloat | ftime, | ||
double | fmass | ||
) |
Constructor, calculated from the from velocity vector.
Definition at line 20 of file mparticle.cpp.
|
inlinevirtual |
|
inlineoverridevirtual |
Clone the particle.
Reimplemented from Heed::gparticle.
Reimplemented in Heed::eparticle.
Definition at line 37 of file mparticle.h.
|
overrideprotectedvirtual |
Set curvature. Calls force().
Reimplemented from Heed::gparticle.
Definition at line 98 of file mparticle.cpp.
|
protectedvirtual |
The force is considered to be split in two components. One component, f, can be in any direction and is capable of doing work. The other one is always normal to dir and cannot do work. The latter can represent the magnetic component of the Lorentz force. This splitting improve precision of calculation of kinetic energy. But the latter component is not the true force. To derive the force one should do vector multiplication of speed by f_perp, f_perp2 = currpos.speed * (currpos.dir || f_perp_fl2); Return 0 if there is no force, f is initialised to zero anyway. mrange is the distance at which the force should not change much. The dimension of f is [weight] * [lenght] / [time]^2 The dimension of f_perp is [weight] / [time];
Reimplemented in Heed::eparticle.
Definition at line 139 of file mparticle.cpp.
Referenced by curvature().
|
inline |
Get the current kinetic energy.
Definition at line 34 of file mparticle.h.
Referenced by Garfield::TrackHeed::GetCluster().
|
overridevirtual |
Print-out.
Reimplemented from Heed::gparticle.
Reimplemented in Heed::eparticle.
Definition at line 243 of file mparticle.cpp.
Referenced by Heed::HeedDeltaElectron::print(), Heed::HeedParticle::print(), Heed::HeedParticle_BGM::print(), Heed::eparticle::print(), and step().
|
overrideprotectedvirtual |
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 from Heed::gparticle.
Definition at line 71 of file mparticle.cpp.
|
protected |
Current kinetic energy.
Definition at line 73 of file mparticle.h.
Referenced by curvature(), kinetic_energy(), mparticle(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), Heed::HeedDeltaElectron::physics_after_new_speed(), Heed::HeedDeltaElectron::physics_mrange(), print(), and step().
|
protected |
Current .
Definition at line 80 of file mparticle.h.
Referenced by curvature(), mparticle(), Heed::HeedParticle_BGM::physics(), Heed::HeedDeltaElectron::physics_after_new_speed(), print(), and step().
|
protected |
Mass (not mass * speed_of_light^2)
Definition at line 70 of file mparticle.h.
Referenced by curvature(), mparticle(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), Heed::HeedDeltaElectron::physics_after_new_speed(), and print().
|
protected |
Original kinetic energy.
Definition at line 75 of file mparticle.h.
Referenced by mparticle(), and print().
|
protected |
|
protected |
Previous kinetic energy.
Definition at line 77 of file mparticle.h.
Referenced by mparticle(), Heed::HeedDeltaElectron::physics_after_new_speed(), print(), and step().
|
protected |
Previous .
Definition at line 84 of file mparticle.h.
Referenced by mparticle(), print(), and step().