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() ;
41 
42  //--- Base class interface
43 
44  virtual DTRecSegment4D* clone() const { return new DTRecSegment4D(*this);}
45 
50  AlgebraicVector parameters() const ;
51 
54 
56  virtual AlgebraicMatrix projectionMatrix() const;
57 
59  virtual LocalPoint localPosition() const { return thePosition;}
60 
62  virtual LocalError localPositionError() const ;
63 
65  virtual LocalVector localDirection() const { return theDirection; }
66 
68  virtual LocalError localDirectionError() const ;
69 
70  // Chi2 of the segment fit
71  virtual double chi2() const ;
72 
73  // Degrees of freedom of the segment fit
74  virtual int degreesOfFreedom() const ;
75 
76  // Dimension (in parameter space)
77  virtual int dimension() const { return theDimension; }
78 
79  // Access to component RecHits (if any)
80  virtual std::vector<const TrackingRecHit*> recHits() const ;
81 
82  // Non-const access to component RecHits (if any)
83  virtual std::vector<TrackingRecHit*> recHits() ;
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: 0;
98  }
99 
101  const DTSLRecSegment2D *zSegment() const {
102  return hasZed()? &theZedSeg : 0;
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 
AlgebraicVector parameters() const
DTRecSegment4D()
Empty constructor.
DTSLRecSegment2D theZedSeg
virtual DTRecSegment4D * clone() const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
LocalPoint thePosition
DTChamberRecSegment2D * phiSegment()
the superPhi segment
std::ostream & operator<<(std::ostream &os, const DTRecSegment4D &seg)
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
Projection theProjection
LocalVector theDirection
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
virtual int degreesOfFreedom() const
Degrees of freedom of the segment fit.
void setCovMatrixForZed(const LocalPoint &posZInCh)
void setCovMatrix(const AlgebraicSymMatrix &mat)
Set covariance matrix.
virtual LocalError localPositionError() const
Local position error in Chamber frame.
virtual LocalVector localDirection() const
Local direction in Chamber frame.
CLHEP::HepMatrix AlgebraicMatrix
~DTRecSegment4D()
Destructor.
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?
virtual AlgebraicMatrix projectionMatrix() const
The projection matrix relates the trajectory state parameters to the segment parameters().
virtual LocalPoint localPosition() const
Local position in Chamber frame.
virtual int dimension() const
Dimension (in parameter space)
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.
AlgebraicSymMatrix parametersError() const
Covariance matrix fo parameters()
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setPosition(LocalPoint pos)
Set position.
dbl *** dir
Definition: mlp_gen.cc:35
virtual double chi2() const
Chi2 of the segment fit.
virtual LocalError localDirectionError() const
Local direction error in the Chamber frame.
DTChamberRecSegment2D thePhiSeg