Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-23 16:00:34

0001 #ifndef SteppingHelixPropagator_SteppingHelixStateInfo_h
0002 #define SteppingHelixPropagator_SteppingHelixStateInfo_h
0003 
0004 /** \class SteppingHelixStateInfo
0005  *  Holder of SteppingHelixState information
0006  *
0007  *  \author Vyacheslav Krutelyov (slava77)
0008  */
0009 
0010 //
0011 // Original Author:  Vyacheslav Krutelyov
0012 //         Created:  Wed Jan  3 16:01:24 CST 2007
0013 //
0014 //
0015 
0016 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0017 
0018 #include "CLHEP/Matrix/SymMatrix.h"
0019 #include "CLHEP/Vector/ThreeVector.h"
0020 
0021 class MagneticField;
0022 class MagVolume;
0023 class Surface;
0024 class SteppingHelixPropagator;
0025 class FreeTrajectoryState;
0026 
0027 class SteppingHelixStateInfo {
0028   friend class SteppingHelixPropagator;
0029 
0030 public:
0031   typedef CLHEP::Hep3Vector Vector;
0032   typedef CLHEP::Hep3Vector Point;
0033 
0034   enum Result { OK = 0, FAULT, APPROX, RANGEOUT, INACC, NOT_IMPLEMENTED, WRONG_VOLUME, UNDEFINED, MAX_RESULT };
0035 
0036   static const std::string ResultName[MAX_RESULT];
0037 
0038   SteppingHelixStateInfo()
0039       : q(0),
0040         path_(0),
0041         radPath_(0),
0042         dir(0),
0043         magVol(nullptr),
0044         isYokeVol(false),
0045         field(nullptr),
0046         dEdx(0),
0047         dEdXPrime(0),
0048         radX0(1e12),
0049         isComplete(false),
0050         isValid_(false),
0051         hasErrorPropagated_(false),
0052         status_(UNDEFINED) {}
0053   SteppingHelixStateInfo(const FreeTrajectoryState& fts);
0054 
0055   TrajectoryStateOnSurface getStateOnSurface(const Surface& surf, bool returnTangentPlane = false) const;
0056 
0057   ///convert internal structure into the fts
0058   void getFreeState(FreeTrajectoryState& fts) const;
0059 
0060   GlobalPoint position() const { return GlobalPoint(r3.x(), r3.y(), r3.z()); }
0061   GlobalVector momentum() const { return GlobalVector(p3.x(), p3.y(), p3.z()); }
0062   int charge() const { return q; }
0063   double path() const { return isValid_ ? path_ : 0; }
0064   double radPath() const { return isValid_ ? radPath_ : 0; }
0065 
0066   bool isValid() const { return isValid_; }
0067   bool hasErrorPropagated() const { return hasErrorPropagated_; }
0068 
0069   Result status() const { return status_; }
0070 
0071 protected:
0072   struct VolumeBounds {
0073     VolumeBounds() : zMin(0), zMax(1e4), rMin(0), rMax(1e4), th1(0), th2(0) {}
0074     VolumeBounds(double r0, double r1, double z0, double z1) : zMin(z0), zMax(z1), rMin(r0), rMax(r1), th1(0), th2(0) {}
0075     VolumeBounds(double r0, double r1, double z0, double z1, double t1, double t2)
0076         : zMin(z0), zMax(z1), rMin(r0), rMax(r1), th1(t1), th2(t2) {}
0077     double zMin;
0078     double zMax;
0079     double rMin;
0080     double rMax;
0081     double th1;
0082     double th2;
0083   };
0084 
0085   int q;
0086   Vector p3;
0087   Point r3;
0088   AlgebraicSymMatrix55 covCurv;
0089   AlgebraicSymMatrix55 matDCovCurv;
0090   double path_;
0091   double radPath_;
0092   double dir;
0093   Vector bf;
0094   Vector bfGradLoc;
0095   const MagVolume* magVol;
0096   bool isYokeVol;  //will be set (most likely) only for the barrel volumes (850>r>3.8, z<667)
0097   const MagneticField* field;
0098 
0099   VolumeBounds rzLims;
0100   double dEdx;
0101   double dEdXPrime;
0102   double radX0;
0103 
0104   bool isComplete;
0105   bool isValid_;
0106   bool hasErrorPropagated_;
0107 
0108   Result status_;
0109 };
0110 #endif