CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTRecSegment2D.h
Go to the documentation of this file.
1 #ifndef TrackingRecHit_DTRecSegment2D_h
2 #define TrackingRecHit_DTRecSegment2D_h
3 
28 /* Base Class Headers */
30 
31 /* Collaborating Class Declarations */
35 
37 /* C++ Headers */
38 #include <iosfwd>
39 
40 /* Fwd declaration */
41 class DTSegmentUpdator;
42 
43 /* ====================================================================== */
44 
45 /* Class DTRecSegment2D Interface */
46 
47 class DTRecSegment2D : public RecSegment{
48 
49  public:
50 
53  DTRecSegment2D(): theChi2(0.0), theT0(0.), theVdrift(0.) {}
54 
56  DTRecSegment2D(DetId id, const std::vector<DTRecHit1D>& hits) ;
57 
60  LocalPoint &position, LocalVector &direction,
62  std::vector<DTRecHit1D> &hits1D);
63 
65  virtual ~DTRecSegment2D();
66 
67  /* Operations */
68 
69  virtual DTRecSegment2D* clone() const { return new DTRecSegment2D(*this);}
70 
71 
73  virtual AlgebraicVector parameters() const {
74  return param( localPosition(), localDirection());
75  }
76 
77  // The parameter error matrix
78  virtual AlgebraicSymMatrix parametersError() const;
79 
84  if ( !isInitialized) initialize();
85  return theProjectionMatrix;
86  }
87 
89  virtual int dimension() const { return 2;}
90 
92  virtual LocalPoint localPosition() const {return thePosition; }
93 
95  virtual LocalError localPositionError() const ;
96 
98  virtual LocalVector localDirection() const { return theDirection; }
99 
101  virtual LocalError localDirectionError() const;
102 
104  virtual double chi2() const { return theChi2; }
105 
107  virtual int degreesOfFreedom() const ;
108 
109  // Access to component RecHits (if any)
110  virtual std::vector<const TrackingRecHit*> recHits() const ;
111 
112  // Non-const access to component RecHits (if any)
113  virtual std::vector<TrackingRecHit*> recHits() ;
114 
116  std::vector<DTRecHit1D> specificRecHits() const ;
117 
120 
122  double t0() const {return theT0;}
123  bool ist0Valid() const {return (theT0 > -998.) ? true : false;}
124 
127  double vDrift() const {return theVdrift;}
128 
129  protected:
130  friend class DTSegmentUpdator;
131  void setPosition(const LocalPoint& pos);
132  void setDirection(const LocalVector& dir);
133  void setCovMatrix(const AlgebraicSymMatrix& cov);
134  void setChi2(const double& chi2);
135  void update(std::vector<DTRecHit1D> & updatedRecHits);
136  void setT0(const double& t0);
137  void setVdrift(const double& vdrift);
138 
139  LocalPoint thePosition; // in SL frame
140  LocalVector theDirection; // in SL frame
141 
145  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
146 
147  double theChi2; // chi2 of the fit
148  double theT0; // T0 as coming from the fit
149  double theVdrift; // vDrift as coming from the fit
150 
151  std::vector<DTRecHit1D> theHits; // the hits with defined R/L
152 
153 
154  private:
155 
156  static bool isInitialized;
158 
159  void initialize() const {
160  isInitialized=true;
162  theProjectionMatrix[0][1]=1;
163  theProjectionMatrix[1][3]=1;
164  }
165 
166  AlgebraicVector param( const LocalPoint& lp, const LocalVector& lv) const {
168  result[1]=lp.x();
169  result[0]=lv.x()/lv.z();
170  return result;
171  }
172 
173 };
174 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
175 #endif // TrackingRecHit_DTRecSegment2D_h
176 
static bool isInitialized
virtual LocalError localPositionError() const
local position error in SL frame
void setChi2(const double &chi2)
virtual ~DTRecSegment2D()
Destructor.
virtual AlgebraicVector parameters() const
the vector of parameters (dx/dz,x)
virtual int degreesOfFreedom() const
return the DOF of the segment
virtual double chi2() const
the chi2 of the fit
virtual LocalError localDirectionError() const
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
std::vector< DTRecHit1D > theHits
void setCovMatrix(const AlgebraicSymMatrix &cov)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void update(std::vector< DTRecHit1D > &updatedRecHits)
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
void initialize() const
double vDrift() const
CLHEP::HepMatrix AlgebraicMatrix
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
AlgebraicSymMatrix theCovMatrix
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
static AlgebraicMatrix theProjectionMatrix
bool ist0Valid() const
AlgebraicSymMatrix covMatrix() const
the Covariance Matrix
virtual LocalPoint localPosition() const
local position in SL frame
Definition: DetId.h:20
CLHEP::HepVector AlgebraicVector
virtual AlgebraicSymMatrix parametersError() const
LocalPoint thePosition
virtual DTRecSegment2D * clone() const
void setT0(const double &t0)
AlgebraicVector param(const LocalPoint &lp, const LocalVector &lv) const
virtual int dimension() const
return 2. The dimension of the matrix
void setPosition(const LocalPoint &pos)
virtual LocalVector localDirection() const
the local direction in SL frame
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
LocalVector theDirection
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)
virtual AlgebraicMatrix projectionMatrix() const
T x() const
Definition: PV3DBase.h:62