10 const double *Arr()
const {
return &mHH;}
11 double *Arr() {
return &mHH;}
12 const double &operator[](
int idx)
const {
return (&mHH)[idx];}
13 double &operator[](
int idx) {
return (&mHH)[idx];}
15 {
for (
int i=0;i<6;i++) {Arr()[i]*=f;}
return *
this;}
16 void Clear() { memset(
this,0,
sizeof(*
this));}
18 void Set(
const double *err);
19 void Move(
double const F[3][3]);
35 operator const double* () {
return &mHH;}
36 operator double* () {
return &mHH;}
37 const double *Arr()
const {
return &mHH;}
38 double *Arr() {
return &mHH;}
39 const double &operator[](
int idx)
const {
return (&mHH)[idx];}
40 double &operator[](
int idx) {
return (&mHH)[idx];}
42 {
for (
int i=0;i<15;i++) {Arr()[i]*=f;}
return *
this;}
43 void Clear() { memset(
this,0,
sizeof(*
this));}
44 void Set(
const double *err);
45 void Set(
const double *errxy,
const double *errz);
46 void Move(
double const F[5][5]);
48 void Print(
const char *tit=0)
const;
50 double MaxCorr()
const;
59 mHL, mAL, mCL, mZL, mLL;
70 TCircle(
const double *x,
const double *dir,
double rho);
75 void Set(
const double *x=0,
const double *dir=0,
const double rho=0);
76 virtual void Clear(
const char *opt=
"");
77 const double* Pos()
const {
return fX; }
78 double* Pos() {
return fX; }
79 const double* Dir()
const {
return fD; }
80 double Rho()
const {
return fRho;}
81 double& Rho() {
return fRho;}
82 void Nor(
double *norVec)
const;
83 void SetEmx(
const double *err=0);
84 const TCEmx_t *Emx()
const {
return fEmx;}
86 void GetCenter(
double center[2])
const;
87 double Path(
const double pnt[2])
const;
88 double Path(
const double pnt[2],
const double exy[3])
const;
89 double Path(
const TCircle &tc,
double *s2=0)
const;
90 double Move(
double step);
91 void Rot(
double angle);
92 void Rot(
double cosa,
double sina);
94 double Eval(
double step,
double *xy,
double *dir=0)
const;
95 void Show(
int nPts,
const double *Pts,
int pstep=2)
const;
96 virtual void Print(
const char* chopt =
"")
const;
97 void SetStrait(
int strait=1) {SetBit(1,strait) ;}
98 int IsStrait() {
return TestBit(1);}
104 static void TestMtx();
107 void MoveErrs(
double l);
108 void MakeMtx (
double l,
double F[3][3]);
137 int Size()
const {
return fN;}
138 int Used()
const {
return fNuse;}
139 void Add (
double x,
double y,
const double *errs=0);
140 void Add (
double x,
double y,
double z);
141 void AddErr(
const double *errs,
double errz=0);
142 void AddErr(
double errh,
double errz=0);
143 void AddZ(
double z,
double err2z=0);
146 double FixAt(
const double vals[5],
int flag);
148 double GetZ0()
const {
return fZ0 ;}
149 double GetTanL()
const {
return fTanL ;}
150 void SetCase(
int kase=0) {fCase=kase ;}
151 int GetCase()
const {
return fKase ;}
152 double Chi2()
const {
return fChi2 ;}
153 int Ndf()
const {
return fNdf ;}
154 double Chi2Z ()
const {
return fChi2Z ;}
155 void SetNdf(
int ndf);
157 void Clear(
const char *opt =
"");
158 void Print(
const char* chopt =
"")
const;
159 const double *GetX(
int i=0)
const;
160 double *GetX(
int i=0);
164 static void Test(
int iTest=0);
165 static void TestCorr(
int kode=0);
169 double d2f(
int i,
int j);
172 double d2Rho2(
int i,
int j);
175 double d2F(
int i,
int j);
200 double fXd, fYd, fG1;
202 double fXCenter,fYCenter;
203 double fCov[6],fA,fB,fC,fH;
206 double fCorrR,fCorrB;
222 THelixTrack(
const double *xyz,
const double *dir,
double rho,
double drho=0);
227 void Set (
const double *xyz,
const double *dir,
double rho,
double drho=0);
228 void Set (
double rho,
double drho=0);
229 void SetEmx(
const double* err2xy,
const double* err2z);
230 void SetEmx(
const double* err=0);
231 THEmx_t *Emx()
const {
return fEmx;}
232 void StiEmx(
double emx[21])
const;
233 void GetSpot(
const double axis[3][3],
double emx[3])
const;
234 void Fill (
TCircle &circ)
const;
238 double Move(
double step);
239 double Move(
double step,
double F[5][5]);
241 double Eval(
double step,
double *xyz,
double *dir,
double &rho)
const;
242 double Step(
double step,
double *xyz,
double *dir,
double &rho)
const
243 {
return Eval( step, xyz, dir, rho);}
245 void Get (
double *xyz,
double *dir,
double &rho)
const {
Step(0.,xyz,dir,rho);}
246 double Eval(
double step,
double *xyz,
double *dir=0)
const;
247 double Step(
double step,
double *xyz,
double *dir=0)
const
248 {
return Eval( step, xyz, dir );}
249 void Get (
double *xyz,
double *dir=0)
const {
Step(0.,xyz,dir);}
255 double Step(
double stmax,
const double *surf,
int nsurf
256 ,
double *x=0,
double *dir=0,
int nearest=0)
const;
257 double Path(
double stmax,
const double *surf,
int nsurf
258 ,
double *x=0,
double *dir=0,
int nearest=0)
const
259 {
return Step(stmax,surf,nsurf,x,dir,nearest);}
262 double Step(
const double point[3],
double *xyz=0,
double *dir=0)
const;
263 double Path(
const double point[3],
double *xyz=0,
double *dir=0)
const
264 {
return Step(point,xyz,dir);}
266 double Dca(
const double point[3],
double *dcaErr=0)
const;
269 double Path(
double x,
double y)
const ;
271 double Dca(
double x,
double y,
double *dcaErr=0)
const ;
277 double Path(
const THelixTrack &hlx,
double *s2=0)
const ;
284 ,
double *dist=0,
double *xyz=0)
const;
287 double Dca(
const double point[3]
288 ,
double &dcaXY,
double &dcaZ,
double dcaEmx[3],
int kind=3)
const;
290 const double *GetXYZ()
const {
return fX;}
291 const double *Pos()
const {
return fX;}
292 double *Pos() {
return fX;}
293 const double *GetDir()
const {
return fP;}
294 const double *Dir()
const {
return fP;}
295 double *Dir() {
return fP;}
296 double GetRho()
const {
return fRho ;}
297 double GetDRho()
const {
return fDRho ;}
298 double GetCos()
const {
return fCosL;}
299 double GetSin()
const {
return fP[2];}
300 double GetTan()
const {
return fP[2]/fCosL;}
301 double GetPeriod()
const ;
302 void Rot(
double angle);
303 void Rot(
double cosa,
double sina);
305 void Show(
double len,
const THelixTrack *other=0)
const;
306 void Print(Option_t *opt=
"")
const;
308 static void InvertMtx(
double derivs[5][5]);
314 static void TestMtx();
315 static void TestDer();
316 static void TestTwoHlx();
320 void MakeMtx(
double step,
double F[5][5]);
322 double Step(
double stmin,
double stmax,
const double *surf,
int nsurf
323 ,
double *x=0,
double *dir=0,
int nearest=0)
const;
324 double StepHZ(
const double *surf,
int nsurf
325 ,
double *x=0,
double *dir=0,
int nearest=0)
const;
342 int Size()
const {
return fCircleFitter.Size();}
343 int Used()
const {
return fCircleFitter.Used();}
344 void Add (
double x,
double y,
double z);
345 void AddErr(
const double *err2xy,
double err2z);
346 void AddErr(
double errhh,
double errzz);
349 double FixAt(
const double vals[5],
int flag=1);
351 void SetCase(
int kase=0) {fCircleFitter.SetCase(kase);}
352 int GetCase()
const {
return fCircleFitter.GetCase();}
353 double Chi2()
const {
return fChi2;}
354 int Ndf()
const {
return fCircleFitter.Ndf()+fPoli1Fitter.Ndf();}
355 double Chi2XY ()
const {
return fCircleFitter.Chi2();}
356 double Chi2SZ ()
const {
return fPoli1Fitter.Chi2() ;}
357 int NdfXY ()
const {
return fCircleFitter.Ndf() ;}
358 int NdfSZ ()
const {
return fPoli1Fitter.Ndf() ;}
361 void Clear(
const char *opt =
"");
362 void Print(
const char* chopt =
"")
const;
365 static void Test(
int kase=0);
367 void Update(
int kase);
378 typedef std::vector<THelixKFitterAux> THelixKFitterAuxV;
385 void Add (
const double x[3]);
386 void AddErr(
const double err[6]);
388 double Chi2()
const {
return fChi2 ;}
389 int Ndf()
const {
return 2*fAux.size()-5 ;}
390 int Size()
const {
return fAux.size() ;}
392 void Clear(
const char * =
"") {fAux.clear();fChi2=0 ;}
393 void Print(
const char* chopt =
"")
const;
395 void SetFitingShow() {fFitingShow =
new std::vector<double>;}
396 static void Test(
int nev=10000);
398 std::vector<double> *fFitingShow;
399 THelixKFitterAuxV fAux;
403 #endif // THELIXTRACK_H
double Eval(double step, double *xyz, double *dir, double &rho) const
Evaluate params with given step along helix.
double PathX(const THelixTrack &hlx, double *s2=0, double *dist=0, double *xyz=0) const
void Get(double *xyz, double *dir, double &rho) const
Get current parameters.
void Backward()
Change direction.
double Move(double step)
Move along helix.
void GetSpot(const double axis[3][3], double emx[3]) const
double FixAt(const double vals[5], int flag)
double Dca(const double point[3], double *dcaErr=0) const
DCA to given space point (with error matrix)