CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSegmentCand.h
Go to the documentation of this file.
1 #ifndef DTSegment_DTSegmentCand_h
2 #define DTSegment_DTSegmentCand_h
3 
17 /* Base Class Headers */
18 
19 /* Collaborating Class Declarations */
21 
22 /* C++ Headers */
23 #include <vector>
24 #include <set>
25 #include <iostream>
26 
27 /* ====================================================================== */
28 
29 /* Class DTSegmentCand Interface */
30 
31 class DTSLRecSegment2D;
33 class DTChamber;
34 class DTSuperLayer;
35 
37 
38  public:
39  struct AssPointLessZ ;
40  typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
41  typedef std::set<AssPoint, AssPointLessZ> AssPointCont;
42 
45  const DTSuperLayer* sl) ;
46 
50  double chi2,
51  AlgebraicSymMatrix covMat,
52  const DTSuperLayer* sl);
53 
55  virtual ~DTSegmentCand() ;
56 
57 /* Operations */
58  virtual bool good() const ;
59 
60  virtual bool hitsShareLayer() const;
61 
62  virtual unsigned int nHits() const { return theHits.size(); }
63 
65  virtual double chi2() const {return theChi2; }
66 
68  virtual double chi2ndof() const {return theChi2/(nHits()-2.); }
69 
71  virtual bool operator==(const DTSegmentCand& seg);
72 
74  virtual bool operator<(const DTSegmentCand& seg);
75 
77  const DTSuperLayer* superLayer() const {return theSL;}
78 
79  // in SL frame
80  virtual LocalPoint position() const { return thePosition; }
81 
82  // in SL frame
83  virtual LocalVector direction() const { return theDirection;}
84 
86  virtual AlgebraicSymMatrix covMatrix() const {return theCovMatrix; }
87 
88  virtual unsigned int NDOF() const { return nHits()-2; }
89 
92 
94  virtual void setDirection(LocalVector& dir) { theDirection = dir ; }
95 
97  virtual void add(DTHitPairForFit* hit, DTEnums::DTCellSide code) ;
98 
100  virtual void removeHit(AssPoint hit) ;
101 
103  virtual void setChi2(double& chi2) { theChi2 = chi2 ;}
104 
106  virtual int nSharedHitPairs(const DTSegmentCand& seg) const;
107 
110  virtual AssPointCont conflictingHitPairs(const DTSegmentCand& seg) const;
111 
113  virtual void setCovMatrix(AlgebraicSymMatrix& cov) { theCovMatrix = cov; }
114 
116  virtual int nLayers() const ;
117 
119  virtual AssPointCont hits() const { return theHits;}
120 
122  // DTSLRecSegment2D* convert() const;
123  operator DTSLRecSegment2D*() const;
124 
125 
127  operator DTChamberRecSegment2D*() const;
128 
129 
130  struct AssPointLessZ :
131  public std::binary_function<const AssPoint&, const AssPoint&, bool> {
132  public:
133  bool operator()(const AssPoint& pt1,
134  const AssPoint& pt2) const ;
135  };
136  private:
137  const DTSuperLayer* theSL; // the SL
138  LocalPoint thePosition; // in SL frame
139  LocalVector theDirection; // in SL frame
140  double theChi2; // chi2 of the fit
141 
145  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
146 
147 
148  AssPointCont theHits; // the used hits
149 
150  protected:
151  static double chi2max; // to be tuned!!
152  static unsigned int nHitsMin; // to be tuned!!
153 };
154 
155 std::ostream& operator<<(std::ostream& out, const DTSegmentCand& seg) ;
156 std::ostream& operator<<(std::ostream& out, const DTSegmentCand::AssPoint& hit) ;
157 #endif // DTSegment_DTSegmentCand_h
static unsigned int nHitsMin
virtual double chi2ndof() const
the chi2/NDOF of the fit
Definition: DTSegmentCand.h:68
virtual AlgebraicSymMatrix covMatrix() const
the covariance matrix
Definition: DTSegmentCand.h:86
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:17
virtual void setChi2(double &chi2)
set chi2
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual bool good() const
virtual unsigned int NDOF() const
Definition: DTSegmentCand.h:88
DTSegmentCand(AssPointCont &hits, const DTSuperLayer *sl)
Constructor.
AlgebraicSymMatrix theCovMatrix
virtual bool operator==(const DTSegmentCand &seg)
equality operator based on position, direction, chi2 and nHits
virtual bool hitsShareLayer() const
virtual bool operator<(const DTSegmentCand &seg)
less operator based on nHits and chi2
AssPointCont theHits
virtual void setCovMatrix(AlgebraicSymMatrix &cov)
set the cov matrix
bool operator()(const AssPoint &pt1, const AssPoint &pt2) const
virtual int nLayers() const
number of different layers with hits
virtual double chi2() const
the chi2 (NOT chi2/NDOF) of the fit
Definition: DTSegmentCand.h:65
const DTSuperLayer * superLayer() const
the super layer on which relies
Definition: DTSegmentCand.h:77
virtual AssPointCont hits() const
the used hits
std::pair< DTHitPairForFit *, DTEnums::DTCellSide > AssPoint
Definition: DTSegmentCand.h:39
tuple out
Definition: dbtoconf.py:99
const DTSuperLayer * theSL
virtual AssPointCont conflictingHitPairs(const DTSegmentCand &seg) const
std::set< AssPoint, AssPointLessZ > AssPointCont
Definition: DTSegmentCand.h:41
virtual unsigned int nHits() const
Definition: DTSegmentCand.h:62
virtual LocalPoint position() const
Definition: DTSegmentCand.h:80
LocalPoint thePosition
virtual void add(DTHitPairForFit *hit, DTEnums::DTCellSide code)
add hits to the hit list.
virtual void setDirection(LocalVector &dir)
set direction
Definition: DTSegmentCand.h:94
virtual void removeHit(AssPoint hit)
remove hit from the candidate
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual ~DTSegmentCand()
Destructor.
virtual int nSharedHitPairs(const DTSegmentCand &seg) const
number of shared hit pair with other segment candidate
LocalVector theDirection
dbl *** dir
Definition: mlp_gen.cc:35
virtual void setPosition(LocalPoint &pos)
set position
Definition: DTSegmentCand.h:91
static double chi2max
virtual LocalVector direction() const
Definition: DTSegmentCand.h:83