CMS 3D CMS Logo

DTRecSegment4D.h
Go to the documentation of this file.
1 #ifndef DTRecHit_DTRecSegment4D_h
2 #define DTRecHit_DTRecSegment4D_h
3 
13 /* Base Class Headers */
15 
16 /* Collaborating Class Declarations */
19 
20 /* C++ Headers */
21 #include <iosfwd>
22 
23 class DTRecSegment4D : public RecSegment {
24 public:
25  friend class DTSegmentUpdator;
28 
31  const DTSLRecSegment2D& zedSeg,
32  const LocalPoint& posZInCh,
33  const LocalVector& dirZInCh);
34 
37 
39  DTRecSegment4D(const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
40 
42  ~DTRecSegment4D() override;
43 
44  //--- Base class interface
45 
46  DTRecSegment4D* clone() const override { return new DTRecSegment4D(*this); }
47 
52  AlgebraicVector parameters() const override;
53 
55  AlgebraicSymMatrix parametersError() const override;
56 
58  AlgebraicMatrix projectionMatrix() const override;
59 
61  LocalPoint localPosition() const override { return thePosition; }
62 
64  LocalError localPositionError() const override;
65 
67  LocalVector localDirection() const override { return theDirection; }
68 
70  LocalError localDirectionError() const override;
71 
72  // Chi2 of the segment fit
73  double chi2() const override;
74 
75  // Degrees of freedom of the segment fit
76  int degreesOfFreedom() const override;
77 
78  // Dimension (in parameter space)
79  int dimension() const override { return theDimension; }
80 
81  // Access to component RecHits (if any)
82  std::vector<const TrackingRecHit*> recHits() const override;
83 
84  // Non-const access to component RecHits (if any)
85  std::vector<TrackingRecHit*> recHits() override;
86 
87  //--- Extension of the interface
88 
90  bool hasPhi() const { return (theProjection == full || theProjection == phi); }
91 
93  bool hasZed() const { return (theProjection == full || theProjection == Z); }
94 
96  const DTChamberRecSegment2D* phiSegment() const { return hasPhi() ? &thePhiSeg : nullptr; }
97 
99  const DTSLRecSegment2D* zSegment() const { return hasZed() ? &theZedSeg : nullptr; }
100 
103 
106 
108  void setCovMatrix(const AlgebraicSymMatrix& mat) { theCovMatrix = mat; }
109 
111  virtual DTChamberId chamberId() const;
112 
113 private:
115  enum Projection { full, phi, Z, none };
117 
120 
123 
124  LocalPoint thePosition; // in chamber frame
125  LocalVector theDirection; // in chamber frame
126 
127  void setCovMatrixForZed(const LocalPoint& posZInCh);
128 
129  // the covariance matrix, has the following meaning
130  // mat[0][0]=sigma (dx/dz)
131  // mat[1][1]=sigma (dy/dz)
132  // mat[2][2]=sigma (x)
133  // mat[3][3]=sigma (y)
134  // mat[0][2]=cov(dx/dz,x)
135  // mat[1][3]=cov(dy/dz,y)
137 
140 
141  int theDimension; // the dimension of this rechit
142 };
143 
144 std::ostream& operator<<(std::ostream& os, const DTRecSegment4D& seg);
145 
146 #endif // DTRecHit_DTRecSegment4D_h
~DTRecSegment4D() override
Destructor.
DTRecSegment4D * clone() const override
DTRecSegment4D()
Empty constructor.
DTSLRecSegment2D theZedSeg
LocalPoint thePosition
DTChamberRecSegment2D * phiSegment()
the superPhi segment
std::ostream & operator<<(std::ostream &os, const DTRecSegment4D &seg)
bool hasPhi() const
Does it have the Phi projection?
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
LocalError localDirectionError() const override
Local direction error in the Chamber frame.
AlgebraicSymMatrix parametersError() const override
Covariance matrix fo parameters()
LocalVector localDirection() const override
Local direction in Chamber frame.
Projection theProjection
LocalVector theDirection
int dimension() const override
Dimension (in parameter space)
void setCovMatrixForZed(const LocalPoint &posZInCh)
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
void setCovMatrix(const AlgebraicSymMatrix &mat)
Set covariance matrix.
CLHEP::HepMatrix AlgebraicMatrix
Projection
Which projections are actually there.
DTSLRecSegment2D * zSegment()
the Z segment
void setDirection(LocalVector dir)
Set direction.
AlgebraicSymMatrix theCovMatrix
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
CLHEP::HepVector AlgebraicVector
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
AlgebraicVector parameters() const override
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
LocalError localPositionError() const override
Local position error in Chamber frame.
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setPosition(LocalPoint pos)
Set position.
bool hasZed() const
Does it have the Z projection?
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
double chi2() const override
Chi2 of the segment fit.
DTChamberRecSegment2D thePhiSeg