CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h

Go to the documentation of this file.
00001 //
00002 // $Id: PATMuonProducer.h,v 1.28 2011/09/21 03:40:18 tucker Exp $
00003 //
00004 
00005 #ifndef PhysicsTools_PatAlgos_PATMuonProducer_h
00006 #define PhysicsTools_PatAlgos_PATMuonProducer_h
00007 
00019 #include <string>
00020 
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/Framework/interface/EDProducer.h"
00023 #include "DataFormats/PatCandidates/interface/Muon.h"
00024 #include "CommonTools/Utils/interface/PtComparator.h"
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 
00027 #include "TrackingTools/IPTools/interface/IPTools.h"
00028 #include "PhysicsTools/PatAlgos/interface/MultiIsolator.h"
00029 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
00030 #include "PhysicsTools/PatAlgos/interface/KinResolutionsLoader.h"
00031 
00032 #include "DataFormats/PatCandidates/interface/UserData.h"
00033 #include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h"
00034 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00035 
00036 
00037 namespace pat {
00039   class TrackerIsolationPt;
00040   class CaloIsolationEnergy;
00041 
00043   class PATMuonProducer : public edm::EDProducer {
00044     
00045   public:
00047     explicit PATMuonProducer(const edm::ParameterSet & iConfig);
00049     ~PATMuonProducer();
00051     virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup);
00053     static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
00054 
00055   private:
00057     typedef edm::RefToBase<reco::Muon> MuonBaseRef;
00058     typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > GenAssociations;
00059     typedef std::vector< edm::Handle< edm::ValueMap<IsoDeposit> > > IsoDepositMaps;
00060     typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
00061     typedef std::pair<pat::IsolationKeys,edm::InputTag> IsolationLabel;
00062     typedef std::vector<IsolationLabel> IsolationLabels;
00063 
00064 
00066     void fillMuon( Muon& aMuon, const MuonBaseRef& muonRef, const reco::CandidateBaseRef& baseRef, const GenAssociations& genMatches, const IsoDepositMaps& deposits, const IsolationValueMaps& isolationValues) const;
00069     void readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels); 
00070 
00071 
00072     // embed various impact parameters with errors
00073     // embed high level selection
00074     void embedHighLevel( pat::Muon & aMuon,
00075                          reco::TrackRef innerTrack,
00076                          reco::TransientTrack & tt,
00077                          reco::Vertex & primaryVertex,
00078                          bool primaryVertexIsValid,
00079                          reco::BeamSpot & beamspot,
00080                          bool beamspotIsValid );
00081 
00082     
00083   private:
00085     edm::InputTag muonSrc_;
00087     bool embedTrack_;
00089     bool embedStandAloneMuon_;
00091     bool embedCombinedMuon_;
00093     bool embedCaloMETMuonCorrs_;
00095     edm::InputTag caloMETMuonCorrs_;
00097     bool embedTcMETMuonCorrs_;
00099     edm::InputTag tcMETMuonCorrs_;
00101     bool embedPickyMuon_;
00103     bool embedTpfmsMuon_;
00105     bool embedDytMuon_;
00107     bool addGenMatch_;
00109     std::vector<edm::InputTag> genMatchSrc_;
00111     bool embedGenMatch_;
00113     bool addResolutions_;
00115     pat::helper::KinResolutionsLoader resolutionLoader_;    
00117     bool useParticleFlow_;    
00119     edm::InputTag pfMuonSrc_;
00121     bool embedPFCandidate_;
00123     bool embedHighLevelSelection_;
00125     edm::InputTag beamLineSrc_;
00127     bool usePV_;
00129     edm::InputTag pvSrc_;
00131     IsolationLabels isoDepositLabels_;
00133     IsolationLabels isolationValueLabels_;
00135     bool addEfficiencies_;    
00137     bool useUserData_;
00138 
00141     GreaterByPt<Muon> pTComparator_;
00143     pat::helper::MultiIsolator isolator_; 
00145     pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_;
00147     pat::helper::EfficiencyLoader efficiencyLoader_;
00149     pat::PATUserDataHelper<pat::Muon> userDataHelper_;    
00150   };
00151 
00152 }
00153 
00154 #endif