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
SteppingHelixPropagator::clone
SteppingHelixPropagator * clone() const override
Definition: SteppingHelixPropagator.h:76
SteppingHelixPropagator::Point
CLHEP::Hep3Vector Point
Definition: SteppingHelixPropagator.h:39
SteppingHelixPropagator::CONE_DT
Definition: SteppingHelixPropagator.h:56
Propagator.h
SteppingHelixPropagator::useIsYokeFlag_
bool useIsYokeFlag_
Definition: SteppingHelixPropagator.h:273
TrajectoryStateOnSurface.h
SteppingHelixPropagator::MatBounds
SteppingHelixStateInfo::VolumeBounds MatBounds
Definition: SteppingHelixPropagator.h:170
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
SteppingHelixPropagator::setEndcapShiftsInZPosNeg
void setEndcapShiftsInZPosNeg(double valPos, double valNeg)
set shifts in Z for endcap pieces (includes EE, HE, ME, YE)
Definition: SteppingHelixPropagator.h:164
SteppingHelixPropagator::ecShiftPos_
double ecShiftPos_
Definition: SteppingHelixPropagator.h:282
SteppingHelixPropagator::Basis::lX
Vector lX
Definition: SteppingHelixPropagator.h:45
SteppingHelixPropagator::setReturnTangentPlane
void setReturnTangentPlane(bool val)
flag to return tangent plane for non-plane input
Definition: SteppingHelixPropagator.h:142
SteppingHelixPropagator::initStateArraySHPSpecific
void initStateArraySHPSpecific(StateArray &svBuf, bool flagsOnly) const
(Internals) set defaults needed for states used inside propagate methods
Definition: SteppingHelixPropagator.cc:38
metsig::tau
Definition: SignAlgoResolutions.h:49
SteppingHelixPropagator::FtsPP
std::pair< FreeTrajectoryState, double > FtsPP
Definition: SteppingHelixPropagator.h:258
VolumeBasedMagneticField
Definition: VolumeBasedMagneticField.h:18
SteppingHelixPropagator::DestType
DestType
Definition: SteppingHelixPropagator.h:52
SteppingHelixPropagator::POINT_PCA_DT
Definition: SteppingHelixPropagator.h:59
SteppingHelixPropagator::setIState
void setIState(const SteppingHelixStateInfo &sStart, StateArray &svBuff, int &nPoints) const
(Internals) Init starting point
Definition: SteppingHelixPropagator.cc:296
SteppingHelixPropagator::field_
const MagneticField * field_
Definition: SteppingHelixPropagator.h:265
SteppingHelixPropagator::setUseTuningForL2Speed
void setUseTuningForL2Speed(bool val)
Definition: SteppingHelixPropagator.h:153
SteppingHelixPropagator::Vector
CLHEP::Hep3Vector Vector
Definition: SteppingHelixPropagator.h:38
SteppingHelixPropagator::Basis::lZ
Vector lZ
Definition: SteppingHelixPropagator.h:47
SteppingHelixPropagator::refToDest
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
Definition: SteppingHelixPropagator.cc:1781
Surface
Definition: Surface.h:36
SteppingHelixPropagator::setNoErrorPropagation
void setNoErrorPropagation(bool noErrorPropagation)
Force no error propagation.
Definition: SteppingHelixPropagator.h:127
SteppingHelixPropagator::setUseMagVolumes
void setUseMagVolumes(bool val)
Switch to using MagneticField Volumes .. as in VolumeBasedMagneticField.
Definition: SteppingHelixPropagator.h:136
SteppingHelixPropagator::Result
SteppingHelixStateInfo::Result Result
Definition: SteppingHelixPropagator.h:42
SteppingHelixPropagator::setDebug
void setDebug(bool debug)
Switch debug printouts (to cout) .. very verbose.
Definition: SteppingHelixPropagator.h:121
SteppingHelixPropagator::SteppingHelixPropagator
SteppingHelixPropagator()
Constructors.
Definition: SteppingHelixPropagator.cc:56
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
SteppingHelixPropagator::returnTangentPlane_
bool returnTangentPlane_
Definition: SteppingHelixPropagator.h:276
SteppingHelixPropagator::Z_P
Definition: SteppingHelixPropagator.h:50
SteppingHelixPropagator::POL_M_F
Definition: SteppingHelixPropagator.h:69
Propagator
Definition: Propagator.h:44
SteppingHelixPropagator::makeAtomStep
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
Definition: SteppingHelixPropagator.cc:879
debug
#define debug
Definition: HDRShower.cc:19
SteppingHelixPropagator
Definition: SteppingHelixPropagator.h:36
SteppingHelixPropagator::StateInfo
SteppingHelixStateInfo StateInfo
Definition: SteppingHelixPropagator.h:41
SteppingHelixPropagator::PATHL_P
Definition: SteppingHelixPropagator.h:50
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
BeamSpot.h
SteppingHelixPropagator::getNextState
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
Definition: SteppingHelixPropagator.cc:775
SteppingHelixPropagator::setVBFPointer
void setVBFPointer(const VolumeBasedMagneticField *val)
Definition: SteppingHelixPropagator.h:158
SteppingHelixPropagator::applyRadX0Correction_
bool applyRadX0Correction_
Definition: SteppingHelixPropagator.h:271
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
reco::BeamSpot
Definition: BeamSpot.h:21
SteppingHelixPropagator::Pars
Pars
Definition: SteppingHelixPropagator.h:50
SteppingHelixPropagator::Basis::lY
Vector lY
Definition: SteppingHelixPropagator.h:46
SteppingHelixPropagator::LINE_PCA_DT
Definition: SteppingHelixPropagator.h:60
SteppingHelixPropagator::~SteppingHelixPropagator
~SteppingHelixPropagator() override
Destructor.
Definition: SteppingHelixPropagator.cc:54
SteppingHelixPropagator::MAX_STEPS
static const int MAX_STEPS
Definition: SteppingHelixPropagator.h:259
SteppingHelixPropagator::POL_2_F
Definition: SteppingHelixPropagator.h:68
Point3DBase< float, GlobalTag >
SteppingHelixPropagator::defaultStep_
double defaultStep_
Definition: SteppingHelixPropagator.h:280
SteppingHelixPropagator::useTuningForL2Speed_
bool useTuningForL2Speed_
Definition: SteppingHelixPropagator.h:278
SteppingHelixPropagator::TsosPP
std::pair< TrajectoryStateOnSurface, double > TsosPP
Definition: SteppingHelixPropagator.h:257
SteppingHelixPropagator::invalidState_
StateInfo invalidState_
Definition: SteppingHelixPropagator.h:263
SteppingHelixStateInfo
Definition: SteppingHelixStateInfo.h:27
SteppingHelixPropagator::noMaterialMode_
bool noMaterialMode_
Definition: SteppingHelixPropagator.h:269
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
SteppingHelixStateInfo::VolumeBounds
Definition: SteppingHelixStateInfo.h:71
SteppingHelixPropagator::RADIUS_DT
Definition: SteppingHelixPropagator.h:53
SteppingHelixPropagator::isYokeVolume
bool isYokeVolume(const MagVolume *vol) const
check if it's a yoke/iron based on this MagVol internals
Definition: SteppingHelixPropagator.cc:2432
SteppingHelixPropagator::HEL_ALL_F
Definition: SteppingHelixPropagator.h:66
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
SteppingHelixPropagator::setRep
void setRep(SteppingHelixPropagator::Basis &rep, const SteppingHelixPropagator::Vector &tau) const
Set/compute basis vectors for local coordinates at current step (called by incrementState)
Definition: SteppingHelixPropagator.cc:870
SteppingHelixPropagator::useInTeslaFromMagField_
bool useInTeslaFromMagField_
Definition: SteppingHelixPropagator.h:275
SteppingHelixPropagator::POL_1_F
Definition: SteppingHelixPropagator.h:67
SteppingHelixPropagator::getDeDx
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
Definition: SteppingHelixPropagator.cc:1317
SteppingHelixPropagator::applyRadX0Correction
void applyRadX0Correction(bool applyRadX0Correction)
Definition: SteppingHelixPropagator.h:133
SteppingHelixPropagator::setSendLogWarning
void setSendLogWarning(bool val)
flag to send LogWarning on failures
Definition: SteppingHelixPropagator.h:145
SteppingHelixPropagator::PATHL_DT
Definition: SteppingHelixPropagator.h:58
MagVolume
Definition: MagVolume.h:13
cuy.rep
rep
Definition: cuy.py:1189
SteppingHelixPropagator::propagateWithPath
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &ftsStart, const Plane &pDest) const override
Definition: SteppingHelixPropagator.cc:79
SteppingHelixPropagator::vbField_
const VolumeBasedMagneticField * vbField_
Definition: SteppingHelixPropagator.h:266
SteppingHelixPropagator::UNDEFINED_DT
Definition: SteppingHelixPropagator.h:61
SteppingHelixPropagator::useMagVolumes_
bool useMagVolumes_
Definition: SteppingHelixPropagator.h:272
SteppingHelixPropagator::useMatVolumes_
bool useMatVolumes_
Definition: SteppingHelixPropagator.h:274
SteppingHelixPropagator::loadState
void loadState(SteppingHelixPropagator::StateInfo &svCurrent, const SteppingHelixPropagator::Vector &p3, const SteppingHelixPropagator::Point &r3, int charge, PropagationDirection dir, const AlgebraicSymMatrix55 &covCurv) const
Definition: SteppingHelixPropagator.cc:657
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
SteppingHelixStateInfo::Result
Result
Definition: SteppingHelixStateInfo.h:34
SteppingHelixPropagator::RADIUS_P
Definition: SteppingHelixPropagator.h:50
SteppingHelixPropagator::setMaterialMode
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
Definition: SteppingHelixPropagator.h:124
PropagationDirection.h
SteppingHelixPropagator::Fancy
Fancy
Definition: SteppingHelixPropagator.h:64
SteppingHelixPropagator::setUseInTeslaFromMagField
void setUseInTeslaFromMagField(bool val)
force getting field value from MagneticField, not the geometric one
Definition: SteppingHelixPropagator.h:161
SteppingHelixStateInfo.h
SteppingHelixPropagator::refToMagVolume
Result refToMagVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12, bool expectNewMagVolume=false, double maxStep=1e12) const
Definition: SteppingHelixPropagator.cc:2049
heppy_batch.val
val
Definition: heppy_batch.py:351
SteppingHelixPropagator::refToMatVolume
Result refToMatVolume(const SteppingHelixPropagator::StateInfo &sv, PropagationDirection dir, double &dist, double &tanDist, double fastSkipDist=1e12) const
Definition: SteppingHelixPropagator.cc:2308
SteppingHelixPropagator::StateArray
StateInfo StateArray[MAX_POINTS+1]
Definition: SteppingHelixPropagator.h:172
SteppingHelixPropagator::MAX_POINTS
static const int MAX_POINTS
Definition: SteppingHelixPropagator.h:171
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
SteppingHelixPropagator::CYLINDER_DT
Definition: SteppingHelixPropagator.h:57
SteppingHelixPropagator::Z_DT
Definition: SteppingHelixPropagator.h:54
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
Plane
Definition: Plane.h:16
SteppingHelixPropagator::ecShiftNeg_
double ecShiftNeg_
Definition: SteppingHelixPropagator.h:283
SteppingHelixPropagator::debug_
bool debug_
Definition: SteppingHelixPropagator.h:268
GlobalVector.h
SteppingHelixPropagator::magneticField
const MagneticField * magneticField() const override
Definition: SteppingHelixPropagator.h:81
SteppingHelixPropagator::propagate
void propagate(const SteppingHelixStateInfo &ftsStart, const Surface &sDest, SteppingHelixStateInfo &out) const
Propagate to Plane given a starting point.
Definition: SteppingHelixPropagator.cc:152
SteppingHelixPropagator::noErrorPropagation_
bool noErrorPropagation_
Definition: SteppingHelixPropagator.h:270
p3
double p3[4]
Definition: TauolaWrapper.h:91
Propagator::propagateWithPath
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:10
SteppingHelixPropagator::PLANE_DT
Definition: SteppingHelixPropagator.h:55
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
Cylinder
Definition: Cylinder.h:19
SteppingHelixPropagator::HEL_AS_F
Definition: SteppingHelixPropagator.h:65
SteppingHelixPropagator::sendLogWarning_
bool sendLogWarning_
Definition: SteppingHelixPropagator.h:277
SteppingHelixPropagator::unit55_
const AlgebraicSymMatrix55 unit55_
Definition: SteppingHelixPropagator.h:267
SteppingHelixPropagator::Basis
Definition: SteppingHelixPropagator.h:44
SteppingHelixPropagator::setUseIsYokeFlag
void setUseIsYokeFlag(bool val)
Definition: SteppingHelixPropagator.h:149
MagneticField
Definition: MagneticField.h:19
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
SteppingHelixPropagator::setUseMatVolumes
void setUseMatVolumes(bool val)
Switch to using Material Volumes .. internally defined for now.
Definition: SteppingHelixPropagator.h:139
GlobalPoint.h
alongMomentum
Definition: PropagationDirection.h:4
mps_fire.dest
dest
Definition: mps_fire.py:179
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SteppingHelixPropagator::cIndex_
int cIndex_(int ind) const
(Internals) circular index for array of transients
Definition: SteppingHelixPropagator.cc:1773