CMS 3D CMS Logo

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