CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 public:
49  DTRecSegment2D() : theChi2(0.0), theT0(0.), theVdrift(0.) {}
50 
52  DTRecSegment2D(DetId id, const std::vector<DTRecHit1D>& hits);
53 
57  LocalVector& direction,
59  double chi2,
60  std::vector<DTRecHit1D>& hits1D);
61 
63  ~DTRecSegment2D() override;
64 
65  /* Operations */
66 
67  DTRecSegment2D* clone() const override { return new DTRecSegment2D(*this); }
68 
70  AlgebraicVector parameters() const override { return param(localPosition(), localDirection()); }
71 
72  // The parameter error matrix
73  AlgebraicSymMatrix parametersError() const override;
74 
79 
81  int dimension() const override { return 2; }
82 
84  LocalPoint localPosition() const override { return thePosition; }
85 
87  LocalError localPositionError() const override;
88 
90  LocalVector localDirection() const override { return theDirection; }
91 
93  LocalError localDirectionError() const override;
94 
96  double chi2() const override { return theChi2; }
97 
99  int degreesOfFreedom() const override;
100 
101  // Access to component RecHits (if any)
102  std::vector<const TrackingRecHit*> recHits() const override;
103 
104  // Non-const access to component RecHits (if any)
105  std::vector<TrackingRecHit*> recHits() override;
106 
108  std::vector<DTRecHit1D> specificRecHits() const;
109 
112 
114  double t0() const { return theT0; }
115  bool ist0Valid() const { return (theT0 > -998.) ? true : false; }
116 
119  double vDrift() const { return theVdrift; }
120 
121 protected:
122  friend class DTSegmentUpdator;
123  void setPosition(const LocalPoint& pos);
124  void setDirection(const LocalVector& dir);
125  void setCovMatrix(const AlgebraicSymMatrix& cov);
126  void setChi2(const double& chi2);
127  void update(std::vector<DTRecHit1D>& updatedRecHits);
128  void setT0(const double& t0);
129  void setVdrift(const double& vdrift);
130 
131  LocalPoint thePosition; // in SL frame
132  LocalVector theDirection; // in SL frame
133 
137  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
138 
139  double theChi2; // chi2 of the fit
140  double theT0; // T0 as coming from the fit
141  double theVdrift; // vDrift as coming from the fit
142 
143  std::vector<DTRecHit1D> theHits; // the hits with defined R/L
144 
145 private:
147 
148  AlgebraicVector param(const LocalPoint& lp, const LocalVector& lv) const {
150  result[1] = lp.x();
151  result[0] = lv.x() / lv.z();
152  return result;
153  }
154 };
155 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
156 #endif // TrackingRecHit_DTRecSegment2D_h
void setChi2(const double &chi2)
LocalPoint localPosition() const override
local position in SL frame
int dimension() const override
return 2. The dimension of the matrix
AlgebraicMatrix projectionMatrix() const override
LocalVector localDirection() const override
the local direction in SL frame
double chi2() const override
the chi2 of the fit
AlgebraicVector parameters() const override
the vector of parameters (dx/dz,x)
std::vector< DTRecHit1D > theHits
void setCovMatrix(const AlgebraicSymMatrix &cov)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
void update(std::vector< DTRecHit1D > &updatedRecHits)
DTRecSegment2D * clone() const override
tuple result
Definition: mps_fire.py:311
double vDrift() const
CLHEP::HepMatrix AlgebraicMatrix
static const AlgebraicMatrix theProjectionMatrix
LocalError localDirectionError() const override
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
T z() const
Definition: PV3DBase.h:61
AlgebraicSymMatrix theCovMatrix
AlgebraicSymMatrix parametersError() const override
LocalError localPositionError() const override
local position error in SL frame
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
bool ist0Valid() const
AlgebraicSymMatrix covMatrix() const
the Covariance Matrix
Definition: DetId.h:17
CLHEP::HepVector AlgebraicVector
LocalPoint thePosition
void setT0(const double &t0)
AlgebraicVector param(const LocalPoint &lp, const LocalVector &lv) const
int degreesOfFreedom() const override
return the DOF of the segment
static int position[264][3]
Definition: ReadPGInfo.cc:289
void setPosition(const LocalPoint &pos)
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
LocalVector theDirection
void setVdrift(const double &vdrift)
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
~DTRecSegment2D() override
Destructor.
T x() const
Definition: PV3DBase.h:59