CMS 3D CMS Logo

BaseTrackerRecHit.cc
Go to the documentation of this file.
5 
6 
7 
8 namespace {
9  inline void
10  throwExceptionUninitialized(const char *where)
11  {
12  throw cms::Exception("BaseTrackerRecHit") <<
13  "Trying to access " << where << " for a RecHit that was read from disk, but since CMSSW_2_1_X local positions are transient.\n" <<
14  "If you want to get coarse position/error estimation from disk, please set: ComputeCoarseLocalPositionFromDisk = True \n " <<
15  " to the TransientTrackingRecHitBuilder you are using from RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
16  }
17 
18  void obsolete() {
19  throw cms::Exception("BaseTrackerRecHit") << "CLHEP is obsolete for Tracker Hits";
20  }
21 }
22 
23 #ifdef EDM_LM_DEBUG
24 void BaseTrackerRecHit::check() const {
25  if (!hasPositionAndError()) throwExceptionUninitialized("localPosition or Error");
26 }
27 #endif
28 
30  return det();
31 
32  // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
33  // (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0);
34 }
35 
36 
37 
38 void
40 {
41  // if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
42  AlgebraicVector1 & pars = holder.params<1>();
43  pars[0] = pos_.x();
44 
45  AlgebraicSymMatrix11 & errs = holder.errors<1>();
46  errs(0,0) = err_.xx();
47 
48  ProjectMatrix<double,5,1> & pf = holder.projFunc<1>();
49  pf.index[0] = 3;
50 
51  holder.measuredParams<1>() = AlgebraicVector1( holder.tsosLocalParameters().At(3) );
52  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>( 3, 3 );
53 }
54 
55 void
57 {
58  //if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
59  AlgebraicVector2 & pars = holder.params<2>();
60  pars[0] = pos_.x();
61  pars[1] = pos_.y();
62 
63  AlgebraicSymMatrix22 & errs = holder.errors<2>();
64  errs(0,0) = err_.xx();
65  errs(0,1) = err_.xy();
66  errs(1,1) = err_.yy();
67 
68  ProjectMatrix<double,5,2> & pf = holder.projFunc<2>();
69  pf.index[0] = 3;
70  pf.index[1] = 4;
71 
72  holder.measuredParams<2>() = AlgebraicVector2( & holder.tsosLocalParameters().At(3), 2 );
73  holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>( 3, 3 );
74 
75 }
76 
77  // obsolete (for what tracker is concerned...) interface
79  obsolete();
80  return AlgebraicVector();
81 }
82 
84  obsolete();
85  return AlgebraicSymMatrix();
86 }
87 
88 
90  obsolete();
91  return AlgebraicMatrix();
92 }
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
bool hasPositionAndError() const final
to be redefined by daughter class
T y() const
Definition: PV3DBase.h:63
virtual AlgebraicSymMatrix parametersError() const
float xy() const
Definition: LocalError.h:25
CLHEP::HepMatrix AlgebraicMatrix
float yy() const
Definition: LocalError.h:26
const GeomDet * det() const
void getKfComponents2D(KfComponentsHolder &holder) const
virtual AlgebraicVector parameters() const
AlgebraicROOTObject< D >::Vector & params()
CLHEP::HepVector AlgebraicVector
const AlgebraicVector5 & tsosLocalParameters() const
void getKfComponents1D(KfComponentsHolder &holder) const
AlgebraicROOTObject< D >::Vector & measuredParams()
CLHEP::HepSymMatrix AlgebraicSymMatrix
unsigned int index[D]
Definition: ProjectMatrix.h:62
virtual AlgebraicMatrix projectionMatrix() const
AlgebraicROOTObject< D, D >::SymMatrix & errors()
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