Garfield++ v2r0
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 time, particle_def* fpardef, HeedFieldMap* fieldmap)
9 : mparticle(primvol, pt, vel, time, 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
virtual void print(std::ostream &file, int l) const
Definition: eparticle.cpp:26
eparticle()
Default constructor.
Definition: eparticle.h:18
HeedFieldMap * m_fieldMap
Definition: eparticle.h:33
virtual int force(const point &pt, vec &f, vec &f_perp, vfloat &mrange)
Calculate force components.
Definition: eparticle.cpp:13
Abstract base classs for volume "manipulators".
Definition: volume.h:178
Massive particle. A force can be applied.
Definition: mparticle.h:23
virtual void print(std::ostream &file, int l) const
Definition: mparticle.cpp:242
void print_notation(std::ostream &file) const
PassivePtr< particle_def > pardef
Definition: particle_def.h:148
Point.
Definition: vec.h:374
Definition: vec.h:186
Definition: BGMesh.cpp:5
double vfloat
Definition: vfloat.h:16
#define Ifile
Definition: prstream.h:196