CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/TrajectoryParametrization/interface/PerigeeTrajectoryParameters.h

Go to the documentation of this file.
00001 #ifndef PerigeeTrajectoryParameters_H
00002 #define PerigeeTrajectoryParameters_H
00003 
00012 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00013 #include "DataFormats/Math/interface/Vector.h"
00014 #include "DataFormats/TrackReco/interface/TrackBase.h"
00015 
00016 class PerigeeTrajectoryParameters
00017 {
00018 
00019 public:
00020 
00021   PerigeeTrajectoryParameters() {}
00022 
00023   explicit PerigeeTrajectoryParameters(const AlgebraicVector &aVector, bool charged = true):
00024        theCurv(aVector[0]), theTheta(aVector[1]), thePhi(aVector[2]),
00025        theTip(aVector[3]), theLip(aVector[4]), theVector(asSVector<5>(aVector)), 
00026        vectorIsAvailable(true)
00027   {
00028     if ( charged )
00029       theCharge = theCurv>0 ? -1 : 1;
00030     else
00031       theCharge = 0;
00032   }
00033 
00034   explicit PerigeeTrajectoryParameters(const AlgebraicVector5 &aVector, bool charged = true):
00035        theCurv(aVector[0]), theTheta(aVector[1]), thePhi(aVector[2]),
00036        theTip(aVector[3]), theLip(aVector[4]), theVector(aVector), 
00037        vectorIsAvailable(true)
00038   {
00039     if ( charged )
00040       theCharge = theCurv>0 ? -1 : 1;
00041     else
00042       theCharge = 0;
00043   }
00044 
00045   PerigeeTrajectoryParameters(double aCurv, double aTheta, double aPhi,
00046                               double aTip, double aLip, bool charged = true):
00047     theCurv(aCurv), theTheta(aTheta), thePhi(aPhi), theTip(aTip), theLip(aLip),
00048     vectorIsAvailable(false)
00049   {
00050     if ( charged )
00051       theCharge = theCurv>0 ? -1 : 1;
00052     else
00053       theCharge = 0;
00054   }
00055 
00060   TrackCharge charge() const {return theCharge;}
00061 
00066   double transverseCurvature() const {return ((charge()!=0)?theCurv:0.);}
00067 
00072   double theta() const {return theTheta;}
00073 
00078   double phi() const {return thePhi;}
00079 
00084   double transverseImpactParameter() const {return theTip;}
00085 
00090   double longitudinalImpactParameter() const {return theLip;}
00091 
00098   const AlgebraicVector  vector_old() const { return asHepVector(theVector); }
00099 
00100   const AlgebraicVector5 & vector() const
00101   {
00102     if (!vectorIsAvailable) {
00103       //theVector = AlgebraicVector5();
00104       theVector[0] = theCurv;
00105       theVector[1] = theTheta;
00106       theVector[2] = thePhi;
00107       theVector[3] = theTip;
00108       theVector[4] = theLip;
00109       vectorIsAvailable = true;
00110     }
00111     return theVector;
00112   }
00113 
00114 
00115 private:
00116   double theCurv, theTheta, thePhi, theTip, theLip;
00117   TrackCharge theCharge;
00118   mutable AlgebraicVector5 theVector;
00119   mutable bool vectorIsAvailable;
00120 
00121 };
00122 #endif