CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/TrajectoryParametrization/src/GlobalTrajectoryParameters.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
00002 #include "MagneticField/Engine/interface/MagneticField.h"
00003 
00004 GlobalTrajectoryParameters::GlobalTrajectoryParameters(const GlobalPoint& aX,
00005                                                        const GlobalVector& direction,
00006                                                        double transverseCurvature, int, 
00007                                                        const MagneticField* fieldProvider) :
00008   theX(aX), theField(fieldProvider), hasCurvature_(true), cachedCurvature_(transverseCurvature)
00009 {
00010   double bza = -2.99792458e-3 * theField->inTesla(theX).z();
00011   double qbp = transverseCurvature/bza*direction.perp();
00012   theP = direction*fabs(1./qbp);
00013   theCharge = qbp > 0. ? 1 : -1;
00014 }
00015 
00016 double GlobalTrajectoryParameters::transverseCurvature() const
00017 {
00018   if (!hasCurvature_) {
00019       double bza = -2.99792458e-3 * theField->inTesla(theX).z();
00020       cachedCurvature_ = bza*signedInverseTransverseMomentum();
00021       hasCurvature_ = true;
00022   }
00023   return cachedCurvature_;
00024 }
00025 
00026 GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV( const GlobalPoint& x) const
00027 {
00028   return 2.99792458e-3 * theField->inTesla(x);
00029 }