00001 #ifndef RecoMuon_MuonSeedCleaner_H 00002 #define RecoMuon_MuonSeedCleaner_H 00003 00012 #include <FWCore/ParameterSet/interface/ParameterSet.h> 00013 #include <RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h> 00014 #include <DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h> 00015 00016 //muon service 00017 #include <RecoMuon/TrackingTools/interface/MuonServiceProxy.h> 00018 00019 #include<vector> 00020 00021 class DetLayer; 00022 class MuonDetLayerGeometry; 00023 class MagneticField; 00024 00025 typedef std::vector<TrajectorySeed> SeedContainer; 00026 00027 class MuonSeedCleaner 00028 { 00029 00030 public: 00031 00032 typedef MuonTransientTrackingRecHit::MuonRecHitContainer SegmentContainer; 00033 typedef std::deque<bool> BoolContainer; 00034 00036 explicit MuonSeedCleaner(const edm::ParameterSet&); 00037 00039 ~MuonSeedCleaner(); 00040 00041 // Operations 00042 00044 //void setGeometry( const MuonDetLayerGeometry* lgeom ) {muonLayers = lgeom;} 00045 00047 //void setBField( const MagneticField* theField ) {BField = theField;} 00048 00050 std::vector<TrajectorySeed> seedCleaner(const edm::EventSetup& eventSetup, std::vector<TrajectorySeed>& seeds ); 00051 00052 int NRecHitsFromSegment( const TrackingRecHit& rhit ); 00053 int NRecHitsFromSegment( MuonTransientTrackingRecHit *rhit ); 00054 //int NRecHitsFromSegment( const MuonTransientTrackingRecHit& rhit ); 00055 00056 std::vector<int> badSeedLayer; 00057 00058 00059 private: 00060 00061 00063 std::vector<SeedContainer> GroupSeeds( std::vector<TrajectorySeed>& seeds ); 00064 00066 TrajectorySeed Chi2LengthSelection(std::vector<TrajectorySeed>& seeds ); 00068 TrajectorySeed LeanHighMomentum( std::vector<TrajectorySeed>& seeds ); 00070 TrajectorySeed BiggerCone( std::vector<TrajectorySeed>& seeds ) ; 00072 TrajectorySeed MoreRecHits( std::vector<TrajectorySeed>& seeds ); 00073 00075 bool MomentumFilter(std::vector<TrajectorySeed>& seeds ); 00077 SeedContainer SeedCandidates( std::vector<TrajectorySeed>& seeds, bool good ); 00079 unsigned int OverlapSegments( TrajectorySeed seed1, TrajectorySeed seed2 ); 00080 00082 double NChi2OfSegment( const TrackingRecHit& rhit ); 00083 00084 double SeedChi2( TrajectorySeed seed ); 00085 int SeedLength( TrajectorySeed seed ); 00086 00088 GlobalPoint SeedPosition( TrajectorySeed seed ); 00090 GlobalVector SeedMomentum( TrajectorySeed seed ); 00091 00092 // obsoleted functions 00095 SeedContainer LengthFilter(std::vector<TrajectorySeed>& seeds ); 00096 00097 00098 // This Producer private debug flag 00099 bool debug; 00100 00101 // Number of Segments from a shower 00102 int NShowerSeg; 00103 SegmentContainer ShoweringSegments; 00104 std::vector<int> ShoweringLayers; 00105 00106 // Cache geometry for current event 00107 //const MuonDetLayerGeometry* muonLayers; 00108 00109 // Cache Magnetic Field for current event 00110 const MagneticField* BField; 00111 00112 // muon service 00113 MuonServiceProxy* theService; 00114 00115 // Minimum separation when we can distinguish between 2 muon seeds 00116 // (to suppress combinatorics) 00117 00118 }; 00119 #endif 00120