CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseTrackerRecHit.cc
Go to the documentation of this file.
4 
5 
6 
7 namespace {
8  void
9  throwExceptionUninitialized(const char *where)
10  {
11  throw cms::Exception("BaseTrackerRecHit") <<
12  "Trying to access " << where << " for a RecHit that was read from disk, but since CMSSW_2_1_X local positions are transient.\n" <<
13  "If you want to get coarse position/error estimation from disk, please set: ComputeCoarseLocalPositionFromDisk = True \n " <<
14  " to the TransientTrackingRecHitBuilder you are using from RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
15  }
16 
17  void obsolete() {
18  throw cms::Exception("BaseTrackerRecHit") << "CLHEP is obsolete for Tracker Hits";
19  }
20 }
21 
22 
24  return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
25  (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0);
26 }
27 
29  if (!hasPositionAndError()) throwExceptionUninitialized("localPosition");
30  return pos_;
31 }
32 
34  if (!hasPositionAndError()) throwExceptionUninitialized("localPositionError");
35  return err_;
36 }
37 
38 
39 
40 void
42 {
43  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
44  AlgebraicVector1 & pars = holder.params<1>();
45  pars[0] = pos_.x();
46 
47  AlgebraicSymMatrix11 & errs = holder.errors<1>();
48  errs(0,0) = err_.xx();
49 
50  AlgebraicMatrix15 & proj = holder.projection<1>();
51  proj(0,3) = 1;
52 
53  holder.measuredParams<1>() = AlgebraicVector1( holder.tsosLocalParameters().At(3) );
54  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>( 3, 3 );
55 }
56 
57 void
59 {
60  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
61  AlgebraicVector2 & pars = holder.params<2>();
62  pars[0] = pos_.x();
63  pars[1] = pos_.y();
64 
65  AlgebraicSymMatrix22 & errs = holder.errors<2>();
66  errs(0,0) = err_.xx();
67  errs(0,1) = err_.xy();
68  errs(1,1) = err_.yy();
69 
70 
71  AlgebraicMatrix25 & proj = holder.projection<2>();
72  proj(0,3) = 1;
73  proj(1,4) = 1;
74 
75  ProjectMatrix<double,5,2> & pf = holder.projFunc<2>();
76  pf.index[0] = 3;
77  pf.index[1] = 4;
78  holder.doUseProjFunc();
79 
80  holder.measuredParams<2>() = AlgebraicVector2( & holder.tsosLocalParameters().At(3), 2 );
81  holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>( 3, 3 );
82 
83 }
84 
85  // obsolete (for what tracker is concerned...) interface
87  obsolete();
88  return AlgebraicVector();
89 }
90 
92  obsolete();
93  return AlgebraicSymMatrix();
94 }
95 
96 
98  obsolete();
99  return AlgebraicMatrix();
100 }
float xx() const
Definition: LocalError.h:24
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
ROOT::Math::SVector< double, 1 > AlgebraicVector1
T y() const
Definition: PV3DBase.h:63
virtual AlgebraicSymMatrix parametersError() const
virtual LocalPoint localPosition() const GCC11_FINAL
float xy() const
Definition: LocalError.h:25
bool hasPositionAndError() const GCC11_FINAL
to be redefined by daughter class
CLHEP::HepMatrix AlgebraicMatrix
float yy() const
Definition: LocalError.h:26
T z() const
Definition: PV3DBase.h:64
void getKfComponents2D(KfComponentsHolder &holder) const
ROOT::Math::SMatrix< double, 1, 5, ROOT::Math::MatRepStd< double, 1, 5 > > AlgebraicMatrix15
virtual AlgebraicVector parameters() const
AlgebraicROOTObject< D >::Vector & params()
CLHEP::HepVector AlgebraicVector
const AlgebraicVector5 & tsosLocalParameters() const
void getKfComponents1D(KfComponentsHolder &holder) const
virtual LocalError localPositionError() const GCC11_FINAL
AlgebraicROOTObject< D >::Vector & measuredParams()
ROOT::Math::SMatrix< double, 2, 5, ROOT::Math::MatRepStd< double, 2, 5 > > AlgebraicMatrix25
CLHEP::HepSymMatrix AlgebraicSymMatrix
unsigned int index[D]
Definition: ProjectMatrix.h:42
virtual AlgebraicMatrix projectionMatrix() const
AlgebraicROOTObject< D, D >::SymMatrix & errors()
AlgebraicROOTObject< D, 5 >::Matrix & projection()
T x() const
Definition: PV3DBase.h:62
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SVector< double, 2 > AlgebraicVector2
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11