CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoMuon/MuonIdentification/interface/MuonMesh.h

Go to the documentation of this file.
00001 #ifndef _MuonIdentification_MuonMesh_h_
00002 #define _MuonIdentification_MuonMesh_h_
00003 //
00004 // Creates a mesh of muons connected by overlapping segments
00005 // Original author: Lindsey Gray
00006 //
00007 
00008 #include <vector>
00009 #include <utility>
00010 #include <map>
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "DataFormats/MuonReco/interface/Muon.h"
00013 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
00014 
00015 class CSCGeometry;
00016 
00017 class MuonMesh {
00018 
00019   typedef std::map<reco::Muon*,
00020                    std::vector<std::pair<reco::Muon*,
00021                                          std::pair<reco::MuonChamberMatch*,
00022                                                    reco::MuonSegmentMatch*
00023                                                   >
00024                                         >
00025                               >
00026                   > MeshType;
00027 
00028   typedef std::vector<std::pair<reco::Muon*,
00029                                 std::pair<reco::MuonChamberMatch*,
00030                                           reco::MuonSegmentMatch*
00031                                          >
00032                                >
00033                      > AssociationType;
00034 
00035  public:
00036   
00037   MuonMesh(const edm::ParameterSet&);
00038   
00039   void runMesh(std::vector<reco::Muon>* p) {fillMesh(p); pruneMesh();}
00040 
00041   void clearMesh() { mesh_.clear(); }
00042 
00043   void setCSCGeometry(const CSCGeometry* pg) { geometry_ = pg; } 
00044 
00045   bool isDuplicateOf(const CSCSegmentRef& lhs, const CSCSegmentRef& rhs) const;
00046   bool isDuplicateOf(const std::pair<CSCDetId,CSCSegmentRef>& rhs, 
00047                      const std::pair<CSCDetId,CSCSegmentRef>& lhs) const;
00048   bool isClusteredWith(const std::pair<CSCDetId,CSCSegmentRef>& lhs, 
00049                        const std::pair<CSCDetId,CSCSegmentRef>& rhs) const;
00050 
00051  private:
00052 
00053   void fillMesh(std::vector<reco::Muon>*);
00054 
00055   void pruneMesh();
00056 
00057   
00058   // implement to remove cases where two segments in the same
00059   // chamber overlap within 2 sigma of ALL of their errors
00060   bool withinTwoSigma(const std::pair<CSCDetId,CSCSegmentRef>& rhs, 
00061                       const std::pair<CSCDetId,CSCSegmentRef>& lhs) const { return false; }
00062   
00063   
00064   
00065   
00066 
00067   MeshType mesh_;
00068 
00069   // geometry cache for segment arbitration
00070    const CSCGeometry* geometry_;
00071    
00072    // do various cleanings?
00073    const bool doME1a, doOverlaps, doClustering;
00074    // overlap and clustering parameters
00075    const double OverlapDPhi, OverlapDTheta, ClusterDPhi, ClusterDTheta;
00076 };
00077 
00078 #endif