CMS 3D CMS Logo

SteppingHelixPropagator.h
Go to the documentation of this file.
1 #ifndef SteppingHelixPropagator_SteppingHelixPropagator_h
2 #define SteppingHelixPropagator_SteppingHelixPropagator_h
3 
4 
5 
15 //
16 // Original Author: Vyacheslav Krutelyov
17 // Created: Fri Mar 3 16:01:24 CST 2006
18 //
19 //
20 
21 
22 
29 
30 #include "CLHEP/Matrix/SymMatrix.h"
31 #include "CLHEP/Matrix/Matrix.h"
32 #include "CLHEP/Vector/ThreeVector.h"
33 
34 
36 
37 class MagneticField;
39 class MagVolume;
40 
41 class SteppingHelixPropagator final : public Propagator {
42  public:
43  typedef CLHEP::Hep3Vector Vector;
44  typedef CLHEP::Hep3Vector Point;
45 
48 
49  struct Basis {
50  Vector lX;
51  Vector lY;
52  Vector lZ;
53  };
54 
55  enum Pars {
57  Z_P = 0,
58  PATHL_P = 0
59  };
60 
61  enum DestType {
71  };
72 
73  enum Fancy {
74  HEL_AS_F=0, //simple analytical helix, eloss at end of step
75  HEL_ALL_F, //analytical helix with linear eloss
76  POL_1_F, //1st order approximation, straight line
77  POL_2_F,//2nd order
78  POL_M_F //highest available
79  };
80 
84 
85  SteppingHelixPropagator* clone() const override {return new SteppingHelixPropagator(*this);}
86 
88  ~SteppingHelixPropagator() override;
89 
90  const MagneticField* magneticField() const override { return field_;}
91 
94 
97  std::pair<TrajectoryStateOnSurface, double>
98  propagateWithPath(const FreeTrajectoryState& ftsStart, const Plane& pDest) const override;
101  std::pair<TrajectoryStateOnSurface, double>
102  propagateWithPath(const FreeTrajectoryState& ftsStart, const Cylinder& cDest) const override;
104  std::pair<FreeTrajectoryState, double>
105  propagateWithPath(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const override;
107  std::pair<FreeTrajectoryState, double>
108  propagateWithPath(const FreeTrajectoryState& ftsStart,
109  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const override;
111  std::pair<FreeTrajectoryState, double>
112  propagateWithPath(const FreeTrajectoryState& ftsStart,
113  const reco::BeamSpot& beamSpot) const override;
114 
115 
116 
117  //----------------------------------------------------------------------------------------------------------
118 
120  void
121  propagate(const SteppingHelixStateInfo& ftsStart, const Surface& sDest, SteppingHelixStateInfo& out) const;
122  void
123  propagate(const SteppingHelixStateInfo& ftsStart, const Plane& pDest, SteppingHelixStateInfo& out) const;
125  void
126  propagate(const SteppingHelixStateInfo& ftsStart, const Cylinder& cDest, SteppingHelixStateInfo& out) const;
128  void
129  propagate(const SteppingHelixStateInfo& ftsStart, const GlobalPoint& pDest, SteppingHelixStateInfo& out) const;
131  void
132  propagate(const SteppingHelixStateInfo& ftsStart,
133  const GlobalPoint& pDest1, const GlobalPoint& pDest2, SteppingHelixStateInfo& out) const;
134 
135 
137  void setDebug(bool debug){ debug_ = debug;}
138 
140  void setMaterialMode(bool noMaterial) { noMaterialMode_ = noMaterial;}
141 
143  void setNoErrorPropagation(bool noErrorPropagation) { noErrorPropagation_ = noErrorPropagation;}
144 
150 
153 
156 
159 
162 
166 
170 
175 
178 
180  void setEndcapShiftsInZPosNeg(double valPos, double valNeg){
181  ecShiftPos_ = valPos; ecShiftNeg_ = valNeg;
182  }
183 
184  protected:
186  static const int MAX_POINTS = 7;
187  typedef StateInfo StateArray[MAX_POINTS+1];
188 
190  void initStateArraySHPSpecific(StateArray& svBuf, bool flagsOnly) const;
191 
193  void setIState(const SteppingHelixStateInfo& sStart,
194  StateArray& svBuff, int& nPoints) const;
195 
199  Result propagate(StateArray& svBuff, int& nPoints, SteppingHelixPropagator::DestType type,
200  const double pars[6], double epsilon = 1e-3) const;
201 
206  const SteppingHelixPropagator::Point& r3, int charge,
208  const AlgebraicSymMatrix55& covCurv) const;
209 
212  void getNextState(const SteppingHelixPropagator::StateInfo& svPrevious,
214  double dP,
216  double dS, double dX0,
217  const AlgebraicMatrix55& dCovCurv) const;
218 
221  const SteppingHelixPropagator::Vector& tau) const;
222 
226  double dS, PropagationDirection dir,
227  SteppingHelixPropagator::Fancy fancy) const;
228 
231  double& dEdXPrime, double& radX0, MatBounds& rzLims) const;
232 
234  int cIndex_(int ind) const;
235 
238  const double pars[6],
239  double& dist, double& tanDist, PropagationDirection& refDirection,
240  double fastSkipDist = 1e12) const;
241 
246  double& dist, double& tanDist,
247  double fastSkipDist = 1e12, bool expectNewMagVolume = false, double maxStep = 1e12) const;
248 
251  double& dist, double& tanDist,
252  double fastSkipDist = 1e12) const;
253 
255  bool isYokeVolume(const MagVolume* vol) const;
256 
257 
258  private:
259  typedef std::pair<TrajectoryStateOnSurface, double> TsosPP;
260  typedef std::pair<FreeTrajectoryState, double> FtsPP;
261  static const int MAX_STEPS = 10000;
262  //mutable int nPoints_;
263  //mutable StateInfo svBuf_[MAX_POINTS+1];
264 
265  StateInfo invalidState_;
266 
270  bool debug_;
281 
282  double defaultStep_;
283 
284  double ecShiftPos_;
285  double ecShiftNeg_;
286 };
287 
288 #endif
type
Definition: HCALResponse.h:21
StateInfo StateArray[MAX_POINTS+1]
void setDebug(bool debug)
Switch debug printouts (to cout) .. very verbose.
void setVBFPointer(const VolumeBasedMagneticField *val)
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 ...
bool isYokeVolume(const MagVolume *vol) const
check if it&#39;s a yoke/iron based on this MagVol internals
SteppingHelixStateInfo::VolumeBounds MatBounds
SteppingHelixStateInfo StateInfo
std::pair< TrajectoryStateOnSurface, double > TsosPP
int cIndex_(int ind) const
(Internals) circular index for array of transients
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
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 ...
PropagationDirection
std::pair< FreeTrajectoryState, double > FtsPP
Result refToMatVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12) const
Definition: Plane.h:17
void loadState(SteppingHelixPropagator::StateInfo &svCurrent, const SteppingHelixPropagator::Vector &p3, const SteppingHelixPropagator::Point &r3, int charge, PropagationDirection dir, const AlgebraicSymMatrix55 &covCurv) const
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &ftsStart, const Plane &pDest) const override
SteppingHelixPropagator * clone() const override
void setUseMagVolumes(bool val)
Switch to using MagneticField Volumes .. as in VolumeBasedMagneticField.
void initStateArraySHPSpecific(StateArray &svBuf, bool flagsOnly) const
(Internals) set defaults needed for states used inside propagate methods
SteppingHelixStateInfo::Result Result
void applyRadX0Correction(bool applyRadX0Correction)
const VolumeBasedMagneticField * vbField_
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
void propagate(const SteppingHelixStateInfo &ftsStart, const Surface &sDest, SteppingHelixStateInfo &out) const
Propagate to Plane given a starting point.
const MagneticField * magneticField() const override
rep
Definition: cuy.py:1190
~SteppingHelixPropagator() override
Destructor.
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
Result refToMagVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12, bool expectNewMagVolume=false, double maxStep=1e12) const
#define debug
Definition: HDRShower.cc:19
void setUseMatVolumes(bool val)
Switch to using Material Volumes .. internally defined for now.
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) ...
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
void setIState(const SteppingHelixStateInfo &sStart, StateArray &svBuff, int &nPoints) const
(Internals) Init starting point
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
dbl *** dir
Definition: mlp_gen.cc:35
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
const MagneticField * field_
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
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.
double p3[4]
Definition: TauolaWrapper.h:91