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 
9 //
10 // Original Author: Vyacheslav Krutelyov
11 // Created: Wed Jan 3 16:01:24 CST 2007
12 // $Id: SteppingHelixStateInfo.cc,v 1.13 2009/09/08 20:44:32 slava77 Exp $
13 //
14 //
15 
19 
22 
24 
26 
28  "RESULT_OK",
29  "RESULT_FAULT",
30  "RESULT_RANGEOUT",
31  "RESULT_INACC",
32  "RESULT_NOT_IMPLEMENTED",
33  "RESULT_UNDEFINED"
34 };
35 
37  path_(0), radPath_(0), dir(0), magVol(0), field(0), dEdx(0), dEdXPrime(0), radX0(1e12),
38  status_(UNDEFINED)
39 {
40  p3.set(fts.momentum().x(), fts.momentum().y(), fts.momentum().z());
41  r3.set(fts.position().x(), fts.position().y(), fts.position().z());
42  q = fts.charge();
43 
44  if (fts.hasError()){
46  hasErrorPropagated_ = true;
47  } else {
49  hasErrorPropagated_ = false;
50  }
51  static const std::string metname = "SteppingHelixPropagator";
52  if (fts.hasError()){
53  LogTrace(metname)<<"Created SHPStateInfo from FTS\n"<<fts;
54  // LogTrace(metname)<<"and cartesian error of\n"<<fts.cartesianError().matrix();
55  }
56  else LogTrace(metname)<<"Created SHPStateInfo from FTS without errors";
57 
58  isComplete = false;
59  isValid_ = true;
60 }
61 
62 TrajectoryStateOnSurface SteppingHelixStateInfo::getStateOnSurface(const Surface& surf, bool returnTangentPlane) const {
63  static const std::string metname = "SteppingHelixPropagator";
64  if (! isValid()) LogTrace(metname)<<"Return TSOS is invalid";
65  else LogTrace(metname)<<"Return TSOS is valid";
66  if (! isValid()) return TrajectoryStateOnSurface();
67  GlobalVector p3GV(p3.x(), p3.y(), p3.z());
68  GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
69  GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
70  // CartesianTrajectoryError tCov(cov);
71 
72  // CurvilinearTrajectoryError tCCov(ROOT::Math::Similarity(JacobianCartesianToCurvilinear(tPars).jacobian(), cov));
74 
75  FreeTrajectoryState fts(tPars, tCCov);
76  if (! hasErrorPropagated_) fts = FreeTrajectoryState(tPars);
77 
78 
80  if ( dir > 0 ) side = SurfaceSideDefinition::beforeSurface;
81  if ( dir < 0 ) side = SurfaceSideDefinition::afterSurface;
82  return TrajectoryStateOnSurface(fts, returnTangentPlane ? *surf.tangentPlane(fts.position()) : surf, side);
83 }
84 
85 
87  if (isValid()){
88  GlobalVector p3GV(p3.x(), p3.y(), p3.z());
89  GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
90  GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
91  // CartesianTrajectoryError tCov(cov);
92  // CurvilinearTrajectoryError tCCov(ROOT::Math::Similarity(JacobianCartesianToCurvilinear(tPars).jacobian(), cov));
94 
95  fts = (hasErrorPropagated_ )
96  ? FreeTrajectoryState(tPars, tCCov) : FreeTrajectoryState(tPars);
97  // ? FreeTrajectoryState(tPars, tCov, tCCov) : FreeTrajectoryState(tPars);
98  // if (fts.hasError()) fts.curvilinearError(); //call it so it gets created
99  }
100 }
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
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]