CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
42  public:
43  typedef CLHEP::Hep3Vector Vector;
44  typedef CLHEP::Hep3Vector Point;
45 
48 
49  struct Basis {
53  };
54 
55  enum Pars {
56  RADIUS_P=0,
57  Z_P = 0,
58  PATHL_P = 0
59  };
60 
61  enum DestType {
62  RADIUS_DT=0,
70  UNDEFINED_DT
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  virtual SteppingHelixPropagator* clone() const {return new SteppingHelixPropagator(*this);}
86 
89 
90  virtual const MagneticField* magneticField() const { return field_;}
91 
94  propagate(const FreeTrajectoryState& ftsStart, const Plane& pDest) const;
97  propagate(const FreeTrajectoryState& ftsStart, const Cylinder& cDest) const;
99  virtual FreeTrajectoryState
100  propagate(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const;
102  virtual FreeTrajectoryState
103  propagate(const FreeTrajectoryState& ftsStart,
104  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const;
106  virtual FreeTrajectoryState
107  propagate(const FreeTrajectoryState& ftsStart,
108  const reco::BeamSpot& beamSpot) const;
109 
112  virtual std::pair<TrajectoryStateOnSurface, double>
113  propagateWithPath(const FreeTrajectoryState& ftsStart, const Plane& pDest) const;
116  virtual std::pair<TrajectoryStateOnSurface, double>
117  propagateWithPath(const FreeTrajectoryState& ftsStart, const Cylinder& cDest) const;
119  virtual std::pair<FreeTrajectoryState, double>
120  propagateWithPath(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const;
122  virtual std::pair<FreeTrajectoryState, double>
123  propagateWithPath(const FreeTrajectoryState& ftsStart,
124  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const;
126  virtual std::pair<FreeTrajectoryState, double>
127  propagateWithPath(const FreeTrajectoryState& ftsStart,
128  const reco::BeamSpot& beamSpot) const;
129 
130 
132  const SteppingHelixStateInfo&
133  propagate(const SteppingHelixStateInfo& ftsStart, const Surface& sDest) const;
134  const SteppingHelixStateInfo&
135  propagate(const SteppingHelixStateInfo& ftsStart, const Plane& pDest) const;
137  const SteppingHelixStateInfo&
138  propagate(const SteppingHelixStateInfo& ftsStart, const Cylinder& cDest) const;
140  const SteppingHelixStateInfo&
141  propagate(const SteppingHelixStateInfo& ftsStart, const GlobalPoint& pDest) const;
143  const SteppingHelixStateInfo&
144  propagate(const SteppingHelixStateInfo& ftsStart,
145  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const;
146 
147 
149  void setDebug(bool debug){ debug_ = debug;}
150 
152  void setMaterialMode(bool noMaterial) { noMaterialMode_ = noMaterial;}
153 
155  void setNoErrorPropagation(bool noErrorPropagation) { noErrorPropagation_ = noErrorPropagation;}
156 
161  void applyRadX0Correction(bool applyRadX0Correction) { applyRadX0Correction_ = applyRadX0Correction;}
162 
164  void setUseMagVolumes(bool val){ useMagVolumes_ = val;}
165 
167  void setUseMatVolumes(bool val){ useMatVolumes_ = val;}
168 
170  void setReturnTangentPlane(bool val){ returnTangentPlane_ = val;}
171 
173  void setSendLogWarning(bool val){ sendLogWarning_ = val;}
174 
177  void setUseIsYokeFlag(bool val){ useIsYokeFlag_ = val;}
178 
181  void setUseTuningForL2Speed(bool val){ useTuningForL2Speed_ = val;}
182 
186  void setVBFPointer(const VolumeBasedMagneticField* val) { vbField_ = val;}
187 
189  void setUseInTeslaFromMagField(bool val) { useInTeslaFromMagField_ = val;}
190 
192  void setEndcapShiftsInZPosNeg(double valPos, double valNeg){
193  ecShiftPos_ = valPos; ecShiftNeg_ = valNeg;
194  }
195 
196  protected:
199  void setIState(const SteppingHelixStateInfo& sStart) const;
200 
204  Result propagate(SteppingHelixPropagator::DestType type,
205  const double pars[6], double epsilon = 1e-3) const;
206 
209  void loadState(SteppingHelixPropagator::StateInfo& svCurrent,
211  const SteppingHelixPropagator::Point& r3, int charge,
213  const AlgebraicSymMatrix55& covCurv) const;
214 
217  void getNextState(const SteppingHelixPropagator::StateInfo& svPrevious,
218  SteppingHelixPropagator::StateInfo& svNext,
219  double dP,
221  double dS, double dX0,
222  const AlgebraicMatrix55& dCovCurv) const;
223 
225  void setRep(SteppingHelixPropagator::Basis& rep,
226  const SteppingHelixPropagator::Vector& tau) const;
227 
229  bool makeAtomStep(SteppingHelixPropagator::StateInfo& svCurrent,
230  SteppingHelixPropagator::StateInfo& svNext,
231  double dS, PropagationDirection dir,
232  SteppingHelixPropagator::Fancy fancy) const;
233 
235  double getDeDx(const SteppingHelixPropagator::StateInfo& sv,
236  double& dEdXPrime, double& radX0, MatBounds& rzLims) const;
237 
239  int cIndex_(int ind) const;
240 
242  Result refToDest(DestType dest, const SteppingHelixPropagator::StateInfo& sv,
243  const double pars[6],
244  double& dist, double& tanDist, PropagationDirection& refDirection,
245  double fastSkipDist = 1e12) const;
246 
249  Result refToMagVolume(const SteppingHelixPropagator::StateInfo& sv,
251  double& dist, double& tanDist,
252  double fastSkipDist = 1e12, bool expectNewMagVolume = false, double maxStep = 1e12) const;
253 
254  Result refToMatVolume(const SteppingHelixPropagator::StateInfo& sv,
256  double& dist, double& tanDist,
257  double fastSkipDist = 1e12) const;
258 
260  bool isYokeVolume(const MagVolume* vol) const;
261 
262 
263  private:
264  typedef std::pair<TrajectoryStateOnSurface, double> TsosPP;
265  typedef std::pair<FreeTrajectoryState, double> FtsPP;
266  static const int MAX_STEPS = 10000;
267  static const int MAX_POINTS = 7;
268  mutable int nPoints_;
269  mutable StateInfo svBuf_[MAX_POINTS+1];
270 
272 
276  bool debug_;
287 
288  double defaultStep_;
289 
290  double ecShiftPos_;
291  double ecShiftNeg_;
292 };
293 
294 #endif
void setUseMatVolumes(bool val)
Switch to using Material Volumes .. internally defined for now.
type
Definition: HCALResponse.h:21
string rep
Definition: cuy.py:1188
SteppingHelixStateInfo::VolumeBounds MatBounds
void setUseMagVolumes(bool val)
Switch to using MagneticField Volumes .. as in VolumeBasedMagneticField.
virtual SteppingHelixPropagator * clone() const
void setVBFPointer(const VolumeBasedMagneticField *val)
const MagneticField * field_
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Base::Vector Vector
void applyRadX0Correction(bool applyRadX0Correction)
void setUseTuningForL2Speed(bool val)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
std::pair< double, double > Point
Definition: CaloEllipse.h:18
void setReturnTangentPlane(bool val)
flag to return tangent plane for non-plane input
double charge(const std::vector< uint8_t > &Ampls)
Definition: Plane.h:17
tuple field
Definition: statics.py:62
std::pair< FreeTrajectoryState, double > FtsPP
void setDebug(bool debug)
Switch debug printouts (to cout) .. very verbose.
void setNoErrorPropagation(bool noErrorPropagation)
Force no error propagation.
~SteppingHelixPropagator()
Destructor.
std::pair< TrajectoryStateOnSurface, double > TsosPP
void setUseInTeslaFromMagField(bool val)
force getting field value from MagneticField, not the geometric one
virtual const MagneticField * magneticField() const
SteppingHelixStateInfo::Result Result
#define debug
Definition: HDRShower.cc:19
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
CLHEP::Hep3Vector Vector
void setSendLogWarning(bool val)
flag to send LogWarning on failures
SteppingHelixStateInfo StateInfo
void setEndcapShiftsInZPosNeg(double valPos, double valNeg)
set shifts in Z for endcap pieces (includes EE, HE, ME, YE)
const VolumeBasedMagneticField * vbField_
const AlgebraicSymMatrix55 unit55_
dbl *** dir
Definition: mlp_gen.cc:35
const double epsilon
void setUseIsYokeFlag(bool val)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
CLHEP::Hep3Vector Point
double p3[4]
Definition: TauolaWrapper.h:91
Unlimited (trivial) bounds.