00001 // 00002 // $Id: PATElectronProducer.h,v 1.12.2.4 2009/02/06 23:54:55 pioppi 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/ParameterSet/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 "PhysicsTools/Utilities/interface/PtComparator.h" 00029 00030 #include "PhysicsTools/PatAlgos/interface/MultiIsolator.h" 00031 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h" 00032 00033 #include "DataFormats/PatCandidates/interface/Electron.h" 00034 00035 #include "DataFormats/PatCandidates/interface/UserData.h" 00036 #include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h" 00037 00038 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" 00039 00040 #include <string> 00041 00042 00043 namespace pat { 00044 00045 00046 class TrackerIsolationPt; 00047 class CaloIsolationEnergy; 00048 class LeptonLRCalc; 00049 00050 00051 class PATElectronProducer : public edm::EDProducer { 00052 00053 public: 00054 00055 explicit PATElectronProducer(const edm::ParameterSet & iConfig); 00056 ~PATElectronProducer(); 00057 00058 virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup); 00059 typedef edm::RefToBase<ElectronType> ElectronBaseRef; 00060 00061 private: 00062 00063 // configurables 00064 edm::InputTag electronSrc_; 00065 bool embedGsfTrack_; 00066 bool embedSuperCluster_; 00067 bool embedTrack_; 00068 bool addGenMatch_; 00069 bool embedGenMatch_; 00070 std::vector<edm::InputTag> genMatchSrc_; 00071 bool addTrigMatch_; 00072 std::vector<edm::InputTag> trigMatchSrc_; 00073 bool addResolutions_; 00074 bool addElecID_; 00075 00077 bool useParticleFlow_; 00078 edm::InputTag pfElecSrc_; 00079 bool embedPFCandidate_; 00080 00081 typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > GenAssociations; 00082 00083 typedef std::vector<edm::Handle<edm::Association<TriggerPrimitiveCollection> > > TrigAssociations; 00084 00085 void FillElectron(Electron& aEl, 00086 const ElectronBaseRef& elecRef, 00087 const reco::CandidateBaseRef& baseRef, 00088 const GenAssociations& genMatches, 00089 const TrigAssociations& trigMatches) const; 00090 00091 00092 typedef std::pair<std::string, edm::InputTag> NameTag; 00093 std::vector<NameTag> elecIDSrcs_; 00094 00095 // tools 00096 GreaterByPt<Electron> pTComparator_; 00097 00098 pat::helper::MultiIsolator isolator_; 00099 pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event 00100 std::vector<std::pair<pat::IsolationKeys,edm::InputTag> > isoDepositLabels_; 00101 00102 bool addEfficiencies_; 00103 pat::helper::EfficiencyLoader efficiencyLoader_; 00104 00105 bool useUserData_; 00106 pat::PATUserDataHelper<pat::Electron> userDataHelper_; 00107 00108 //Add electron Cluster Shapes */ 00109 bool addElecShapes_; 00110 //Ecal Cluster Lazy Tools 00111 std::auto_ptr<EcalClusterLazyTools> lazyTools_; 00112 00113 //For the Cluster Shape reading */ 00114 edm::InputTag reducedBarrelRecHitCollection_; 00115 edm::InputTag reducedEndcapRecHitCollection_; 00116 00117 }; 00118 00119 00120 } 00121 00122 #endif