TrackingTools
GeomPropagators
src
HelixForwardPlaneCrossing.cc
Go to the documentation of this file.
1
#include "
TrackingTools/GeomPropagators/interface/HelixForwardPlaneCrossing.h
"
2
3
#include <cmath>
4
#include <vdt/vdtMath.h>
5
6
HelixForwardPlaneCrossing::HelixForwardPlaneCrossing
(
const
PositionType
&
point
,
7
const
DirectionType
& direction,
8
const
float
curvature
,
9
const
PropagationDirection
propDir)
10
: theX0(
point
.
x
()),
11
theY0(
point
.
y
()),
12
theZ0(
point
.
z
()),
13
theRho(
curvature
),
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
}
34
35
//
36
// Position on helix after a step of path length s.
37
//
38
HelixPlaneCrossing::PositionType
HelixForwardPlaneCrossing::position
(
double
s
)
const
{
39
//
40
// Calculate delta phi (if not already available)
41
//
42
if
(
s
!=
theCachedS
) {
43
theCachedS
=
s
;
44
theCachedDPhi
=
theCachedS
*
theRho
*
theSinTheta
;
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
;
54
return
PositionTypeDouble
(
theX0
+ (-
theSinPhi0
* (1. -
theCachedCDPhi
) +
theCosPhi0
*
theCachedSDPhi
) *
o
,
55
theY0
+ (
theCosPhi0
* (1. -
theCachedCDPhi
) +
theSinPhi0
*
theCachedSDPhi
) *
o
,
56
theZ0
+
theCachedS
*
theCosTheta
);
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
}
65
//
66
// Direction vector on helix after a step of path length s.
67
//
68
HelixPlaneCrossing::DirectionType
HelixForwardPlaneCrossing::direction
(
double
s
)
const
{
69
//
70
// Calculate delta phi (if not already available)
71
//
72
if
(
s
!=
theCachedS
) {
73
theCachedS
=
s
;
74
theCachedDPhi
=
theCachedS
*
theRho
*
theSinTheta
;
75
vdt::fast_sincos(
theCachedDPhi
,
theCachedSDPhi
,
theCachedCDPhi
);
76
}
77
78
if
(fabs(
theCachedDPhi
) > 1.
e
-4) {
79
// full helix formula
80
return
DirectionType
(
theCosPhi0
*
theCachedCDPhi
-
theSinPhi0
*
theCachedSDPhi
,
81
theSinPhi0
*
theCachedCDPhi
+
theCosPhi0
*
theCachedSDPhi
,
82
theCosTheta
/
theSinTheta
);
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
}
91
92
const
float
HelixForwardPlaneCrossing::theNumericalPrecision
= 5.e-7;
HelixForwardPlaneCrossing::theX0
const double theX0
Definition:
HelixForwardPlaneCrossing.h:58
detailsBasic3DVector::z
float float float z
Definition:
extBasic3DVector.h:14
multPhiCorr_741_25nsDY_cfi.py
py
Definition:
multPhiCorr_741_25nsDY_cfi.py:12
HelixPlaneCrossing::DirectionType
Basic3DVector< float > DirectionType
Definition:
HelixPlaneCrossing.h:23
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
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition:
PixelRecoUtilities.h:42
EcalTangentSkim_cfg.o
o
Definition:
EcalTangentSkim_cfg.py:42
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
p2
double p2[4]
Definition:
TauolaWrapper.h:90
HelixForwardPlaneCrossing::theCachedCDPhi
double theCachedCDPhi
Definition:
HelixForwardPlaneCrossing.h:68
HelixForwardPlaneCrossing::HelixForwardPlaneCrossing
HelixForwardPlaneCrossing(const PositionType &point, const DirectionType &direction, const float curvature, const PropagationDirection propDir=alongMomentum)
Definition:
HelixForwardPlaneCrossing.cc:6
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:9895
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
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
PropagationDirection
PropagationDirection
Definition:
PropagationDirection.h:4
genVertex_cff.x
x
Definition:
genVertex_cff.py:13
detailsBasic3DVector::y
float float y
Definition:
extBasic3DVector.h:14
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
HelixForwardPlaneCrossing::theNumericalPrecision
static const float theNumericalPrecision
Definition:
HelixForwardPlaneCrossing.h:70
Basic3DVector::z
T z() const
Cartesian z coordinate.
Definition:
extBasic3DVector.h:100
Basic3DVector< float >
HelixForwardPlaneCrossing.h
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
Generated for CMSSW Reference Manual by
1.8.16