00001 #ifndef MuonIdentification_MuonIdProducer_h
00002 #define MuonIdentification_MuonIdProducer_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "FWCore/Framework/interface/Frameworkfwd.h"
00030 #include "FWCore/Framework/interface/EDProducer.h"
00031
00032 #include "FWCore/Framework/interface/Event.h"
00033 #include "FWCore/Framework/interface/EventSetup.h"
00034 #include "FWCore/Framework/interface/MakerMacros.h"
00035
00036 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00037
00038 #include "DataFormats/Common/interface/Handle.h"
00039 #include "DataFormats/TrackReco/interface/Track.h"
00040 #include "DataFormats/MuonReco/interface/Muon.h"
00041 #include "DataFormats/MuonReco/interface/MuonTrackLinks.h"
00042 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00043
00044 #include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h"
00045
00046
00047 #include "RecoMuon/TrackingTools/interface/MuonTimingExtractor.h"
00048 #include "RecoMuon/MuonIdentification/interface/MuonCaloCompatibility.h"
00049 #include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractor.h"
00050
00051 class MuonIdProducer : public edm::EDProducer {
00052 public:
00053 enum TrackType { InnerTrack, OuterTrack, CombinedTrack };
00054
00055 explicit MuonIdProducer(const edm::ParameterSet&);
00056
00057 virtual ~MuonIdProducer();
00058
00059 virtual void produce(edm::Event&, const edm::EventSetup&);
00060
00061 static double sectorPhi( const DetId& id );
00062
00063 private:
00064 void fillMuonId( edm::Event&, const edm::EventSetup&, reco::Muon&,
00065 TrackDetectorAssociator::Direction direction = TrackDetectorAssociator::InsideOut );
00066 void fillTime( edm::Event&, const edm::EventSetup&, reco::Muon&);
00067 void fillArbitrationInfo( reco::MuonCollection* );
00068 void fillMuonIsolation( edm::Event&, const edm::EventSetup&, reco::Muon& aMuon );
00069 void init( edm::Event&, const edm::EventSetup& );
00070
00071
00072 reco::Muon makeMuon( edm::Event& iEvent, const edm::EventSetup& iSetup,
00073 const reco::TrackRef& track, TrackType type);
00074
00075 reco::Muon makeMuon( const reco::MuonTrackLinks& links );
00076
00077
00078 reco::Muon makeMuon( const reco::Track& track );
00079
00080
00081 bool isGoodTrack( const reco::Track& track );
00082
00083 bool isGoodTrackerMuon( const reco::Muon& muon );
00084
00085
00086
00087 int overlap(const reco::Muon& muon, const reco::Track& track);
00088
00089 unsigned int chamberId(const DetId&);
00090
00091 double phiOfMuonIneteractionRegion( const reco::Muon& muon ) const;
00092
00093 TrackDetectorAssociator trackAssociator_;
00094 TrackAssociatorParameters parameters_;
00095
00096 std::vector<edm::InputTag> inputCollectionLabels_;
00097 std::vector<std::string> inputCollectionTypes_;
00098
00099 MuonTimingExtractor* theTimingExtractor_;
00100
00101
00102 double minPt_;
00103 double minP_;
00104 int minNumberOfMatches_;
00105 double maxAbsEta_;
00106 bool addExtraSoftMuons_;
00107
00108
00109 double maxAbsDx_;
00110 double maxAbsPullX_;
00111 double maxAbsDy_;
00112 double maxAbsPullY_;
00113
00114
00115 bool fillCaloCompatibility_;
00116 bool fillEnergy_;
00117 bool fillMatching_;
00118 bool fillIsolation_;
00119 double trackPtThresholdToFillCandidateP4WithGlobalFit_;
00120
00121 bool debugWithTruthMatching_;
00122
00123 edm::Handle<reco::TrackCollection> innerTrackCollectionHandle_;
00124 edm::Handle<reco::TrackCollection> outerTrackCollectionHandle_;
00125 edm::Handle<reco::MuonCollection> muonCollectionHandle_;
00126 edm::Handle<reco::MuonTrackLinksCollection> linkCollectionHandle_;
00127
00128 MuonCaloCompatibility muonCaloCompatibility_;
00129 reco::isodeposit::IsoDepositExtractor* muIsoExtractorCalo_;
00130 reco::isodeposit::IsoDepositExtractor* muIsoExtractorTrack_;
00131 reco::isodeposit::IsoDepositExtractor* muIsoExtractorJet_;
00132 };
00133 #endif