CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixStateInfo.h

Go to the documentation of this file.
00001 #ifndef SteppingHelixPropagator_SteppingHelixStateInfo_h
00002 #define SteppingHelixPropagator_SteppingHelixStateInfo_h
00003 
00004 
00005 
00014 //
00015 // Original Author:  Vyacheslav Krutelyov
00016 //         Created:  Wed Jan  3 16:01:24 CST 2007
00017 // $Id: SteppingHelixStateInfo.h,v 1.16 2009/09/08 20:44:31 slava77 Exp $
00018 //
00019 //
00020 
00021 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00022 
00023 
00024 #include "CLHEP/Matrix/SymMatrix.h"
00025 #include "CLHEP/Vector/ThreeVector.h"
00026 
00027 
00028 
00029 class MagneticField;
00030 class MagVolume;
00031 class Surface;
00032 class SteppingHelixPropagator;
00033 class FreeTrajectoryState;
00034 
00035 class SteppingHelixStateInfo {
00036   friend class SteppingHelixPropagator;
00037  public:
00038   typedef CLHEP::Hep3Vector Vector;
00039   typedef CLHEP::Hep3Vector  Point;
00040   
00041   enum Result {
00042     OK=0,
00043     FAULT,
00044     APPROX,
00045     RANGEOUT,
00046     INACC,
00047     NOT_IMPLEMENTED,
00048     WRONG_VOLUME,
00049     UNDEFINED,
00050     MAX_RESULT
00051   };
00052 
00053   static const std::string ResultName[MAX_RESULT];
00054 
00055   SteppingHelixStateInfo(): 
00056     path_(0), radPath_(0), dir(0), magVol(0), field(0), dEdx(0), dEdXPrime(0), radX0(1e12),
00057     isComplete(0), isValid_(0), hasErrorPropagated_(0), status_(UNDEFINED) {}
00058   SteppingHelixStateInfo(const FreeTrajectoryState& fts);
00059 
00060   TrajectoryStateOnSurface getStateOnSurface(const Surface& surf, bool returnTangentPlane = false) const;
00061 
00063   void getFreeState(FreeTrajectoryState& fts) const;
00064 
00065   GlobalPoint position() const {return GlobalPoint(r3.x(), r3.y(), r3.z());}
00066   GlobalVector momentum() const {return GlobalVector(p3.x(), p3.y(), p3.z());}
00067   int charge() const {return q;}
00068   double path() const {return isValid_ ? path_ : 0;}
00069   double radPath() const {return isValid_ ? radPath_ : 0;}
00070 
00071   bool isValid() const {return isValid_;}
00072   bool hasErrorPropagated() const {return hasErrorPropagated_;}
00073 
00074   Result status() const {return status_;}
00075 
00076  protected:
00077   struct VolumeBounds {
00078     VolumeBounds(): zMin(0), zMax(1e4), rMin(0), rMax(1e4), th1(0), th2(0) {}
00079     VolumeBounds(double r0, double r1, double z0, double z1):
00080       zMin(z0), zMax(z1), rMin(r0), rMax(r1), th1(0), th2(0) {}
00081     VolumeBounds(double r0, double r1, double z0, double z1, double t1, double t2):
00082       zMin(z0), zMax(z1), rMin(r0), rMax(r1), th1(t1), th2(t2) {}
00083     double zMin;
00084     double zMax;
00085     double rMin;
00086     double rMax;
00087     double th1;
00088     double th2;
00089   };
00090   
00091 
00092   int q;
00093   Vector p3;
00094   Point r3;
00095   AlgebraicSymMatrix55 covCurv;
00096   AlgebraicSymMatrix55 matDCovCurv;
00097   double path_;
00098   double radPath_;
00099   double dir;
00100   Vector bf;
00101   Vector bfGradLoc;
00102   const MagVolume* magVol;
00103   bool isYokeVol;//will be set (most likely) only for the barrel volumes (850>r>3.8, z<667)
00104   const MagneticField* field;  
00105   
00106   VolumeBounds rzLims;
00107   double dEdx;
00108   double dEdXPrime;
00109   double radX0;
00110 
00111   bool isComplete;
00112   bool isValid_;
00113   bool hasErrorPropagated_;
00114 
00115   Result status_;
00116 };
00117 #endif