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

#include <trajestep.h>

+ Inheritance diagram for Heed::trajestep:

Public Member Functions

void Gnextpoint (vfloat frange, point &fpos, vec &fdir) const
 
void Gnextpoint1 (vfloat frange, point &fpos, vec &fdir, vec &frelcen) const
 
 trajestep (trajestep_limit *ftl, const point &fcurrpos, const vec &fdir, int fs_cf, const vec &frelcen, vfloat fmrange, vfloat prec)
 
 trajestep (const trajestep &fts, vfloat fmrange)
 
 trajestep ()
 Default constructor.
 
virtual ~trajestep ()
 Destructor.
 
- Public Member Functions inherited from Heed::absref
virtual ~absref ()
 Destructor.
 
virtual void down (const abssyscoor *fasc)
 Convert numbering representation of object to basical system of fasc.
 
virtual void up (const abssyscoor *fasc)
 Convert numbering representation of objects to new system.
 
virtual void turn (const vec &dir, vfloat angle)
 Turn around axis doing via center of coordinate system along dir.
 
virtual void shift (const vec &dir)
 

Public Attributes

PassivePtr< trajestep_limittl
 
point currpos
 
vec dir
 Unit vector.
 
int s_cf
 
vec relcen
 
int s_range_cf
 
int s_prec
 
vfloat mrange
 Maximal possible range.
 
point mpoint
 

Protected Member Functions

virtual void get_components (ActivePtr< absref_transmit > &aref_tran)
 

Static Protected Attributes

static absrefabsref::*[4] aref
 

Detailed Description

Trajectory step of any object (particle, photon, ...). Here we interested in geometrical parameters only. The time, speed, acceleration, mass, and forces are not interesting here. The object can move by straight line or by curved line. The real trajectory is approximated by little steps. Each step can be straight or with constant curvature (circumference). If the path is always straight (for example for light or neutral particles), the step length is limited by extra conditions, typically edge of a volume. If the path is curved, the step length is limited first by length at which the curvature is changed, then by precision of approximation of the real shape of curvature.

Definition at line 65 of file trajestep.h.

Constructor & Destructor Documentation

◆ trajestep() [1/3]

Heed::trajestep::trajestep ( trajestep_limit ftl,
const point fcurrpos,
const vec fdir,
int  fs_cf,
const vec frelcen,
vfloat  fmrange,
vfloat  prec 
)

Constructor. Here prec is used to check if frelcen is perp. to dir. If it is not perpendicular with this precision, the function terminates the program. To reduce range fmrange may be used.

Definition at line 38 of file trajestep.cpp.

41 : tl(ftl),
42 currpos(fcurrpos),
43 dir(),
44 s_cf(fs_cf),
45 relcen(frelcen),
46 s_prec(1),
47 mrange(fmrange) {
48 pvecerror("trajestep::trajestep(...)");
49 if (fdir == dv0) {
50 dir = dv0;
51 mrange = 0;
52 } else {
53 dir = unit_vec(fdir);
54 if (s_cf == 1) {
55 check_econd11a(check_perp(dir, relcen, prec), != 1,
56 "dir=" << dir << "relcen=" << relcen
57 << "fcurrpos=" << fcurrpos << "fdir=" << fdir,
58 mcerr);
59 }
60 tl->range(s_cf, relcen.length(), s_range_cf, mrange);
61 }
62}
#define check_econd11a(a, signb, add, stream)
Definition: FunNameStack.h:172
PassivePtr< trajestep_limit > tl
Definition: trajestep.h:67
vfloat mrange
Maximal possible range.
Definition: trajestep.h:90
vec dir
Unit vector.
Definition: trajestep.h:70
vfloat length() const
Definition: vec.h:205
vec dv0(0, 0, 0)
Definition: vec.h:314
#define mcerr
Definition: prstream.h:128
#define pvecerror(string)
Definition: vec.h:29

◆ trajestep() [2/3]

Heed::trajestep::trajestep ( const trajestep fts,
vfloat  fmrange 
)

Constructor to continue propagation from the end point of another step.

Parameters
ftsold step to continue
fmrangenew range to travel

Definition at line 64 of file trajestep.cpp.

64 {
65 mfunname("trajestep::trajestep(const trajestep& fts, vfloat fmrange)");
66 // Continue propagation from the end point of the old step.
67 point fpos;
68 vec fdir;
69 vec frelcen;
70 fts.Gnextpoint1(fts.mrange, fpos, fdir, frelcen);
71 vfloat prec = 0.1; // not important here
72 *this =
73 trajestep(fts.tl.getver(), fpos, fdir, fts.s_cf, frelcen, fmrange, prec);
74}
#define mfunname(string)
Definition: FunNameStack.h:45
trajestep()
Default constructor.
Definition: trajestep.h:113
double vfloat
Definition: vfloat.h:16

◆ trajestep() [3/3]

Heed::trajestep::trajestep ( )
inline

Default constructor.

Definition at line 113 of file trajestep.h.

113 :
114 tl(),
115 currpos(),
116 dir(),
117 s_cf(0),
118 relcen(),
119 s_range_cf(0),
120 s_prec(0),
121 mrange(0),
122 mpoint() {}

Referenced by trajestep().

◆ ~trajestep()

virtual Heed::trajestep::~trajestep ( )
inlinevirtual

Destructor.

Definition at line 124 of file trajestep.h.

124{}

Member Function Documentation

◆ get_components()

void Heed::trajestep::get_components ( ActivePtr< absref_transmit > &  aref_tran)
protectedvirtual

Reimplemented from Heed::absref.

Definition at line 34 of file trajestep.cpp.

34 {
35 aref_tran.pass(new absref_transmit(4, aref));
36}
static absrefabsref::*[4] aref
Definition: trajestep.h:128

◆ Gnextpoint()

void Heed::trajestep::Gnextpoint ( vfloat  frange,
point fpos,
vec fdir 
) const

Definition at line 76 of file trajestep.cpp.

76 {
77 pvecerror("int trajestep::Gnextpoint(vfloat frange, point& fpos, vec& fdir)");
78 check_econd12(frange, >, mrange, mcerr);
79 if (s_range_cf == 0) {
80 // interpolation by straight line
81 fpos = currpos + frange * dir;
82 if (s_cf == 0) {
83 // no curvature
84 fdir = dir;
85 return;
86 } else {
87 vfloat ang = frange / relcen.length();
88 fdir = dir;
89 fdir.turn(dir || relcen, ang);
90 return;
91 }
92 } else {
93 vfloat ang = frange / relcen.length(); // angle to turn
94 fdir = dir;
95 fdir.turn(dir || relcen, ang); // direction at the end
96 vec frelcen = relcen;
97 frelcen.turn(dir || relcen, ang);
98 fpos = currpos + relcen - frelcen;
99 return;
100 }
101}
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:163
void turn(const vec &dir, vfloat angle)
Turn this vector.
Definition: vec.cpp:216

Referenced by Heed::stvpoint::stvpoint().

◆ Gnextpoint1()

void Heed::trajestep::Gnextpoint1 ( vfloat  frange,
point fpos,
vec fdir,
vec frelcen 
) const

Definition at line 103 of file trajestep.cpp.

104 {
105 pvecerror(
106 "int trajestep::Gnextpoint(vfloat frange, point& fpos, vec& fdir, "
107 "vec& frelcen)");
108 check_econd12(frange, >, mrange, mcerr);
109 if (s_range_cf == 0) {
110 // interpolation by straight line
111 fpos = currpos + frange * dir;
112 if (s_cf == 0) {
113 // no curvature
114 fdir = dir;
115 frelcen = relcen; // whatever it is
116 return;
117 } else {
118 vfloat ang = frange / relcen.length();
119 fdir = dir;
120 fdir.turn(dir || relcen, ang);
121 frelcen = relcen;
122 frelcen.turn(dir || relcen, ang);
123 return;
124 }
125 } else {
126 vfloat ang = frange / relcen.length(); // angle to turn
127 fdir = dir;
128 fdir.turn(dir || relcen, ang); // direction at the end
129 frelcen = relcen;
130 frelcen.turn(dir || relcen, ang);
131 fpos = currpos + relcen - frelcen;
132 return;
133 }
134}

Referenced by trajestep().

Member Data Documentation

◆ aref

absref absref::* Heed::trajestep::aref
staticprotected
Initial value:
= {(absref absref::*)&trajestep::currpos,
(absref absref::*)&trajestep::dir,
(absref absref::*)&trajestep::relcen,
(absref absref::*)&trajestep::mpoint}

Definition at line 128 of file trajestep.h.

Referenced by get_components().

◆ currpos

◆ dir

vec Heed::trajestep::dir

◆ mpoint

point Heed::trajestep::mpoint

◆ mrange

◆ relcen

vec Heed::trajestep::relcen

Definition at line 80 of file trajestep.h.

Referenced by Gnextpoint(), Gnextpoint1(), Heed::operator<<(), Heed::splane::range(), and trajestep().

◆ s_cf

int Heed::trajestep::s_cf

Type of trajectory. 0 - the track is straight, 1 - curved track (but the range may anyway be calculated as straight line, depending on s_range_cf)

Definition at line 75 of file trajestep.h.

Referenced by Gnextpoint(), Gnextpoint1(), Heed::operator<<(), and trajestep().

◆ s_prec

int Heed::trajestep::s_prec

◆ s_range_cf

int Heed::trajestep::s_range_cf

Definition at line 84 of file trajestep.h.

Referenced by Gnextpoint(), Gnextpoint1(), Heed::operator<<(), Heed::splane::range(), and trajestep().

◆ tl

PassivePtr<trajestep_limit> Heed::trajestep::tl

Definition at line 67 of file trajestep.h.

Referenced by trajestep().


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