CMS 3D CMS Logo

HelixForwardPlaneCrossing.h
Go to the documentation of this file.
1 #ifndef HelixForwardPlaneCrossing_H_
2 #define HelixForwardPlaneCrossing_H_
3 
8 #include <limits>
9 
14 public:
18  const DirectionType& direction,
19  const float curvature,
20  const PropagationDirection propDir = alongMomentum);
21  // destructor
23 
27  std::pair<bool, double> pathLength(const Plane& plane) override {
28  //
29  // Protect against p_z=0 and calculate path length
30  //
31  if
32  UNLIKELY(std::abs(theCosTheta) < std::numeric_limits<float>::min()) return std::pair<bool, double>(false, 0);
33 
34  double dS = (plane.position().z() - theZ0) / theCosTheta;
35 
36  // negative logic to avoid checking for anyDirection...
37  return std::make_pair(
38  !(((thePropDir == alongMomentum) & (dS < 0.)) | ((thePropDir == oppositeToMomentum) & (dS > 0.))), dS);
39  }
40 
43  PositionType position(double s) const override;
44 
47  DirectionType direction(double s) const override;
48 
49 private:
50  //
51  // double precision vectors for internal use
52  //
55 
56  const double theX0, theY0, theZ0;
59  const double theRho;
60 
62 
63  mutable double theCachedS;
64  mutable double theCachedDPhi;
65  mutable double theCachedSDPhi;
66  mutable double theCachedCDPhi;
67 
68  static const float theNumericalPrecision;
69 };
70 
71 #endif
PropagationDirection
Definition: Plane.h:16
std::pair< bool, double > pathLength(const Plane &plane) override
static const float theNumericalPrecision
T curvature(T InversePt, const edm::EventSetup &iSetup)
T z() const
Cartesian z coordinate.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HelixForwardPlaneCrossing(const PositionType &point, const DirectionType &direction, const float curvature, const PropagationDirection propDir=alongMomentum)
T min(T a, T b)
Definition: MathUtil.h:58
Basic3DVector< double > PositionTypeDouble
const PropagationDirection thePropDir
Basic3DVector< double > DirectionTypeDouble
#define UNLIKELY(x)
Definition: Likely.h:21
DirectionType direction(double s) const override
const PositionType & position() const
PositionType position(double s) const override
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5