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 
20  const GlobalVector& aP,
21  TrackCharge aCharge,
22  const MagneticField* fieldProvider) :
23  theField(fieldProvider),
24  theX(aX), theP(aP),
25  theCharge(aCharge)
26 {
28 } // we must initialize cache to non-NAN to avoid FPE
29 
31 {
32  return 2.99792458e-3f * theField->inTesla(x);
33 }
34 
35 
36 /* the field is different as it is attached to each given volume!!!!
37 // const MagneticField* GlobalTrajectoryParameters::theField=0;
38 #include<iostream>
39 // FIXME debug code mostly
40 void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
41  if (0==fieldProvider) return;
42  if (0!=theField && fieldProvider!=theField)
43  std::cout << "GlobalTrajectoryParameters: a different MF???? "
44  << theField << " " << fieldProvider << std::endl;
45  theField =fieldProvider;
46 }
47 */
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