00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef VertexFit_VFHelix_FLAG_
00015 #define VertexFit_VFHelix_FLAG_
00016
00017 #include "CLHEP/Matrix/Matrix.h"
00018 #include "CLHEP/Matrix/Vector.h"
00019 #include "CLHEP/Matrix/SymMatrix.h"
00020 using CLHEP::HepMatrix;
00021 using CLHEP::HepVector;
00022 using CLHEP::HepSymMatrix;
00023 #ifndef CLHEP_THREEVECTOR_H
00024 #include "CLHEP/Vector/ThreeVector.h"
00025 using CLHEP::Hep3Vector;
00026 #endif
00027 #include "CLHEP/Vector/LorentzVector.h"
00028 using CLHEP::HepLorentzVector;
00029 #ifndef CLHEP_POINT3D_H
00030 #include "CLHEP/Geometry/Point3D.h"
00031 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00032 typedef HepGeom::Point3D<double> HepPoint3D;
00033 #endif
00034
00035 #endif
00036
00038 class VFHelix {
00039
00040 public:
00042 VFHelix(const HepPoint3D & pivot,
00043 const HepVector & a,
00044 const HepSymMatrix & Ea);
00045
00047 VFHelix(const HepPoint3D & pivot,
00048 const HepVector & a);
00049
00051 VFHelix(const HepPoint3D & position,
00052 const Hep3Vector & momentum,
00053 double charge);
00054
00056 virtual ~VFHelix();
00057
00058 public:
00060 const HepPoint3D & center(void) const;
00061
00063 const HepPoint3D & pivot(void) const;
00064
00066 double radius(void) const;
00067
00069 HepPoint3D x(double dPhi = 0.) const;
00070 double * x(double dPhi, double p[3]) const;
00071
00073 HepPoint3D x(double dPhi, HepSymMatrix & Ex) const;
00074
00076 Hep3Vector direction(double dPhi = 0.) const;
00077
00079 Hep3Vector momentum(double dPhi = 0.) const;
00080
00082 Hep3Vector momentum(double dPhi, HepSymMatrix & Em) const;
00083
00085 HepLorentzVector momentum(double dPhi, double mass) const;
00086
00088 HepLorentzVector momentum(double dPhi, double mass, HepSymMatrix & Em) const;
00089
00091 HepLorentzVector momentum(double dPhi, double mass, HepPoint3D & x, HepSymMatrix & Emx) const;
00092
00093 public:
00095 double dr(void) const;
00096 double phi0(void) const;
00097 double kappa(void) const;
00098 double dz(void) const;
00099 double tanl(void) const;
00100 double curv(void) const;
00101 double sinPhi0(void) const;
00102 double cosPhi0(void) const;
00103
00105 const HepVector & a(void) const;
00106
00108 const HepSymMatrix & Ea(void) const;
00109
00110 public:
00112 const HepVector & a(const HepVector & newA);
00113
00115 const HepSymMatrix & Ea(const HepSymMatrix & newdA);
00116
00118 const HepPoint3D & pivot(const HepPoint3D & newPivot);
00119
00121 void set(const HepPoint3D & pivot,
00122 const HepVector & a,
00123 const HepSymMatrix & Ea);
00124
00126 void ignoreErrorMatrix(void);
00127
00129 double bFieldZ(double);
00130 double bFieldZ(void) const;
00131
00132 public:
00134 VFHelix & operator = (const VFHelix &);
00135
00136 public:
00137 HepMatrix delApDelA(const HepVector & ap) const;
00138 HepMatrix delXDelA(double phi) const;
00139 HepMatrix delMDelA(double phi) const;
00140 HepMatrix del4MDelA(double phi, double mass) const;
00141 HepMatrix del4MXDelA(double phi, double mass) const;
00142
00143 private:
00144 void updateCache(void);
00145
00146 public:
00148 static const double ConstantAlpha;
00149
00150 private:
00151 double m_bField;
00152 double m_alpha;
00153 HepPoint3D m_pivot;
00154 HepVector m_a;
00155 HepSymMatrix m_Ea;
00156 bool m_matrixValid;
00157
00158 private:
00159 HepPoint3D m_center;
00160 double m_cp;
00161 double m_sp;
00162 double m_pt;
00163 double m_r;
00164 double m_ac[5];
00165 };
00166
00167
00168
00169 #ifdef VFHelix_NO_INLINE
00170 #define inline
00171 #else
00172 #undef inline
00173 #define VFHelix_INLINE_DEFINE_HERE
00174 #endif
00175
00176 #ifdef VFHelix_INLINE_DEFINE_HERE
00177
00178 inline
00179 const HepPoint3D &
00180 VFHelix::center(void) const {
00181 return m_center;
00182 }
00183
00184 inline
00185 const HepPoint3D &
00186 VFHelix::pivot(void) const {
00187 return m_pivot;
00188 }
00189
00190 inline
00191 double
00192 VFHelix::radius(void) const {
00193 return m_r;
00194 }
00195
00196 inline
00197 Hep3Vector
00198 VFHelix::direction(double phi) const {
00199 return momentum(phi).unit();
00200 }
00201
00202 inline
00203 double
00204 VFHelix::dr(void) const {
00205 return m_ac[0];
00206 }
00207
00208 inline
00209 double
00210 VFHelix::phi0(void) const {
00211 return m_ac[1];
00212 }
00213
00214 inline
00215 double
00216 VFHelix::kappa(void) const {
00217 return m_ac[2];
00218 }
00219
00220 inline
00221 double
00222 VFHelix::dz(void) const {
00223 return m_ac[3];
00224 }
00225
00226 inline
00227 double
00228 VFHelix::tanl(void) const {
00229 return m_ac[4];
00230 }
00231
00232 inline
00233 double
00234 VFHelix::curv(void) const {
00235 return m_r;
00236 }
00237
00238 inline
00239 const HepVector &
00240 VFHelix::a(void) const {
00241 return m_a;
00242 }
00243
00244 inline
00245 const HepSymMatrix &
00246 VFHelix::Ea(void) const {
00247 return m_Ea;
00248 }
00249
00250 inline
00251 const HepVector &
00252 VFHelix::a(const HepVector & i) {
00253 m_a = i;
00254 updateCache();
00255 return m_a;
00256 }
00257
00258 inline
00259 const HepSymMatrix &
00260 VFHelix::Ea(const HepSymMatrix & i) {
00261 return m_Ea = i;
00262 }
00263
00264 inline
00265 double
00266 VFHelix::bFieldZ(double a) {
00267 m_bField = a;
00268 m_alpha = 10000. / 2.99792458 / m_bField;
00269 updateCache();
00270 return m_bField;
00271 }
00272
00273 inline
00274 double
00275 VFHelix::bFieldZ(void) const {
00276 return m_bField;
00277 }
00278
00279 inline
00280 double
00281 VFHelix::sinPhi0(void) const {
00282 return m_sp;
00283 }
00284
00285 inline
00286 double
00287 VFHelix::cosPhi0(void) const {
00288 return m_cp;
00289 }
00290
00291 #endif
00292
00293 #undef inline
00294
00295 #endif