BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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"
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
Definition: Code.h:31
int Doca_Samb() const
Definition: MdcxHel.h:69
double Y() const
Definition: MdcxHel.h:60
double Phi0() const
Definition: MdcxHel.h:54
double CalcPhi(double xf, double yf, double xl, double yl) const
Definition: MdcxHel.h:167
double z0
Definition: MdcxHel.h:126
double eang
Definition: MdcxHel.h:164
double t0
Definition: MdcxHel.h:128
double CosPhi0() const
Definition: MdcxHel.h:63
double T0() const
Definition: MdcxHel.h:62
double sphi0
Definition: MdcxHel.h:132
double vy
Definition: MdcxHel.h:162
Hep3Vector tvec
Definition: MdcxHel.h:163
double vz
Definition: MdcxHel.h:162
int ominfl
Definition: MdcxHel.h:154
double X0() const
Definition: MdcxHel.cxx:77
void SetZ0(int n)
Definition: MdcxHel.cxx:181
double D0() const
Definition: MdcxHel.h:53
double Omin() const
Definition: MdcxHel.h:72
double Lmax() const
Definition: MdcxHel.cxx:142
int turnflag
Definition: MdcxHel.h:155
int wamb
Definition: MdcxHel.h:164
double Yc() const
Definition: MdcxHel.cxx:68
double Doca_Eang() const
Definition: MdcxHel.h:71
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 vx
Definition: MdcxHel.h:162
double len
Definition: MdcxHel.h:162
double tz
Definition: MdcxHel.h:162
double Py(double l=0.0) const
Definition: MdcxHel.cxx:116
double X() const
Definition: MdcxHel.h:58
void SetOmega(int n)
Definition: MdcxHel.cxx:161
double Px(double l=0.0) const
Definition: MdcxHel.cxx:107
int nfree
Definition: MdcxHel.h:153
double yc
Definition: MdcxHel.h:136
double omin
Definition: MdcxHel.h:158
int Code() const
Definition: MdcxHel.h:74
Hep3Vector dvec
Definition: MdcxHel.h:163
double yref
Definition: MdcxHel.h:130
int mode
Definition: MdcxHel.h:145
Hep3Vector wvec
Definition: MdcxHel.h:163
double d0
Definition: MdcxHel.h:123
double Ptot(double l=0.0) const
Definition: MdcxHel.cxx:134
double f0
Definition: MdcxHel.h:162
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 Omega() const
Definition: MdcxHel.h:55
int Doca_Wamb() const
Definition: MdcxHel.h:70
double Doca_Zh() const
Definition: MdcxHel.h:68
double Doca(double WX, double WY, double WZ, double X, double Y, double Z=0.0)
Definition: MdcxHel.cxx:239
double zh
Definition: MdcxHel.h:162
double tanl
Definition: MdcxHel.h:127
int qtanl
Definition: MdcxHel.h:151
int Ominfl() const
Definition: MdcxHel.h:76
void print() const
Definition: MdcxHel.cxx:357
double xh
Definition: MdcxHel.h:162
double xc
Definition: MdcxHel.h:135
Hep3Vector vhat
Definition: MdcxHel.h:163
double Yref() const
Definition: MdcxHel.h:61
int qomega
Definition: MdcxHel.h:149
void SetMode(int n)
Definition: MdcxHel.cxx:154
double Doca_Tof() const
Definition: MdcxHel.h:67
double Y0() const
Definition: MdcxHel.cxx:81
int qphi0
Definition: MdcxHel.h:148
double phi0
Definition: MdcxHel.h:124
double yh
Definition: MdcxHel.h:162
double xref
Definition: MdcxHel.h:129
double Z0() const
Definition: MdcxHel.h:56
void flip()
Definition: MdcxHel.cxx:375
double Yh(double l) const
Definition: MdcxHel.cxx:94
double Zh(double l) const
Definition: MdcxHel.cxx:103
int Qd0() const
Definition: MdcxHel.h:77
int qt0
Definition: MdcxHel.h:152
double omega
Definition: MdcxHel.h:125
void copy(const MdcxHel &hel)
Definition: MdcxHel.cxx:219
double x0
Definition: MdcxHel.h:133
int Qomega() const
Definition: MdcxHel.h:79
int Qphi0() const
Definition: MdcxHel.h:78
int Qz0() const
Definition: MdcxHel.h:80
int code
Definition: MdcxHel.h:137
double Tanl() const
Definition: MdcxHel.h:57
int deltaq(int i, int j) const
Definition: MdcxHel.h:170
double Xh(double l) const
Definition: MdcxHel.cxx:85
void SetTurnFlag(const int &i)
Definition: MdcxHel.h:115
int qd0
Definition: MdcxHel.h:147
void SetT0(int n)
Definition: MdcxHel.cxx:186
MdcxHel()
Definition: MdcxHel.cxx:32
double Doca_FLen() const
Definition: MdcxHel.h:66
double SinPhi0() const
Definition: MdcxHel.h:64
virtual ~MdcxHel()
Definition: MdcxHel.cxx:55
double cosl
Definition: MdcxHel.h:162
double tx
Definition: MdcxHel.h:162
double cphi0
Definition: MdcxHel.h:131
int Mode() const
Definition: MdcxHel.h:73
double Xref() const
Definition: MdcxHel.h:59
int Qt0() const
Definition: MdcxHel.h:82
int Nfree() const
Definition: MdcxHel.h:75
int GetTurnFlag() const
Definition: MdcxHel.h:116
double y0
Definition: MdcxHel.h:134
int Qtanl() const
Definition: MdcxHel.h:81
std::vector< float > derivatives(const MdcxHit &h)
Definition: MdcxHel.cxx:324
double Doca_Len() const
Definition: MdcxHel.h:65
double sinl
Definition: MdcxHel.h:162
MdcxHel & operator=(const MdcxHel &)
Definition: MdcxHel.cxx:193
int qz0
Definition: MdcxHel.h:150
int samb
Definition: MdcxHel.h:164
double phi
Definition: MdcxHel.h:162
double ty
Definition: MdcxHel.h:162
static const double c
constants
Definition: MdcxParameters.h:9
double y[1000]