CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h

Go to the documentation of this file.
00001 //
00002 // $Id: PATMuonProducer.h,v 1.30 2013/02/27 23:26:56 wmtan 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) override;
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 track,
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_;
00086 
00088     bool embedBestTrack_;
00090     bool embedTrack_;
00092     bool embedStandAloneMuon_;
00094     bool embedCombinedMuon_;
00096     bool embedCaloMETMuonCorrs_;
00098     edm::InputTag caloMETMuonCorrs_;
00100     bool embedTcMETMuonCorrs_;
00102     edm::InputTag tcMETMuonCorrs_;
00104     bool embedPickyMuon_;
00106     bool embedTpfmsMuon_;
00108     bool embedDytMuon_;
00110     bool addGenMatch_;
00112     std::vector<edm::InputTag> genMatchSrc_;
00114     bool embedGenMatch_;
00116     bool addResolutions_;
00118     pat::helper::KinResolutionsLoader resolutionLoader_;    
00120     bool useParticleFlow_;    
00122     edm::InputTag pfMuonSrc_;
00124     bool embedPFCandidate_;
00126     bool embedHighLevelSelection_;
00128     edm::InputTag beamLineSrc_;
00130     bool usePV_;
00132     edm::InputTag pvSrc_;
00134     IsolationLabels isoDepositLabels_;
00136     IsolationLabels isolationValueLabels_;
00138     bool addEfficiencies_;    
00140     bool useUserData_;
00141 
00144     GreaterByPt<Muon> pTComparator_;
00146     pat::helper::MultiIsolator isolator_; 
00148     pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_;
00150     pat::helper::EfficiencyLoader efficiencyLoader_;
00152     pat::PATUserDataHelper<pat::Muon> userDataHelper_;    
00153   };
00154 
00155 }
00156 
00157 #endif