BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcxReco/include/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 "CLHEP/Alist/AList.h"
26#include "CLHEP/Vector/ThreeVector.h"
27#include "MdcxReco/MdcxHit.h"
28#include "MdcxReco/MdcxParameters.h"
29#include <fstream>
30#include <iostream>
31#include <math.h>
32#include <vector>
33
34using CLHEP::Hep3Vector;
35// class MdcxHit;//yzhang del
36
37class MdcxHel {
38
39public:
40 // constructors
41
43
44 MdcxHel( double D0, double Phi0, double Omega, double Z0 = 0.0, double Tanl = 0.0,
45 double T0 = 0.0, int Code = 11111, int Mode = 0, double X = 0.0, double Y = 0.0 );
46
47 // destructor
48
49 virtual ~MdcxHel();
50
51 // access
52 inline double D0() const { return d0; }
53 inline double Phi0() const { return phi0; }
54 inline double Omega() const { return omega; }
55 inline double Z0() const { return z0; }
56 inline double Tanl() const { return tanl; }
57 inline double X() const { return xref; }
58 inline double Xref() const { return xref; }
59 inline double Y() const { return yref; }
60 inline double Yref() const { return yref; }
61 inline double T0() const { return t0; }
62 inline double CosPhi0() const { return cphi0; }
63 inline double SinPhi0() const { return sphi0; }
64 inline double Doca_Len() const { return len; }
65 inline double Doca_FLen() const { return len * sqrt( 1.0 + tanl * tanl ); }
66 inline double Doca_Tof() const {
67 return len * sqrt( 1.0 + tanl * tanl ) / MdcxParameters::c;
68 }
69 inline double Doca_Zh() const { return zh; }
70 inline int Doca_Samb() const { return samb; }
71 inline int Doca_Wamb() const { return wamb; }
72 inline double Doca_Eang() const { return eang; }
73 inline double Omin() const { return omin; }
74 inline int Mode() const { return mode; }
75 inline int Code() const { return code; }
76 inline int Nfree() const { return nfree; }
77 inline int Ominfl() const { return ominfl; }
78 inline int Qd0() const { return qd0; }
79 inline int Qphi0() const { return qphi0; }
80 inline int Qomega() const { return qomega; }
81 inline int Qz0() const { return qz0; }
82 inline int Qtanl() const { return qtanl; }
83 inline int Qt0() const { return qt0; }
84 double Xc() const;
85 double Yc() const;
86 double X0() const;
87 double Y0() const;
88 double Xh( double l ) const;
89 double Yh( double l ) const;
90 double Zh( double l ) const;
91 double Px( double l = 0.0 ) const;
92 double Py( double l = 0.0 ) const;
93 double Pz( double l = 0.0 ) const;
94 double Ptot( double l = 0.0 ) const;
95 double Lmax() const;
96
97 // workers
98 double Doca( double WX, double WY, double WZ, double X, double Y, double Z = 0.0 );
99 double Doca( const MdcxHit& h );
100 // double Doca(const MdcxHit& h) { return Doca( h.wx(), h.wy(), h.wz(), h.x(), h.y() ); }
101 void print() const; // print this helix
102 void flip(); // flip this helix if moving towards origin
103
104 // set values
105 std::vector<float> derivatives( const MdcxHit& h );
106 void SetRef( double x, double y );
107
108 // controls
109 void SetMode( int n );
110 void SetD0( int n );
111 void SetPhi0( int n );
112 void SetOmega( int n );
113 void SetZ0( int n );
114 void SetTanl( int n );
115 void SetT0( int n );
116 inline void SetTurnFlag( const int& i ) { turnflag = i; }
117 inline int GetTurnFlag() const { return turnflag; }
118
119 // operators
121
122protected:
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;
149 int qomega;
150 int qz0;
151 int qtanl;
152 int qt0;
153 int nfree;
154 int ominfl;
155 int turnflag;
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)
162 double len, phi, xh, yh, zh, vx, vy, vz, cosl, sinl, f0, tx, ty, tz;
163 Hep3Vector wvec, tvec, vhat, dvec;
164 int samb, wamb;
165 double eang;
166
167 // utility functions
168 double CalcPhi( double xf, double yf, double xl, double yl ) const {
169 double phit = atan2( yl - yf, xl - xf );
170 return phit < 0 ? phit + 2 * M_PI : phit;
171 } // endof CalcPhi
172 int deltaq( int i, int j ) const {
173 return i == j ? 0 : i == 0 ? 1 : -1;
174 } // integer comparisons
175 void decode( const int i, int& i1, int& i2, int& i3, int& i4, int& i5, int& i6, int& n );
176 void copy( const MdcxHel& hel );
177};
178// endof MdcxHel
179
180#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
void SetZ0(int n)
double Lmax() const
double Yc() const
void SetRef(double x, double y)
double Xc() const
void SetD0(int n)
double Py(double l=0.0) const
void SetOmega(int n)
double Px(double l=0.0) const
double Ptot(double l=0.0) const
MdcxHel(double D0, double Phi0, double Omega, double Z0=0.0, double Tanl=0.0, double T0=0.0, int Code=11111, int Mode=0, double X=0.0, double Y=0.0)
void SetTanl(int n)
void SetPhi0(int n)
double Pz(double l=0.0) const
void decode(const int i, int &i1, int &i2, int &i3, int &i4, int &i5, int &i6, int &n)
virtual ~MdcxHel()
double Doca(double WX, double WY, double WZ, double X, double Y, double Z=0.0)
void print() const
void SetMode(int n)
double Y0() const
void flip()
double Yh(double l) const
double Zh(double l) const
void copy(const MdcxHel &hel)
double Xh(double l) const
void SetT0(int n)
std::vector< float > derivatives(const MdcxHit &h)
double Doca(const MdcxHit &h)
MdcxHel & operator=(const MdcxHel &)