CMS 3D CMS Logo

DTSegmentCand.h

Go to the documentation of this file.
00001 #ifndef DTSegment_DTSegmentCand_h
00002 #define DTSegment_DTSegmentCand_h
00003 
00017 /* Base Class Headers */
00018 
00019 /* Collaborating Class Declarations */
00020 #include "RecoLocalMuon/DTSegment/src/DTHitPairForFit.h"
00021 
00022 /* C++ Headers */
00023 #include <vector>
00024 #include <set>
00025 #include <iostream>
00026 
00027 /* ====================================================================== */
00028 
00029 /* Class DTSegmentCand Interface */
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     ~DTSegmentCand() ;
00056 
00057 /* Operations */ 
00058     bool good() const ;
00059 
00060     unsigned int nHits() const { return theHits.size(); }
00061 
00063     double chi2() const {return theChi2; }
00064 
00066     double chi2ndof() const {return theChi2/(nHits()-2.); }
00067 
00069     bool operator==(const DTSegmentCand& seg);
00070 
00072     bool operator<(const DTSegmentCand& seg);
00073 
00074     //  /// the super layer on which relies 
00075     // const DTSuperLayer* superLayer() const {return theSL;}
00076 
00077     // in SL frame
00078     LocalPoint  position() const { return thePosition; }
00079 
00080     // in SL frame
00081     LocalVector direction() const { return theDirection;}
00082 
00084     AlgebraicSymMatrix covMatrix() const {return theCovMatrix; }
00085 
00086     unsigned int NDOF() const { return nHits()-2; }
00087 
00089     void setPosition(LocalPoint& pos) { thePosition=pos; }
00090 
00092     void setDirection(LocalVector& dir) { theDirection = dir ; }
00093 
00095     void add(DTHitPairForFit* hit, DTEnums::DTCellSide code) ;
00096 
00098     void removeHit(AssPoint hit) ;
00099 
00101     void setChi2(double& chi2) { theChi2 = chi2 ;}
00102 
00104     int nSharedHitPairs(const DTSegmentCand& seg) const;
00105 
00108     AssPointCont conflictingHitPairs(const DTSegmentCand& seg) const;
00109 
00111     void setCovMatrix(AlgebraicSymMatrix& cov) { theCovMatrix = cov; }
00112 
00114     int nLayers() const ;
00115     
00117     AssPointCont hits() const { return theHits;}
00118 
00120     //  DTSLRecSegment2D* convert() const;
00121     operator DTSLRecSegment2D*() const;
00122 
00123 
00125     operator DTChamberRecSegment2D*() const;
00126 
00127 
00128     struct AssPointLessZ : 
00129       public std::binary_function<const AssPoint&, const AssPoint&, bool> {
00130         public:
00131           bool operator()(const AssPoint& pt1, 
00132                           const AssPoint& pt2) const ; 
00133       };
00134   protected:
00135 
00136   private:
00137     const DTSuperLayer* theSL; // the SL
00138     LocalPoint  thePosition;  // in SL frame
00139     LocalVector theDirection; // in SL frame
00140     double theChi2;           // chi2 of the fit
00141 
00145     AlgebraicSymMatrix theCovMatrix; // the covariance matrix
00146 
00147 
00148     AssPointCont theHits; // the used hits
00149 
00150     static double chi2max; // to be tuned!!
00151     static unsigned int nHitsMin; // to be tuned!!
00152 };
00153 
00154 std::ostream& operator<<(std::ostream& out, const DTSegmentCand& seg) ;
00155 std::ostream& operator<<(std::ostream& out, const DTSegmentCand::AssPoint& hit) ;
00156 #endif // DTSegment_DTSegmentCand_h

Generated on Tue Jun 9 17:43:54 2009 for CMSSW by  doxygen 1.5.4