MyMarlinTPC  170316
SimpleHelixTrackModel.h
Go to the documentation of this file.
1 #ifndef SIMPLEHELIXTRACKMODEL_H
2 #define SIMPLEHELIXTRACKMODEL_H
3 
4 #include <gearimpl/Vector3D.h>
5 
6 #include "TVectorD.h"
7 #include "TMatrixD.h"
8 #include "TMatrixDSym.h"
9 
10 #include "EVENT/Track.h"
11 
12 namespace marlintpc {
13 
15 
22 class simpleHelix {
23  public:
24  simpleHelix(const double, const double, const double, const double, const double, const double*, const double);
25  simpleHelix(const double*, const double*, const double);
26  void dump() const;
27  double getArcLengthXY(const double*) const;
28  void getZSDirection(double*) const;
29  void getPosAtArcLength(const double, double*) const;
30  bool getExpectedPlanePos(const double*, const double, double&, double&, double&, double&, double&) const;
31  TMatrixD analyticalHelixJacobian(const double, const double) const;
32  TMatrixD simplifiedHelixJacobian(const double, const double) const;
33  TMatrixD curvilinearToPerigeeJacobian() const;
34  TMatrixD perigeeToILDJacobian() const;
35  TMatrixD perigeeToLCIOJacobian() const;
36  TMatrixD helixToLCIOJacobian() const;
37  void moveTo(const double, const double, const double, double*);
38  void getStateAt(const double, const double, const double, TMatrixDSym&, TVectorD&, TMatrixDSym&);
39 
40  protected:
42  const double _xref;
44  const double _yref;
46  const double _zref;
48  const double _bzc;
50  const double _rinv;
52  const double _phi0;
54  const double _dca;
56  const double _dzds;
58  const double _z0;
60  const double _xRelCenter;
62  const double _yRelCenter;
64  const double _eps;
65 };
66 
68 
82 class localHelix {
83  public:
84  localHelix(const double*, const double*, const double);
85  void dump() const;
86  TMatrixD propagateTo(const double*, const double);
87  simpleHelix getSimpleHelix() const;
88 
89  private:
91  double _bfac;
93  gear::Vector3D _bFieldc;
95  TVectorD _offset;
97  TMatrixD _rotation;
99  TMatrixD _rotInv;
101  gear::Vector3D _trackDir;
103  double _cosLambda;
105  double _qbyp;
107  double _localPar[5];
109  double _localRef[3];
110 
111  gear::Vector3D getBFieldc(const double*) const;
112  void calcLocal();
113  void calcGlobal();
114 };
115 
117 
120 class simpleFitXY {
121  public:
122  simpleFitXY(bool, double, double);
123  void addPoint(double, double, double);
124  void addTrack(EVENT::Track const *);
125  int fit(double&, int&);
126  TVectorD getPar() const;
127  TMatrixDSym getCov() const;
128 
129  private:
131  const bool _curved;
133  const int _npar;
135  const double _xRef;
137  const double _yRef;
141  double _sx;
143  double _sy;
145  double _sxx;
147  double _sxy;
149  double _syy;
151  double _sw;
153  double _sr;
155  double _sxr;
157  double _syr;
159  double _srr;
161  TVectorD _parameters;
163  TMatrixDSym _covariance;
164 };
165 
167 
170 class simpleFitZS {
171  public:
172  simpleFitZS();
173  void addPoint(double, double, double);
174  int fit(double&, int&);
175  TVectorD getPar() const;
176  TMatrixDSym getCov() const;
177 
178  private:
180  const int _npar;
184  double _sx;
186  double _sy;
188  double _sxx;
190  double _sxy;
192  double _syy;
194  double _sw;
196  TVectorD _parameters;
198  TMatrixDSym _covariance;
199 };
200 
201 } // namespace marlintpc
202 
203 #endif // SIMPLEHELIXTRACKMODEL_H
double _sxx
weighted sum(x*x)
double _sx
weighted sum(x)
double _sy
weighted sum(z)
gear::Vector3D _bFieldc
B-field.
double _srr
weighted sum(r*r*r*r)
const double _z0
Z position at distance of closest approach.
simpleHelix(const double, const double, const double, const double, const double, const double *, const double)
Constructor.
TMatrixD analyticalHelixJacobian(const double, const double) const
Get analytical helix propagator (in constant solenoidal magnetic field)
void moveTo(const double, const double, const double, double *)
Change reference point.
const double _eps
cut off for straight line approximation (|relevent scale / R| < _eps)
void dump() const
Dump helix.
TMatrixD _rotation
rotation to local system
TMatrixD _rotInv
rotation from local system
double _syy
weighted sum(z*z)
double _syr
weighted sum(y*r*r)
TMatrixD perigeeToLCIOJacobian() const
Get transformation from helix to LCIO track parameters (at reference point)
gear::Vector3D _trackDir
(global) track direction
double _sy
weighted sum(y)
int _numPoints
number of points (hits) used
void getPosAtArcLength(const double, double *) const
Get position (on helix) at arc length.
const double _phi0
flight direction at point of closest approach (in XY)
const double _yRef
Y of reference point.
const double _yref
Y of reference point.
double _qbyp
Q/P = const !
bool getExpectedPlanePos(const double *, const double, double &, double &, double &, double &, double &) const
Get expected position (and direction) in plane.
double _sxy
weighted sum(s*z)
const double _xref
X of reference point.
TVectorD _parameters
parameter vector
double _syy
weighted sum(y*y)
const double _yRelCenter
XY circle parameter: Y position of center / R.
void getStateAt(const double, const double, const double, TMatrixDSym &, TVectorD &, TMatrixDSym &)
Get state (parameters, covariance matrix) at point.
TMatrixD simplifiedHelixJacobian(const double, const double) const
Get simplified helix propagator (in constant solenoidal magnetic field)
void getZSDirection(double *) const
Get ZS direction (cosLambda, sinLambda).
double _cosLambda
(local) cos(lambda)
double _sr
weighted sum(r*r)
double _sx
weighted sum(s)
const double _dca
distance of closest approach in (XY)
const double _xRelCenter
XY circle parameter: X position of center / R.
double _sxx
weighted sum(s*s)
TMatrixD curvilinearToPerigeeJacobian() const
Get transformation from curivilinear to perigee track parameters (at reference point) ...
TVectorD _parameters
parameter vector
const bool _curved
flag for curved (circle) track
TMatrixDSym _covariance
covariance matrix
const int _npar
number of track parameters (3: circle, 2: line)
TMatrixD perigeeToILDJacobian() const
Get transformation from perigee to L3/ILD track parameters (at reference point)
const double _xRef
X of reference point.
double _sw
sum of weights
double _sxr
weighted sum(x*r*r)
const double _bzc
Z component of magnetic field (*c)
double _bfac
c * scaling factor (0/1) for magnetic field
const int _npar
number of track parameters (2)
TVectorD _offset
offset of local system
double getArcLengthXY(const double *) const
Get (2D) arc length for given point.
TMatrixDSym _covariance
covariance matrix
TMatrixD helixToLCIOJacobian() const
Get transformation from helix to LCIO track parameters (at reference point)
int _numPoints
number of points (hits) used
double _sxy
weighted sum(x*y)
const double _zref
Z of reference point.
double _sw
sum of weights