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 }
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:127
TrackingRecHit::det
const GeomDet * det() const
Definition: TrackingRecHit.h:122
BaseTrackerRecHit::parameters
AlgebraicVector parameters() const override
Definition: BaseTrackerRecHit.cc:76
KfComponentsHolder::tsosLocalErrors
const AlgebraicSymMatrix55 & tsosLocalErrors() const
Definition: KfComponentsHolder.h:83
Types.obsolete
obsolete
Definition: Types.py:200
BaseTrackerRecHit::check
static void check()
Definition: BaseTrackerRecHit.h:122
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:126
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
BaseTrackerRecHit::hasPositionAndError
bool hasPositionAndError() const override
to be redefined by daughter class
Definition: BaseTrackerRecHit.cc:29
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:245
BaseTrackerRecHit::projectionMatrix
AlgebraicMatrix projectionMatrix() const override
Definition: BaseTrackerRecHit.cc:86
Exception.h
BaseTrackerRecHit::getKfComponents2D
void getKfComponents2D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:53
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:35
KfComponentsHolder::errors
AlgebraicROOTObject< D, D >::SymMatrix & errors()
Definition: KfComponentsHolder.h:39
BaseTrackerRecHit::parametersError
AlgebraicSymMatrix parametersError() const override
Definition: BaseTrackerRecHit.cc:81