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,
8
int
,
9
const
MagneticField
* fieldProvider)
10
: theField(fieldProvider),
theX
(aX) {
11
cachedMagneticField
=
theField
->
inTesla
(
theX
);
12
float
bza = -2.99792458e-3
f
*
cachedMagneticField
.
z
();
13
float
qbpi = bza / (direction.
perp
() *
transverseCurvature
);
14
theP
= direction *
std::abs
(qbpi);
15
theCharge
= qbpi > 0.f ? 1 : -1;
16
}
17
18
GlobalTrajectoryParameters::GlobalTrajectoryParameters
(
const
GlobalPoint
& aX,
19
const
GlobalVector
&
direction
,
20
float
transverseCurvature
,
21
int
,
22
const
MagneticField
* fieldProvider,
23
GlobalVector
fieldValue)
24
:
theField
(fieldProvider),
theX
(aX),
cachedMagneticField
(fieldValue) {
25
float
bza = -2.99792458e-3
f
*
cachedMagneticField
.
z
();
26
float
qbpi = bza / (direction.
perp
() *
transverseCurvature
);
27
theP
= direction *
std::abs
(qbpi);
28
theCharge
= qbpi > 0.f ? 1 : -1;
29
}
30
31
void
GlobalTrajectoryParameters::setCache
() {
32
cachedMagneticField
=
theField
?
theField
->
inTesla
(
theX
) :
GlobalVector
(0, 0, 0);
33
}
// we must initialize cache to non-NAN to avoid FPE
34
35
GlobalVector
GlobalTrajectoryParameters::magneticFieldInInverseGeV
(
const
GlobalPoint
&
x
)
const
{
36
return
2.99792458e-3
f
*
theField
->
inTesla
(x);
37
}
38
39
/* the field is different as it is attached to each given volume!!!!
40
// const MagneticField* GlobalTrajectoryParameters::theField=0;
41
#include<iostream>
42
// FIXME debug code mostly
43
void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
44
if (0==fieldProvider) return;
45
if (0!=theField && fieldProvider!=theField)
46
std::cout << "GlobalTrajectoryParameters: a different MF???? "
47
<< theField << " " << fieldProvider << std::endl;
48
theField =fieldProvider;
49
}
50
*/
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:69
Vector3DBase
Definition:
Vector3DBase.h:8
MagneticField
Definition:
MagneticField.h:19
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters()
Definition:
GlobalTrajectoryParameters.h:18
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition:
GlobalTrajectoryParameters.h:116
MagneticField.h
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition:
GlobalTrajectoryParameters.h:89
PV3DBase::z
T z() const
Definition:
PV3DBase.h:61
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition:
GlobalTrajectoryParameters.h:115
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV() const
Definition:
GlobalTrajectoryParameters.h:102
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.
GlobalTrajectoryParameters::setCache
void setCache()
Definition:
GlobalTrajectoryParameters.cc:31
Point3DBase< float, GlobalTag >
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition:
GlobalTrajectoryParameters.h:112
theX
T theX
Definition:
Basic3DVectorLD.h:241
Likely.h
DDAxes::x
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition:
GlobalTrajectoryParameters.h:113
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition:
GlobalTrajectoryParameters.h:67
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition:
GlobalTrajectoryParameters.h:114
GlobalVector
Global3DVector GlobalVector
Definition:
GlobalVector.h:10
Generated for CMSSW Reference Manual by
1.8.11