CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/TrackingTools/TrajectoryParametrization/interface/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/TrajectoryState/interface/TrackCharge.h"
00007 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
00008 
00009 class MagneticField;
00010 
00016 class GlobalTrajectoryParameters {
00017 public:
00018 // construct
00019   GlobalTrajectoryParameters() :
00020     theField(0), 
00021     theX(), theP(), 
00022     cachedCurvature_(0.0),
00023     theCharge(0),
00024     hasCurvature_(false)  {}  // we must initialize cache to non-NAN to avoid FPE
00025 
00029   GlobalTrajectoryParameters(const GlobalPoint& aX,
00030                              const GlobalVector& aP,
00031                              TrackCharge aCharge, 
00032                              const MagneticField* fieldProvider) :
00033     theField(fieldProvider),
00034     theX(aX), theP(aP),     
00035     cachedCurvature_(aCharge),
00036     theCharge(aCharge),
00037     hasCurvature_(false) {
00038   } // we must initialize cache to non-NAN to avoid FPE
00039 
00045   GlobalTrajectoryParameters(const GlobalPoint& aX,
00046                              const GlobalVector& direction,
00047                              float transverseCurvature, int, 
00048                              const MagneticField* fieldProvider);
00049 
00053   GlobalPoint position() const {
00054     return theX;
00055   }
00056 
00060   GlobalVector momentum() const {
00061     return theP;
00062   }
00063 
00064   GlobalVector direction() const {
00065     return theP.unit();
00066   }
00067 
00071   TrackCharge charge() const {
00072     return theCharge;
00073   }
00074 
00078   float signedInverseMomentum() const {
00079     return theCharge/theP.mag();
00080   }
00081 
00085   float signedInverseTransverseMomentum() const {
00086     return theCharge/theP.perp();
00087   }
00088 
00094   float transverseCurvature() const;
00095 
00100   AlgebraicVector6 vector() const {
00101     //AlgebraicVector6 v;
00102     //v[0] = theX.x();
00103     //v[1] = theX.y();
00104     //v[2] = theX.z();
00105     //v[3] = theP.x();
00106     //v[4] = theP.y();
00107     //v[5] = theP.z();
00108     return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
00109   }
00110 
00111  
00112   GlobalVector magneticFieldInInverseGeV( const GlobalPoint& x) const; 
00113   const MagneticField& magneticField() const {return *theField;}
00114 
00115 
00116 private:
00117   const MagneticField* theField;
00118   GlobalPoint theX;
00119   GlobalVector theP;
00120   mutable float cachedCurvature_;
00121   signed char  theCharge;
00122   mutable bool hasCurvature_; 
00123   //mutable bool hasMagneticField_; mutable GlobalVector cachedMagneticField_; // 
00124 
00125 };
00126 
00127 #endif