/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/TrkExtAlg/TrkExtAlg-00-00-64/TrkExtAlg/Helix.h

Go to the documentation of this file.
00001 //
00002 // $Id: Helix.h,v 1.6 2009/08/12 11:16:28 wangll Exp $
00003 //
00004 //   Class Helix 
00005 //
00006 //   Author      Date         comments
00007 //   Y.Ohnishi   03/01/1997   original version
00008 //   Y.Ohnishi   06/03/1997   updated
00009 //   Y.Iwasaki   17/02/1998   BFILED removed, func. name changed, func. added
00010 //   J.Tanaka    06/12/1998   add some utilities.
00011 //   Y.Iwasaki   07/07/1998   cache added to speed up
00012 //   Y.Iwasaki   25/04/2001   cache m_ac[5] added to speed up
00013 //
00014 #ifndef Ext_Helix_FLAG_
00015 #define Ext_Helix_FLAG_
00016 #include "GaudiKernel/IInterface.h"
00017 #include "GaudiKernel/Kernel.h"
00018 #include "GaudiKernel/Service.h"
00019 #include "MagneticField/IMagneticFieldSvc.h"
00020 #include "MagneticField/MagneticFieldSvc.h"
00021 
00022 #include "CLHEP/Matrix/Vector.h"
00023 #include "CLHEP/Matrix/SymMatrix.h"
00024 //#ifndef CLHEP_THREEVECTOR_H
00025 #include "CLHEP/Vector/ThreeVector.h"
00026 //#endif
00027 #include "CLHEP/Vector/LorentzVector.h"
00028 //#ifndef CLHEP_POINT3D_H
00029 #include "CLHEP/Geometry/Point3D.h"
00030 //#endif
00031 
00032 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00033 typedef HepGeom::Point3D<double> HepPoint3D;
00034 #endif
00035 using namespace CLHEP;
00036 
00038 class Ext_Helix {
00039 
00040   public:
00042     Ext_Helix(const HepPoint3D & pivot,
00043           const HepVector & a,
00044           const HepSymMatrix & Ea);
00045 
00047     Ext_Helix(const HepPoint3D & pivot,
00048           const HepVector & a);
00049 
00051     Ext_Helix(const HepPoint3D & position,
00052           const Hep3Vector & momentum,
00053           double charge);
00054 
00056     virtual ~Ext_Helix();
00057 
00058   public:// Selectors
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:// Parametrization dependent functions. Prepared for tracking codes. Users should not use them.
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:// Modifiers
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:// Operators
00134     Ext_Helix & operator = (const Ext_Helix &);
00135 
00136   public:// Mathmatical functions
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     IMagneticFieldSvc* m_pmgnIMF;
00145 
00146   private:
00147     void updateCache(void);
00148 
00149   public:
00151     static const double ConstantAlpha;
00152 
00153   private:
00154     double m_bField;
00155     double m_alpha;
00156     HepPoint3D m_pivot;
00157     HepVector m_a;
00158     HepSymMatrix m_Ea;
00159     bool m_matrixValid;
00160 
00161   private: // caches
00162     HepPoint3D m_center;
00163     double m_cp;
00164     double m_sp;
00165     double m_pt;
00166     double m_r;
00167     double m_ac[5];
00168 };
00169 
00170 //-----------------------------------------------------------------------------
00171 
00172 #ifdef Ext_Helix_NO_INLINE
00173 #define inline
00174 #else
00175 #undef inline
00176 #define Ext_Helix_INLINE_DEFINE_HERE
00177 #endif
00178 
00179 #ifdef Ext_Helix_INLINE_DEFINE_HERE
00180 
00181 inline
00182 const HepPoint3D &
00183 Ext_Helix::center(void) const {
00184     return m_center;
00185 }
00186 
00187 inline
00188 const HepPoint3D &
00189 Ext_Helix::pivot(void) const {
00190     return m_pivot;
00191 }
00192 
00193 inline
00194 double
00195 Ext_Helix::radius(void) const {
00196     return m_r;
00197 }
00198 
00199 inline
00200 Hep3Vector
00201 Ext_Helix::direction(double phi) const {
00202     return momentum(phi).unit();
00203 }
00204 
00205 inline
00206 double
00207 Ext_Helix::dr(void) const {
00208     return m_ac[0];
00209 }
00210 
00211 inline
00212 double
00213 Ext_Helix::phi0(void) const {
00214     return m_ac[1];
00215 }
00216 
00217 inline
00218 double
00219 Ext_Helix::kappa(void) const {
00220     return m_ac[2];
00221 }
00222 
00223 inline
00224 double
00225 Ext_Helix::dz(void) const {
00226     return m_ac[3];
00227 }
00228 
00229 inline
00230 double
00231 Ext_Helix::tanl(void) const {
00232     return m_ac[4];
00233 }
00234 
00235 inline
00236 double
00237 Ext_Helix::curv(void) const {
00238     return m_r;
00239 }
00240 
00241 inline
00242 const HepVector &
00243 Ext_Helix::a(void) const {
00244     return m_a;
00245 }
00246 
00247 inline
00248 const HepSymMatrix &
00249 Ext_Helix::Ea(void) const {
00250     return m_Ea;
00251 }
00252 
00253 inline
00254 const HepVector &
00255 Ext_Helix::a(const HepVector & i) {
00256     m_a = i;
00257     updateCache();
00258     return m_a;
00259 }
00260 
00261 inline
00262 const HepSymMatrix &
00263 Ext_Helix::Ea(const HepSymMatrix & i) {
00264     return m_Ea = i;
00265 }
00266 
00267 inline
00268 double
00269 Ext_Helix::bFieldZ(double a) {
00270     m_bField = a;
00271     m_alpha = 10000. / 2.99792458 / m_bField;
00272     updateCache();
00273     return m_bField;
00274 }
00275 
00276 inline
00277 double
00278 Ext_Helix::bFieldZ(void) const {
00279     return m_bField;
00280 }
00281 
00282 inline
00283 double
00284 Ext_Helix::sinPhi0(void) const {
00285     return m_sp;
00286 }
00287 
00288 inline
00289 double
00290 Ext_Helix::cosPhi0(void) const {
00291     return m_cp;
00292 }
00293 
00294 #endif
00295 
00296 #undef inline
00297 
00298 #endif /* Ext_Helix_FLAG_ */

Generated on Tue Nov 29 22:57:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7