Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::eparticle Class Reference

#include <eparticle.h>

+ Inheritance diagram for Heed::eparticle:

Public Member Functions

 eparticle ()=default
 Default constructor.
 
 eparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, particle_def *fpardef, HeedFieldMap *fieldmap)
 Constructor using velocity vector.
 
virtual ~eparticle ()
 Destructor.
 
eparticlecopy () const override
 Clone the particle.
 
void print (std::ostream &file, int l) const override
 Print-out.
 
- Public Member Functions inherited from Heed::mparticle
 mparticle ()=default
 Default constructor.
 
 mparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat ftime, double fmass)
 Constructor, $\gamma - 1$ 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.
 
mparticlecopy () 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.
 
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 vecposition () const
 Get the current position of the particle.
 
vfloat time () const
 Get the current time of the particle.
 
const vecdirection () const
 Get the current direction of the particle.
 
bool alive () const
 Alive?
 

Protected Member Functions

int force (const point &pt, vec &f, vec &f_perp, vfloat &mrange) override
 Calculate force components.
 
- Protected Member Functions inherited from Heed::mparticle
void step (std::vector< gparticle * > &secondaries) override
 
void curvature (bool &curved, vec &frelcen, vfloat &fmrange, vfloat prec) override
 
- Protected Member Functions inherited from Heed::gparticle
virtual void change_vol ()
 Move from one volume to another.
 
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.
 
void turn (const double ctheta, const double stheta)
 Change the direction of the particle.
 
stvpoint switch_new_vol ()
 Generate next position in new volume.
 

Protected Attributes

particle_defm_pardef = nullptr
 
HeedFieldMapm_fieldMap = nullptr
 Pointer to field map.
 
- Protected Attributes inherited from Heed::mparticle
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 $\gamma - 1$.
 
double m_orig_gamma_1 = 0.
 Original $\gamma - 1$.
 
double m_prev_gamma_1 = 0.
 Previous $\gamma - 1$.
 
- 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 Public Member Functions inherited from Heed::gparticle
static void reset_counter ()
 Reset the counter.
 
- Static Protected Attributes inherited from Heed::gparticle
static std::atomic< long > s_counter {0L}
 Instance counter.
 
static constexpr long m_max_qzero_step = 100
 Max. number of zero-steps allowed.
 

Detailed Description

Charged particle. Combination of features of massive geometrical particle and specification of concrete particle as one of types known by science.

Definition at line 15 of file eparticle.h.

Constructor & Destructor Documentation

◆ eparticle() [1/2]

◆ eparticle() [2/2]

Heed::eparticle::eparticle ( manip_absvol * primvol,
const point & pt,
const vec & vel,
vfloat time,
particle_def * fpardef,
HeedFieldMap * fieldmap )

Constructor using velocity vector.

Definition at line 7 of file eparticle.cpp.

9 : mparticle(primvol, pt, vel, ftime, fpardef->mass),
10 m_pardef(fpardef), m_fieldMap(fieldmap) {
11}
particle_def * m_pardef
Definition eparticle.h:32
HeedFieldMap * m_fieldMap
Pointer to field map.
Definition eparticle.h:34
mparticle()=default
Default constructor.

◆ ~eparticle()

virtual Heed::eparticle::~eparticle ( )
inlinevirtual

Destructor.

Definition at line 23 of file eparticle.h.

23{}

Member Function Documentation

◆ copy()

eparticle * Heed::eparticle::copy ( ) const
inlineoverridevirtual

Clone the particle.

Reimplemented from Heed::gparticle.

Reimplemented in Heed::HeedDeltaElectron, Heed::HeedParticle, and Heed::HeedParticle_BGM.

Definition at line 25 of file eparticle.h.

25{ return new eparticle(*this); }
eparticle()=default
Default constructor.

◆ force()

int Heed::eparticle::force ( const point & pt,
vec & f,
vec & f_perp,
vfloat & mrange )
overrideprotectedvirtual

Calculate force components.

Reimplemented from Heed::mparticle.

Definition at line 13 of file eparticle.cpp.

13 {
14 vec efield(0., 0., 0.);
15 vec hfield(0., 0., 0.);
16 if (!m_fieldMap) {
17 std::cerr << "Field map not defined.\n";
18 return 1;
19 }
20 m_fieldMap->field_map(pt, efield, hfield, mrange);
21 f = m_pardef->charge * efield;
22 f_perp = m_pardef->charge * hfield;
23 return 1;
24}

◆ print()

void Heed::eparticle::print ( std::ostream & file,
int l ) const
overridevirtual

Print-out.

Reimplemented from Heed::gparticle.

Reimplemented in Heed::HeedDeltaElectron, Heed::HeedParticle, and Heed::HeedParticle_BGM.

Definition at line 26 of file eparticle.cpp.

26 {
27 if (l < 0) return;
28 Ifile << "eparticle: particle is ";
29 if (!m_pardef) {
30 file << "none";
31 } else {
32 file << m_pardef->notation;
33 }
34 file << '\n';
35 mparticle::print(file, l);
36}
void print(std::ostream &file, int l) const override
Print-out.
#define Ifile
Definition prstream.h:195

Member Data Documentation

◆ m_fieldMap

HeedFieldMap* Heed::eparticle::m_fieldMap = nullptr
protected

◆ m_pardef

particle_def* Heed::eparticle::m_pardef = nullptr
protected

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