Garfield++
v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
eiparticle.cpp
Go to the documentation of this file.
1
#include <iomanip>
2
#include "
wcpplib/particle/eiparticle.h
"
3
#include "
wcpplib/ioniz/bethe_bloch.h
"
4
#include "
wcpplib/math/lorgamma.h
"
5
#include "
wcpplib/matter/MatterDef.h
"
6
#include "
wcpplib/util/FunNameStack.h
"
7
#include "
wcpplib/clhep_units/WPhysicalConstants.h
"
8
/*
9
1998 - 2002, I. Smirnov
10
*/
11
12
namespace
Heed
{
13
14
double
eiparticle::Bethe_Bloch_en_loss
() {
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
}
28
29
void
eiparticle::physics_after_new_speed
() {
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;
43
curr_gamma_1
=
curr_kin_energy
/ resten;
44
currpos
.
speed
= c_light *
lorbeta
(
curr_gamma_1
);
45
}
46
}
else
{
47
curr_kin_energy
+= loss;
48
const
double
resten =
mass
* c_squared;
49
curr_gamma_1
=
curr_kin_energy
/ resten;
50
currpos
.
speed
= c_light *
lorbeta
(
curr_gamma_1
);
51
}
52
}
53
54
void
eiparticle::print
(std::ostream& file,
int
l)
const
{
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
}
61
62
}
FunNameStack.h
mfunname
#define mfunname(string)
Definition:
FunNameStack.h:67
MatterDef.h
WPhysicalConstants.h
bethe_bloch.h
Heed::AtomMixDef::A_mean
double A_mean(void) const
Definition:
AtomDef.h:150
Heed::AtomMixDef::Z_mean
double Z_mean(void) const
Definition:
AtomDef.h:149
Heed::MatterDef
Definition:
MatterDef.h:19
Heed::MatterDef::I_eff
double I_eff(void) const
Definition:
MatterDef.h:54
Heed::MatterDef::density
double density(void) const
Definition:
MatterDef.h:52
Heed::MatterType
Definition:
MatterDef.h:70
Heed::MatterType::matdef
PassivePtr< MatterDef > matdef
Definition:
MatterDef.h:72
Heed::eiparticle::s_add_loss
int s_add_loss
Definition:
eiparticle.h:39
Heed::eiparticle::Bethe_Bloch_en_loss
double Bethe_Bloch_en_loss(void)
Energy loss per unit length.
Definition:
eiparticle.cpp:14
Heed::eiparticle::print
virtual void print(std::ostream &file, int l) const
Definition:
eiparticle.cpp:54
Heed::eiparticle::physics_after_new_speed
virtual void physics_after_new_speed(void)
Definition:
eiparticle.cpp:29
Heed::eiparticle::total_loss
double total_loss
Definition:
eiparticle.h:40
Heed::eparticle::print
virtual void print(std::ostream &file, int l) const
Definition:
eparticle.cpp:33
Heed::mparticle::curr_kin_energy
double curr_kin_energy
Definition:
mparticle.h:31
Heed::mparticle::mass
double mass
Mass (not mass * speed_of_light^2)
Definition:
mparticle.h:25
Heed::mparticle::curr_gamma_1
double curr_gamma_1
Definition:
mparticle.h:32
Heed::particle_type::pardef
PassivePtr< particle_def > pardef
Definition:
particle_def.h:150
absvol
Definition:
volume.h:91
gparticle::currpos
stvpoint currpos
Definition:
gparticle.h:188
gparticle::s_life
int s_life
Definition:
gparticle.h:180
stvpoint::G_lavol
absvol * G_lavol() const
Definition:
gparticle.h:63
stvpoint::prange
vfloat prange
Definition:
gparticle.h:54
stvpoint::speed
vfloat speed
Definition:
gparticle.h:41
eiparticle.h
lorgamma.h
Heed
Definition:
BGMesh.cpp:3
Heed::lorbeta
double lorbeta(const double gamma_1)
Definition:
lorgamma.cpp:22
Heed::Bethe_Bloch_energy_loss
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
Ifile
#define Ifile
Definition:
prstream.h:207
garfieldpp-v1r0
Heed
wcpplib
particle
eiparticle.cpp
Generated by
1.9.6