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 }
KfComponentsHolder.h
KfComponentsHolder::projFunc
ProjectMatrix< double, 5, D > & projFunc()
Definition: KfComponentsHolder.h:56
ProjectMatrix.h
LocalError::xy
float xy() const
Definition: LocalError.h:23
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
AlgebraicVector1
ROOT::Math::SVector< double, 1 > AlgebraicVector1
Definition: AlgebraicROOTObjects.h:10
BaseTrackerRecHit::err_
LocalError err_
Definition: BaseTrackerRecHit.h:126
TrackingRecHit::det
const GeomDet * det() const
Definition: TrackingRecHit.h:122
BaseTrackerRecHit::parameters
AlgebraicVector parameters() const override
Definition: BaseTrackerRecHit.cc:77
KfComponentsHolder::tsosLocalErrors
const AlgebraicSymMatrix55 & tsosLocalErrors() const
Definition: KfComponentsHolder.h:83
Types.obsolete
obsolete
Definition: Types.py:168
BaseTrackerRecHit::check
static void check()
Definition: BaseTrackerRecHit.h:121
KfComponentsHolder::tsosLocalParameters
const AlgebraicVector5 & tsosLocalParameters() const
Definition: KfComponentsHolder.h:82
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
LocalError::xx
float xx() const
Definition: LocalError.h:22
BaseTrackerRecHit::pos_
LocalPoint pos_
Definition: BaseTrackerRecHit.h:125
AlgebraicSymMatrix11
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11
Definition: AlgebraicROOTObjects.h:19
KfComponentsHolder::measuredParams
AlgebraicROOTObject< D >::Vector & measuredParams()
Definition: KfComponentsHolder.h:67
AlgebraicVector2
ROOT::Math::SVector< double, 2 > AlgebraicVector2
Definition: AlgebraicROOTObjects.h:11
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
KfComponentsHolder::measuredErrors
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
Definition: KfComponentsHolder.h:75
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
KfComponentsHolder
Definition: KfComponentsHolder.h:13
BaseTrackerRecHit.h
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
Exception
Definition: hltDiff.cc:246
BaseTrackerRecHit::hasPositionAndError
bool hasPositionAndError() const final
to be redefined by daughter class
Definition: BaseTrackerRecHit.cc:29
BaseTrackerRecHit::projectionMatrix
AlgebraicMatrix projectionMatrix() const override
Definition: BaseTrackerRecHit.cc:87
Exception.h
BaseTrackerRecHit::getKfComponents2D
void getKfComponents2D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:54
ProjectMatrix
Definition: ProjectMatrix.h:8
LocalError::yy
float yy() const
Definition: LocalError.h:24
KfComponentsHolder::params
AlgebraicROOTObject< D >::Vector & params()
Definition: KfComponentsHolder.h:31
AlgebraicSymMatrix22
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
Definition: AlgebraicROOTObjects.h:20
BaseTrackerRecHit::getKfComponents1D
void getKfComponents1D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:36
KfComponentsHolder::errors
AlgebraicROOTObject< D, D >::SymMatrix & errors()
Definition: KfComponentsHolder.h:39
BaseTrackerRecHit::parametersError
AlgebraicSymMatrix parametersError() const override
Definition: BaseTrackerRecHit.cc:82