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), cachedCurvature_(transverseCurvature), hasCurvature_(true)
11 {
12  float bza = -2.99792458e-3f * theField->inTesla(theX).z();
13  float qbpi = bza/(direction.perp()*transverseCurvature);
14  theP = direction*std::abs(qbpi);
15  theCharge = qbpi > 0.f ? 1 : -1;
16 }
17 
19 {
20  if unlikely(!hasCurvature_) {
21  float bza = -2.99792458e-3f * theField->inTesla(theX).z();
23  hasCurvature_ = true;
24  }
25  return cachedCurvature_;
26 }
27 
29 {
30  return 2.99792458e-3f * theField->inTesla(x);
31 }
32 
33 
34 /* the field is different as it is attached to each given volume!!!!
35 // const MagneticField* GlobalTrajectoryParameters::theField=0;
36 #include<iostream>
37 // FIXME debug code mostly
38 void GlobalTrajectoryParameters::setMF(const MagneticField* fieldProvider) {
39  if (0==fieldProvider) return;
40  if (0!=theField && fieldProvider!=theField)
41  std::cout << "GlobalTrajectoryParameters: a different MF???? "
42  << theField << " " << fieldProvider << std::endl;
43  theField =fieldProvider;
44 }
45 */
T perp() const
Definition: PV3DBase.h:72
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define abs(x)
Definition: mlp_lapack.h:159
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
#define unlikely(x)
Definition: Likely.h:21
T z() const
Definition: PV3DBase.h:64
double f[11][100]
T theX
Definition: DDAxes.h:10