00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "FWCore/Framework/interface/Frameworkfwd.h"
00022 #include "FWCore/Framework/interface/MakerMacros.h"
00023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00024 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00025 #include "RecoEgamma/EgammaElectronAlgos/interface/GsfElectronAlgo.h"
00026 #include "DataFormats/EgammaReco/interface/ElectronPixelSeed.h"
00027 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00028 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
00029 #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h"
00030 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00031
00032 #include "GsfElectronProducer.h"
00033
00034 #include <iostream>
00035
00036 using namespace reco;
00037
00038 GsfElectronProducer::GsfElectronProducer(const edm::ParameterSet& iConfig)
00039 {
00040
00041 produces<GsfElectronCollection>();
00042
00043
00044 algo_ = new
00045 GsfElectronAlgo(iConfig,
00046 iConfig.getParameter<double>("maxEOverPBarrel"),
00047 iConfig.getParameter<double>("maxEOverPEndcaps"),
00048 iConfig.getParameter<double>("minEOverPBarrel"),
00049 iConfig.getParameter<double>("minEOverPEndcaps"),
00050 iConfig.getParameter<double>("maxDeltaEta"),
00051 iConfig.getParameter<double>("maxDeltaPhi"),
00052 iConfig.getParameter<bool>("highPtPreselection"),
00053 iConfig.getParameter<double>("highPtMin"),
00054 iConfig.getParameter<bool>("applyEtaCorrection"),
00055 iConfig.getParameter<bool>("applyAmbResolution")
00056 );
00057
00058 }
00059
00060 GsfElectronProducer::~GsfElectronProducer()
00061 {
00062 delete algo_;
00063 }
00064
00065 void GsfElectronProducer::beginJob(edm::EventSetup const&iSetup)
00066 {
00067 }
00068
00069
00070 void GsfElectronProducer::produce(edm::Event& e, const edm::EventSetup& iSetup)
00071 {
00072 algo_->setupES(iSetup);
00073
00074
00075 std::auto_ptr<GsfElectronCollection> pOutEle(new GsfElectronCollection);
00076
00077
00078 algo_->run(e,*pOutEle);
00079
00080
00081 e.put(pOutEle);
00082
00083 }
00084
00085