Main Page
Namespaces
Classes
Package Documentation
TrackingTools
TrajectoryParametrization
src
GlobalTrajectoryParameters.cc
Go to the documentation of this file.
1
#include "
TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h
"
2
#include "
MagneticField/Engine/interface/MagneticField.h
"
3
#include "
FWCore/Utilities/interface/Likely.h
"
4
5
GlobalTrajectoryParameters::GlobalTrajectoryParameters
(
const
GlobalPoint
& aX,
6
const
GlobalVector
& direction,
7
float
transverseCurvature,
int
,
8
const
MagneticField
* fieldProvider) :
9
theField(fieldProvider),
10
theX
(aX)
11
{
12
cachedMagneticField
=
theField
->
inTesla
(
theX
);
13
float
bza = -2.99792458e-3
f
*
cachedMagneticField
.
z
();
14
float
qbpi = bza/(direction.
perp
()*
transverseCurvature
);
15
theP
= direction*
std::abs
(qbpi);
16
theCharge
= qbpi > 0.f ? 1 : -1;
17
}
18
19
20
GlobalTrajectoryParameters::GlobalTrajectoryParameters
(
const
GlobalPoint
& aX,
21
const
GlobalVector
&
direction
,
22
float
transverseCurvature
,
int
,
23
const
MagneticField
* fieldProvider,
24
GlobalVector
fieldValue) :
25
theField
(fieldProvider),
26
theX
(aX),
27
cachedMagneticField
(fieldValue)
28
{
29
float
bza = -2.99792458e-3
f
*
cachedMagneticField
.
z
();
30
float
qbpi = bza/(direction.
perp
()*
transverseCurvature
);
31
theP
= direction*
std::abs
(qbpi);
32
theCharge
= qbpi > 0.f ? 1 : -1;
33
}
34
35
36
37
38
GlobalTrajectoryParameters::GlobalTrajectoryParameters
(
const
GlobalPoint
& aX,
39
const
GlobalVector
& aP,
40
TrackCharge
aCharge,
41
const
MagneticField
* fieldProvider) :
42
theField
(fieldProvider),
43
theX
(aX),
theP
(aP),
44
theCharge
(aCharge)
45
{
46
cachedMagneticField
=
theField
?
theField
->
inTesla
(
theX
) :
GlobalVector
(0, 0, 0);
47
}
// we must initialize cache to non-NAN to avoid FPE
48
49
50
51
52
GlobalTrajectoryParameters::GlobalTrajectoryParameters
(
const
GlobalPoint
& aX,
53
const
GlobalVector
& aP,
54
TrackCharge
aCharge,
55
const
MagneticField
* fieldProvider,
56
GlobalVector
fieldValue) :
57
theField
(fieldProvider),
58
theX
(aX),
theP
(aP),
59
cachedMagneticField
(fieldValue),
60
theCharge
(aCharge)
61
{}
62
63
64
GlobalVector
GlobalTrajectoryParameters::magneticFieldInInverseGeV
(
const
GlobalPoint
&
x
)
const
65
{
66
return
2.99792458e-3
f
*
theField
->
inTesla
(x);
67
}
68
69
70
/* the field is different as it is attached to each given volume!!!!
71
// const MagneticField* GlobalTrajectoryParameters::theField=0;
72
#include<iostream>
73
// FIXME debug code mostly
74
void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
75
if (0==fieldProvider) return;
76
if (0!=theField && fieldProvider!=theField)
77
std::cout << "GlobalTrajectoryParameters: a different MF???? "
78
<< theField << " " << fieldProvider << std::endl;
79
theField =fieldProvider;
80
}
81
*/
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:72
Vector3DBase< float, GlobalTag >
MagneticField
Definition:
MagneticField.h:17
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters()
Definition:
GlobalTrajectoryParameters.h:18
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition:
GlobalTrajectoryParameters.h:138
MagneticField.h
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition:
GlobalTrajectoryParameters.h:101
TrackCharge
int TrackCharge
Definition:
TrackCharge.h:4
PV3DBase::z
T z() const
Definition:
PV3DBase.h:64
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition:
GlobalTrajectoryParameters.h:137
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV() const
Definition:
GlobalTrajectoryParameters.h:122
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
GlobalTrajectoryParameters.h
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Point3DBase< float, GlobalTag >
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition:
GlobalTrajectoryParameters.h:134
theX
T theX
Definition:
Basic3DVectorLD.h:268
Likely.h
DDAxes::x
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition:
GlobalTrajectoryParameters.h:135
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition:
GlobalTrajectoryParameters.h:71
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition:
GlobalTrajectoryParameters.h:136
GlobalVector
Global3DVector GlobalVector
Definition:
GlobalVector.h:10
Generated for CMSSW Reference Manual by
1.8.11