CMS 3D CMS Logo

DTRecSegment2D.h
Go to the documentation of this file.
1 #ifndef TrackingRecHit_DTRecSegment2D_h
2 #define TrackingRecHit_DTRecSegment2D_h
3 
26 /* Base Class Headers */
28 
29 /* Collaborating Class Declarations */
33 
35 /* C++ Headers */
36 #include <iosfwd>
37 
38 /* Fwd declaration */
39 class DTSegmentUpdator;
40 
41 /* ====================================================================== */
42 
43 /* Class DTRecSegment2D Interface */
44 
45 class DTRecSegment2D : public RecSegment{
46 
47  public:
48 
51  DTRecSegment2D(): theChi2(0.0), theT0(0.), theVdrift(0.) {}
52 
54  DTRecSegment2D(DetId id, const std::vector<DTRecHit1D>& hits) ;
55 
58  LocalPoint &position, LocalVector &direction,
60  std::vector<DTRecHit1D> &hits1D);
61 
63  ~DTRecSegment2D() override;
64 
65  /* Operations */
66 
67  DTRecSegment2D* clone() const override { return new DTRecSegment2D(*this);}
68 
69 
71  AlgebraicVector parameters() const override {
72  return param( localPosition(), localDirection());
73  }
74 
75  // The parameter error matrix
76  AlgebraicSymMatrix parametersError() const override;
77 
81  AlgebraicMatrix projectionMatrix() const override {
82  return theProjectionMatrix;
83  }
84 
86  int dimension() const override { return 2;}
87 
89  LocalPoint localPosition() const override {return thePosition; }
90 
92  LocalError localPositionError() const override ;
93 
95  LocalVector localDirection() const override { return theDirection; }
96 
98  LocalError localDirectionError() const override;
99 
101  double chi2() const override { return theChi2; }
102 
104  int degreesOfFreedom() const override ;
105 
106  // Access to component RecHits (if any)
107  std::vector<const TrackingRecHit*> recHits() const override ;
108 
109  // Non-const access to component RecHits (if any)
110  std::vector<TrackingRecHit*> recHits() override ;
111 
113  std::vector<DTRecHit1D> specificRecHits() const ;
114 
117 
119  double t0() const {return theT0;}
120  bool ist0Valid() const {return (theT0 > -998.) ? true : false;}
121 
124  double vDrift() const {return theVdrift;}
125 
126  protected:
127  friend class DTSegmentUpdator;
128  void setPosition(const LocalPoint& pos);
129  void setDirection(const LocalVector& dir);
130  void setCovMatrix(const AlgebraicSymMatrix& cov);
131  void setChi2(const double& chi2);
132  void update(std::vector<DTRecHit1D> & updatedRecHits);
133  void setT0(const double& t0);
134  void setVdrift(const double& vdrift);
135 
136  LocalPoint thePosition; // in SL frame
137  LocalVector theDirection; // in SL frame
138 
142  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
143 
144  double theChi2; // chi2 of the fit
145  double theT0; // T0 as coming from the fit
146  double theVdrift; // vDrift as coming from the fit
147 
148  std::vector<DTRecHit1D> theHits; // the hits with defined R/L
149 
150 
151  private:
152 
154 
155  AlgebraicVector param( const LocalPoint& lp, const LocalVector& lv) const {
157  result[1]=lp.x();
158  result[0]=lv.x()/lv.z();
159  return result;
160  }
161 
162 };
163 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
164 #endif // TrackingRecHit_DTRecSegment2D_h
165 
LocalError localPositionError() const override
local position error in SL frame
void setChi2(const double &chi2)
AlgebraicMatrix projectionMatrix() const override
AlgebraicSymMatrix parametersError() const override
std::vector< DTRecHit1D > theHits
void setCovMatrix(const AlgebraicSymMatrix &cov)
std::ostream & operator<<(std::ostream &os, const DTRecSegment2D &seg)
void update(std::vector< DTRecHit1D > &updatedRecHits)
double vDrift() const
CLHEP::HepMatrix AlgebraicMatrix
int degreesOfFreedom() const override
return the DOF of the segment
static const AlgebraicMatrix theProjectionMatrix
T z() const
Definition: PV3DBase.h:64
AlgebraicSymMatrix theCovMatrix
AlgebraicVector parameters() const override
the vector of parameters (dx/dz,x)
double chi2() const override
the chi2 of the fit
DTRecSegment2D * clone() const override
int dimension() const override
return 2. The dimension of the matrix
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
bool ist0Valid() const
AlgebraicSymMatrix covMatrix() const
the Covariance Matrix
Definition: DetId.h:18
CLHEP::HepVector AlgebraicVector
LocalPoint localPosition() const override
local position in SL frame
LocalPoint thePosition
void setT0(const double &t0)
AlgebraicVector param(const LocalPoint &lp, const LocalVector &lv) const
static int position[264][3]
Definition: ReadPGInfo.cc:509
LocalVector localDirection() const override
the local direction in SL frame
void setPosition(const LocalPoint &pos)
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
LocalVector theDirection
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
void setVdrift(const double &vdrift)
dbl *** dir
Definition: mlp_gen.cc:35
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
LocalError localDirectionError() const override
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
~DTRecSegment2D() override
Destructor.
T x() const
Definition: PV3DBase.h:62