CMS 3D CMS Logo

MuonIdProducer.h

Go to the documentation of this file.
00001 #ifndef MuonIdentification_MuonIdProducer_h
00002 #define MuonIdentification_MuonIdProducer_h
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    MuonIdentification
00007 // Class:      MuonIdProducer
00008 // 
00009 /*
00010 
00011  Description: reco::Muon producer that can fill various information:
00012               - track-segment matching
00013               - energy deposition
00014               - muon isolation
00015               - muon hypothesis compatibility (calorimeter)
00016               Acceptable inputs:
00017               - reco::TrackCollection
00018               - reco::MuonCollection
00019               - reco::MuonTrackLinksCollection
00020 */
00021 //
00022 // Original Author:  Dmytro Kovalskyi
00023 // $Id: MuonIdProducer.h,v 1.14 2008/11/11 10:19:15 ptraczyk Exp $
00024 //
00025 //
00026 
00027 
00028 // user include files
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 // #include "Utilities/Timing/interface/TimerStack.h"
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    // make a muon based on a track ref
00072    reco::Muon    makeMuon( edm::Event& iEvent, const edm::EventSetup& iSetup, 
00073                            const reco::TrackRef& track, TrackType type);
00074    // make a global muon based on the links object
00075    reco::Muon    makeMuon( const reco::MuonTrackLinks& links );
00076    
00077    // make a muon based on track (p4)
00078    reco::Muon    makeMuon( const reco::Track& track );
00079 
00080    // check if a silicon track satisfies the trackerMuon requirements
00081    bool          isGoodTrack( const reco::Track& track );
00082    
00083    bool          isGoodTrackerMuon( const reco::Muon& muon );
00084    
00085    // check number of common DetIds for a given trackerMuon and a stand alone
00086    // muon track
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    // selections
00102    double minPt_;
00103    double minP_;
00104    int    minNumberOfMatches_;
00105    double maxAbsEta_;
00106    bool   addExtraSoftMuons_;
00107    
00108    // matching
00109    double maxAbsDx_;
00110    double maxAbsPullX_;
00111    double maxAbsDy_;
00112    double maxAbsPullY_;
00113    
00114    // what information to fill
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

Generated on Tue Jun 9 17:44:18 2009 for CMSSW by  doxygen 1.5.4