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 
12 class HelixForwardPlaneCrossing GCC11_FINAL : public HelixPlaneCrossing {
13 public:
16  HelixForwardPlaneCrossing(const PositionType& point,
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;
58  double theCosPhi0,theSinPhi0;
59  double theCosTheta,theSinTheta;
60  const double theRho;
61 
62  const PropagationDirection thePropDir;
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 DirectionType direction(double s) const =0
PropagationDirection
Definition: Plane.h:17
virtual std::pair< bool, double > pathLength(const Plane &plane)
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
#define unlikely(x)
Definition: Likely.h:21
T curvature(T InversePt, const edm::EventSetup &iSetup)
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual PositionType position(double s) const =0
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
Basic3DVector< double > PositionTypeDouble
virtual ~HelixForwardPlaneCrossing()
Unlimited (trivial) bounds.