CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/PhysicsTools/PatAlgos/plugins/PATElectronProducer.h

Go to the documentation of this file.
00001 //
00002 // $Id: PATElectronProducer.h,v 1.24 2011/02/08 09:11:41 chamont Exp $
00003 //
00004 
00005 #ifndef PhysicsTools_PatAlgos_PATElectronProducer_h
00006 #define PhysicsTools_PatAlgos_PATElectronProducer_h
00007 
00020 #include "FWCore/Framework/interface/EDProducer.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/Utilities/interface/InputTag.h"
00024 #include "DataFormats/Common/interface/View.h"
00025 #include "DataFormats/Common/interface/ValueMap.h"
00026 #include "DataFormats/Candidate/interface/CandAssociation.h"
00027 
00028 #include "CommonTools/Utils/interface/PtComparator.h"
00029 
00030 #include "PhysicsTools/PatAlgos/interface/MultiIsolator.h"
00031 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
00032 #include "PhysicsTools/PatAlgos/interface/KinResolutionsLoader.h"
00033 
00034 #include "DataFormats/PatCandidates/interface/Electron.h"
00035 
00036 #include "DataFormats/PatCandidates/interface/UserData.h"
00037 #include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h"
00038 
00039 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
00040 
00041 #include <string>
00042 
00043 
00044 namespace pat {
00045 
00046 
00047   class TrackerIsolationPt;
00048   class CaloIsolationEnergy;
00049   class LeptonLRCalc;
00050 
00051 
00052   class PATElectronProducer : public edm::EDProducer {
00053 
00054     public:
00055 
00056       explicit PATElectronProducer(const edm::ParameterSet & iConfig);
00057       ~PATElectronProducer();
00058 
00059       virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup);
00060 
00061       static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
00062 
00063     private:
00064 
00065       // configurables
00066       edm::InputTag electronSrc_;
00067       bool          embedGsfElectronCore_;
00068       bool          embedGsfTrack_;
00069       bool          embedSuperCluster_;
00070       bool          embedTrack_;
00071       bool          addGenMatch_;
00072       bool          embedGenMatch_;
00073       std::vector<edm::InputTag> genMatchSrc_;
00074 
00076       bool          useParticleFlow_;
00077       edm::InputTag pfElecSrc_;
00078       bool          embedPFCandidate_;
00079 
00081       bool          embedHighLevelSelection_;
00082       edm::InputTag beamLineSrc_;
00083       bool          usePV_;
00084       edm::InputTag pvSrc_;
00085 
00086       typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > GenAssociations;
00087       typedef edm::RefToBase<reco::GsfElectron> ElectronBaseRef;
00088       typedef std::vector< edm::Handle< edm::ValueMap<IsoDeposit> > > IsoDepositMaps;
00089       typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
00090 
00091 
00093       void fillElectron( Electron& aElectron,
00094                          const ElectronBaseRef& electronRef,
00095                          const reco::CandidateBaseRef& baseRef,
00096                          const GenAssociations& genMatches,
00097                          const IsoDepositMaps& deposits,
00098                          const IsolationValueMaps& isolationValues) const;
00099 
00100       void fillElectron2( Electron& anElectron,
00101                           const reco::CandidatePtr& candPtrForIsolation,
00102                           const reco::CandidatePtr& candPtrForGenMatch,
00103                           const reco::CandidatePtr& candPtrForLoader,
00104                           const GenAssociations& genMatches,
00105                           const IsoDepositMaps& deposits,
00106                           const IsolationValueMaps& isolationValues ) const;
00107 
00108       typedef std::pair<pat::IsolationKeys,edm::InputTag> IsolationLabel;
00109       typedef std::vector<IsolationLabel> IsolationLabels;
00110 
00113       void readIsolationLabels( const edm::ParameterSet & iConfig,
00114                                 const char* psetName,
00115                                 IsolationLabels& labels);
00116 
00117       bool          addElecID_;
00118       typedef std::pair<std::string, edm::InputTag> NameTag;
00119       std::vector<NameTag> elecIDSrcs_;
00120 
00121       // tools
00122       GreaterByPt<Electron>       pTComparator_;
00123 
00124       pat::helper::MultiIsolator isolator_;
00125       pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event
00126       IsolationLabels isoDepositLabels_;
00127       IsolationLabels isolationValueLabels_;
00128 
00129       bool addEfficiencies_;
00130       pat::helper::EfficiencyLoader efficiencyLoader_;
00131 
00132       bool addResolutions_;
00133       pat::helper::KinResolutionsLoader resolutionLoader_;
00134 
00135       bool useUserData_;
00136       pat::PATUserDataHelper<pat::Electron>      userDataHelper_;
00137 
00138 
00139   };
00140 
00141 
00142 }
00143 
00144 #endif