CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Static Private Member Functions
BaseTrackerRecHit Class Referenceabstract

#include <BaseTrackerRecHit.h>

Inheritance diagram for BaseTrackerRecHit:
TrackingRecHit FastTrackerRecHit SiStripMatchedRecHit2D SiTrackerMultiRecHit TrackerSingleRecHit FastMatchedTrackerRecHit FastProjectedTrackerRecHit FastSingleTrackerRecHit MTDTrackingRecHit Phase2TrackerRecHit1D ProjectedSiStripRecHit2D SiPixelRecHit SiStripRecHit1D SiStripRecHit2D

Public Member Functions

 BaseTrackerRecHit ()
 
 BaseTrackerRecHit (DetId id, trackerHitRTTI::RTTI rt)
 
 BaseTrackerRecHit (const LocalPoint &p, const LocalError &e, GeomDet const &idet, trackerHitRTTI::RTTI rt)
 
virtual float clusterProbability () const
 cluster probability, overloaded by pixel rechits. More...
 
int dimension () const override=0
 
float errorGlobalR () const final
 
float errorGlobalRPhi () const final
 
float errorGlobalZ () const final
 
virtual OmniClusterRef const & firstClusterRef () const =0
 
void getKfComponents (KfComponentsHolder &holder) const override=0
 
void getKfComponents1D (KfComponentsHolder &holder) const
 
void getKfComponents2D (KfComponentsHolder &holder) const
 
GlobalPoint globalPosition () const final
 
GlobalError globalPositionError () const final
 
TrackingRecHitGlobalState globalState () const
 
bool hasPositionAndError () const final
 to be redefined by daughter class More...
 
BaseTrackerRecHit const * hit () const final
 
bool isMatched () const
 
bool isMulti () const
 
virtual bool isPhase2 () const
 
virtual bool isPixel () const
 
bool isProjected () const
 
bool isProjMono () const
 
bool isProjStereo () const
 
bool isSingle () const
 
LocalPoint localPosition () const final
 
LocalError localPositionError () const final
 
const LocalErrorlocalPositionErrorFast () const
 
const LocalPointlocalPositionFast () const
 
AlgebraicVector parameters () const override
 
AlgebraicSymMatrix parametersError () const override
 
AlgebraicMatrix projectionMatrix () const override
 
trackerHitRTTI::RTTI rtti () const
 
bool sameDetModule (TrackingRecHit const &hit) const
 
const Surfacesurface () const final
 
 ~BaseTrackerRecHit () override
 
- Public Member Functions inherited from TrackingRecHit
virtual bool canImproveWithTrack () const
 
virtual TrackingRecHitclone () const =0
 
RecHitPointer cloneForFit (const GeomDet &idet) const
 
virtual TrackingRecHitcloneHit () const
 
virtual RecHitPointer cloneSH () const
 
const GeomDetdet () const
 
virtual const GeomDetUnitdetUnit () const
 
DetId geographicalId () const
 
unsigned int getRTTI () const
 
Type getType () const
 
bool isValid () const
 
id_type rawId () const
 
virtual std::vector< const TrackingRecHit * > recHits () const =0
 Access to component RecHits (if any) More...
 
virtual std::vector< TrackingRecHit * > recHits ()=0
 Non-const access to component RecHits (if any) More...
 
virtual void recHitsV (std::vector< const TrackingRecHit * > &) const
 
virtual void recHitsV (std::vector< TrackingRecHit * > &)
 
virtual void setDet (const GeomDet &idet)
 
virtual bool sharesInput (const TrackingRecHit *other, SharedInputType what) const
 
 TrackingRecHit (DetId id, Type type=valid)
 
 TrackingRecHit (id_type id=0, Type type=valid)
 
 TrackingRecHit (DetId id, unsigned int rt, Type type=valid)
 
 TrackingRecHit (const GeomDet &idet, Type type=valid)
 
 TrackingRecHit (const GeomDet &idet, unsigned int rt, Type type=valid)
 
 TrackingRecHit (const GeomDet &idet, TrackingRecHit const &rh)
 
virtual ConstRecHitContainer transientHits () const
 
Type type () const
 
virtual float weight () const
 
virtual ~TrackingRecHit ()
 

Protected Attributes

LocalError err_
 
LocalPoint pos_
 
unsigned int qualWord_
 

Static Private Member Functions

static void check ()
 

Additional Inherited Members

- Public Types inherited from TrackingRecHit
typedef std::vector< ConstRecHitPointerConstRecHitContainer
 
using ConstRecHitPointer = std::shared_ptr< TrackingRecHit const >
 
typedef unsigned int id_type
 
typedef std::vector< ConstRecHitPointerRecHitContainer
 
using RecHitPointer = std::shared_ptr< TrackingRecHit const >
 
enum  SharedInputType { all, some }
 definition of equality via shared input More...
 
enum  Type {
  valid = 0, missing = 1, inactive = 2, bad = 3,
  missing_inner = 4, missing_outer = 5, inactive_inner = 6, inactive_outer = 7
}
 
- Static Public Attributes inherited from TrackingRecHit
static const int rttiShift = 24
 
static const int typeMask = 0xf
 
- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setRTTI (unsigned int rt)
 
void setType (Type ttype)
 

Detailed Description

Definition at line 16 of file BaseTrackerRecHit.h.

Constructor & Destructor Documentation

BaseTrackerRecHit::BaseTrackerRecHit ( )
inline

Definition at line 18 of file BaseTrackerRecHit.h.

18 : qualWord_(0){}
unsigned int qualWord_
BaseTrackerRecHit::~BaseTrackerRecHit ( )
inlineoverride

Definition at line 23 of file BaseTrackerRecHit.h.

23 {}
BaseTrackerRecHit::BaseTrackerRecHit ( DetId  id,
trackerHitRTTI::RTTI  rt 
)
inline

Definition at line 26 of file BaseTrackerRecHit.h.

26 : TrackingRecHit(id,(unsigned int)(rt)),qualWord_(0) {}
TrackingRecHit(DetId id, Type type=valid)
unsigned int qualWord_
BaseTrackerRecHit::BaseTrackerRecHit ( const LocalPoint p,
const LocalError e,
GeomDet const &  idet,
trackerHitRTTI::RTTI  rt 
)
inline

Definition at line 28 of file BaseTrackerRecHit.h.

References TrackingRecHit::det(), err_, LocalError::valid(), LocalError::xx(), LocalError::xy(), and LocalError::yy().

29  :
30  TrackingRecHit(idet, (unsigned int)(rt)), pos_(p), err_(e), qualWord_(0){
31  LocalError lape = static_cast<TrackerGeomDet const *>(det())->localAlignmentError();
32  if (lape.valid())
33  err_ = LocalError(err_.xx()+lape.xx(),
34  err_.xy()+lape.xy(),
35  err_.yy()+lape.yy()
36  );
37  }
bool valid() const
Definition: LocalError.h:21
float xx() const
Definition: LocalError.h:24
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
const GeomDet * det() const
TrackingRecHit(DetId id, Type type=valid)
unsigned int qualWord_

Member Function Documentation

static void BaseTrackerRecHit::check ( )
inlinestaticprivate
virtual float BaseTrackerRecHit::clusterProbability ( ) const
inlinevirtual

cluster probability, overloaded by pixel rechits.

Definition at line 107 of file BaseTrackerRecHit.h.

References check(), TrackingRecHit::det(), parameters(), parametersError(), and projectionMatrix().

Referenced by SiPixelRecHit::cloneSH_().

107 { return 1.f; }
int BaseTrackerRecHit::dimension ( ) const
overridepure virtual
float BaseTrackerRecHit::errorGlobalR ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 87 of file BaseTrackerRecHit.h.

References globalPosition(), globalPositionError(), and mathSSE::sqrt().

87 { return std::sqrt(globalPositionError().rerr(globalPosition()));}
GlobalError globalPositionError() const final
T sqrt(T t)
Definition: SSEVec.h:18
GlobalPoint globalPosition() const final
float BaseTrackerRecHit::errorGlobalRPhi ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 89 of file BaseTrackerRecHit.h.

References globalPosition(), globalPositionError(), PV3DBase< T, PVType, FrameType >::perp(), and mathSSE::sqrt().

89 { return globalPosition().perp()*sqrt(globalPositionError().phierr(globalPosition())); }
T perp() const
Definition: PV3DBase.h:72
GlobalError globalPositionError() const final
T sqrt(T t)
Definition: SSEVec.h:18
GlobalPoint globalPosition() const final
float BaseTrackerRecHit::errorGlobalZ ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 88 of file BaseTrackerRecHit.h.

References globalPositionError(), and mathSSE::sqrt().

88 { return std::sqrt(globalPositionError().czz()); }
GlobalError globalPositionError() const final
T sqrt(T t)
Definition: SSEVec.h:18
virtual OmniClusterRef const& BaseTrackerRecHit::firstClusterRef ( ) const
pure virtual
void BaseTrackerRecHit::getKfComponents ( KfComponentsHolder holder) const
overridepure virtual
void BaseTrackerRecHit::getKfComponents1D ( KfComponentsHolder holder) const

Definition at line 41 of file BaseTrackerRecHit.cc.

References err_, KfComponentsHolder::errors(), hasPositionAndError(), ProjectMatrix< T, N, D >::index, KfComponentsHolder::measuredErrors(), KfComponentsHolder::measuredParams(), KfComponentsHolder::params(), packedPFCandidateRefMixer_cfi::pf, pos_, KfComponentsHolder::projFunc(), KfComponentsHolder::tsosLocalErrors(), KfComponentsHolder::tsosLocalParameters(), PV3DBase< T, PVType, FrameType >::x(), and LocalError::xx().

Referenced by SiTrackerMultiRecHit::getKfComponents(), SiStripRecHit1D::getKfComponents(), and localPositionErrorFast().

42 {
43 #if defined(DO_THROW_UNINITIALIZED)
44  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
45 #endif
46  AlgebraicVector1 & pars = holder.params<1>();
47  pars[0] = pos_.x();
48 
49  AlgebraicSymMatrix11 & errs = holder.errors<1>();
50  errs(0,0) = err_.xx();
51 
52  ProjectMatrix<double,5,1> & pf = holder.projFunc<1>();
53  pf.index[0] = 3;
54 
55  holder.measuredParams<1>() = AlgebraicVector1( holder.tsosLocalParameters().At(3) );
56  holder.measuredErrors<1>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix11>( 3, 3 );
57 }
float xx() const
Definition: LocalError.h:24
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
ROOT::Math::SVector< double, 1 > AlgebraicVector1
bool hasPositionAndError() const final
to be redefined by daughter class
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
AlgebraicROOTObject< D >::Vector & measuredParams()
unsigned int index[D]
Definition: ProjectMatrix.h:62
AlgebraicROOTObject< D, D >::SymMatrix & errors()
T x() const
Definition: PV3DBase.h:62
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11
void BaseTrackerRecHit::getKfComponents2D ( KfComponentsHolder holder) const

Definition at line 60 of file BaseTrackerRecHit.cc.

References err_, KfComponentsHolder::errors(), hasPositionAndError(), ProjectMatrix< T, N, D >::index, KfComponentsHolder::measuredErrors(), KfComponentsHolder::measuredParams(), KfComponentsHolder::params(), packedPFCandidateRefMixer_cfi::pf, pos_, KfComponentsHolder::projFunc(), KfComponentsHolder::tsosLocalErrors(), KfComponentsHolder::tsosLocalParameters(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by MTDTrackingRecHit::getKfComponents(), SiTrackerMultiRecHit::getKfComponents(), Phase2TrackerRecHit1D::getKfComponents(), SiStripRecHit2D::getKfComponents(), SiStripMatchedRecHit2D::getKfComponents(), ProjectedSiStripRecHit2D::getKfComponents(), SiPixelRecHit::getKfComponents(), and localPositionErrorFast().

61 {
62 #if defined(DO_THROW_UNINITIALIZED)
63  if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
64 #endif
65  AlgebraicVector2 & pars = holder.params<2>();
66  pars[0] = pos_.x();
67  pars[1] = pos_.y();
68 
69  AlgebraicSymMatrix22 & errs = holder.errors<2>();
70  errs(0,0) = err_.xx();
71  errs(0,1) = err_.xy();
72  errs(1,1) = err_.yy();
73 
74  ProjectMatrix<double,5,2> & pf = holder.projFunc<2>();
75  pf.index[0] = 3;
76  pf.index[1] = 4;
77 
78  holder.measuredParams<2>() = AlgebraicVector2( & holder.tsosLocalParameters().At(3), 2 );
79  holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>( 3, 3 );
80 
81 }
float xx() const
Definition: LocalError.h:24
AlgebraicROOTObject< D, D >::SymMatrix & measuredErrors()
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
bool hasPositionAndError() const final
to be redefined by daughter class
T y() const
Definition: PV3DBase.h:63
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
AlgebraicROOTObject< D >::Vector & params()
const AlgebraicVector5 & tsosLocalParameters() const
AlgebraicROOTObject< D >::Vector & measuredParams()
unsigned int index[D]
Definition: ProjectMatrix.h:62
AlgebraicROOTObject< D, D >::SymMatrix & errors()
T x() const
Definition: PV3DBase.h:62
const AlgebraicSymMatrix55 & tsosLocalErrors() const
ProjectMatrix< double, 5, D > & projFunc()
ROOT::Math::SVector< double, 2 > AlgebraicVector2
GlobalPoint BaseTrackerRecHit::globalPosition ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 82 of file BaseTrackerRecHit.h.

References localPosition(), surface(), and Surface::toGlobal().

Referenced by errorGlobalR(), errorGlobalRPhi(), globalState(), CosmicHitPairGeneratorFromLayerPair::hitPairs(), and CRackTrajectoryBuilder::SortHits().

82  {
83  return surface()->toGlobal(localPosition());
84  }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
const Surface * surface() const final
LocalPoint localPosition() const final
GlobalError BaseTrackerRecHit::globalPositionError ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 86 of file BaseTrackerRecHit.h.

References localPositionError(), surface(), and ErrorFrameTransformer::transform().

Referenced by errorGlobalR(), errorGlobalRPhi(), and errorGlobalZ().

static GlobalError transform(const LocalError &le, const Surface &surf)
LocalError localPositionError() const final
const Surface * surface() const final
TrackingRecHitGlobalState BaseTrackerRecHit::globalState ( ) const
inline

Definition at line 92 of file BaseTrackerRecHit.h.

References PV3DBase< T, PVType, FrameType >::barePhi(), PV3DBase< T, PVType, FrameType >::basicVector(), GlobalErrorBase< T, ErrorWeightType >::czz(), globalPosition(), runTauDisplay::gp, localPositionError(), PV3DBase< T, PVType, FrameType >::perp(), GlobalErrorBase< T, ErrorWeightType >::phierr(), alignCSCRings::r, GlobalErrorBase< T, ErrorWeightType >::rerr(), mathSSE::sqrt(), surface(), and ErrorFrameTransformer::transform().

92  {
96  float r = gp.perp();
97  float errorRPhi = r*std::sqrt(float(globalError.phierr(gp)));
98  float errorR = std::sqrt(float(globalError.rerr(gp)));
99  float errorZ = std::sqrt(float(globalError.czz()));
100  return (TrackingRecHitGlobalState){
101  gp.basicVector(), r, gp.barePhi(),
102  errorR,errorZ,errorRPhi
103  };
104  }
static GlobalError transform(const LocalError &le, const Surface &surf)
T perp() const
Definition: PV3DBase.h:72
LocalError localPositionError() const final
T phierr(const GlobalPoint &aPoint) const
T barePhi() const
Definition: PV3DBase.h:68
T sqrt(T t)
Definition: SSEVec.h:18
T rerr(const GlobalPoint &aPoint) const
const Surface * surface() const final
GlobalPoint globalPosition() const final
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
bool BaseTrackerRecHit::hasPositionAndError ( ) const
finalvirtual

to be redefined by daughter class

Reimplemented from TrackingRecHit.

Definition at line 31 of file BaseTrackerRecHit.cc.

References TrackingRecHit::det().

Referenced by getKfComponents1D(), getKfComponents2D(), and isPhase2().

31  {
32  return det();
33 
34  // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
35  // (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0);
36 }
const GeomDet * det() const
BaseTrackerRecHit const* BaseTrackerRecHit::hit ( ) const
inlinefinalvirtual
bool BaseTrackerRecHit::isMatched ( ) const
inline

Definition at line 41 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isMatched().

Referenced by FastTrackerRecHitSplitter::split().

41 { return trackerHitRTTI::isMatched(*this);}
bool isMatched(TrackingRecHit const &hit)
bool BaseTrackerRecHit::isMulti ( ) const
inline

Definition at line 45 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isMulti().

45 { return trackerHitRTTI::isMulti(*this);}
bool isMulti(TrackingRecHit const &hit)
virtual bool BaseTrackerRecHit::isPhase2 ( ) const
inlinevirtual

Reimplemented in Phase2TrackerRecHit1D, and MTDTrackingRecHit.

Definition at line 48 of file BaseTrackerRecHit.h.

References firstClusterRef(), hasPositionAndError(), and sameDetModule().

48 { return false;}
virtual bool BaseTrackerRecHit::isPixel ( ) const
inlinevirtual

Reimplemented in FastTrackerRecHit, and SiPixelRecHit.

Definition at line 47 of file BaseTrackerRecHit.h.

Referenced by Trajectory::pixel().

47 { return false;}
bool BaseTrackerRecHit::isProjected ( ) const
inline

Definition at line 42 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isProjected().

Referenced by FastTrackerRecHitSplitter::split().

42 { return trackerHitRTTI::isProjected(*this);}
bool isProjected(TrackingRecHit const &hit)
bool BaseTrackerRecHit::isProjMono ( ) const
inline

Definition at line 43 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isProjMono().

43 { return trackerHitRTTI::isProjMono(*this);}
bool isProjMono(TrackingRecHit const &hit)
bool BaseTrackerRecHit::isProjStereo ( ) const
inline

Definition at line 44 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isProjStereo().

44 { return trackerHitRTTI::isProjStereo(*this);}
bool isProjStereo(TrackingRecHit const &hit)
bool BaseTrackerRecHit::isSingle ( ) const
inline

Definition at line 40 of file BaseTrackerRecHit.h.

References trackerHitRTTI::isSingle().

Referenced by FastTrackerRecHitMatcher::_cast2Single().

40 { return trackerHitRTTI::isSingle(*this);}
bool isSingle(TrackingRecHit const &hit)
LocalPoint BaseTrackerRecHit::localPosition ( ) const
inlinefinalvirtual
LocalError BaseTrackerRecHit::localPositionError ( ) const
inlinefinalvirtual
const LocalError& BaseTrackerRecHit::localPositionErrorFast ( ) const
inline

Definition at line 65 of file BaseTrackerRecHit.h.

References check(), dimension(), err_, getKfComponents(), getKfComponents1D(), and getKfComponents2D().

65 { check(); return err_; }
const LocalPoint& BaseTrackerRecHit::localPositionFast ( ) const
inline

Definition at line 64 of file BaseTrackerRecHit.h.

References check(), and pos_.

Referenced by SiStripRecHitMatcher::match().

64 { check(); return pos_; }
AlgebraicVector BaseTrackerRecHit::parameters ( void  ) const
overridevirtual
AlgebraicSymMatrix BaseTrackerRecHit::parametersError ( ) const
overridevirtual

Implements TrackingRecHit.

Definition at line 89 of file BaseTrackerRecHit.cc.

Referenced by clusterProbability().

89  {
90  obsolete();
91  return AlgebraicSymMatrix();
92 }
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlgebraicMatrix BaseTrackerRecHit::projectionMatrix ( ) const
overridevirtual

Implements TrackingRecHit.

Definition at line 95 of file BaseTrackerRecHit.cc.

Referenced by clusterProbability().

95  {
96  obsolete();
97  return AlgebraicMatrix();
98 }
CLHEP::HepMatrix AlgebraicMatrix
trackerHitRTTI::RTTI BaseTrackerRecHit::rtti ( ) const
inline

Definition at line 39 of file BaseTrackerRecHit.h.

References trackerHitRTTI::rtti().

Referenced by FastTrackerRecHitMatcher::_cast2Single().

39 { return trackerHitRTTI::rtti(*this);}
RTTI rtti(TrackingRecHit const &hit)
bool BaseTrackerRecHit::sameDetModule ( TrackingRecHit const &  hit) const
inline

Definition at line 136 of file BaseTrackerRecHit.h.

References TrackingRecHit::geographicalId(), TrackingRecHit::isValid(), DetId::kSubdetOffset, and DetId::rawId().

Referenced by isPhase2(), SiStripMatchedRecHit2D::sharesInput(), and TrackerSingleRecHit::sharesInput().

136  {
137  unsigned int myid = geographicalId().rawId();
138  unsigned int mysubd = myid >> (DetId::kSubdetOffset);
139 
140  unsigned int id = hit.geographicalId().rawId();
141  unsigned int subd = id >> (DetId::kSubdetOffset);
142 
143  if (mysubd!=subd) return false;
144 
145  //Protection against invalid hits
146  if(!hit.isValid()) return false;
147 
148  const unsigned int limdet = 10; // TIB=11
149 
150  if (mysubd>limdet) { // strip
151  // mask glue and stereo
152  myid|=3;
153  id|=3;
154  }
155  return id==myid;
156 
157 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const int kSubdetOffset
Definition: DetId.h:23
DetId geographicalId() const
const Surface* BaseTrackerRecHit::surface ( ) const
inlinefinalvirtual

Reimplemented from TrackingRecHit.

Definition at line 79 of file BaseTrackerRecHit.h.

References TrackingRecHit::det(), and GeomDet::surface().

Referenced by globalPosition(), globalPositionError(), globalState(), and HSCPDeDxInfoProducer::processHit().

79 {return &(det()->surface());}
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const GeomDet * det() const

Member Data Documentation

LocalError BaseTrackerRecHit::err_
protected
LocalPoint BaseTrackerRecHit::pos_
protected
unsigned int BaseTrackerRecHit::qualWord_
protected