Garfield++ 3.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.
 
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.
 
virtual void print (std::ostream &file, int l) const
 Print-out.
 
virtual gparticlecopy () const
 Clone the particle.
 
- Public Member Functions inherited from Heed::particle_type
 particle_type ()=default
 
 particle_type (particle_def *f)
 
 particle_type (const char *name, int s=0)
 
int operator== (const particle_type &f)
 
int operator!= (const particle_type &f)
 
void print_notation (std::ostream &file) const
 

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
 
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

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

- Public Attributes inherited from Heed::particle_type
particle_defpardef = nullptr
 
- Static Protected Attributes inherited from Heed::gparticle
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]

Heed::eparticle::eparticle ( )
default

Default constructor.

Referenced by copy().

◆ 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 particle_type(fpardef), m_fieldMap(fieldmap) {
11}
HeedFieldMap * m_fieldMap
Pointer to field map.
Definition: eparticle.h:34
mparticle()=default
Default constructor.
particle_type()=default

◆ ~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::mparticle.

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 = pardef->charge * efield;
22 f_perp = pardef->charge * hfield;
23 return 1;
24}
void field_map(const point &pt, vec &efield, vec &bfield, vfloat &mrange) const
particle_def * pardef
Definition: particle_def.h:137

◆ print()

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

Print-out.

Reimplemented from Heed::mparticle.

Definition at line 26 of file eparticle.cpp.

26 {
27 if (l < 0) return;
28 Ifile << "eparticle: particle is ";
29 print_notation(file);
30 file << '\n';
31 mparticle::print(file, l);
32}
void print(std::ostream &file, int l) const override
Print-out.
Definition: mparticle.cpp:243
void print_notation(std::ostream &file) const
#define Ifile
Definition: prstream.h:196

Member Data Documentation

◆ m_fieldMap

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

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