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

#include <HeedDeltaElectron.h>

+ Inheritance diagram for Heed::HeedDeltaElectron:

Public Member Functions

 HeedDeltaElectron ()
 Default constructor.
 
 HeedDeltaElectron (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, long fparent_particle_number, HeedFieldMap *fieldmap, bool fs_print_listing=false)
 Constructor.
 
virtual ~HeedDeltaElectron ()
 Destructor.
 
virtual void physics_mrange (double &fmrange)
 
virtual void physics_after_new_speed (std::vector< gparticle * > &secondaries)
 
virtual HeedDeltaElectroncopy () const
 
virtual void print (std::ostream &file, int l) const
 
- Public Member Functions inherited from Heed::eparticle
 eparticle ()
 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.
 
virtual eparticlecopy () const
 
virtual void print (std::ostream &file, int l) const
 
virtual int force (const point &pt, vec &f, vec &f_perp, vfloat &mrange)
 Calculate force components.
 
- Public Member Functions inherited from Heed::mparticle
void check_consistency () const
 Check consistency of kin_energy, gamma_1, speed, speed_of_light and mass.
 
virtual void step (std::vector< gparticle * > &secondaries)
 
virtual void curvature (int &fs_cf, vec &frelcen, vfloat &fmrange, vfloat prec)
 
virtual int force (const point &pt, vec &f, vec &f_perp, vfloat &mrange)
 
void new_speed ()
 Set new speed, direction and time for currpos.
 
 mparticle ()
 Default constructor.
 
 mparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time, double fmass)
 Constructor, $\gamma - 1$ calculated from the from velocity vector.
 
virtual void print (std::ostream &file, int l) const
 
virtual mparticlecopy () const
 
virtual ~mparticle ()
 Destructor.
 
- Public Member Functions inherited from Heed::gparticle
 gparticle ()
 Default constructor.
 
 gparticle (manip_absvol *primvol, const point &pt, const vec &vel, vfloat time)
 Constructor.
 
virtual ~gparticle ()
 Destructor.
 
virtual void step (std::vector< gparticle * > &secondaries)
 
virtual void change_vol (void)
 
virtual void curvature (int &fs_cf, vec &frelcen, vfloat &fmrange, vfloat prec)
 
virtual void physics_after_new_speed (std::vector< gparticle * > &)
 
virtual void physics (std::vector< gparticle * > &)
 
virtual void physics_mrange (double &fmrange)
 
virtual stvpoint calc_step_to_bord ()
 Produces nextpos.
 
stvpoint switch_new_vol ()
 
virtual void fly (std::vector< gparticle * > &secondaries)
 Transport the particle.
 
virtual void print (std::ostream &file, int l) const
 
virtual gparticlecopy () const
 
- Public Member Functions inherited from Heed::RegPassivePtr
 RegPassivePtr (void)
 
 RegPassivePtr (char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0)
 
 RegPassivePtr (const RegPassivePtr &f)
 
RegPassivePtroperator= (const RegPassivePtr &f)
 
CountPP_ns::CountPassivePtrbook (void) const
 
void clear_pointers (void) const
 
virtual RegPassivePtrcopy () const
 
virtual ~RegPassivePtr ()
 
virtual void print (std::ostream &file, int l=1) const
 
void set_s_ban_del (char fs_ban_del)
 
char get_s_ban_del (void) const
 
void set_s_ban_sub (char fs_ban_sub)
 
char get_s_ban_sub (void) const
 
void set_s_ban_cop (char fs_ban_cop)
 
char get_s_ban_cop (void) const
 
void set_s_allow_del_at_zero_count (char fs_allow_del_at_zero_count)
 
char get_s_allow_del_at_zero_count (void) const
 
long get_total_number_of_references (void) const
 
- Public Member Functions inherited from Heed::particle_type
 particle_type ()
 
 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

std::vector< HeedCondElectronconduction_electrons
 
std::vector< HeedCondElectronconduction_ions
 
long parent_particle_number
 
- 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 Heed::gparticle
bool s_life
 
long nstep
 Step number.
 
double total_range_from_origin
 Range from origin to currpos.
 
long n_zero_step
 Number of previous steps with zero range (including this 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 Member Functions inherited from Heed::RegPassivePtr
static void set_s_ban_del_ignore (char fs_ban_del_ignore)
 
static char get_s_ban_del_ignore (void)
 
static void set_s_print_adr_cpp (char fs_print_adr_cpp)
 
static char get_s_print_adr_cpp (void)
 
- Static Public Attributes inherited from Heed::gparticle
static long max_q_zero_step = 100
 
- Protected Attributes inherited from Heed::eparticle
HeedFieldMapm_fieldMap
 

Detailed Description

Definition of delta-electron which can be traced through the geometry. 2003, I. Smirnov

Definition at line 15 of file HeedDeltaElectron.h.

Constructor & Destructor Documentation

◆ HeedDeltaElectron() [1/2]

Heed::HeedDeltaElectron::HeedDeltaElectron ( )
inline

Default constructor.

Definition at line 18 of file HeedDeltaElectron.h.

18: eparticle(), s_print_listing(false) {}
eparticle()
Default constructor.
Definition: eparticle.h:18

Referenced by copy().

◆ HeedDeltaElectron() [2/2]

Heed::HeedDeltaElectron::HeedDeltaElectron ( manip_absvol primvol,
const point pt,
const vec vel,
vfloat  time,
long  fparent_particle_number,
HeedFieldMap fieldmap,
bool  fs_print_listing = false 
)

Constructor.

Definition at line 36 of file HeedDeltaElectron.cpp.

41 : eparticle(primvol, pt, vel, time, &electron_def, fieldmap),
42 parent_particle_number(fparent_particle_number),
43 particle_number(last_particle_number++),
44 s_print_listing(fs_print_listing),
45 phys_mrange(0.0),
46 s_stop_eloss(false),
47 s_mult_low_path_length(false),
48 q_low_path_length(0.0),
49 s_path_length(false),
50 necessary_energy(0.0),
51 total_Eloss(0.) {
52 mfunname("HeedDeltaElectron::HeedDeltaElectron(...)");
53}
#define mfunname(string)
Definition: FunNameStack.h:45
long last_particle_number
Definition: HeedParticle.h:9
particle_def electron_def("electron", "e-", electron_mass_c2/c_squared, electron_charge, 1, 0, 0.5, spin_def(0.0, 0.0))
Definition: particle_def.h:110

◆ ~HeedDeltaElectron()

virtual Heed::HeedDeltaElectron::~HeedDeltaElectron ( )
inlinevirtual

Destructor.

Definition at line 24 of file HeedDeltaElectron.h.

24{}

Member Function Documentation

◆ copy()

virtual HeedDeltaElectron * Heed::HeedDeltaElectron::copy ( ) const
inlinevirtual

Reimplemented from Heed::eparticle.

Definition at line 33 of file HeedDeltaElectron.h.

33 {
34 return new HeedDeltaElectron(*this);
35 }
HeedDeltaElectron()
Default constructor.

◆ physics_after_new_speed()

void Heed::HeedDeltaElectron::physics_after_new_speed ( std::vector< gparticle * > &  secondaries)
virtual

Reimplemented from Heed::gparticle.

Definition at line 153 of file HeedDeltaElectron.cpp.

154 {
155 mfunname("void HeedDeltaElectron::physics_after_new_speed()");
156 if (s_print_listing) {
157 mcout << "HeedDeltaElectron::physics_after_new_speed is started\n";
159 }
161 if (currpos.prange <= 0.0) {
162 if (curr_kin_energy == 0.0) {
163 // Get local volume.
164 absvol* av = currpos.tid.G_lavol();
165 if (av && av->s_sensitive && m_fieldMap->inside(currpos.ptloc)) {
166 if (s_print_listing) {
167 mcout << "HeedDeltaElectron::physics_after_new_speed: \n";
168 mcout << "This is converted to conduction\n";
169 }
170 // TODO: replace push_back by emplace_back.
171 conduction_electrons.push_back(
172 HeedCondElectron(currpos.ptloc, currpos.time));
173 }
174 s_life = false;
175 }
176 if (s_print_listing) mcout << "exit due to currpos.prange <= 0.0\n";
177 return;
178 }
179 if (s_print_listing) mcout << "physics_after_new_speed: started" << std::endl;
180 // Get local volume and convert it to a cross-section object.
181 const absvol* av = currpos.tid.G_lavol();
182 const HeedDeltaElectronCS* hdecs =
183 dynamic_cast<const HeedDeltaElectronCS*>(av);
184 if (!hdecs) return;
185 double ek = curr_kin_energy / MeV;
186 if (s_print_listing) {
187 Iprintnf(mcout, ek);
188 Iprint3n(mcout, s_stop_eloss, phys_mrange, currpos.prange);
189 }
190 // Calculate dE/dx and energy loss. Update the kinetic energy.
191 double dedx;
192 double Eloss = 0.;
193 if (s_stop_eloss && phys_mrange == currpos.prange) {
194 Eloss = curr_kin_energy;
195 curr_kin_energy = 0.0;
196 dedx = Eloss / currpos.prange / (MeV / cm);
197 } else {
198 EnergyMesh* emesh = hdecs->hmd->energy_mesh.get();
199 const long n1 = findInterval(emesh, ek);
200 if (s_print_listing) Iprintn(mcout, n1);
201 const double e1 = emesh->get_ec(n1);
202 const double e2 = emesh->get_ec(n1 + 1);
203 const double y1 = hdecs->eLoss[n1];
204 const double y2 = hdecs->eLoss[n1 + 1];
205 dedx = y1 + (y2 - y1) / (e2 - e1) * (ek - e1);
206 Eloss = (dedx * MeV / cm) * currpos.prange;
207 total_Eloss += Eloss;
208 curr_kin_energy -= Eloss;
209 }
210 if (s_print_listing)
211 Iprint3nf(mcout, prev_kin_energy / eV, curr_kin_energy / eV, Eloss / eV);
212 if (curr_kin_energy <= 0.0) {
213 if (s_print_listing) mcout << "curr_kin_energy <= 0.0\n";
214 curr_kin_energy = 0.0;
215 curr_gamma_1 = 0.0;
216 currpos.speed = 0.0;
217 s_life = false;
218 } else {
219 const double resten = mass * c_squared;
220 curr_gamma_1 = curr_kin_energy / resten;
221 currpos.speed = c_light * lorbeta(curr_gamma_1);
222 }
223 absvol* vav = currpos.tid.G_lavol();
224 if (vav && vav->s_sensitive) {
225 if (s_print_listing) {
226 mcout << "volume is sensitive\n";
227 Iprint2nf(mcout, Eloss / eV, necessary_energy / eV);
228 }
229 if (Eloss > 0.0) ionisation(Eloss, dedx, hdecs->pairprod.get());
230 }
231 if (s_print_listing) {
232 mcout << '\n';
234 }
235 if (!s_life) {
236 // Done tracing the delta electron. Create the last conduction electron.
237 vav = currpos.tid.G_lavol();
238 if (vav && vav->s_sensitive && m_fieldMap->inside(currpos.ptloc)) {
239 if (s_print_listing) mcout << "Last conduction electron\n";
240 conduction_electrons.push_back(
241 HeedCondElectron(currpos.ptloc, currpos.time));
242 }
243 return;
244 }
245
246 if (s_print_listing) mcout << "\nstart to rotate by low angle\n";
247 double ek_restr = std::max(ek, 0.0005);
248 if (s_print_listing) Iprint2nf(mcout, currpos.prange, phys_mrange);
249 if (currpos.prange < phys_mrange) {
250 // recalculate scatterings
251 s_path_length = false;
252 if (s_low_mult_scattering) {
253 EnergyMesh* emesh = hdecs->hmd->energy_mesh.get();
254 const long n1r = findInterval(emesh, ek_restr);
255 const double e1 = emesh->get_ec(n1r);
256 const double e2 = emesh->get_ec(n1r + 1);
257 const double y1 = hdecs->low_lambda[n1r];
258 const double y2 = hdecs->low_lambda[n1r + 1];
259 // Path length in internal units.
260 double low_path_length =
261 (y1 + (y2 - y1) / (e2 - e1) * (ek_restr - e1)) * cm;
262 if (s_print_listing) Iprintnf(mcout, low_path_length / cm);
263 s_mult_low_path_length = false;
264 q_low_path_length = currpos.prange / low_path_length;
265 if (s_print_listing) Iprintnf(mcout, q_low_path_length);
266 }
267 }
268 if (s_print_listing) Iprintnf(mcout, q_low_path_length);
269#ifdef RANDOM_POIS
270 if (q_low_path_length > 0.0) {
271 int ierror = 0;
272 long random_q_low_path_length = pois(q_low_path_length, ierror);
273 check_econd11a(ierror, == 1,
274 " q_low_path_length=" << q_low_path_length << '\n', mcerr);
275 q_low_path_length = long(random_q_low_path_length);
276 if (s_print_listing) {
277 mcout << "After pois:\n";
278 Iprintnf(mcout, q_low_path_length);
279 }
280 }
281#endif
282 if (q_low_path_length > 0) {
283#ifdef DIRECT_LOW_IF_LITTLE
284 const long max_q_low_path_length_for_direct = 5;
285 if (q_low_path_length < max_q_low_path_length_for_direct) {
286 // direct modeling
287 if (s_print_listing) {
288 mcout << "direct modeling of low scatterings\n";
290 }
291 EnergyMesh* emesh = hdecs->hmd->energy_mesh.get();
292 const long n1r = findInterval(emesh, ek_restr);
293 for (long nscat = 0; nscat < q_low_path_length; ++nscat) {
294 if (s_print_listing) Iprintn(mcout, nscat);
295 double theta_rot =
296 hdecs->low_angular_points_ran[n1r].ran(SRANLUX()) * degree;
297 if (s_print_listing) Iprintnf(mcout, theta_rot);
298 vec dir = currpos.dir;
299 basis temp(dir, "temp");
300 vec vturn;
301 vturn.random_round_vec();
302 vturn = vturn * sin(theta_rot);
303 vec new_dir(vturn.x, vturn.y, cos(theta_rot));
304 new_dir.down(&temp);
305 currpos.dir = new_dir;
306 if (s_print_listing) Iprint(mcout, new_dir);
307 }
310 } else {
311#endif
312 double sigma_ctheta = hdecs->get_sigma(ek_restr, q_low_path_length);
313 // actually it is mean(1-cos(theta)) or
314 // sqrt( mean( square(1-cos(theta) ) ) ) depending on USE_MEAN_COEF
315
316 if (s_print_listing) Iprintnf(mcout, sigma_ctheta);
317 // Gauss (but actually exponential distribution fits better).
318 // double ctheta = 1.0 - fabs(rnorm_improved() * sigma_ctheta);
319 // Exponential:
320 double ctheta = 0.0;
321 {
322#ifdef USE_MEAN_COEF
323#else
324 double sq2 = sqrt(2.0);
325#endif
326 do {
327 double y = 0.0;
328 do { // in order to avoid SRANLUX() = 1
329 y = SRANLUX();
330 if (s_print_listing) Iprintnf(mcout, y);
331 } while (y == 1.0);
332#ifdef USE_MEAN_COEF
333 double x = sigma_ctheta * (-log(1.0 - y));
334#else
335 double x = sigma_ctheta * 1.0 / sq2 * (-log(1.0 - y));
336#endif
337 ctheta = 1.0 - x;
338 if (s_print_listing) Iprint2nf(mcout, x, ctheta);
339 } while (ctheta <= -1.0); // avoid absurd cos(theta)
340 check_econd21(ctheta, < -1.0 ||, > 1.0, mcerr);
341 }
342 if (s_print_listing) Iprintnf(mcout, ctheta);
343 double theta_rot = acos(ctheta);
344 if (s_print_listing) Iprint2nf(mcout, theta_rot, theta_rot / degree);
345 vec dir = currpos.dir;
346 basis temp(dir, "temp");
347 vec vturn;
348 vturn.random_round_vec();
349 vturn = vturn * sin(theta_rot);
350 vec new_dir(vturn.x, vturn.y, cos(theta_rot));
351 new_dir.down(&temp);
352 currpos.dir = new_dir;
355 }
356#ifdef DIRECT_LOW_IF_LITTLE
357 }
358#endif
359 if (s_path_length) {
360 if (s_print_listing) {
361 mcout << "\nstarting to rotate by large angle" << std::endl;
362 Iprintnf(mcout, s_path_length);
363 }
364 EnergyMesh* emesh = hdecs->hmd->energy_mesh.get();
365 const long n1r = findInterval(emesh, ek_restr);
366 double theta_rot = hdecs->angular_points_ran[n1r].ran(SRANLUX()) * degree;
367 if (s_print_listing) Iprintnf(mcout, theta_rot);
368 vec dir = currpos.dir;
369 basis temp(dir, "temp");
370 vec vturn;
371 vturn.random_round_vec();
372 vturn = vturn * sin(theta_rot);
373 vec new_dir(vturn.x, vturn.y, cos(theta_rot));
374 new_dir.down(&temp);
375 currpos.dir = new_dir;
378 }
379 if (s_print_listing) Iprint2nf(mcout, currpos.dir, currpos.dirloc);
380}
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
Definition: FunNameStack.h:191
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define check_econd11a(a, signb, add, stream)
Definition: FunNameStack.h:172
std::vector< HeedCondElectron > conduction_electrons
bool inside(const point &pt)
HeedFieldMap * m_fieldMap
Definition: eparticle.h:33
stvpoint currpos
Definition: gparticle.h:177
void up_absref(absref *f)
Definition: volume.cpp:26
absvol * G_lavol() const
Get last address of volume.
Definition: volume.cpp:17
double prev_kin_energy
Definition: mparticle.h:30
double curr_kin_energy
Definition: mparticle.h:32
double mass
Mass (not mass * speed_of_light^2)
Definition: mparticle.h:26
double curr_gamma_1
Definition: mparticle.h:33
vfloat time
Definition: gparticle.h:47
vec dirloc
Unit vector, in the local system (last system in the tree).
Definition: gparticle.h:29
vec dir
Unit vector, in the first system in the tree.
Definition: gparticle.h:25
vfloat prange
Range from previous point.
Definition: gparticle.h:46
vfloat speed
Longitudinal velocity.
Definition: gparticle.h:31
manip_absvol_treeid tid
Definition: gparticle.h:32
point ptloc
Coordinates in the local system (last system in the tree).
Definition: gparticle.h:27
DoubleAc cos(const DoubleAc &f)
Definition: DoubleAc.cpp:432
double lorbeta(const double gamma_1)
as function of .
Definition: lorgamma.cpp:23
long pois(const double amu, int &ierror)
Definition: pois.cpp:9
int vecerror
Definition: vec.cpp:29
DoubleAc acos(const DoubleAc &f)
Definition: DoubleAc.cpp:490
DoubleAc sin(const DoubleAc &f)
Definition: DoubleAc.cpp:384
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314
#define Iprint3nf(file, name1, name2, name3)
Definition: prstream.h:237
#define mcout
Definition: prstream.h:126
#define Iprint3n(file, name1, name2, name3)
Definition: prstream.h:233
#define Iprint(file, name)
Definition: prstream.h:198
#define mcerr
Definition: prstream.h:128
#define Iprintn(file, name)
Definition: prstream.h:205
#define Iprint2nf(file, name1, name2)
Definition: prstream.h:223
#define Iprint2n(file, name1, name2)
Definition: prstream.h:220
#define Iprintnf(file, name)
Definition: prstream.h:207

◆ physics_mrange()

void Heed::HeedDeltaElectron::physics_mrange ( double &  fmrange)
virtual

Reimplemented from Heed::gparticle.

Definition at line 55 of file HeedDeltaElectron.cpp.

55 {
56 mfunname("void HeedDeltaElectron::physics_mrange(double& fmrange)");
57 if (s_print_listing) mcout << "void HeedDeltaElectron::physics_mrange\n";
58
59 s_mult_low_path_length = false;
60 q_low_path_length = 0.0;
61 s_path_length = false;
62 if (fmrange <= 0.0) return;
63 if (curr_kin_energy == 0.0) {
64 fmrange = 0.0;
65 return;
66 }
67 // Get local volume and convert it to a cross-section object.
68 const absvol* av = currpos.tid.G_lavol();
69 const HeedDeltaElectronCS* hdecs =
70 dynamic_cast<const HeedDeltaElectronCS*>(av);
71 if (!hdecs) return;
72 if (s_print_listing) Iprintnf(mcout, fmrange);
73 const double ek = curr_kin_energy / MeV;
74 EnergyMesh* emesh = hdecs->hmd->energy_mesh.get();
75 const long n1 = findInterval(emesh, ek);
76 const double e1 = emesh->get_ec(n1);
77 const double e2 = emesh->get_ec(n1 + 1);
78 const double loss1 = hdecs->eLoss[n1];
79 const double loss2 = hdecs->eLoss[n1 + 1];
80 double dedx = loss1 + (loss2 - loss1) / (e2 - e1) * (ek - e1);
81 // Min. loss 50 eV.
82 double eloss = std::max(0.1 * ek, 0.00005);
83 if (eloss > ek) {
84 eloss = ek;
85 s_stop_eloss = true;
86 } else {
87 s_stop_eloss = false;
88 }
89 fmrange = std::min(fmrange, (eloss / dedx) * cm);
90 if (s_print_listing) Iprint2nf(mcout, fmrange, ek);
91 const double ek_restr = std::max(ek, 0.0005);
92 if (s_print_listing) Iprintnf(mcout, ek_restr / keV);
93
94 const long n1r = findInterval(emesh, ek_restr);
95 double low_path_length = 0.; // in internal units
96 if (s_low_mult_scattering) {
97 const double e1r = emesh->get_ec(n1r);
98 const double e2r = emesh->get_ec(n1r + 1);
99 const double y1 = hdecs->low_lambda[n1r];
100 const double y2 = hdecs->low_lambda[n1r + 1];
101 low_path_length = (y1 + (y2 - y1) / (e2r - e1r) * (ek_restr - e1r)) * cm;
102 if (s_print_listing) Iprintnf(mcout, low_path_length / cm);
103 long qscat = hdecs->eesls->get_qscat();
104 const double sigma_ctheta = hdecs->get_sigma(ek_restr, qscat);
105 // Reduce the number of scatterings, if the angle is too large.
106 if (sigma_ctheta > 0.3) qscat = long(qscat * 0.3 / sigma_ctheta);
107 double mult_low_path_length = qscat * low_path_length;
108 if (s_print_listing) Iprintnf(mcout, mult_low_path_length);
109 if (fmrange > mult_low_path_length) {
110 fmrange = mult_low_path_length;
111 s_mult_low_path_length = true;
112 q_low_path_length = hdecs->eesls->get_qscat();
113 s_stop_eloss = false;
114 } else {
115 s_mult_low_path_length = false;
116 q_low_path_length = fmrange / low_path_length;
117 }
118 if (s_print_listing) Iprint2nf(mcout, fmrange, q_low_path_length);
119 }
120
121 if (s_high_mult_scattering) {
122 const double e1r = emesh->get_ec(n1r);
123 const double e2r = emesh->get_ec(n1r + 1);
124 if (s_print_listing) {
126 Iprintnf(mcout, n1r);
127 Iprintnf(mcout, ek_restr);
128 Iprint2nf(mcout, e1r, e2r);
129 }
130 const double y1 = hdecs->lambda[n1r];
131 const double y2 = hdecs->lambda[n1r + 1];
132 const double mean_path = y1 + (y2 - y1) / (e2r - e1r) * (ek_restr - e1r);
133 if (s_print_listing) Iprintnf(mcout, mean_path);
134 const double path_length = -mean_path * cm * log(1.0 - SRANLUX());
135 if (s_print_listing) Iprintnf(mcout, path_length);
136 if (fmrange > path_length) {
137 fmrange = path_length;
138 s_path_length = true;
139 s_mult_low_path_length = true;
140 if (s_low_mult_scattering) {
141 q_low_path_length = fmrange / low_path_length;
142 if (s_print_listing) Iprintnf(mcout, q_low_path_length);
143 }
144 s_stop_eloss = false;
145 } else {
146 s_path_length = false;
147 }
148 if (s_print_listing) Iprintnf(mcout, fmrange);
149 }
150 phys_mrange = fmrange;
151}
point pt
Coordinates in the first system in the tree.
Definition: gparticle.h:23
#define Iprintf(file, name)
Definition: prstream.h:200

◆ print()

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

Reimplemented from Heed::eparticle.

Definition at line 434 of file HeedDeltaElectron.cpp.

434 {
435 if (l < 0) return;
436 Ifile << "HeedDeltaElectron (l=" << l
437 << "): particle_number=" << particle_number << "\n";
438 if (l == 1) return;
439 indn.n += 2;
440 Ifile << "s_low_mult_scattering=" << s_low_mult_scattering
441 << " s_high_mult_scattering=" << s_high_mult_scattering << '\n';
442 Ifile << "phys_mrange=" << phys_mrange << " s_stop_eloss=" << s_stop_eloss
443 << " s_mult_low_path_length=" << s_mult_low_path_length << '\n';
444 Ifile << "q_low_path_length=" << q_low_path_length
445 << " s_path_length=" << s_path_length
446 << " necessary_energy/eV=" << necessary_energy / eV << '\n';
447 Ifile << " parent_particle_number=" << parent_particle_number << '\n';
448
449 mparticle::print(file, l - 1);
450 indn.n -= 2;
451}
virtual void print(std::ostream &file, int l) const
Definition: mparticle.cpp:242
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:196

Member Data Documentation

◆ conduction_electrons

◆ conduction_ions

std::vector<HeedCondElectron> Heed::HeedDeltaElectron::conduction_ions

◆ parent_particle_number

long Heed::HeedDeltaElectron::parent_particle_number

Definition at line 29 of file HeedDeltaElectron.h.

Referenced by print().


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