CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Types | Private Attributes | Static Private Attributes
HelixForwardPlaneCrossing Class Referencefinal

#include <HelixForwardPlaneCrossing.h>

Inheritance diagram for HelixForwardPlaneCrossing:
HelixPlaneCrossing

Public Member Functions

DirectionType direction (double s) const override
 
 HelixForwardPlaneCrossing (const PositionType &point, const DirectionType &direction, const float curvature, const PropagationDirection propDir=alongMomentum)
 
std::pair< bool, double > pathLength (const Plane &plane) override
 
PositionType position (double s) const override
 
 ~HelixForwardPlaneCrossing () override
 
- Public Member Functions inherited from HelixPlaneCrossing
virtual ~HelixPlaneCrossing ()=default
 

Private Types

typedef Basic3DVector< double > DirectionTypeDouble
 
typedef Basic3DVector< double > PositionTypeDouble
 

Private Attributes

double theCachedCDPhi
 
double theCachedDPhi
 
double theCachedS
 
double theCachedSDPhi
 
double theCosPhi0
 
double theCosTheta
 
const PropagationDirection thePropDir
 
const double theRho
 
double theSinPhi0
 
double theSinTheta
 
const double theX0
 
const double theY0
 
const double theZ0
 

Static Private Attributes

static const float theNumericalPrecision = 5.e-7
 

Additional Inherited Members

- Public Types inherited from HelixPlaneCrossing
typedef Basic3DVector< float > DirectionType
 
typedef Basic3DVector< float > PositionType
 the helix is passed to the constructor and does not appear in the interface More...
 

Detailed Description

Calculates intersections of a helix with planes perpendicular to the z-axis.

Definition at line 14 of file HelixForwardPlaneCrossing.h.

Member Typedef Documentation

Definition at line 56 of file HelixForwardPlaneCrossing.h.

Definition at line 55 of file HelixForwardPlaneCrossing.h.

Constructor & Destructor Documentation

HelixForwardPlaneCrossing::HelixForwardPlaneCrossing ( const PositionType point,
const DirectionType direction,
const float  curvature,
const PropagationDirection  propDir = alongMomentum 
)

Constructor using point, direction and (transverse!) curvature.

Definition at line 6 of file HelixForwardPlaneCrossing.cc.

References fireworks::p2, mathSSE::sqrt(), theCosPhi0, theCosTheta, theSinPhi0, theSinTheta, Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

10  : theX0(point.x()),
11  theY0(point.y()),
12  theZ0(point.z()),
14  thePropDir(propDir),
15  theCachedS(0),
16  theCachedDPhi(0.),
17  theCachedSDPhi(0.),
18  theCachedCDPhi(1.) {
19  //
20  // Components of direction vector (with correct normalisation)
21  //
22  double px = direction.x();
23  double py = direction.y();
24  double pz = direction.z();
25  double pt2 = px * px + py * py;
26  double p2 = pt2 + pz * pz;
27  double pI = 1. / sqrt(p2);
28  double ptI = 1. / sqrt(pt2);
29  theCosPhi0 = px * ptI;
30  theSinPhi0 = py * ptI;
31  theCosTheta = pz * pI;
32  theSinTheta = pt2 * ptI * pI;
33 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
const TString p2
Definition: fwPaths.cc:13
T curvature(T InversePt, const MagneticField &field)
DirectionType direction(double s) const override
T z() const
Cartesian z coordinate.
T sqrt(T t)
Definition: SSEVec.h:19
const PropagationDirection thePropDir
*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
HelixForwardPlaneCrossing::~HelixForwardPlaneCrossing ( )
inlineoverride

Definition at line 23 of file HelixForwardPlaneCrossing.h.

23 {}

Member Function Documentation

HelixPlaneCrossing::DirectionType HelixForwardPlaneCrossing::direction ( double  s) const
overridevirtual

Direction at pathlength s from the starting point.

Implements HelixPlaneCrossing.

Definition at line 68 of file HelixForwardPlaneCrossing.cc.

References alignCSCRings::e, alignCSCRings::s, theCachedCDPhi, theCachedDPhi, theCachedS, theCachedSDPhi, theCosPhi0, theCosTheta, theRho, theSinPhi0, and theSinTheta.

68  {
69  //
70  // Calculate delta phi (if not already available)
71  //
72  if (s != theCachedS) {
73  theCachedS = s;
75  vdt::fast_sincos(theCachedDPhi, theCachedSDPhi, theCachedCDPhi);
76  }
77 
78  if (fabs(theCachedDPhi) > 1.e-4) {
79  // full helix formula
81  theSinPhi0 * theCachedCDPhi + theCosPhi0 * theCachedSDPhi,
83  } else {
84  // 2nd order
85  double dph = theCachedS * theRho * theSinTheta;
86  return DirectionType(theCosPhi0 - (theSinPhi0 + 0.5 * theCosPhi0 * dph) * dph,
87  theSinPhi0 + (theCosPhi0 - 0.5 * theSinPhi0 * dph) * dph,
88  theCosTheta / theSinTheta);
89  }
90 }
Basic3DVector< float > DirectionType
std::pair<bool, double> HelixForwardPlaneCrossing::pathLength ( const Plane plane)
inlineoverridevirtual

Propagation status (true if valid) and (signed) path length along the helix from the starting point to the plane.

Implements HelixPlaneCrossing.

Definition at line 28 of file HelixForwardPlaneCrossing.h.

References funct::abs(), alongMomentum, edm::isNotFinite(), min(), oppositeToMomentum, GloballyPositioned< T >::position(), theCosTheta, thePropDir, theZ0, UNLIKELY, and Basic3DVector< T >::z().

Referenced by CompositeTECWedge::computeCrossings(), TIDRing::computeCrossings(), and CompositeTECPetal::computeCrossings().

28  {
29  //
30  // Protect against p_z=0 and calculate path length
31  //
33  return std::pair<bool, double>(false, 0);
34 
35  double dS = (plane.position().z() - theZ0) / theCosTheta;
36 
37  // negative logic to avoid checking for anyDirection...
38  return std::make_pair(!(((thePropDir == alongMomentum) & (dS < 0.)) |
39  ((thePropDir == oppositeToMomentum) & (dS > 0.)) | edm::isNotFinite(dS)),
40  dS);
41  }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
const PropagationDirection thePropDir
PositionType position(double s) const override
#define UNLIKELY(x)
Definition: Likely.h:21
HelixPlaneCrossing::PositionType HelixForwardPlaneCrossing::position ( double  s) const
overridevirtual

Position at pathlength s from the starting point.

Implements HelixPlaneCrossing.

Definition at line 38 of file HelixForwardPlaneCrossing.cc.

References funct::abs(), alignCSCRings::e, class-composition::o, alignCSCRings::s, theCachedCDPhi, theCachedDPhi, theCachedS, theCachedSDPhi, theCosPhi0, theCosTheta, theRho, theSinPhi0, theSinTheta, theX0, theY0, and theZ0.

Referenced by CompositeTECWedge::computeCrossings(), TIDRing::computeCrossings(), and CompositeTECPetal::computeCrossings().

38  {
39  //
40  // Calculate delta phi (if not already available)
41  //
42  if (s != theCachedS) {
43  theCachedS = s;
45  vdt::fast_sincos(theCachedDPhi, theCachedSDPhi, theCachedCDPhi);
46  }
47  //
48  // Calculate with appropriate formulation of full helix formula or with
49  // 2nd order approximation.
50  //
51  if (std::abs(theCachedDPhi) > 1.e-4) {
52  // "standard" helix formula
53  double o = 1. / theRho;
55  theY0 + (theCosPhi0 * (1. - theCachedCDPhi) + theSinPhi0 * theCachedSDPhi) * o,
57  } else {
58  // 2nd order
59  double st = theCachedS * theSinTheta;
60  return PositionType(theX0 + (theCosPhi0 - st * 0.5 * theRho * theSinPhi0) * st,
61  theY0 + (theSinPhi0 + st * 0.5 * theRho * theCosPhi0) * st,
62  theZ0 + st * theCosTheta / theSinTheta);
63  }
64 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Basic3DVector< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Basic3DVector< double > PositionTypeDouble

Member Data Documentation

double HelixForwardPlaneCrossing::theCachedCDPhi
mutableprivate

Definition at line 68 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedDPhi
mutableprivate

Definition at line 66 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedS
mutableprivate

Definition at line 65 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedSDPhi
mutableprivate

Definition at line 67 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCosPhi0
private

Definition at line 59 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

double HelixForwardPlaneCrossing::theCosTheta
private
const float HelixForwardPlaneCrossing::theNumericalPrecision = 5.e-7
staticprivate

Definition at line 70 of file HelixForwardPlaneCrossing.h.

const PropagationDirection HelixForwardPlaneCrossing::thePropDir
private

Definition at line 63 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength().

const double HelixForwardPlaneCrossing::theRho
private

Definition at line 61 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theSinPhi0
private

Definition at line 59 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

double HelixForwardPlaneCrossing::theSinTheta
private

Definition at line 60 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

const double HelixForwardPlaneCrossing::theX0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by position().

const double HelixForwardPlaneCrossing::theY0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by position().

const double HelixForwardPlaneCrossing::theZ0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength(), and position().