Go to the documentation of this file.00001 #ifndef DTSegment_DTSegmentCand_h
00002 #define DTSegment_DTSegmentCand_h
00003
00017
00018
00019
00020 #include "RecoLocalMuon/DTSegment/src/DTHitPairForFit.h"
00021
00022
00023 #include <vector>
00024 #include <set>
00025 #include <iostream>
00026
00027
00028
00029
00030
00031 class DTSLRecSegment2D;
00032 class DTChamberRecSegment2D;
00033 class DTChamber;
00034 class DTSuperLayer;
00035
00036 class DTSegmentCand{
00037
00038 public:
00039 struct AssPointLessZ ;
00040 typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
00041 typedef std::set<AssPoint, AssPointLessZ> AssPointCont;
00042
00044 DTSegmentCand(AssPointCont& hits,
00045 const DTSuperLayer* sl) ;
00046
00047 DTSegmentCand(AssPointCont hits,
00048 LocalPoint& position,
00049 LocalVector& direction,
00050 double chi2,
00051 AlgebraicSymMatrix covMat,
00052 const DTSuperLayer* sl);
00053
00055 virtual ~DTSegmentCand() ;
00056
00057
00058 virtual bool good() const ;
00059
00060 virtual bool hitsShareLayer() const;
00061
00062 virtual unsigned int nHits() const { return theHits.size(); }
00063
00065 virtual double chi2() const {return theChi2; }
00066
00068 virtual double chi2ndof() const {return theChi2/(nHits()-2.); }
00069
00071 virtual bool operator==(const DTSegmentCand& seg);
00072
00074 virtual bool operator<(const DTSegmentCand& seg);
00075
00077 const DTSuperLayer* superLayer() const {return theSL;}
00078
00079
00080 virtual LocalPoint position() const { return thePosition; }
00081
00082
00083 virtual LocalVector direction() const { return theDirection;}
00084
00086 virtual AlgebraicSymMatrix covMatrix() const {return theCovMatrix; }
00087
00088 virtual unsigned int NDOF() const { return nHits()-2; }
00089
00091 virtual void setPosition(LocalPoint& pos) { thePosition=pos; }
00092
00094 virtual void setDirection(LocalVector& dir) { theDirection = dir ; }
00095
00097 virtual void add(DTHitPairForFit* hit, DTEnums::DTCellSide code) ;
00098
00100 virtual void removeHit(AssPoint hit) ;
00101
00103 virtual void setChi2(double& chi2) { theChi2 = chi2 ;}
00104
00106 virtual int nSharedHitPairs(const DTSegmentCand& seg) const;
00107
00110 virtual AssPointCont conflictingHitPairs(const DTSegmentCand& seg) const;
00111
00113 virtual void setCovMatrix(AlgebraicSymMatrix& cov) { theCovMatrix = cov; }
00114
00116 virtual int nLayers() const ;
00117
00119 virtual AssPointCont hits() const { return theHits;}
00120
00122
00123 operator DTSLRecSegment2D*() const;
00124
00125
00127 operator DTChamberRecSegment2D*() const;
00128
00129
00130 struct AssPointLessZ :
00131 public std::binary_function<const AssPoint&, const AssPoint&, bool> {
00132 public:
00133 bool operator()(const AssPoint& pt1,
00134 const AssPoint& pt2) const ;
00135 };
00136 private:
00137 const DTSuperLayer* theSL;
00138 LocalPoint thePosition;
00139 LocalVector theDirection;
00140 double theChi2;
00141
00145 AlgebraicSymMatrix theCovMatrix;
00146
00147
00148 AssPointCont theHits;
00149
00150 protected:
00151 static double chi2max;
00152 static unsigned int nHitsMin;
00153 };
00154
00155 std::ostream& operator<<(std::ostream& out, const DTSegmentCand& seg) ;
00156 std::ostream& operator<<(std::ostream& out, const DTSegmentCand::AssPoint& hit) ;
00157 #endif // DTSegment_DTSegmentCand_h