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

#include <eiparticle.h>

+ Inheritance diagram for Heed::eiparticle:

Public Member Functions

 eiparticle (void)
 Constructors.
 
 eiparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, particle_def *fpardef, int fs_add_loss=0)
 
 AnyType_copy (eiparticle, gparticle)
 
virtual ~eiparticle ()
 Destructor.
 
virtual void print (std::ostream &file, int l) const
 
double Bethe_Bloch_en_loss (void)
 Energy loss per unit length.
 
virtual void physics_after_new_speed (void)
 
- Public Member Functions inherited from Heed::eparticle
 eparticle (void)
 Constructors.
 
 eparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, particle_def *fpardef)
 
 eparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, particle_def *fpardef, double gamma_1)
 
 AnyType_copy (eparticle, gparticle)
 
virtual ~eparticle ()
 Destructor.
 
virtual void print (std::ostream &file, int l) const
 
virtual int force (const point &pt, vec &f, vec &f_perp, vfloat &mrange)
 
- Public Member Functions inherited from Heed::mparticle
void check_consistency (void) const
 
virtual void step (void)
 
virtual void curvature (int &fs_cf, vec &frelcen, vfloat &fmrange, vfloat prec)
 
virtual void physics_after_new_speed (void)
 
virtual void physics (void)
 
virtual int force (const point &pt, vec &f, vec &f_perp, vfloat &mrange)
 
void new_speed (void)
 
 mparticle (void)
 
 mparticle (gparticle const &gp, double fmass)
 
 mparticle (gparticle const &gp, double fmass, double gamma_1)
 
 mparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, double fmass, double gamma_1)
 
virtual void print (std::ostream &file, int l) const
 
 macro_copy_total (gparticle)
 
virtual ~mparticle ()
 
- Public Member Functions inherited from gparticle
 gparticle (void)
 
 gparticle (const stvpoint &sp)
 
 gparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time)
 
virtual void step (void)
 
virtual void change_vol (void)
 
virtual void curvature (int &fs_cf, vec &frelcen, vfloat &fmrange, vfloat prec)
 
virtual void physics_after_new_speed (void)
 
virtual void physics (void)
 
virtual void physics_mrange (double &fmrange)
 
virtual stvpoint calc_step_to_bord ()
 
stvpoint switch_new_vol (void)
 
virtual void fly (void)
 
virtual void print (std::ostream &file, int l) const
 
 macro_copy_total (gparticle)
 
virtual ~gparticle ()
 
- Public Member Functions inherited from Heed::particle_type
 particle_type (void)
 
 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
 

Public Attributes

int s_add_loss
 
double total_loss
 
- Public Attributes inherited from Heed::mparticle
double mass
 Mass (not mass * speed_of_light^2)
 
double orig_kin_energy
 
double orig_gamma_1
 
double prev_kin_energy
 
double prev_gamma_1
 
double curr_kin_energy
 
double curr_gamma_1
 
- Public Attributes inherited from gparticle
int s_life
 
long nstep
 
double total_range_from_origin
 
long n_zero_step
 
stvpoint origin
 
stvpoint prevpos
 
stvpoint currpos
 
stvpoint nextpos
 
vec curr_relcen
 
- Public Attributes inherited from Heed::particle_type
PassivePtr< particle_defpardef
 

Additional Inherited Members

- Static Public Attributes inherited from gparticle
static long max_q_zero_step = 100
 

Detailed Description

Definition at line 16 of file eiparticle.h.

Constructor & Destructor Documentation

◆ eiparticle() [1/2]

Heed::eiparticle::eiparticle ( void  )
inline

Constructors.

Definition at line 19 of file eiparticle.h.

19: eparticle() { ; }
eparticle(void)
Constructors.
Definition: eparticle.h:19

◆ eiparticle() [2/2]

Heed::eiparticle::eiparticle ( manip_absvol primvol,
const point pt,
const vec vel,
vfloat  time,
particle_def fpardef,
int  fs_add_loss = 0 
)
inline

Definition at line 20 of file eiparticle.h.

22 : eparticle(primvol, pt, vel, time, fpardef),
23 s_add_loss(fs_add_loss),
24 total_loss(0.0) {}
double total_loss
Definition: eiparticle.h:40

◆ ~eiparticle()

virtual Heed::eiparticle::~eiparticle ( )
inlinevirtual

Destructor.

Definition at line 27 of file eiparticle.h.

27{}

Member Function Documentation

◆ AnyType_copy()

Heed::eiparticle::AnyType_copy ( eiparticle  ,
gparticle   
)

◆ Bethe_Bloch_en_loss()

double Heed::eiparticle::Bethe_Bloch_en_loss ( void  )

Energy loss per unit length.

Definition at line 14 of file eiparticle.cpp.

14 {
15
16 mfunname("double eiparticle::Bethe_Bloch_energy_loss()");
17 // Get least address of volume
18 const absvol* av = currpos.G_lavol();
19 const MatterType* amt = dynamic_cast<const MatterType*>(av);
20 if (amt == NULL) return 0.;
21 MatterDef* amd = amt->matdef.get();
22 const double beta = lorbeta(curr_gamma_1);
23 const double loss =
24 Bethe_Bloch_energy_loss(amd->Z_mean() / amd->A_mean(), amd->I_eff(), beta,
25 pardef->charge / eplus);
26 return loss * amd->density();
27}
#define mfunname(string)
Definition: FunNameStack.h:67
double curr_gamma_1
Definition: mparticle.h:32
PassivePtr< particle_def > pardef
Definition: particle_def.h:150
Definition: volume.h:91
stvpoint currpos
Definition: gparticle.h:188
absvol * G_lavol() const
Definition: gparticle.h:63
double lorbeta(const double gamma_1)
Definition: lorgamma.cpp:22
double Bethe_Bloch_energy_loss(const double ratio_Z_to_A, const double I_eff, const double beta, const double z)
Definition: bethe_bloch.cpp:14

Referenced by physics_after_new_speed().

◆ physics_after_new_speed()

void Heed::eiparticle::physics_after_new_speed ( void  )
virtual

Reimplemented from Heed::mparticle.

Definition at line 29 of file eiparticle.cpp.

29 {
30 mfunname("void eiparticle::physics_after_new_speed(void)");
31 double loss = Bethe_Bloch_en_loss();
32 loss *= currpos.prange;
33 total_loss += loss;
34 if (s_add_loss == 0) {
35 curr_kin_energy -= loss;
36 if (curr_kin_energy <= 0.0) {
37 curr_kin_energy = 0.0;
38 curr_gamma_1 = 0.0;
39 currpos.speed = 0.0;
40 s_life = 0;
41 } else {
42 const double resten = mass * c_squared;
44 currpos.speed = c_light * lorbeta(curr_gamma_1);
45 }
46 } else {
47 curr_kin_energy += loss;
48 const double resten = mass * c_squared;
50 currpos.speed = c_light * lorbeta(curr_gamma_1);
51 }
52}
double Bethe_Bloch_en_loss(void)
Energy loss per unit length.
Definition: eiparticle.cpp:14
double curr_kin_energy
Definition: mparticle.h:31
double mass
Mass (not mass * speed_of_light^2)
Definition: mparticle.h:25
int s_life
Definition: gparticle.h:180
vfloat prange
Definition: gparticle.h:54
vfloat speed
Definition: gparticle.h:41

◆ print()

void Heed::eiparticle::print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented from Heed::eparticle.

Definition at line 54 of file eiparticle.cpp.

54 {
55 if (l >= 0) {
56 Ifile << "eiparticle: s_add_loss=" << s_add_loss
57 << " total_loss/keV=" << total_loss / keV << '\n';
58 eparticle::print(file, l);
59 }
60}
virtual void print(std::ostream &file, int l) const
Definition: eparticle.cpp:33
#define Ifile
Definition: prstream.h:207

Member Data Documentation

◆ s_add_loss

int Heed::eiparticle::s_add_loss

Flag for handling energy loss 0 - loss is subtracted from current particle energy 1 - loss is added (simulation of particle passage to opposite

Definition at line 39 of file eiparticle.h.

Referenced by physics_after_new_speed(), and print().

◆ total_loss

double Heed::eiparticle::total_loss

Definition at line 40 of file eiparticle.h.

Referenced by physics_after_new_speed(), and print().


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