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 override {return new SteppingHelixPropagator(*this);}
86 
88  virtual ~SteppingHelixPropagator();
89 
90  virtual const MagneticField* magneticField() const override { return field_;}
91 
94 
97  virtual std::pair<TrajectoryStateOnSurface, double>
98  propagateWithPath(const FreeTrajectoryState& ftsStart, const Plane& pDest) const override;
101  virtual std::pair<TrajectoryStateOnSurface, double>
102  propagateWithPath(const FreeTrajectoryState& ftsStart, const Cylinder& cDest) const override;
104  virtual std::pair<FreeTrajectoryState, double>
105  propagateWithPath(const FreeTrajectoryState& ftsStart, const GlobalPoint& pDest) const override;
107  virtual std::pair<FreeTrajectoryState, double>
108  propagateWithPath(const FreeTrajectoryState& ftsStart,
109  const GlobalPoint& pDest1, const GlobalPoint& pDest2) const override;
111  virtual 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 
149  void applyRadX0Correction(bool applyRadX0Correction) { applyRadX0Correction_ = applyRadX0Correction;}
150 
152  void setUseMagVolumes(bool val){ useMagVolumes_ = val;}
153 
155  void setUseMatVolumes(bool val){ useMatVolumes_ = val;}
156 
158  void setReturnTangentPlane(bool val){ returnTangentPlane_ = val;}
159 
161  void setSendLogWarning(bool val){ sendLogWarning_ = val;}
162 
165  void setUseIsYokeFlag(bool val){ useIsYokeFlag_ = val;}
166 
169  void setUseTuningForL2Speed(bool val){ useTuningForL2Speed_ = val;}
170 
174  void setVBFPointer(const VolumeBasedMagneticField* val) { vbField_ = val;}
175 
177  void setUseInTeslaFromMagField(bool val) { useInTeslaFromMagField_ = val;}
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 
204  void loadState(SteppingHelixPropagator::StateInfo& svCurrent,
206  const SteppingHelixPropagator::Point& r3, int charge,
208  const AlgebraicSymMatrix55& covCurv) const;
209 
212  void getNextState(const SteppingHelixPropagator::StateInfo& svPrevious,
213  SteppingHelixPropagator::StateInfo& svNext,
214  double dP,
216  double dS, double dX0,
217  const AlgebraicMatrix55& dCovCurv) const;
218 
220  void setRep(SteppingHelixPropagator::Basis& rep,
221  const SteppingHelixPropagator::Vector& tau) const;
222 
224  bool makeAtomStep(SteppingHelixPropagator::StateInfo& svCurrent,
225  SteppingHelixPropagator::StateInfo& svNext,
226  double dS, PropagationDirection dir,
227  SteppingHelixPropagator::Fancy fancy) const;
228 
230  double getDeDx(const SteppingHelixPropagator::StateInfo& sv,
231  double& dEdXPrime, double& radX0, MatBounds& rzLims) const;
232 
234  int cIndex_(int ind) const;
235 
237  Result refToDest(DestType dest, const SteppingHelixPropagator::StateInfo& sv,
238  const double pars[6],
239  double& dist, double& tanDist, PropagationDirection& refDirection,
240  double fastSkipDist = 1e12) const;
241 
244  Result refToMagVolume(const SteppingHelixPropagator::StateInfo& sv,
246  double& dist, double& tanDist,
247  double fastSkipDist = 1e12, bool expectNewMagVolume = false, double maxStep = 1e12) const;
248 
249  Result refToMatVolume(const SteppingHelixPropagator::StateInfo& sv,
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 
266 
270  bool debug_;
281 
282  double defaultStep_;
283 
284  double ecShiftPos_;
285  double ecShiftNeg_;
286 };
287 
288 #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.
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
std::pair< FreeTrajectoryState, double > FtsPP
void setDebug(bool debug)
Switch debug printouts (to cout) .. very verbose.
void setNoErrorPropagation(bool noErrorPropagation)
Force no error propagation.
std::pair< TrajectoryStateOnSurface, double > TsosPP
void setUseInTeslaFromMagField(bool val)
force getting field value from MagneticField, not the geometric one
virtual SteppingHelixPropagator * clone() const override
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
virtual const MagneticField * magneticField() const override
tuple out
Definition: dbtoconf.py:99
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
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:56
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.