CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HelixForwardPlaneCrossing.h
Go to the documentation of this file.
1 #ifndef HelixForwardPlaneCrossing_H_
2 #define HelixForwardPlaneCrossing_H_
3 
7 #include <limits>
8 
13 public:
17  const DirectionType& direction,
18  const float curvature,
19  const PropagationDirection propDir = alongMomentum);
20  // destructor
22 
26  virtual std::pair<bool,double> pathLength(const Plane& plane) {
27  //
28  // Protect against p_z=0 and calculate path length
29  //
30  if unlikely( std::abs(theCosTheta)<std::numeric_limits<float>::min() ) return std::pair<bool,double>(false,0);
31 
32  double dS = (plane.position().z()-theZ0) / theCosTheta;
33 
34  // negative logic to avoid checking for anyDirection...
35  return std::make_pair( ! (
36  ( (thePropDir==alongMomentum) & (dS<0.) ) |
37  ( (thePropDir==oppositeToMomentum) & (dS>0.) )
38  ) , dS);
39 
40  }
41 
44  virtual PositionType position(double s) const;
45 
48  virtual DirectionType direction(double s) const;
49 
50 private:
51  //
52  // double precision vectors for internal use
53  //
56 
57  const double theX0,theY0,theZ0;
60  const double theRho;
61 
63 
64  mutable double theCachedS;
65  mutable double theCachedDPhi;
66  mutable double theCachedSDPhi;
67  mutable double theCachedCDPhi;
68 
69  static const float theNumericalPrecision;
70 };
71 
72 #endif
virtual PositionType position(double s) const
PropagationDirection
Definition: Plane.h:17
#define unlikely(x)
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< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Basic3DVector< float > DirectionType
Basic3DVector< double > PositionTypeDouble
virtual DirectionType direction(double s) const
virtual std::pair< bool, double > pathLength(const Plane &plane)
const PropagationDirection thePropDir
Basic3DVector< double > DirectionTypeDouble
const PositionType & position() const
*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