BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Dedx_Helix.h
Go to the documentation of this file.
1//
2// Class Helix
3//
4#ifndef Helix_FLAG_
5#define Helix_FLAG_
6#include "GaudiKernel/IInterface.h"
7#include "GaudiKernel/Kernel.h"
8#include "GaudiKernel/Service.h"
11
12#include "CLHEP/Matrix/Vector.h"
13#include "CLHEP/Matrix/SymMatrix.h"
14#ifndef CLHEP_THREEVECTOR_H
15#include "CLHEP/Vector/ThreeVector.h"
16#endif
17
18#include "CLHEP/Vector/LorentzVector.h"
19
20#ifndef CLHEP_POINT3D_H
21#include "CLHEP/Geometry/Point3D.h"
22#endif
23
24#ifndef ENABLE_BACKWARDS_COMPATIBILITY
26#endif
27//using CLHEP::HepVector;
28//using CLHEP::HepSymMatrix;
29//using CLHEP::Hep3Vector;
30//using CLHEP::HepLorentzVector;
31
32/// Helix parameter class
34
35 public:
36 /// Constructor with pivot, helix parameter a, and its error matrix.
38 const HepVector & a,
39 const HepSymMatrix & Ea);
40
41 /// Constructor without error matrix.
43 const HepVector & a);
44
45 /// Constructor with position, momentum, and charge.
46 Dedx_Helix(const HepPoint3D & position,
47 const Hep3Vector & momentum,
48 double charge);
49
50 /// Destructor
51 virtual ~Dedx_Helix();
52
53 public:// Selectors
54 /// returns position of helix center(z = 0.);
55 const HepPoint3D & center(void) const;
56
57 /// returns pivot position.
58 const HepPoint3D & pivot(void) const;
59
60 /// returns radious of helix.
61 double radius(void) const;
62
63 /// returns position after rotating angle dPhi in phi direction.
64 HepPoint3D x(double dPhi = 0.) const;
65 double * x(double dPhi, double p[3]) const;
66
67 /// returns position and convariance matrix(Ex) after rotation.
68 HepPoint3D x(double dPhi, HepSymMatrix & Ex) const;
69
70 /// returns direction vector after rotating angle dPhi in phi direction.
71 Hep3Vector direction(double dPhi = 0.) const;
72
73 /// returns momentum vector after rotating angle dPhi in phi direction.
74 Hep3Vector momentum(double dPhi = 0.) const;
75
76 /// returns momentum vector after rotating angle dPhi in phi direction.
77 Hep3Vector momentum(double dPhi, HepSymMatrix & Em) const;
78
79 /// returns 4momentum vector after rotating angle dPhi in phi direction.
80 HepLorentzVector momentum(double dPhi, double mass) const;
81
82 /// returns 4momentum vector after rotating angle dPhi in phi direction.
83 HepLorentzVector momentum(double dPhi, double mass, HepSymMatrix & Em) const;
84
85 /// returns 4momentum vector after rotating angle dPhi in phi direction.
86 HepLorentzVector momentum(double dPhi, double mass, HepPoint3D & x, HepSymMatrix & Emx) const;
87
88 public:// Parametrization dependent functions. Prepared for tracking codes. Users should not use them.
89 /// returns an element of parameters.
90 double dr(void) const;
91 double phi0(void) const;
92 double kappa(void) const;
93 double dz(void) const;
94 double tanl(void) const;
95 double curv(void) const;
96 double sinPhi0(void) const;
97 double cosPhi0(void) const;
98
99 /// returns helix parameters.
100 const HepVector & a(void) const;
101
102 /// returns error matrix.
103 const HepSymMatrix & Ea(void) const;
104
105 public:// Modifiers
106 /// sets helix parameters.
107 const HepVector & a(const HepVector & newA);
108
109 /// sets helix paramters and error matrix.
110 const HepSymMatrix & Ea(const HepSymMatrix & newdA);
111
112 /// sets pivot position.
113 const HepPoint3D & pivot(const HepPoint3D & newPivot);
114
115 /// sets helix pivot position, parameters, and error matrix.
116 void set(const HepPoint3D & pivot,
117 const HepVector & a,
118 const HepSymMatrix & Ea);
119
120 /// unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.
121 void ignoreErrorMatrix(void);
122
123 /// sets/returns z componet of the magnetic field.
124 double bFieldZ(double);
125 double bFieldZ(void) const;
126
127 public:// Operators
128 /// Copy operator
130
131 public:// Mathmatical functions
132 HepMatrix delApDelA(const HepVector & ap) const;
133 HepMatrix delXDelA(double phi) const;
134 HepMatrix delMDelA(double phi) const;
135 HepMatrix del4MDelA(double phi, double mass) const;
136 HepMatrix del4MXDelA(double phi, double mass) const;
137
138 private:
139 IMagneticFieldSvc* m_pmgnIMF;
140
141 private:
142 void updateCache(void);
143
144 public:
145 /// Constant alpha for uniform field.
146 static const double ConstantAlpha;
147
148 private:
149 double m_bField;
150 double m_alpha;
151 HepPoint3D m_pivot;
152 HepVector m_a;
153 HepSymMatrix m_Ea;
154 bool m_matrixValid;
155
156 private: // caches
157 HepPoint3D m_center;
158 double m_cp;
159 double m_sp;
160 double m_pt;
161 double m_r;
162 double m_ac[5];
163};
164
165//-----------------------------------------------------------------------------
166
167#ifdef Helix_NO_INLINE
168#define inline
169#else
170#undef inline
171#define Helix_INLINE_DEFINE_HERE
172#endif
173
174#ifdef Helix_INLINE_DEFINE_HERE
175
176inline
177const HepPoint3D &
179 return m_center;
180}
181
182inline
183const HepPoint3D &
184Dedx_Helix::pivot(void) const {
185 return m_pivot;
186}
187
188inline
189double
191 return m_r;
192}
193
194inline
195Hep3Vector
196Dedx_Helix::direction(double phi) const {
197 return momentum(phi).unit();
198}
199
200inline
201double
202Dedx_Helix::dr(void) const {
203 return m_ac[0];
204}
205
206inline
207double
208Dedx_Helix::phi0(void) const {
209 return m_ac[1];
210}
211
212inline
213double
214Dedx_Helix::kappa(void) const {
215 return m_ac[2];
216}
217
218inline
219double
220Dedx_Helix::dz(void) const {
221 return m_ac[3];
222}
223
224inline
225double
226Dedx_Helix::tanl(void) const {
227 return m_ac[4];
228}
229
230inline
231double
232Dedx_Helix::curv(void) const {
233 return m_r;
234}
235
236inline
237const HepVector &
238Dedx_Helix::a(void) const {
239 return m_a;
240}
241
242inline
243const HepSymMatrix &
244Dedx_Helix::Ea(void) const {
245 return m_Ea;
246}
247
248inline
249const HepVector &
250Dedx_Helix::a(const HepVector & i) {
251 m_a = i;
252 updateCache();
253 return m_a;
254}
255
256inline
257const HepSymMatrix &
258Dedx_Helix::Ea(const HepSymMatrix & i) {
259 return m_Ea = i;
260}
261
262inline
263double
265 m_bField = a;
266 m_alpha = 10000. / 2.99792458 / m_bField;
267 updateCache();
268 return m_bField;
269}
270
271inline
272double
274 return m_bField;
275}
276
277inline
278double
280 return m_sp;
281}
282
283inline
284double
286 return m_cp;
287}
288
289#endif
290
291#undef inline
292
293#endif /* Helix_FLAG_ */
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
double mass
Double_t x[10]
HepGeom::Point3D< double > HepPoint3D
Definition: Dedx_Helix.h:25
Helix parameter class.
Definition: Dedx_Helix.h:33
double kappa(void) const
Definition: Dedx_Helix.h:214
HepMatrix del4MDelA(double phi, double mass) const
Definition: Dedx_Helix.cxx:681
double sinPhi0(void) const
Definition: Dedx_Helix.h:279
double cosPhi0(void) const
Definition: Dedx_Helix.h:285
double phi0(void) const
Definition: Dedx_Helix.h:208
const HepVector & a(void) const
returns helix parameters.
Definition: Dedx_Helix.h:238
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
Definition: Dedx_Helix.cxx:209
double bFieldZ(void) const
Definition: Dedx_Helix.h:273
static const double ConstantAlpha
Constant alpha for uniform field.
Definition: Dedx_Helix.h:146
Dedx_Helix & operator=(const Dedx_Helix &)
Copy operator.
Definition: Dedx_Helix.cxx:464
void set(const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
sets helix pivot position, parameters, and error matrix.
Definition: Dedx_Helix.cxx:453
HepMatrix del4MXDelA(double phi, double mass) const
Definition: Dedx_Helix.cxx:727
virtual ~Dedx_Helix()
Destructor.
Definition: Dedx_Helix.cxx:205
HepMatrix delMDelA(double phi) const
Definition: Dedx_Helix.cxx:644
const HepSymMatrix & Ea(void) const
returns error matrix.
Definition: Dedx_Helix.h:244
double dz(void) const
Definition: Dedx_Helix.h:220
const HepPoint3D & pivot(void) const
returns pivot position.
Definition: Dedx_Helix.h:184
double dr(void) const
returns an element of parameters.
Definition: Dedx_Helix.h:202
double curv(void) const
Definition: Dedx_Helix.h:232
void ignoreErrorMatrix(void)
unsets error matrix. Error calculations will be ignored after this function call until an error matri...
Definition: Dedx_Helix.cxx:798
HepMatrix delXDelA(double phi) const
Definition: Dedx_Helix.cxx:590
double tanl(void) const
Definition: Dedx_Helix.h:226
HepMatrix delApDelA(const HepVector &ap) const
Definition: Dedx_Helix.cxx:522
double radius(void) const
returns radious of helix.
Definition: Dedx_Helix.h:190
Hep3Vector direction(double dPhi=0.) const
returns direction vector after rotating angle dPhi in phi direction.
Definition: Dedx_Helix.h:196
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
Definition: Dedx_Helix.h:178
float charge