Garfield++
5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
trajestep.h
Go to the documentation of this file.
1
#ifndef TRAJESTEP_H
2
#define TRAJESTEP_H
3
#include "
wcpplib/geometry/vec.h
"
4
#include "
wcpplib/clhep_units/WPhysicalConstants.h
"
5
6
/*
7
Copyright (c) 2000 Igor B. Smirnov
8
9
The file can be used, copied, modified, and distributed
10
according to the terms of GNU Lesser General Public License version 2.1
11
as published by the Free Software Foundation,
12
and provided that the above copyright notice, this permission notice,
13
and notices about any modifications of the original text
14
appear in all copies and in supporting documentation.
15
The file is provided "as is" without express or implied warranty.
16
*/
17
18
namespace
Heed
{
19
20
/// Trajectory step of any object (particle, photon, ...).
21
/// Here we interested in geometrical parameters only.
22
/// The time, speed, acceleration, mass, and forces are not interesting here.
23
/// The object can move by straight line or by curved line.
24
/// The real trajectory is approximated by little steps.
25
/// Each step can be straight or with constant curvature (circumference).
26
/// If the path is always straight (for example for light or neutral particles),
27
/// the step length is limited by extra conditions, typically edge of a volume.
28
/// If the path is curved, the step length is limited first by length at
29
/// which the curvature is changed, then by precision of approximation
30
/// of the real shape of curvature.
31
32
class
trajestep
:
public
absref
{
33
public
:
34
/** Constructor.
35
* \param fmax_range maximum step length
36
* \param frad_for_straight radius beyond which to use straight-line steps.
37
* \param fmax_straight_arange angular step for straight-line approximation.
38
* \param fmax_circ_arange angular step for curved steps.
39
* \param fcurrpos initial coordinates.
40
* \param fdir initial direction.
41
* \param fcurved flag whether the trajectory is curved or straight.
42
* \param frelcen centre of rotation (only used for curved lines).
43
* \param fmrange can be used for reducing/limiting the step length.
44
* \param prec tolerance for checking if frelcen is perpendicular to dir.
45
*/
46
trajestep
(
const
vfloat
fmax_range,
const
vfloat
frad_for_straight,
47
const
vfloat
fmax_straight_arange,
const
vfloat
fmax_circ_arange,
48
const
point
& fcurrpos,
const
vec
& fdir,
const
bool
fcurved,
49
const
vec
& frelcen,
vfloat
fmrange,
vfloat
prec);
50
/** Constructor to continue propagation from the end point of another step.
51
* \param fts old step to continue
52
* \param fmrange new range to travel
53
*/
54
trajestep
(
const
trajestep
& fts,
vfloat
fmrange);
55
/// Default constructor.
56
trajestep
() =
default
;
57
/// Destructor
58
virtual
~trajestep
() {}
59
60
/// Move to the next point.
61
void
Gnextpoint
(
vfloat
frange,
point
& fpos,
vec
& fdir)
const
;
62
63
/// Max. step length.
64
vfloat
max_range
= 100. * CLHEP::cm;
65
// The three following parameters regulate the precision for curved lines.
66
/// Radius beyond which to prefer straight lines to reduce calculation time.
67
vfloat
rad_for_straight
= 1000. * CLHEP::cm;
68
/// Angular step for curved lines when using straight-line approximation.
69
vfloat
max_straight_arange
= 0.1 * CLHEP::rad;
70
/// Angular step for curved lines.
71
vfloat
max_circ_arange
= 0.2 * CLHEP::rad;
72
73
/// Current position.
74
point
currpos
;
75
/// Unit vector.
76
vec
dir
;
77
/// Type of trajectory (curved or straight).
78
bool
curved
=
false
;
79
80
/// Centre of rotation relative to currpos.
81
/// Used only for curved trajectories.
82
/// If used, should be perpendicular to dir.
83
vec
relcen
;
84
85
// 0 - range have been calculated via straight line
86
// 1 - via circle
87
int
s_range_cf
= 0;
88
89
// 1 - range is limited by precision
90
int
s_prec
= 0;
91
92
/// Maximal possible range
93
vfloat
mrange
= 0.;
94
95
// Finishing point
96
// It looks like that at s_prec=1 mpoint is not initiated
97
// At s_prec=0 the point is initiated
98
point
mpoint
;
99
100
protected
:
101
virtual
absref_transmit
get_components
()
override
;
102
static
absref
absref
::*
aref
[4];
103
104
private
:
105
void
Gnextpoint1(
vfloat
frange,
point
& fpos,
vec
& fdir,
vec
& frelcen)
const
;
106
};
107
std::ostream&
operator<<
(std::ostream& file,
const
trajestep
& f);
108
}
109
110
#endif
WPhysicalConstants.h
Heed::absref_transmit
Definition
vec.h:101
Heed::absref
Definition
vec.h:83
Heed::point
Point.
Definition
vec.h:368
Heed::trajestep
Definition
trajestep.h:32
Heed::trajestep::currpos
point currpos
Current position.
Definition
trajestep.h:74
Heed::trajestep::rad_for_straight
vfloat rad_for_straight
Radius beyond which to prefer straight lines to reduce calculation time.
Definition
trajestep.h:67
Heed::trajestep::mrange
vfloat mrange
Maximal possible range.
Definition
trajestep.h:93
Heed::trajestep::aref
static absref absref::* aref[4]
Definition
trajestep.h:102
Heed::trajestep::s_range_cf
int s_range_cf
Definition
trajestep.h:87
Heed::trajestep::trajestep
trajestep()=default
Default constructor.
Heed::trajestep::mpoint
point mpoint
Definition
trajestep.h:98
Heed::trajestep::max_straight_arange
vfloat max_straight_arange
Angular step for curved lines when using straight-line approximation.
Definition
trajestep.h:69
Heed::trajestep::curved
bool curved
Type of trajectory (curved or straight).
Definition
trajestep.h:78
Heed::trajestep::s_prec
int s_prec
Definition
trajestep.h:90
Heed::trajestep::relcen
vec relcen
Definition
trajestep.h:83
Heed::trajestep::Gnextpoint
void Gnextpoint(vfloat frange, point &fpos, vec &fdir) const
Move to the next point.
Definition
trajestep.cpp:80
Heed::trajestep::~trajestep
virtual ~trajestep()
Destructor.
Definition
trajestep.h:58
Heed::trajestep::get_components
virtual absref_transmit get_components() override
Definition
trajestep.cpp:21
Heed::trajestep::max_circ_arange
vfloat max_circ_arange
Angular step for curved lines.
Definition
trajestep.h:71
Heed::trajestep::trajestep
trajestep(const vfloat fmax_range, const vfloat frad_for_straight, const vfloat fmax_straight_arange, const vfloat fmax_circ_arange, const point &fcurrpos, const vec &fdir, const bool fcurved, const vec &frelcen, vfloat fmrange, vfloat prec)
Definition
trajestep.cpp:25
Heed::trajestep::max_range
vfloat max_range
Max. step length.
Definition
trajestep.h:64
Heed::trajestep::dir
vec dir
Unit vector.
Definition
trajestep.h:76
Heed::vec
Definition
vec.h:179
Heed
Definition
BGMesh.cpp:6
Heed::operator<<
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition
BGMesh.cpp:37
Heed::vfloat
double vfloat
Definition
vfloat.h:16
vec.h
garfieldpp-5.0
Heed
wcpplib
geometry
trajestep.h
Generated by
1.13.2