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 UNLIKELY( std::abs(theCosTheta)<std::numeric_limits<float>::min() ) return std::pair<bool,double>(false,0);
32 
33  double dS = (plane.position().z()-theZ0) / theCosTheta;
34 
35  // negative logic to avoid checking for anyDirection...
36  return std::make_pair( ! (
37  ( (thePropDir==alongMomentum) & (dS<0.) ) |
38  ( (thePropDir==oppositeToMomentum) & (dS>0.) )
39  ) , dS);
40 
41  }
42 
45  PositionType position(double s) const override;
46 
49  DirectionType direction(double s) const override;
50 
51 private:
52  //
53  // double precision vectors for internal use
54  //
57 
58  const double theX0,theY0,theZ0;
61  const double theRho;
62 
64 
65  mutable double theCachedS;
66  mutable double theCachedDPhi;
67  mutable double theCachedSDPhi;
68  mutable double theCachedCDPhi;
69 
70  static const float theNumericalPrecision;
71 };
72 
73 #endif
PropagationDirection
Definition: Plane.h:17
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
std::pair< bool, double > pathLength(const Plane &plane) override
const PropagationDirection thePropDir
Basic3DVector< double > DirectionTypeDouble
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
#define UNLIKELY(x)