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 
25  public:
26  friend class DTSegmentUpdator;
29 
31  DTRecSegment4D(const DTChamberRecSegment2D& phiSeg, const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
32 
35 
37  DTRecSegment4D(const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
38 
40  ~DTRecSegment4D() override ;
41 
42  //--- Base class interface
43 
44  DTRecSegment4D* clone() const override { return new DTRecSegment4D(*this);}
45 
50  AlgebraicVector parameters() const override ;
51 
53  AlgebraicSymMatrix parametersError() const override ;
54 
56  AlgebraicMatrix projectionMatrix() const override;
57 
59  LocalPoint localPosition() const override { return thePosition;}
60 
62  LocalError localPositionError() const override ;
63 
65  LocalVector localDirection() const override { return theDirection; }
66 
68  LocalError localDirectionError() const override ;
69 
70  // Chi2 of the segment fit
71  double chi2() const override ;
72 
73  // Degrees of freedom of the segment fit
74  int degreesOfFreedom() const override ;
75 
76  // Dimension (in parameter space)
77  int dimension() const override { return theDimension; }
78 
79  // Access to component RecHits (if any)
80  std::vector<const TrackingRecHit*> recHits() const override ;
81 
82  // Non-const access to component RecHits (if any)
83  std::vector<TrackingRecHit*> recHits() override ;
84 
85 
86  //--- Extension of the interface
87 
88 
90  bool hasPhi() const {return (theProjection==full || theProjection==phi);}
91 
93  bool hasZed() const {return (theProjection==full || theProjection==Z);}
94 
97  return hasPhi()? &thePhiSeg: nullptr;
98  }
99 
101  const DTSLRecSegment2D *zSegment() const {
102  return hasZed()? &theZedSeg : nullptr;
103  }
104 
107 
110 
112  void setCovMatrix(const AlgebraicSymMatrix& mat) { theCovMatrix = mat; }
113 
115  virtual DTChamberId chamberId() const;
116 
117  private:
119  enum Projection {full, phi, Z, none};
121 
124 
127 
128  LocalPoint thePosition; // in chamber frame
129  LocalVector theDirection; // in chamber frame
130 
131  void setCovMatrixForZed(const LocalPoint& posZInCh);
132 
133  // the covariance matrix, has the following meaning
134  // mat[0][0]=sigma (dx/dz)
135  // mat[1][1]=sigma (dy/dz)
136  // mat[2][2]=sigma (x)
137  // mat[3][3]=sigma (y)
138  // mat[0][2]=cov(dx/dz,x)
139  // mat[1][3]=cov(dy/dz,y)
141 
144 
145  int theDimension; // the dimension of this rechit
146 
147 };
148 
149 std::ostream& operator<<(std::ostream& os, const DTRecSegment4D& seg);
150 
151 #endif // DTRecHit_DTRecSegment4D_h
152 
~DTRecSegment4D() override
Destructor.
int dimension() const override
Dimension (in parameter space)
DTRecSegment4D()
Empty constructor.
DTSLRecSegment2D theZedSeg
LocalPoint localPosition() const override
Local position in Chamber frame.
LocalPoint thePosition
DTChamberRecSegment2D * phiSegment()
the superPhi segment
std::ostream & operator<<(std::ostream &os, const DTRecSegment4D &seg)
LocalVector localDirection() const override
Local direction in Chamber frame.
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
double chi2() const override
Chi2 of the segment fit.
Projection theProjection
LocalVector theDirection
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
void setCovMatrixForZed(const LocalPoint &posZInCh)
void setCovMatrix(const AlgebraicSymMatrix &mat)
Set covariance matrix.
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicSymMatrix parametersError() const override
Covariance matrix fo parameters()
AlgebraicVector parameters() const override
LocalError localPositionError() const override
Local position error in Chamber frame.
Projection
Which projections are actually there.
DTSLRecSegment2D * zSegment()
the Z segment
void setDirection(LocalVector dir)
Set direction.
bool hasPhi() const
Does it have the Phi projection?
LocalError localDirectionError() const override
Local direction error in the Chamber frame.
AlgebraicSymMatrix theCovMatrix
bool hasZed() const
Does it have the Z projection?
CLHEP::HepVector AlgebraicVector
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
CLHEP::HepSymMatrix AlgebraicSymMatrix
DTRecSegment4D * clone() const override
void setPosition(LocalPoint pos)
Set position.
dbl *** dir
Definition: mlp_gen.cc:35
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
DTChamberRecSegment2D thePhiSeg