CMS 3D CMS Logo

GlobalTrajectoryParameters.cc
Go to the documentation of this file.
4 
6  const GlobalVector& direction,
7  float transverseCurvature, int,
8  const MagneticField* fieldProvider) :
9  theField(fieldProvider),
10  theX(aX)
11 {
13  float bza = -2.99792458e-3f * 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 
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-3f * cachedMagneticField.z();
30  float qbpi = bza/(direction.perp()*transverseCurvature);
31  theP = direction*std::abs(qbpi);
32  theCharge = qbpi > 0.f ? 1 : -1;
33 }
34 
37 } // we must initialize cache to non-NAN to avoid FPE
38 
39 
40 
42 {
43  return 2.99792458e-3f * 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 */
T perp() const
Definition: PV3DBase.h:72
T z() const
Definition: PV3DBase.h:64
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