CMS 3D CMS Logo

GlobalTrajectoryParameters.h

Go to the documentation of this file.
00001 #ifndef _TRACKER_GLOBALTRAJECTORYPARAMETERS_H_
00002 #define _TRACKER_GLOBALTRAJECTORYPARAMETERS_H_
00003 
00004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00005 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00007 #include "DataFormats/TrajectoryState/interface/TrackCharge.h"
00008 
00009 class MagneticField;
00010 
00016 class GlobalTrajectoryParameters {
00017 public:
00018 // construct
00019   GlobalTrajectoryParameters() {}
00020 
00024   GlobalTrajectoryParameters(const GlobalPoint& aX,
00025                              const GlobalVector& aP,
00026                              TrackCharge aCharge, 
00027                              const MagneticField* fieldProvider) :
00028     theX(aX), theP(aP), theCharge(aCharge), theField(fieldProvider),
00029     hasCurvature_(false), cachedCurvature_(1.0) {} // we must initialize cache to non-NAN to avoid FPE
00030 
00037   GlobalTrajectoryParameters(const GlobalPoint& aX,
00038                              const GlobalVector& direction,
00039                              double transverseCurvature, int, 
00040                              const MagneticField* fieldProvider);
00041 
00045   GlobalPoint position() const {
00046     return theX;
00047   }
00048 
00052   GlobalVector momentum() const {
00053     return theP;
00054   }
00055 
00059   TrackCharge charge() const {
00060     return theCharge;
00061   }
00062 
00066   double signedInverseMomentum() const {
00067     return theCharge/theP.mag();
00068   }
00069 
00073   double signedInverseTransverseMomentum() const {
00074     return theCharge/theP.perp();
00075   }
00076 
00082   double transverseCurvature() const;
00083 
00088   AlgebraicVector6 vector() const {
00089     //AlgebraicVector6 v;
00090     //v[0] = theX.x();
00091     //v[1] = theX.y();
00092     //v[2] = theX.z();
00093     //v[3] = theP.x();
00094     //v[4] = theP.y();
00095     //v[5] = theP.z();
00096     return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
00097   }
00098 
00103   AlgebraicVector vector_old() const { return asHepVector(vector());  }
00104 
00105   GlobalVector magneticFieldInInverseGeV( const GlobalPoint& x) const; 
00106   const MagneticField& magneticField() const {return *theField;}
00107 
00108 private:
00109   GlobalPoint theX;
00110   GlobalVector theP;
00111   TrackCharge theCharge;
00112   const MagneticField* theField;
00113   mutable bool hasCurvature_; mutable double cachedCurvature_;
00114   //mutable bool hasMagneticField_; mutable GlobalVector cachedMagneticField_; // 
00115 
00116 };
00117 
00118 #endif

Generated on Tue Jun 9 17:48:35 2009 for CMSSW by  doxygen 1.5.4