CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/RecoLocalMuon/DTSegment/src/DTMeantimerPatternReco.h

Go to the documentation of this file.
00001 #ifndef DTSegment_DTMeantimerPatternReco_h
00002 #define DTSegment_DTMeantimerPatternReco_h
00003 
00017 /* Base Class Headers */
00018 #include "RecoLocalMuon/DTSegment/src/DTRecSegment2DBaseAlgo.h"
00019 
00020 /* Collaborating Class Declarations */
00021 namespace edm {
00022   class ParameterSet;
00023   class EventSetup;
00024   //  class ESHandle;
00025 }
00026 class DTSegmentUpdator;
00027 class DTSegmentCleaner;
00028 class DTHitPairForFit;
00029 class DTSegmentCand;
00030 
00031 /* C++ Headers */
00032 #include <vector>
00033 #include <deque>
00034 #include <utility>
00035 
00036 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00037 #include "FWCore/Framework/interface/ESHandle.h"
00038 
00039 /* ====================================================================== */
00040 
00041 /* Class DTMeantimerPatternReco Interface */
00042 
00043 class DTMeantimerPatternReco : public DTRecSegment2DBaseAlgo {
00044 
00045  public:
00046 
00048   DTMeantimerPatternReco(const edm::ParameterSet& pset) ;
00049 
00051   virtual ~DTMeantimerPatternReco() ;
00052 
00053   /* Operations */
00054 
00056   virtual edm::OwnVector<DTSLRecSegment2D>
00057     reconstruct(const DTSuperLayer* sl,
00058                 const std::vector<DTRecHit1DPair>& hits);
00059         
00061   virtual std::string algoName() const { return theAlgoName; }
00062     
00065   virtual void setES(const edm::EventSetup& setup);
00066 
00067  protected:
00068 
00069  private:
00070   friend class DTMeantimerPatternReco4D;
00071 
00072   typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
00073     
00074   // create the DTHitPairForFit from the pairs for easy use
00075   std::vector<DTHitPairForFit*> initHits(const DTSuperLayer* sl,
00076                                          const std::vector<DTRecHit1DPair>& hits);
00077 
00078   // search for candidate, starting from pairs of hits in different layers
00079   std::vector<DTSegmentCand*> buildSegments(const DTSuperLayer* sl,
00080                                             const std::vector<DTHitPairForFit*>& hits);
00081 
00082   // try adding more hits to a candidate
00083   void addHits(const DTSuperLayer* sl, 
00084                std::vector<AssPoint>& assHits, 
00085                const std::vector<DTHitPairForFit*>& hits, 
00086                std::vector<DTSegmentCand*> &result,
00087                std::vector<AssPoint>& usedHits);
00088 
00089   // fit a set of left/right hits, calculate t0 and chi^2
00090   bool fitWithT0(const std::vector<AssPoint> &assHits, double &chi2, double &t0_corr, const bool fitdebug);
00091 
00092   // check if two hist can be considered in one segment (come from different layers, not too far away etc.)
00093   bool geometryFilter( const DTWireId first, const DTWireId second ) const;
00094 
00095   // a generic least-square fit to a set of points
00096   void rawFit(double &a, double &b, const std::vector< std::pair<double,double> > &hits);
00097 
00098   bool checkDoubleCandidates(std::vector<DTSegmentCand*>& segs,
00099                              DTSegmentCand* seg);
00100 
00101  private:
00102 
00103   std::string theAlgoName;
00104   unsigned int theMaxAllowedHits;
00105   double theAlphaMaxTheta;
00106   double theAlphaMaxPhi;
00107   double theMaxChi2;
00108   double theMaxT0;
00109   double theMinT0;
00110   bool debug;
00111   DTSegmentUpdator* theUpdator; // the updator and fitter
00112   DTSegmentCleaner* theCleaner; // the cleaner
00113   
00114   unsigned int maxfound;
00115 
00116   edm::ESHandle<DTGeometry> theDTGeometry; // the DT geometry
00117 };
00118 #endif // DTSegment_DTMeantimerPatternReco_h