Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
eparticle.cpp
Go to the documentation of this file.
2
3// 1998 - 2004, I. Smirnov
4
5namespace Heed {
6
7eparticle::eparticle(manip_absvol* primvol, const point& pt, const vec& vel,
8 vfloat ftime, particle_def* fpardef, HeedFieldMap* fieldmap)
9 : mparticle(primvol, pt, vel, ftime, fpardef->mass),
10 particle_type(fpardef), m_fieldMap(fieldmap) {
11}
12
13int eparticle::force(const point& pt, vec& f, vec& f_perp, vfloat& mrange) {
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}
25
26void eparticle::print(std::ostream& file, int l) const {
27 if (l < 0) return;
28 Ifile << "eparticle: particle is ";
29 print_notation(file);
30 file << '\n';
31 mparticle::print(file, l);
32}
33}
Retrieve electric and magnetic field from Sensor.
Definition: HeedFieldMap.h:15
void field_map(const point &pt, vec &efield, vec &bfield, vfloat &mrange) const
void print(std::ostream &file, int l) const override
Print-out.
Definition: eparticle.cpp:26
eparticle()=default
Default constructor.
HeedFieldMap * m_fieldMap
Pointer to field map.
Definition: eparticle.h:34
int force(const point &pt, vec &f, vec &f_perp, vfloat &mrange) override
Calculate force components.
Definition: eparticle.cpp:13
Abstract base classs for volume "manipulators".
Definition: volume.h:128
Massive particle. A force can be applied.
Definition: mparticle.h:23
void print(std::ostream &file, int l) const override
Print-out.
Definition: mparticle.cpp:243
void print_notation(std::ostream &file) const
particle_def * pardef
Definition: particle_def.h:137
Point.
Definition: vec.h:366
Definition: vec.h:177
Definition: BGMesh.cpp:6
double vfloat
Definition: vfloat.h:16
#define Ifile
Definition: prstream.h:196