CMS 3D CMS Logo

BaseTrackerRecHit.cc
Go to the documentation of this file.
1 //#define DO_THROW_UNINITIALIZED
6 
7 namespace {
8 #if defined(DO_THROW_UNINITIALIZED) || defined(DO_INTERNAL_CHECKS_BTR)
9  inline void throwExceptionUninitialized(const char *where) {
10  throw cms::Exception("BaseTrackerRecHit")
11  << "Trying to access " << where
12  << " 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: "
14  "ComputeCoarseLocalPositionFromDisk = True \n "
15  << " to the TransientTrackingRecHitBuilder you are using from "
16  "RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
17  }
18 #endif
19  void obsolete() { throw cms::Exception("BaseTrackerRecHit") << "CLHEP is obsolete for Tracker Hits"; }
20 } // namespace
21 
22 #if !defined(VI_DEBUG) && defined(DO_INTERNAL_CHECKS_BTR)
23 void BaseTrackerRecHit::check() const {
24  if (!hasPositionAndError())
25  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 
37 #if defined(DO_THROW_UNINITIALIZED)
38  if (!hasPositionAndError())
39  throwExceptionUninitialized("getKfComponents");
40 #endif
41  AlgebraicVector1 &pars = holder.params<1>();
42  pars[0] = pos_.x();
43 
44  AlgebraicSymMatrix11 &errs = holder.errors<1>();
45  errs(0, 0) = err_.xx();
46 
48  pf.index[0] = 3;
49 
50  holder.measuredParams<1>() = AlgebraicVector1(holder.tsosLocalParameters().At(3));
51  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>(3, 3);
52 }
53 
55 #if defined(DO_THROW_UNINITIALIZED)
56  if (!hasPositionAndError())
57  throwExceptionUninitialized("getKfComponents");
58 #endif
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 
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 // obsolete (for what tracker is concerned...) interface
78  obsolete();
79  return AlgebraicVector();
80 }
81 
83  obsolete();
84  return AlgebraicSymMatrix();
85 }
86 
88  obsolete();
89  return AlgebraicMatrix();
90 }
float xx() const
Definition: LocalError.h:22
bool hasPositionAndError() const final
to be redefined by daughter class
T y() const
Definition: PV3DBase.h:60
AlgebraicMatrix projectionMatrix() const override
ROOT::Math::SVector< double, 1 > AlgebraicVector1
float xy() const
Definition: LocalError.h:23
ROOT::Math::SVector< double, 2 > AlgebraicVector2
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
CLHEP::HepMatrix AlgebraicMatrix
float yy() const
Definition: LocalError.h:24
const GeomDet * det() const
void getKfComponents2D(KfComponentsHolder &holder) const
AlgebraicROOTObject< D >::Vector & params()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11
CLHEP::HepVector AlgebraicVector
AlgebraicSymMatrix parametersError() const override
const AlgebraicVector5 & tsosLocalParameters() const
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
void getKfComponents1D(KfComponentsHolder &holder) const
AlgebraicVector parameters() const override
AlgebraicROOTObject< D >::Vector & measuredParams()
CLHEP::HepSymMatrix AlgebraicSymMatrix
obsolete
Definition: Types.py:168
unsigned int index[D]
Definition: ProjectMatrix.h:62
T x() const
Definition: PV3DBase.h:59
const AlgebraicSymMatrix55 & tsosLocalErrors() const