CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseSiTrackerRecHit2DLocalPos.cc
Go to the documentation of this file.
4 
6  return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
7  (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0);
8 }
9 
11  if (!hasPositionAndError()) throwExceptionUninitialized("localPosition");
12  return pos_;
13 }
14 
16  if (!hasPositionAndError()) throwExceptionUninitialized("localPositionError");
17  return err_;
18 }
19 
20 
21 void
23 {
24  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
25  //std::cout << "Call to KfComponentsHolder::genericFill should be optimized here " << std::endl;
26  AlgebraicVector2 & pars = holder.params<2>();
27  pars[0] = pos_.x();
28  pars[1] = pos_.y();
29 
30  AlgebraicSymMatrix22 & errs = holder.errors<2>();
31  errs(0,0) = err_.xx();
32  errs(0,1) = err_.xy();
33  errs(1,1) = err_.yy();
34 
35 
36  AlgebraicMatrix25 & proj = holder.projection<2>();
37  proj(0,3) = 1;
38  proj(1,4) = 1;
39 
40  ProjectMatrix<double,5,2> & pf = holder.projFunc<2>();
41  pf.index[0] = 3;
42  pf.index[1] = 4;
43  holder.doUseProjFunc();
44 
45  holder.measuredParams<2>() = AlgebraicVector2( & holder.tsosLocalParameters().At(3), 2 );
46  holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>( 3, 3 );
47 
48  //std::cout << "======== MYSELF ==========" << std::endl;
49  //holder.dump<2>();
50  //std::cout << "======== GENERIC ==========" << std::endl;
51  //holder.genericFill(*this);
52  //holder.dump<2>();
53 }
54 
55 void
57 {
58  throw cms::Exception("BaseSiTrackerRecHit2DLocalPos") <<
59  "Trying to access " << where << " for a RecHit that was read from disk, but since CMSSW_2_1_X local positions are transient.\n" <<
60  "If you want to get coarse position/error estimation from disk, please set: ComputeCoarseLocalPositionFromDisk = True \n " <<
61  " to the TransientTrackingRecHitBuilder you are using from RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
62 }
63 
float xx() const
Definition: LocalError.h:24
virtual LocalError localPositionError() const
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
T y() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const
virtual void getKfComponents(KfComponentsHolder &holder) const
float xy() const
Definition: LocalError.h:25
void throwExceptionUninitialized(const char *where) const
float yy() const
Definition: LocalError.h:26
T z() const
Definition: PV3DBase.h:63
bool hasPositionAndError() const
to be redefined by daughter class
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
AlgebraicROOTObject< D >::Vector & measuredParams()
ROOT::Math::SMatrix< double, 2, 5, ROOT::Math::MatRepStd< double, 2, 5 > > AlgebraicMatrix25
unsigned int index[D]
Definition: ProjectMatrix.h:42
AlgebraicROOTObject< D, D >::SymMatrix & errors()
AlgebraicROOTObject< D, 5 >::Matrix & projection()
T x() const
Definition: PV3DBase.h:61
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SVector< double, 2 > AlgebraicVector2