CMS 3D CMS Logo

SteppingHelixPropagator.h
Go to the documentation of this file.
1 #ifndef SteppingHelixPropagator_SteppingHelixPropagator_h
2 #define SteppingHelixPropagator_SteppingHelixPropagator_h
3 
13 //
14 // Original Author: Vyacheslav Krutelyov
15 // Created: Fri Mar 3 16:01:24 CST 2006
16 //
17 //
18 
25 
26 #include "CLHEP/Matrix/SymMatrix.h"
27 #include "CLHEP/Matrix/Matrix.h"
28 #include "CLHEP/Vector/ThreeVector.h"
29 
31 
32 class MagneticField;
34 class MagVolume;
35 
36 class SteppingHelixPropagator final : public Propagator {
37 public:
38  typedef CLHEP::Hep3Vector Vector;
39  typedef CLHEP::Hep3Vector Point;
40 
43 
44  struct Basis {
48  };
49 
50  enum Pars { RADIUS_P = 0, Z_P = 0, PATHL_P = 0 };
51 
52  enum DestType {
53  RADIUS_DT = 0,
62  };
63 
64  enum Fancy {
65  HEL_AS_F = 0, //simple analytical helix, eloss at end of step
66  HEL_ALL_F, //analytical helix with linear eloss
67  POL_1_F, //1st order approximation, straight line
68  POL_2_F, //2nd order
69  POL_M_F //highest available
70  };
71 
75 
76  SteppingHelixPropagator* clone() const override { return new SteppingHelixPropagator(*this); }
77 
79  ~SteppingHelixPropagator() override;
80 
81  const MagneticField* magneticField() const override { return field_; }
82 
85 
88  std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
89  const Plane& pDest) const override;
92  std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
93  const Cylinder& cDest) const override;
95  std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
96  const GlobalPoint& pDest) const override;
98  std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
99  const GlobalPoint& pDest1,
100  const GlobalPoint& pDest2) const override;
102  std::pair<FreeTrajectoryState, double> propagateWithPath(const FreeTrajectoryState& ftsStart,
103  const reco::BeamSpot& beamSpot) const override;
104 
105  //----------------------------------------------------------------------------------------------------------
106 
108  void propagate(const SteppingHelixStateInfo& ftsStart, const Surface& sDest, SteppingHelixStateInfo& out) const;
109  void propagate(const SteppingHelixStateInfo& ftsStart, const Plane& pDest, SteppingHelixStateInfo& out) const;
111  void propagate(const SteppingHelixStateInfo& ftsStart, const Cylinder& cDest, SteppingHelixStateInfo& out) const;
113  void propagate(const SteppingHelixStateInfo& ftsStart, const GlobalPoint& pDest, SteppingHelixStateInfo& out) const;
115  void propagate(const SteppingHelixStateInfo& ftsStart,
116  const GlobalPoint& pDest1,
117  const GlobalPoint& pDest2,
118  SteppingHelixStateInfo& out) const;
119 
121  void setDebug(bool debug) { debug_ = debug; }
122 
124  void setMaterialMode(bool noMaterial) { noMaterialMode_ = noMaterial; }
125 
127  void setNoErrorPropagation(bool noErrorPropagation) { noErrorPropagation_ = noErrorPropagation; }
128 
134 
137 
140 
143 
146 
150 
154 
159 
162 
164  void setEndcapShiftsInZPosNeg(double valPos, double valNeg) {
165  ecShiftPos_ = valPos;
166  ecShiftNeg_ = valNeg;
167  }
168 
169 protected:
171  static const int MAX_POINTS = 7;
173 
175  void initStateArraySHPSpecific(StateArray& svBuf, bool flagsOnly) const;
176 
178  void setIState(const SteppingHelixStateInfo& sStart, StateArray& svBuff, int& nPoints) const;
179 
183  Result propagate(StateArray& svBuff,
184  int& nPoints,
186  const double pars[6],
187  double epsilon = 1e-3) const;
188 
194  int charge,
196  const AlgebraicSymMatrix55& covCurv) const;
197 
200  void getNextState(const SteppingHelixPropagator::StateInfo& svPrevious,
202  double dP,
204  const SteppingHelixPropagator::Vector& drVec,
205  double dS,
206  double dX0,
207  const AlgebraicMatrix55& dCovCurv) const;
208 
211 
215  double dS,
217  SteppingHelixPropagator::Fancy fancy) const;
218 
221  double& dEdXPrime,
222  double& radX0,
223  MatBounds& rzLims) const;
224 
226  int cIndex_(int ind) const;
227 
231  const double pars[6],
232  double& dist,
233  double& tanDist,
234  PropagationDirection& refDirection,
235  double fastSkipDist = 1e12) const;
236 
241  double& dist,
242  double& tanDist,
243  double fastSkipDist = 1e12,
244  bool expectNewMagVolume = false,
245  double maxStep = 1e12) const;
246 
249  double& dist,
250  double& tanDist,
251  double fastSkipDist = 1e12) const;
252 
254  bool isYokeVolume(const MagVolume* vol) const;
255 
256 private:
257  typedef std::pair<TrajectoryStateOnSurface, double> TsosPP;
258  typedef std::pair<FreeTrajectoryState, double> FtsPP;
259  static const int MAX_STEPS = 10000;
260  //mutable int nPoints_;
261  //mutable StateInfo svBuf_[MAX_POINTS+1];
262 
264 
268  bool debug_;
279 
280  double defaultStep_;
281 
282  double ecShiftPos_;
283  double ecShiftNeg_;
284 };
285 
286 #endif
StateInfo StateArray[MAX_POINTS+1]
void setIState(const SteppingHelixStateInfo &sStart, StateArray &svBuff, int &nPoints) const
(Internals) Init starting point
void setDebug(bool debug)
Switch debug printouts (to cout) .. very verbose.
const MagneticField * magneticField() const override
void getNextState(const SteppingHelixPropagator::StateInfo &svPrevious, SteppingHelixPropagator::StateInfo &svNext, double dP, const SteppingHelixPropagator::Vector &tau, const SteppingHelixPropagator::Vector &drVec, double dS, double dX0, const AlgebraicMatrix55 &dCovCurv) const
void setVBFPointer(const VolumeBasedMagneticField *val)
SteppingHelixPropagator * clone() const override
bool makeAtomStep(SteppingHelixPropagator::StateInfo &svCurrent, SteppingHelixPropagator::StateInfo &svNext, double dS, PropagationDirection dir, SteppingHelixPropagator::Fancy fancy) const
main stepping function: compute next state vector after a step of length dS
SteppingHelixStateInfo::VolumeBounds MatBounds
SteppingHelixStateInfo StateInfo
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
std::pair< TrajectoryStateOnSurface, double > TsosPP
void initStateArraySHPSpecific(StateArray &svBuf, bool flagsOnly) const
(Internals) set defaults needed for states used inside propagate methods
PropagationDirection
std::pair< FreeTrajectoryState, double > FtsPP
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
Definition: Plane.h:16
double getDeDx(const SteppingHelixPropagator::StateInfo &sv, double &dEdXPrime, double &radX0, MatBounds &rzLims) const
estimate average (in fact smth. close to MPV and median) energy loss per unit path length ...
Result refToDest(DestType dest, const SteppingHelixPropagator::StateInfo &sv, const double pars[6], double &dist, double &tanDist, PropagationDirection &refDirection, double fastSkipDist=1e12) const
(Internals) determine distance and direction from the current position to the plane ...
void loadState(SteppingHelixPropagator::StateInfo &svCurrent, const SteppingHelixPropagator::Vector &p3, const SteppingHelixPropagator::Point &r3, int charge, PropagationDirection dir, const AlgebraicSymMatrix55 &covCurv) const
void setUseMagVolumes(bool val)
Switch to using MagneticField Volumes .. as in VolumeBasedMagneticField.
SteppingHelixStateInfo::Result Result
void applyRadX0Correction(bool applyRadX0Correction)
const VolumeBasedMagneticField * vbField_
rep
Definition: cuy.py:1189
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:10
~SteppingHelixPropagator() override
Destructor.
#define debug
Definition: HDRShower.cc:19
void setUseMatVolumes(bool val)
Switch to using Material Volumes .. internally defined for now.
void propagate(const SteppingHelixStateInfo &ftsStart, const Surface &sDest, SteppingHelixStateInfo &out) const
Propagate to Plane given a starting point.
bool isYokeVolume(const MagVolume *vol) const
check if it&#39;s a yoke/iron based on this MagVol internals
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const AlgebraicSymMatrix55 unit55_
void setRep(SteppingHelixPropagator::Basis &rep, const SteppingHelixPropagator::Vector &tau) const
Set/compute basis vectors for local coordinates at current step (called by incrementState) ...
int cIndex_(int ind) const
(Internals) circular index for array of transients
void setReturnTangentPlane(bool val)
flag to return tangent plane for non-plane input
void setSendLogWarning(bool val)
flag to send LogWarning on failures
void setUseInTeslaFromMagField(bool val)
force getting field value from MagneticField, not the geometric one
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &ftsStart, const Plane &pDest) const override
Result refToMagVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12, bool expectNewMagVolume=false, double maxStep=1e12) const
Result refToMatVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12) const
const MagneticField * field_
void setEndcapShiftsInZPosNeg(double valPos, double valNeg)
set shifts in Z for endcap pieces (includes EE, HE, ME, YE)
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
void setNoErrorPropagation(bool noErrorPropagation)
Force no error propagation.