CMS 3D CMS Logo

VectorHit.h
Go to the documentation of this file.
1 #ifndef DataFormats_TrackerRecHit2D_VectorHit_h
2 #define DataFormats_TrackerRecHit2D_VectorHit_h
3 
16 
19 
23 
25 
27 
28 class VectorHit final : public BaseTrackerRecHit {
29 public:
31 
33 
34  VectorHit(const GeomDet& idet,
35  const LocalPoint& posInner,
36  const LocalVector& dir,
38  const float chi2,
39  OmniClusterRef const& lower,
40  OmniClusterRef const& upper,
41  const float curvature,
42  const float curvatureError,
43  const float phi);
44 
45  VectorHit(const GeomDet& idet,
46  const VectorHit2D& vh2Dzx,
47  const VectorHit2D& vh2Dzy,
48  OmniClusterRef const& lower,
49  OmniClusterRef const& upper,
50  const float curvature,
51  const float curvatureError,
52  const float phi);
53 
54  ~VectorHit() override = default;
55 
56  VectorHit* clone() const override { return new VectorHit(*this); }
57  RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this); }
58 
59  bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override;
60  bool sharesClusters(VectorHit const& other, SharedInputType what) const;
61 
62  // Parameters of the segment, for the track fit
63  // For a 4D segment: (dx/dz,dy/dz,x,y)
64  bool hasPositionAndError() const override {
65  //if det is present pos&err are available as well.
66  //if det() is not present (null) the hit has been read from file and not updated
67  return det();
68  };
69 
70  void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents4D(holder); }
71  void getKfComponents4D(KfComponentsHolder& holder) const;
72 
73  // returning methods
74  LocalPoint localPosition() const override { return thePosition; }
75  virtual LocalVector localDirection() const { return theDirection; }
76  const AlgebraicSymMatrix44& covMatrix() const;
77  LocalError localPositionError() const override;
80 
81  float chi2() const { return theChi2; }
82  int dimension() const override { return theDimension; }
83  float curvature() const { return theCurvature; }
84  float curvatureError() const { return theCurvatureError; }
85  float phi() const { return thePhi; }
86 
87  float transverseMomentum(float magField) const;
88  float momentum(float magField) const;
89 
95 
96  //FIXME::to update with a proper CPE maybe...
103 
104  bool isPhase2() const override { return true; }
105 
106  //FIXME: I have always two clusters in a VH
107  OmniClusterRef const& firstClusterRef() const override { return theLowerCluster; }
109 
110  //This method returns the direction of the segment/stub in global coordinates
112  float theta() const;
113 
114  // Access to component RecHits (if any)
115  std::vector<const TrackingRecHit*> recHits() const override;
116  std::vector<TrackingRecHit*> recHits() override;
117 
118 private:
119  // double dispatch
120  VectorHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
121  return cloner(*this, tsos).release();
122  }
123  RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
124  return cloner.makeShared(*this, tsos);
125  }
126 
129 
130  // the covariance matrix, has the following meaning
131  // mat[0][0]=var(dx/dz)
132  // mat[1][1]=var(dy/dz)
133  // mat[2][2]=var(x)
134  // mat[3][3]=var(y)
135  // mat[0][2]=cov(dx/dz,x)
136  // mat[1][3]=cov(dy/dz,y)
138  float theChi2;
139  static constexpr int theDimension = 4;
144  float thePhi;
145 };
146 
147 inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); }
148 
149 std::ostream& operator<<(std::ostream& os, const VectorHit& vh);
150 
152 
153 #endif
Vector3DBase< float, LocalTag >
VectorHit::lowerCluster
ClusterRef lowerCluster() const
"lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel
Definition: VectorHit.h:91
KfComponentsHolder.h
VectorHit::curvature
float curvature() const
Definition: VectorHit.h:83
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
GeomDet
Definition: GeomDet.h:27
VectorHit::upperCluster
ClusterRef upperCluster() const
Definition: VectorHit.h:92
VectorHitCollection
edmNew::DetSetVector< VectorHit > VectorHitCollection
Definition: VectorHit.h:151
VectorHit::theCurvatureError
float theCurvatureError
Definition: VectorHit.h:143
VectorHit::localDirection
virtual LocalVector localDirection() const
Definition: VectorHit.h:75
VectorHit::localPosition
LocalPoint localPosition() const override
Definition: VectorHit.h:74
TrackingRecHit::det
const GeomDet * det() const
Definition: TrackingRecHit.h:122
VectorHit::theUpperCluster
OmniClusterRef theUpperCluster
Definition: VectorHit.h:141
VectorHit::lowerGlobalPos
Global3DPoint lowerGlobalPos() const
Definition: VectorHit.cc:102
VectorHit::sharesClusters
bool sharesClusters(VectorHit const &other, SharedInputType what) const
Definition: VectorHit.cc:78
VectorHit::theChi2
float theChi2
Definition: VectorHit.h:138
VectorHit::thePosition
LocalPoint thePosition
Definition: VectorHit.h:127
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
VectorHit::~VectorHit
~VectorHit() override=default
OmniClusterRef
Definition: OmniClusterRef.h:12
VectorHit::theDirection
LocalVector theDirection
Definition: VectorHit.h:128
VectorHit::ClusterRef
OmniClusterRef::Phase2Cluster1DRef ClusterRef
Definition: VectorHit.h:30
edm::Ref
Definition: AssociativeIterator.h:58
operator<
bool operator<(const VectorHit &one, const VectorHit &other)
Definition: VectorHit.h:147
OmniClusterRef::cluster_phase2OT
Phase2Cluster1DRef cluster_phase2OT() const
Definition: OmniClusterRef.h:48
VectorHit::cloneSH
RecHitPointer cloneSH() const override
Definition: VectorHit.h:57
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
VectorHit::theCurvature
float theCurvature
Definition: VectorHit.h:142
TrackingRecHit::SharedInputType
SharedInputType
definition of equality via shared input
Definition: TrackingRecHit.h:59
VectorHit::momentum
float momentum(float magField) const
Definition: VectorHit.cc:161
TkCloner
Definition: TkCloner.h:16
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
VectorHit::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: VectorHit.cc:185
VectorHit::VectorHit
VectorHit()
Definition: VectorHit.h:32
trackingPlots.other
other
Definition: trackingPlots.py:1467
VectorHit::phi
float phi() const
Definition: VectorHit.h:85
Point3DBase< float, LocalTag >
VectorHit::cluster
ClusterRef cluster() const
Definition: VectorHit.h:108
VectorHit::globalDirection
Global3DVector globalDirection() const
Definition: VectorHit.cc:152
VectorHit::upperClusterRef
const OmniClusterRef upperClusterRef() const
Definition: VectorHit.h:94
TrackingRecHit::bad
Definition: TrackingRecHit.h:49
VectorHit::theta
float theta() const
Definition: VectorHit.cc:154
VectorHit::firstClusterRef
OmniClusterRef const & firstClusterRef() const override
Definition: VectorHit.h:107
LocalError
Definition: LocalError.h:12
VectorHit::chi2
float chi2() const
Definition: VectorHit.h:81
VectorHit::dimension
int dimension() const override
Definition: VectorHit.h:82
VectorHit::covMatrix
const AlgebraicSymMatrix44 & covMatrix() const
Definition: VectorHit.cc:171
VectorHit2D
Definition: VectorHit2D.h:11
VectorHit::clone_
VectorHit * clone_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
Definition: VectorHit.h:120
TkCloner.h
TkCloner::makeShared
TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
Definition: TkCloner.h:24
VectorHit::transverseMomentum
float transverseMomentum(float magField) const
Definition: VectorHit.cc:156
VectorHit::isPhase2
bool isPhase2() const override
Definition: VectorHit.h:104
GlobalErrorBase< double, ErrorMatrixTag >
VectorHit::phase2clusterGlobalPosErr
static GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit *geomDet)
Definition: VectorHit.cc:135
VectorHit::thePhi
float thePhi
Definition: VectorHit.h:144
DetSetVector.h
VectorHit::theDimension
static constexpr int theDimension
Definition: VectorHit.h:139
KfComponentsHolder
Definition: KfComponentsHolder.h:13
VectorHit::lowerClusterRef
const OmniClusterRef lowerClusterRef() const
Definition: VectorHit.h:93
OmniClusterRef.h
VectorHit::theCovMatrix
AlgebraicSymMatrix44 theCovMatrix
Definition: VectorHit.h:137
VectorHit::upperGlobalPos
Global3DPoint upperGlobalPos() const
Definition: VectorHit.cc:108
VectorHit::theLowerCluster
OmniClusterRef theLowerCluster
Definition: VectorHit.h:140
operator<<
std::ostream & operator<<(std::ostream &os, const VectorHit &vh)
Definition: VectorHit.cc:173
AlgebraicSymMatrix44
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
Definition: AlgebraicROOTObjects.h:22
VectorHit::curvatureError
float curvatureError() const
Definition: VectorHit.h:84
TrackingRecHit
Definition: TrackingRecHit.h:21
BaseTrackerRecHit.h
VectorHit::lowerGlobalPosErr
GlobalError lowerGlobalPosErr() const
Definition: VectorHit.cc:123
VectorHit
Definition: VectorHit.h:28
VectorHit::phase2clusterGlobalPos
static Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit *geomDet, ClusterRef cluster)
Definition: VectorHit.cc:114
edmNew::DetSetVector
Definition: DetSetNew.h:13
TrackingRecHit::setType
void setType(Type ttype)
Definition: TrackingRecHit.h:185
VectorHit::localDirectionError
LocalError localDirectionError() const
Definition: VectorHit.cc:167
VectorHit::clone
VectorHit * clone() const override
Definition: VectorHit.h:56
Phase2TrackerCluster1D.h
VectorHit::globalDirectionVH
Global3DVector globalDirectionVH() const
Definition: VectorHit.cc:145
VectorHit::getKfComponents
void getKfComponents(KfComponentsHolder &holder) const override
Definition: VectorHit.h:70
PixelGeomDetUnit.h
pileupCalc.upper
upper
Definition: pileupCalc.py:214
VectorHit2D.h
VectorHit::upperGlobalPosErr
GlobalError upperGlobalPosErr() const
Definition: VectorHit.cc:129
VectorHit::localPositionError
LocalError localPositionError() const override
Definition: VectorHit.cc:163
VectorHit::getKfComponents4D
void getKfComponents4D(KfComponentsHolder &holder) const
Definition: VectorHit.cc:85
LocalVector.h
VectorHit::sharesInput
bool sharesInput(const TrackingRecHit *other, SharedInputType what) const override
Definition: VectorHit.cc:58
DetSetVectorNew.h
VectorHit::hasPositionAndError
bool hasPositionAndError() const override
to be redefined by daughter class
Definition: VectorHit.h:64
VectorHit::cloneSH_
RecHitPointer cloneSH_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
Definition: VectorHit.h:123
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23