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 
15 /* Base Class Headers */
16 
17 /* Collaborating Class Declarations */
19 
20 /* C++ Headers */
21 #include <vector>
22 #include <set>
23 #include <iostream>
24 
25 /* ====================================================================== */
26 
27 /* Class DTSegmentCand Interface */
28 
29 class DTSLRecSegment2D;
31 class DTChamber;
32 class DTSuperLayer;
33 
35 
36  public:
37  struct AssPointLessZ ;
38  typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
39  typedef std::set<AssPoint, AssPointLessZ> AssPointCont;
40 
43  const DTSuperLayer* sl) ;
44 
48  double chi2,
49  const AlgebraicSymMatrix& covMat,
50  const DTSuperLayer* sl);
51 
53  virtual ~DTSegmentCand() ;
54 
55 /* Operations */
56  virtual bool good() const ;
57 
58  virtual bool hitsShareLayer() const;
59 
60  virtual unsigned int nHits() const { return theHits.size(); }
61 
63  virtual double chi2() const {return theChi2; }
64 
66  virtual double chi2ndof() const {return theChi2/(nHits()-2.); }
67 
69  virtual bool operator==(const DTSegmentCand& seg);
70 
72  virtual bool operator<(const DTSegmentCand& seg);
73 
75  const DTSuperLayer* superLayer() const {return theSL;}
76 
77  // in SL frame
78  virtual LocalPoint position() const { return thePosition; }
79 
80  // in SL frame
81  virtual LocalVector direction() const { return theDirection;}
82 
84  virtual AlgebraicSymMatrix covMatrix() const {return theCovMatrix; }
85 
86  virtual unsigned int NDOF() const { return nHits()-2; }
87 
89  virtual void setPosition(LocalPoint& pos) { thePosition=pos; }
90 
92  virtual void setDirection(LocalVector& dir) { theDirection = dir ; }
93 
95  virtual void add(DTHitPairForFit* hit, DTEnums::DTCellSide code) ;
96 
98  virtual void removeHit(AssPoint hit) ;
99 
101  virtual void setChi2(double& chi2) { theChi2 = chi2 ;}
102 
104  virtual int nSharedHitPairs(const DTSegmentCand& seg) const;
105 
108  virtual AssPointCont conflictingHitPairs(const DTSegmentCand& seg) const;
109 
111  virtual void setCovMatrix(AlgebraicSymMatrix& cov) { theCovMatrix = cov; }
112 
114  virtual int nLayers() const ;
115 
117  virtual AssPointCont hits() const { return theHits;}
118 
120  // DTSLRecSegment2D* convert() const;
121  operator DTSLRecSegment2D*() const;
122 
123 
125  operator DTChamberRecSegment2D*() const;
126 
127 
128  struct AssPointLessZ :
129  public std::binary_function<const AssPoint&, const AssPoint&, bool> {
130  public:
131  bool operator()(const AssPoint& pt1,
132  const AssPoint& pt2) const ;
133  };
134  private:
135  const DTSuperLayer* theSL; // the SL
136  LocalPoint thePosition; // in SL frame
137  LocalVector theDirection; // in SL frame
138  double theChi2; // chi2 of the fit
139 
143  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
144 
145 
146  AssPointCont theHits; // the used hits
147 
148  protected:
149  static const double chi2max; // to be tuned!!
150  static const unsigned int nHitsMin; // to be tuned!!
151 };
152 
153 std::ostream& operator<<(std::ostream& out, const DTSegmentCand& seg) ;
154 std::ostream& operator<<(std::ostream& out, const DTSegmentCand::AssPoint& hit) ;
155 #endif // DTSegment_DTSegmentCand_h
virtual double chi2ndof() const
the chi2/NDOF of the fit
Definition: DTSegmentCand.h:66
virtual AlgebraicSymMatrix covMatrix() const
the covariance matrix
Definition: DTSegmentCand.h:84
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:15
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:86
static const unsigned int nHitsMin
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
static const double chi2max
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:63
const DTSuperLayer * superLayer() const
the super layer on which relies
Definition: DTSegmentCand.h:75
virtual AssPointCont hits() const
the used hits
std::pair< DTHitPairForFit *, DTEnums::DTCellSide > AssPoint
Definition: DTSegmentCand.h:37
tuple out
Definition: dbtoconf.py:99
const DTSuperLayer * theSL
virtual AssPointCont conflictingHitPairs(const DTSegmentCand &seg) const
std::set< AssPoint, AssPointLessZ > AssPointCont
Definition: DTSegmentCand.h:39
virtual unsigned int nHits() const
Definition: DTSegmentCand.h:60
virtual LocalPoint position() const
Definition: DTSegmentCand.h:78
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:92
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:89
virtual LocalVector direction() const
Definition: DTSegmentCand.h:81