CMS 3D CMS Logo

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

◆ DirectionTypeDouble

Definition at line 56 of file HelixForwardPlaneCrossing.h.

◆ PositionTypeDouble

Definition at line 55 of file HelixForwardPlaneCrossing.h.

Constructor & Destructor Documentation

◆ HelixForwardPlaneCrossing()

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.

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 }

References direction(), p2, HLT_FULL_cff::pt2, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, mathSSE::sqrt(), theCosPhi0, theCosTheta, theSinPhi0, theSinTheta, Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

◆ ~HelixForwardPlaneCrossing()

HelixForwardPlaneCrossing::~HelixForwardPlaneCrossing ( )
inlineoverride

Definition at line 23 of file HelixForwardPlaneCrossing.h.

23 {}

Member Function Documentation

◆ direction()

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.

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
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,
89  }
90 }

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

Referenced by HelixForwardPlaneCrossing().

◆ pathLength()

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.

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  }

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().

◆ position()

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.

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;
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 }

References funct::abs(), MillePedeFileConverter_cfg::e, EcalTangentSkim_cfg::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().

Member Data Documentation

◆ theCachedCDPhi

double HelixForwardPlaneCrossing::theCachedCDPhi
mutableprivate

Definition at line 68 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

◆ theCachedDPhi

double HelixForwardPlaneCrossing::theCachedDPhi
mutableprivate

Definition at line 66 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

◆ theCachedS

double HelixForwardPlaneCrossing::theCachedS
mutableprivate

Definition at line 65 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

◆ theCachedSDPhi

double HelixForwardPlaneCrossing::theCachedSDPhi
mutableprivate

Definition at line 67 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

◆ theCosPhi0

double HelixForwardPlaneCrossing::theCosPhi0
private

Definition at line 59 of file HelixForwardPlaneCrossing.h.

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

◆ theCosTheta

double HelixForwardPlaneCrossing::theCosTheta
private

◆ theNumericalPrecision

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

Definition at line 70 of file HelixForwardPlaneCrossing.h.

◆ thePropDir

const PropagationDirection HelixForwardPlaneCrossing::thePropDir
private

Definition at line 63 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength().

◆ theRho

const double HelixForwardPlaneCrossing::theRho
private

Definition at line 61 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

◆ theSinPhi0

double HelixForwardPlaneCrossing::theSinPhi0
private

Definition at line 59 of file HelixForwardPlaneCrossing.h.

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

◆ theSinTheta

double HelixForwardPlaneCrossing::theSinTheta
private

Definition at line 60 of file HelixForwardPlaneCrossing.h.

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

◆ theX0

const double HelixForwardPlaneCrossing::theX0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by position().

◆ theY0

const double HelixForwardPlaneCrossing::theY0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by position().

◆ theZ0

const double HelixForwardPlaneCrossing::theZ0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength(), and position().

funct::false
false
Definition: Factorize.h:29
HelixForwardPlaneCrossing::theX0
const double theX0
Definition: HelixForwardPlaneCrossing.h:58
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
min
T min(T a, T b)
Definition: MathUtil.h:58
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
HelixPlaneCrossing::DirectionType
Basic3DVector< float > DirectionType
Definition: HelixPlaneCrossing.h:23
edm
HLT enums.
Definition: AlignableModifier.h:19
oppositeToMomentum
Definition: PropagationDirection.h:4
HelixForwardPlaneCrossing::theSinPhi0
double theSinPhi0
Definition: HelixForwardPlaneCrossing.h:59
HelixForwardPlaneCrossing::direction
DirectionType direction(double s) const override
Definition: HelixForwardPlaneCrossing.cc:68
HelixForwardPlaneCrossing::theZ0
const double theZ0
Definition: HelixForwardPlaneCrossing.h:58
mathSSE::return
return((rh ^ lh) &mask)
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic3DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic3DVector.h:97
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
p2
double p2[4]
Definition: TauolaWrapper.h:90
HelixForwardPlaneCrossing::theCachedCDPhi
double theCachedCDPhi
Definition: HelixForwardPlaneCrossing.h:68
HelixForwardPlaneCrossing::theCosTheta
double theCosTheta
Definition: HelixForwardPlaneCrossing.h:60
HelixForwardPlaneCrossing::PositionTypeDouble
Basic3DVector< double > PositionTypeDouble
Definition: HelixForwardPlaneCrossing.h:55
HelixForwardPlaneCrossing::theCachedDPhi
double theCachedDPhi
Definition: HelixForwardPlaneCrossing.h:66
HelixForwardPlaneCrossing::theSinTheta
double theSinTheta
Definition: HelixForwardPlaneCrossing.h:60
HLT_FULL_cff.pt2
pt2
Definition: HLT_FULL_cff.py:9872
HelixForwardPlaneCrossing::theCosPhi0
double theCosPhi0
Definition: HelixForwardPlaneCrossing.h:59
HelixForwardPlaneCrossing::position
PositionType position(double s) const override
Definition: HelixForwardPlaneCrossing.cc:38
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
HelixForwardPlaneCrossing::theY0
const double theY0
Definition: HelixForwardPlaneCrossing.h:58
std
Definition: JetResolutionObject.h:76
HelixForwardPlaneCrossing::theCachedSDPhi
double theCachedSDPhi
Definition: HelixForwardPlaneCrossing.h:67
HelixForwardPlaneCrossing::theCachedS
double theCachedS
Definition: HelixForwardPlaneCrossing.h:65
HelixForwardPlaneCrossing::theRho
const double theRho
Definition: HelixForwardPlaneCrossing.h:61
Basic3DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic3DVector.h:94
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
point
*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::z
T z() const
Cartesian z coordinate.
Definition: extBasic3DVector.h:100
alongMomentum
Definition: PropagationDirection.h:4
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HelixPlaneCrossing::PositionType
Basic3DVector< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Definition: HelixPlaneCrossing.h:22
HelixForwardPlaneCrossing::thePropDir
const PropagationDirection thePropDir
Definition: HelixForwardPlaneCrossing.h:63