CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
35 
36 
37 
39  const GlobalVector& aP,
40  TrackCharge aCharge,
41  const MagneticField* fieldProvider) :
42  theField(fieldProvider),
43  theX(aX), theP(aP),
44  theCharge(aCharge)
45 {
47 } // we must initialize cache to non-NAN to avoid FPE
48 
49 
50 
51 
53  const GlobalVector& aP,
54  TrackCharge aCharge,
55  const MagneticField* fieldProvider,
56  GlobalVector fieldValue) :
57  theField(fieldProvider),
58  theX(aX), theP(aP),
59  cachedMagneticField(fieldValue),
60  theCharge(aCharge)
61  {}
62 
63 
65 {
66  return 2.99792458e-3f * theField->inTesla(x);
67 }
68 
69 
70 /* the field is different as it is attached to each given volume!!!!
71 // const MagneticField* GlobalTrajectoryParameters::theField=0;
72 #include<iostream>
73 // FIXME debug code mostly
74 void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
75  if (0==fieldProvider) return;
76  if (0!=theField && fieldProvider!=theField)
77  std::cout << "GlobalTrajectoryParameters: a different MF???? "
78  << theField << " " << fieldProvider << std::endl;
79  theField =fieldProvider;
80 }
81 */
T perp() const
Definition: PV3DBase.h:72
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
int TrackCharge
Definition: TrackCharge.h:4
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]
T theX
Definition: DDAxes.h:10
Global3DVector GlobalVector
Definition: GlobalVector.h:10