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

#include <trajestep.h>

+ Inheritance diagram for 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 mrange)
 
 trajestep (void)
 
virtual ~trajestep ()
 
- Public Member Functions inherited from absref
virtual ~absref ()
 
virtual void down (const abssyscoor *fasc)
 
virtual void up (const abssyscoor *fasc)
 
virtual void turn (const vec &dir, vfloat angle)
 
virtual void shift (const vec &dir)
 

Public Attributes

PassivePtr< trajestep_limittl
 
point currpos
 
vec dir
 
int s_cf
 
vec relcen
 
int s_range_cf
 
int s_prec
 
vfloat mrange
 
point mpoint
 

Protected Member Functions

virtual void get_components (ActivePtr< absref_transmit > &aref_tran)
 

Static Protected Attributes

static absrefabsref::*[4] aref
 

Detailed Description

Definition at line 71 of file trajestep.h.

Constructor & Destructor Documentation

◆ trajestep() [1/3]

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

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, length(relcen), s_range_cf, mrange);
61 }
62}
#define check_econd11a(a, signb, add, stream)
Definition: FunNameStack.h:395
int s_range_cf
Definition: trajestep.h:88
vec dir
Definition: trajestep.h:75
point currpos
Definition: trajestep.h:74
PassivePtr< trajestep_limit > tl
Definition: trajestep.h:73
vfloat mrange
Definition: trajestep.h:91
int s_cf
Definition: trajestep.h:76
vec relcen
Definition: trajestep.h:80
int s_prec
Definition: trajestep.h:90
#define mcerr
Definition: prstream.h:135
vec dv0(0, 0, 0)
#define pvecerror(string)
Definition: vec.h:52

◆ trajestep() [2/3]

trajestep::trajestep ( const trajestep fts,
vfloat  mrange 
)

Definition at line 64 of file trajestep.cpp.

67 {
68 mfunname("trajestep::trajestep(const trajestep& fts, vfloat mrange)");
69 point fpos;
70 vec fdir;
71 vec frelcen;
72 fts.Gnextpoint1(fts.mrange, fpos, fdir, frelcen);
73 vfloat prec = 0.1; // not important here
74 *this =
75 trajestep(fts.tl.getver(), fpos, fdir, fts.s_cf, frelcen, mrange, prec);
76}
#define mfunname(string)
Definition: FunNameStack.h:67
Definition: vec.h:477
trajestep(void)
Definition: trajestep.h:109
void Gnextpoint1(vfloat frange, point &fpos, vec &fdir, vec &frelcen) const
Definition: trajestep.cpp:105
Definition: vec.h:248
double vfloat
Definition: vfloat.h:15

◆ trajestep() [3/3]

trajestep::trajestep ( void  )
inline

Definition at line 109 of file trajestep.h.

110 : // temporary
111 tl(),
112 currpos(),
113 dir(),
114 s_cf(0),
115 relcen(),
116 s_range_cf(0),
117 s_prec(0),
118 mrange(0),
119 mpoint() {
120 ;
121 }
point mpoint
Definition: trajestep.h:92

Referenced by trajestep().

◆ ~trajestep()

virtual trajestep::~trajestep ( )
inlinevirtual

Definition at line 123 of file trajestep.h.

123{}

Member Function Documentation

◆ get_components()

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

Reimplemented from 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:130

◆ Gnextpoint()

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

Definition at line 78 of file trajestep.cpp.

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

Referenced by stvpoint::stvpoint().

◆ Gnextpoint1()

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

Definition at line 105 of file trajestep.cpp.

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

Referenced by trajestep().

Member Data Documentation

◆ aref

absref absref::* trajestep::aref
staticprotected
Initial value:

Definition at line 130 of file trajestep.h.

Referenced by get_components().

◆ currpos

◆ dir

vec trajestep::dir

◆ mpoint

point trajestep::mpoint

Definition at line 92 of file trajestep.h.

Referenced by operator<<(), Heed::ulsvolume::range_ext(), and stvpoint::stvpoint().

◆ mrange

◆ relcen

vec trajestep::relcen

Definition at line 80 of file trajestep.h.

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

◆ s_cf

int trajestep::s_cf

Definition at line 76 of file trajestep.h.

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

◆ s_prec

int trajestep::s_prec

◆ s_range_cf

int trajestep::s_range_cf

Definition at line 88 of file trajestep.h.

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

◆ tl

PassivePtr<trajestep_limit> trajestep::tl

Definition at line 73 of file trajestep.h.

Referenced by trajestep().


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