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
void
GlobalTrajectoryParameters::setCache
() {
36
cachedMagneticField
=
theField
?
theField
->
inTesla
(
theX
) :
GlobalVector
(0, 0, 0);
37
}
// we must initialize cache to non-NAN to avoid FPE
38
39
40
41
GlobalVector
GlobalTrajectoryParameters::magneticFieldInInverseGeV
(
const
GlobalPoint
&
x
)
const
42
{
43
return
2.99792458e-3
f
*
theField
->
inTesla
(x);
44
}
45
46
47
/* the field is different as it is attached to each given volume!!!!
48
// const MagneticField* GlobalTrajectoryParameters::theField=0;
49
#include<iostream>
50
// FIXME debug code mostly
51
void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
52
if (0==fieldProvider) return;
53
if (0!=theField && fieldProvider!=theField)
54
std::cout << "GlobalTrajectoryParameters: a different MF???? "
55
<< theField << " " << fieldProvider << std::endl;
56
theField =fieldProvider;
57
}
58
*/
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:72
Vector3DBase
Definition:
Vector3DBase.h:9
MagneticField
Definition:
MagneticField.h:19
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters()
Definition:
GlobalTrajectoryParameters.h:18
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition:
GlobalTrajectoryParameters.h:144
MagneticField.h
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition:
GlobalTrajectoryParameters.h:112
PV3DBase::z
T z() const
Definition:
PV3DBase.h:64
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition:
GlobalTrajectoryParameters.h:143
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV() const
Definition:
GlobalTrajectoryParameters.h:126
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:35
Point3DBase< float, GlobalTag >
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition:
GlobalTrajectoryParameters.h:140
theX
T theX
Definition:
Basic3DVectorLD.h:277
Likely.h
DDAxes::x
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition:
GlobalTrajectoryParameters.h:141
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition:
GlobalTrajectoryParameters.h:82
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition:
GlobalTrajectoryParameters.h:142
GlobalVector
Global3DVector GlobalVector
Definition:
GlobalVector.h:10
Generated for CMSSW Reference Manual by
1.8.11