CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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 
00067   TrackCharge charge() const {
00068     return theCharge;
00069   }
00070 
00074   float signedInverseMomentum() const {
00075     return theCharge/theP.mag();
00076   }
00077 
00081   float signedInverseTransverseMomentum() const {
00082     return theCharge/theP.perp();
00083   }
00084 
00090   float transverseCurvature() const;
00091 
00096   AlgebraicVector6 vector() const {
00097     //AlgebraicVector6 v;
00098     //v[0] = theX.x();
00099     //v[1] = theX.y();
00100     //v[2] = theX.z();
00101     //v[3] = theP.x();
00102     //v[4] = theP.y();
00103     //v[5] = theP.z();
00104     return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
00105   }
00106 
00107  
00108   GlobalVector magneticFieldInInverseGeV( const GlobalPoint& x) const; 
00109   const MagneticField& magneticField() const {return *theField;}
00110 
00111 
00112 private:
00113   const MagneticField* theField;
00114   GlobalPoint theX;
00115   GlobalVector theP;
00116   mutable float cachedCurvature_;
00117   signed char  theCharge;
00118   mutable bool hasCurvature_; 
00119   //mutable bool hasMagneticField_; mutable GlobalVector cachedMagneticField_; // 
00120 
00121 };
00122 
00123 #endif