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  //if det is present pos&err are available as well.
31  // //if det() is not present (null) the hit has been read from file and not updated
32  return det();
33 }
34 
36 #if defined(DO_THROW_UNINITIALIZED)
37  if (!hasPositionAndError())
38  throwExceptionUninitialized("getKfComponents");
39 #endif
40  AlgebraicVector1 &pars = holder.params<1>();
41  pars[0] = pos_.x();
42 
43  AlgebraicSymMatrix11 &errs = holder.errors<1>();
44  errs(0, 0) = err_.xx();
45 
47  pf.index[0] = 3;
48 
49  holder.measuredParams<1>() = AlgebraicVector1(holder.tsosLocalParameters().At(3));
50  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>(3, 3);
51 }
52 
54 #if defined(DO_THROW_UNINITIALIZED)
55  if (!hasPositionAndError())
56  throwExceptionUninitialized("getKfComponents");
57 #endif
58  AlgebraicVector2 &pars = holder.params<2>();
59  pars[0] = pos_.x();
60  pars[1] = pos_.y();
61 
62  AlgebraicSymMatrix22 &errs = holder.errors<2>();
63  errs(0, 0) = err_.xx();
64  errs(0, 1) = err_.xy();
65  errs(1, 1) = err_.yy();
66 
68  pf.index[0] = 3;
69  pf.index[1] = 4;
70 
71  holder.measuredParams<2>() = AlgebraicVector2(&holder.tsosLocalParameters().At(3), 2);
72  holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>(3, 3);
73 }
74 
75 // obsolete (for what tracker is concerned...) interface
77  obsolete();
78  return AlgebraicVector();
79 }
80 
82  obsolete();
83  return AlgebraicSymMatrix();
84 }
85 
87  obsolete();
88  return AlgebraicMatrix();
89 }
AlgebraicSymMatrix parametersError() const override
const AlgebraicSymMatrix55 & tsosLocalErrors() const
const GeomDet * det() const
AlgebraicVector parameters() const override
ROOT::Math::SVector< double, 1 > AlgebraicVector1
const AlgebraicVector5 & tsosLocalParameters() const
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
ROOT::Math::SVector< double, 2 > AlgebraicVector2
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
CLHEP::HepMatrix AlgebraicMatrix
bool hasPositionAndError() const override
to be redefined by daughter class
AlgebraicROOTObject< D >::Vector & params()
AlgebraicROOTObject< D, D >::SymMatrix & errors()
float xy() const
Definition: LocalError.h:23
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11
CLHEP::HepVector AlgebraicVector
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
AlgebraicMatrix projectionMatrix() const override
AlgebraicROOTObject< D >::Vector & measuredParams()
void getKfComponents1D(KfComponentsHolder &holder) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
obsolete
Definition: Types.py:240
void getKfComponents2D(KfComponentsHolder &holder) const
float xx() const
Definition: LocalError.h:22