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 */
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GlobalVector magneticFieldInInverseGeV() const
double f[11][100]
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T theX
Global3DVector GlobalVector
Definition: GlobalVector.h:10