CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SteppingHelixStateInfo.cc
Go to the documentation of this file.
1 
7 //
8 // Original Author: Vyacheslav Krutelyov
9 // Created: Wed Jan 3 16:01:24 CST 2007
10 //
11 //
12 
16 
19 
21 
23 
25  "RESULT_OK",
26  "RESULT_FAULT",
27  "RESULT_RANGEOUT",
28  "RESULT_INACC",
29  "RESULT_NOT_IMPLEMENTED",
30  "RESULT_UNDEFINED"
31 };
32 
34  path_(0), radPath_(0), dir(0), magVol(0), field(0), dEdx(0), dEdXPrime(0), radX0(1e12),
35  status_(UNDEFINED)
36 {
37  p3.set(fts.momentum().x(), fts.momentum().y(), fts.momentum().z());
38  r3.set(fts.position().x(), fts.position().y(), fts.position().z());
39  q = fts.charge();
40 
41  if (fts.hasError()){
43  hasErrorPropagated_ = true;
44  } else {
46  hasErrorPropagated_ = false;
47  }
48  static const std::string metname = "SteppingHelixPropagator";
49  if (fts.hasError()){
50  LogTrace(metname)<<"Created SHPStateInfo from FTS\n"<<fts;
51  // LogTrace(metname)<<"and cartesian error of\n"<<fts.cartesianError().matrix();
52  }
53  else LogTrace(metname)<<"Created SHPStateInfo from FTS without errors";
54 
55  isComplete = false;
56  isValid_ = true;
57 }
58 
59 TrajectoryStateOnSurface SteppingHelixStateInfo::getStateOnSurface(const Surface& surf, bool returnTangentPlane) const {
60  static const std::string metname = "SteppingHelixPropagator";
61  if (! isValid()) LogTrace(metname)<<"Return TSOS is invalid";
62  else LogTrace(metname)<<"Return TSOS is valid";
63  if (! isValid()) return TrajectoryStateOnSurface();
64  GlobalVector p3GV(p3.x(), p3.y(), p3.z());
65  GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
66  GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
67  // CartesianTrajectoryError tCov(cov);
68 
69  // CurvilinearTrajectoryError tCCov(ROOT::Math::Similarity(JacobianCartesianToCurvilinear(tPars).jacobian(), cov));
71 
72  FreeTrajectoryState fts(tPars, tCCov);
73  if (! hasErrorPropagated_) fts = FreeTrajectoryState(tPars);
74 
75 
77  if ( dir > 0 ) side = SurfaceSideDefinition::beforeSurface;
78  if ( dir < 0 ) side = SurfaceSideDefinition::afterSurface;
79  return TrajectoryStateOnSurface(fts, returnTangentPlane ? *surf.tangentPlane(fts.position()) : surf, side);
80 }
81 
82 
84  if (isValid()){
85  GlobalVector p3GV(p3.x(), p3.y(), p3.z());
86  GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
87  GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
88  // CartesianTrajectoryError tCov(cov);
89  // CurvilinearTrajectoryError tCCov(ROOT::Math::Similarity(JacobianCartesianToCurvilinear(tPars).jacobian(), cov));
91 
92  fts = (hasErrorPropagated_ )
93  ? FreeTrajectoryState(tPars, tCCov) : FreeTrajectoryState(tPars);
94  // ? FreeTrajectoryState(tPars, tCov, tCCov) : FreeTrajectoryState(tPars);
95  // if (fts.hasError()) fts.curvilinearError(); //call it so it gets created
96  }
97 }
const std::string metname
void getFreeState(FreeTrajectoryState &fts) const
convert internal structure into the fts
T y() const
Definition: PV3DBase.h:63
AlgebraicSymMatrix55 covCurv
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
tuple field
Definition: statics.py:62
TrajectoryStateOnSurface getStateOnSurface(const Surface &surf, bool returnTangentPlane=false) const
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
GlobalVector momentum() const
const MagneticField * field
GlobalPoint position() const
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
std::string & path_
const AlgebraicSymMatrix55 & matrix() const
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
static const std::string ResultName[MAX_RESULT]