CMS 3D CMS Logo

GlobalTrajectoryParameters.cc
Go to the documentation of this file.
4 
6  const GlobalVector& direction,
7  float transverseCurvature,
8  int,
9  const MagneticField* fieldProvider)
10  : theField(fieldProvider), theX(aX) {
12  float bza = -2.99792458e-3f * cachedMagneticField.z();
13  float qbpi = bza / (direction.perp() * transverseCurvature);
14  theP = direction * std::abs(qbpi);
15  theCharge = qbpi > 0.f ? 1 : -1;
16 }
17 
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-3f * cachedMagneticField.z();
26  float qbpi = bza / (direction.perp() * transverseCurvature);
27  theP = direction * std::abs(qbpi);
28  theCharge = qbpi > 0.f ? 1 : -1;
29 }
30 
33 } // we must initialize cache to non-NAN to avoid FPE
34 
36  return 2.99792458e-3f * 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 */
Vector3DBase
Definition: Vector3DBase.h:8
Likely.h
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition: GlobalTrajectoryParameters.h:112
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition: GlobalTrajectoryParameters.h:113
GlobalTrajectoryParameters.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GlobalTrajectoryParameters::magneticFieldInInverseGeV
GlobalVector magneticFieldInInverseGeV() const
Definition: GlobalTrajectoryParameters.h:102
GlobalTrajectoryParameters::GlobalTrajectoryParameters
GlobalTrajectoryParameters()
Definition: GlobalTrajectoryParameters.h:18
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
theX
T theX
Definition: Basic3DVectorLD.h:241
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition: GlobalTrajectoryParameters.h:67
Point3DBase< float, GlobalTag >
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition: GlobalTrajectoryParameters.h:89
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition: GlobalTrajectoryParameters.h:116
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition: GlobalTrajectoryParameters.h:115
GlobalTrajectoryParameters::setCache
void setCache()
Definition: GlobalTrajectoryParameters.cc:31
MagneticField.h
genVertex_cff.x
x
Definition: genVertex_cff.py:13
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition: GlobalTrajectoryParameters.h:114
MagneticField
Definition: MagneticField.h:19
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69