BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcxReco/MdcxReco/MdcxHel.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcxHel.h,v 1.7 2011/12/08 06:52:29 zhangy Exp $
4//
5// Description:
6// Class Header for |MdcxHel| and |MdcxFittedHel| - helix fitting classes
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author List:
12// S. Wagner
13//
14// Copyright Information:
15// Copyright (C) 1996 BEPCII
16//
17// History:
18// Migration for BESIII MDC
19//
20//------------------------------------------------------------------------
21#ifndef _MDCXHEL_
22#define _MDCXHEL_
23
24//MdcxHel & MdcxFittedHel classes ...
25#include <iostream>
26#include <fstream>
27#include "CLHEP/Alist/AList.h"
28#include "CLHEP/Vector/ThreeVector.h"
29#include "MdcxReco/MdcxHit.h"
30#include "MdcxReco/MdcxParameters.h"
31#include <math.h>
32#include <vector>
33
34using CLHEP::Hep3Vector;
35//class MdcxHit;//yzhang del
36
37class MdcxHel {
38
39public:
40
41 //constructors
42
43 MdcxHel( );
44
45 MdcxHel(double D0, double Phi0, double Omega, double Z0=0.0, double Tanl=0.0,
46 double T0=0.0, int Code=11111, int Mode=0, double X=0.0, double Y=0.0);
47
48 //destructor
49
50 virtual ~MdcxHel( );
51
52 //access
53 inline double D0()const{return d0;}
54 inline double Phi0()const{return phi0;}
55 inline double Omega()const{return omega;}
56 inline double Z0()const{return z0;}
57 inline double Tanl()const{return tanl;}
58 inline double X()const{return xref;}
59 inline double Xref()const{return xref;}
60 inline double Y()const{return yref;}
61 inline double Yref()const{return yref;}
62 inline double T0()const{return t0;}
63 inline double CosPhi0()const{return cphi0;}
64 inline double SinPhi0()const{return sphi0;}
65 inline double Doca_Len()const{return len;}
66 inline double Doca_FLen()const{return len*sqrt(1.0+tanl*tanl);}
67 inline double Doca_Tof()const{return len*sqrt(1.0+tanl*tanl)/MdcxParameters::c;}
68 inline double Doca_Zh()const{return zh;}
69 inline int Doca_Samb()const{return samb;}
70 inline int Doca_Wamb()const{return wamb;}
71 inline double Doca_Eang()const{return eang;}
72 inline double Omin()const{return omin;}
73 inline int Mode()const{return mode;}
74 inline int Code()const{return code;}
75 inline int Nfree()const{return nfree;}
76 inline int Ominfl()const{return ominfl;}
77 inline int Qd0()const{return qd0;}
78 inline int Qphi0()const{return qphi0;}
79 inline int Qomega()const{return qomega;}
80 inline int Qz0()const{return qz0;}
81 inline int Qtanl()const{return qtanl;}
82 inline int Qt0()const{return qt0;}
83 double Xc()const;
84 double Yc()const;
85 double X0()const;
86 double Y0()const;
87 double Xh(double l)const;
88 double Yh(double l)const;
89 double Zh(double l)const;
90 double Px(double l=0.0)const;
91 double Py(double l=0.0)const;
92 double Pz(double l=0.0)const;
93 double Ptot(double l=0.0)const;
94 double Lmax()const;
95
96 //workers
97 double Doca(double WX,double WY,double WZ,double X,double Y,double Z=0.0);
98 double Doca(const MdcxHit& h);
99 //double Doca(const MdcxHit& h) { return Doca( h.wx(), h.wy(), h.wz(), h.x(), h.y() ); }
100 void print()const; //print this helix
101 void flip(); //flip this helix if moving towards origin
102
103 //set values
104 std::vector<float> derivatives(const MdcxHit& h);
105 void SetRef(double x, double y);
106
107 //controls
108 void SetMode(int n);
109 void SetD0(int n);
110 void SetPhi0(int n);
111 void SetOmega(int n);
112 void SetZ0(int n);
113 void SetTanl(int n);
114 void SetT0(int n);
115 inline void SetTurnFlag(const int &i) {turnflag=i;}
116 inline int GetTurnFlag()const {return turnflag;}
117
118 //operators
119 MdcxHel& operator=(const MdcxHel&);
120
121 protected:
122
123 double d0; // signed distance of closest approach (of helix to z axis)
124 double phi0; // direction
125 double omega; // signed 1/r
126 double z0; // z value (at DOCA of helix to z axis)
127 double tanl; // tangent of dip angle
128 double t0; // zero of time
129 double xref; // x of ref pt of fit
130 double yref; // y of ref pt of fit
131 double cphi0; // cos(phi0)
132 double sphi0; // sin(phi0)
133 double x0;
134 double y0;
135 double xc;
136 double yc;
137 int code; // derivative control
138 // specify which derivatives to calculate
139 // digits -> t0 tanl z0 omega phi0 d0
140 // 11111 is standard 5 parameter helix fit
141 // 111111 includes t0
142 // 11 is a 2D straight line fit (if omega=0.0)
143 // 111 is the Dahl-Lynch 2D circle fit
144 // 11011 is a 3D straight line fit (if omega=0.0)
145 int mode; // 0=>unsign drift time; mode=1=>signed drift time
146 // free in fit if q-variable non-zero (true)
147 int qd0;
148 int qphi0;
150 int qz0;
151 int qtanl;
152 int qt0;
153 int nfree;
156
157 //static control parameters
158 double omin; // omega straight line <-> helix cut-off
159
160 //invisible data (calculated by Doca; used by other fcns which first call
161 //Doca or assume Doca is already called)
163 Hep3Vector wvec,tvec,vhat,dvec;
164 int samb,wamb; double eang;
165
166 //utility functions
167 double CalcPhi(double xf,double yf,double xl,double yl) const{
168 double phit=atan2(yl-yf,xl-xf); return phit<0?phit+2*M_PI:phit;
169 }//endof CalcPhi
170 int deltaq(int i,int j) const { return i==j?0:i==0?1:-1; } //integer comparisons
171 void decode(const int i, int& i1, int& i2,
172 int& i3, int& i4, int& i5, int& i6,int& n);
173 void copy(const MdcxHel& hel);
174
175};
176//endof MdcxHel
177
178#endif
const Int_t n
#define M_PI
Definition: TConstant.h:4
double CalcPhi(double xf, double yf, double xl, double yl) const
double X0() const
Definition: MdcxHel.cxx:77
void SetZ0(int n)
Definition: MdcxHel.cxx:181
double Lmax() const
Definition: MdcxHel.cxx:142
double Yc() const
Definition: MdcxHel.cxx:68
void SetRef(double x, double y)
Definition: MdcxHel.cxx:156
double Xc() const
Definition: MdcxHel.cxx:59
void SetD0(int n)
Definition: MdcxHel.cxx:171
double Py(double l=0.0) const
Definition: MdcxHel.cxx:116
void SetOmega(int n)
Definition: MdcxHel.cxx:161
double Px(double l=0.0) const
Definition: MdcxHel.cxx:107
double Ptot(double l=0.0) const
Definition: MdcxHel.cxx:134
void SetTanl(int n)
Definition: MdcxHel.cxx:176
void SetPhi0(int n)
Definition: MdcxHel.cxx:166
double Pz(double l=0.0) const
Definition: MdcxHel.cxx:125
void decode(const int i, int &i1, int &i2, int &i3, int &i4, int &i5, int &i6, int &n)
Definition: MdcxHel.cxx:199
double Doca(double WX, double WY, double WZ, double X, double Y, double Z=0.0)
Definition: MdcxHel.cxx:239
void print() const
Definition: MdcxHel.cxx:357
void SetMode(int n)
Definition: MdcxHel.cxx:154
double Y0() const
Definition: MdcxHel.cxx:81
void flip()
Definition: MdcxHel.cxx:375
double Yh(double l) const
Definition: MdcxHel.cxx:94
double Zh(double l) const
Definition: MdcxHel.cxx:103
void copy(const MdcxHel &hel)
Definition: MdcxHel.cxx:219
double Xh(double l) const
Definition: MdcxHel.cxx:85
void SetT0(int n)
Definition: MdcxHel.cxx:186
MdcxHel()
Definition: MdcxHel.cxx:32
virtual ~MdcxHel()
Definition: MdcxHel.cxx:55
std::vector< float > derivatives(const MdcxHit &h)
Definition: MdcxHel.cxx:324
MdcxHel & operator=(const MdcxHel &)
Definition: MdcxHel.cxx:193