Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Helix.h

00001 #ifndef HELIX_CLASS_HELIX
00002 #define HELIX_CLASS_HELIX
00003 
00004 #include "CLHEP/Matrix/Vector.h"
00005 #include "CLHEP/Matrix/SymMatrix.h"
00006 #include "CLHEP/Vector/ThreeVector.h"
00007 #include "CLHEP/Vector/LorentzVector.h"
00008 #include "CLHEP/Geometry/Point3D.h"
00009 
00011 class Helix {
00012 
00013 public:
00015   Helix();
00016 
00018   Helix(const Helix &h);
00019 
00021   Helix(const HepPoint3D & pivot,
00022         const HepVector & a,
00023         const HepSymMatrix & Ea);
00024   
00026   Helix(const HepPoint3D & pivot,
00027         const HepVector & a);
00028   
00030   Helix(const HepPoint3D & position,
00031         const Hep3Vector & momentum,
00032         double charge);
00033   
00035   virtual ~Helix();
00036   
00037 public:// Selectors
00039   const HepPoint3D & center(void) const;
00040   
00042   const HepPoint3D & pivot(void) const;
00043   
00045   double radius(void) const;
00046   
00048   HepPoint3D x(double dPhi = 0.) const;
00049   double * x(double dPhi, double p[3]) const; // p[3] is the same as the retured values.
00050   
00052   HepPoint3D x(double dPhi, HepSymMatrix & Ex) const;
00053   
00055   Hep3Vector direction(double dPhi = 0.) const;
00056   
00058   Hep3Vector momentum(double dPhi = 0.) const;
00059   
00061   Hep3Vector momentum(double dPhi, HepSymMatrix & Em) const;
00062   
00064   HepLorentzVector momentum(double dPhi, double mass) const;
00065   
00067   HepLorentzVector momentum(double dPhi, double mass, HepSymMatrix & Em) const;
00068   
00070   HepLorentzVector momentum(double dPhi, double mass, HepPoint3D & x, HepSymMatrix & Emx) const;  
00071 
00073   double a0(void) const;
00074   double dr(void) const; // dr is the same as a0.
00075   double z(void) const;
00076   double phi(void) const;
00077   double cotth(void) const;
00078   double ptinv(void) const;
00079   double kappa(void) const; // kappa is the same as ptinv.
00080   // order ATLAS[a0,z,phi,cotth,ptinv]
00081   //       BELLE[dr,phi0,kappa,dz,tanl]
00082 
00083   double sinPhi(void) const; // sin(phi)
00084   double cosPhi(void) const; // cos(phi)
00085   
00087   const HepVector & a(void) const;
00088   
00090   const HepSymMatrix & Ea(void) const;
00091   
00093   const HepVector & a(const HepVector & newA); 
00094   
00096   const HepSymMatrix & Ea(const HepSymMatrix & newdA);
00097   
00099   const HepPoint3D & pivot(const HepPoint3D & newPivot);
00100   
00102   void set(const HepPoint3D & pivot,
00103            const HepVector & a,
00104            const HepSymMatrix & Ea);
00105   
00110   void ignoreErrorMatrix(void);
00111   
00113   double bFieldZ(double);
00114   double bFieldZ(void) const;
00115   
00117   Helix & operator = (const Helix &);
00118   
00119   // Mathmatical functions
00120   HepMatrix delApDelA(const HepVector & ap, const HepPoint3D & newPivot) const;
00121   HepMatrix delXDelA(double phi) const;
00122   HepMatrix delMDelA(double phi) const;
00123   HepMatrix del4MDelA(double phi, double mass) const;
00124   HepMatrix del4MXDelA(double phi, double mass) const;
00125 
00126 protected:
00127   virtual void updateCache(void);
00128   
00129 private:
00130   double m_bField; // Tesla
00131   double m_alpha;
00132   HepPoint3D m_pivot;
00133   HepVector m_a;
00134   HepSymMatrix m_Ea;
00135   bool m_isValidErrorMatrix;
00136   
00137 private: // caches
00138   HepPoint3D m_center;
00139   double m_cp;
00140   double m_sp;
00141   double m_pt;
00142   double m_r;
00143   double m_ac[5];
00144 };
00145 
00146 inline
00147 const HepPoint3D &
00148 Helix::center(void) const {
00149   return m_center;
00150 }
00151 
00152 inline
00153 const HepPoint3D &
00154 Helix::pivot(void) const {
00155   return m_pivot;
00156 }
00157 
00158 inline
00159 double
00160 Helix::radius(void) const {
00161   return m_r;
00162 }
00163 
00164 inline
00165 Hep3Vector
00166 Helix::direction(double phi) const {
00167   return momentum(phi).unit();
00168 }
00169 
00170 inline
00171 double
00172 Helix::a0(void) const {
00173   return m_ac[0];
00174 }
00175 
00176 inline
00177 double
00178 Helix::dr(void) const {
00179   return m_ac[0];
00180 }
00181 
00182 inline
00183 double
00184 Helix::z(void) const {
00185   return m_ac[1];
00186 }
00187 
00188 inline
00189 double
00190 Helix::phi(void) const {
00191   return m_ac[2];
00192 }
00193 
00194 inline
00195 double
00196 Helix::cotth(void) const {
00197   return m_ac[3];
00198 }
00199 
00200 inline
00201 double
00202 Helix::ptinv(void) const {
00203   return m_ac[4];
00204 }
00205 
00206 inline
00207 double
00208 Helix::kappa(void) const {
00209   return m_ac[4];
00210 }
00211 
00212 inline
00213 const HepVector &
00214 Helix::a(void) const {
00215   return m_a;
00216 }
00217 
00218 inline
00219 const HepSymMatrix &
00220 Helix::Ea(void) const {
00221   return m_Ea;
00222 }
00223 
00224 inline
00225 const HepVector &
00226 Helix::a(const HepVector & i) {
00227   m_a = i;
00228   updateCache();
00229   return m_a;
00230 }
00231 
00232 inline
00233 const HepSymMatrix &
00234 Helix::Ea(const HepSymMatrix & i) {
00235   return m_Ea = i;
00236 }
00237 
00238 inline
00239 double
00240 Helix::bFieldZ(void) const {
00241   return m_bField;
00242 }
00243 
00244 inline
00245 double
00246 Helix::sinPhi(void) const {
00247   return m_sp;
00248 }
00249 
00250 inline
00251 double
00252 Helix::cosPhi(void) const {
00253   return m_cp;
00254 }
00255 #endif // HELIX_CLASS_HELIX

Generated on Tue Apr 13 13:25:32 2004 for ATLAS JAPAN by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002