Go to the documentation of this file.00001 #include "RecoMET/METProducers/interface/EcalHaloDataProducer.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010 using namespace edm;
00011 using namespace std;
00012 using namespace reco;
00013
00014 EcalHaloDataProducer::EcalHaloDataProducer(const edm::ParameterSet& iConfig)
00015 {
00016
00017 IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
00018 IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
00019 IT_ESRecHit = iConfig.getParameter<edm::InputTag>("ESRecHitLabel");
00020
00021
00022 IT_SuperCluster = iConfig.getParameter<edm::InputTag>("SuperClusterLabel");
00023 IT_Photon = iConfig.getParameter<edm::InputTag>("PhotonLabel") ;
00024
00025
00026
00027 RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
00028 AngleCut = iConfig.getParameter<double>("AngleCutParam");
00029
00030 EBRecHitEnergyThreshold = (float) iConfig.getParameter<double> ("EBRecHitEnergyThresholdParam");
00031 EERecHitEnergyThreshold = (float) iConfig.getParameter<double> ("EERecHitEnergyThresholdParam");
00032 ESRecHitEnergyThreshold = (float) iConfig.getParameter<double> ("ESRecHitEnergyThresholdParam");
00033 SumEcalEnergyThreshold = (float)iConfig.getParameter<double> ("SumEcalEnergyThresholdParam");
00034 NHitsEcalThreshold = iConfig.getParameter<int> ("NHitsEcalThresholdParam");
00035
00036 RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
00037 AngleCut = iConfig.getParameter<double>("AngleCutParam");
00038
00039 produces<EcalHaloData>();
00040 }
00041
00042 void EcalHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup)
00043 {
00044
00045 edm::ESHandle<CaloGeometry> TheCaloGeometry;
00046 iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
00047
00048
00049 edm::Handle<EBRecHitCollection> TheEBRecHits;
00050 iEvent.getByLabel(IT_EBRecHit, TheEBRecHits);
00051
00052
00053 edm::Handle<EERecHitCollection> TheEERecHits;
00054 iEvent.getByLabel(IT_EERecHit, TheEERecHits);
00055
00056
00057 edm::Handle<ESRecHitCollection> TheESRecHits;
00058 iEvent.getByLabel(IT_ESRecHit, TheESRecHits);
00059
00060
00061 edm::Handle<reco::SuperClusterCollection> TheSuperClusters;
00062 iEvent.getByLabel(IT_SuperCluster, TheSuperClusters);
00063
00064
00065 edm::Handle<reco::PhotonCollection> ThePhotons;
00066 iEvent.getByLabel(IT_Photon, ThePhotons);
00067
00068
00069 EcalHaloAlgo EcalAlgo;
00070 EcalAlgo.SetRoundnessCut(RoundnessCut);
00071 EcalAlgo.SetAngleCut(AngleCut);
00072 EcalAlgo.SetRecHitEnergyThresholds(EBRecHitEnergyThreshold, EERecHitEnergyThreshold, ESRecHitEnergyThreshold);
00073 EcalAlgo.SetPhiWedgeThresholds(SumEcalEnergyThreshold, NHitsEcalThreshold);
00074
00075 if( TheCaloGeometry.isValid() && ThePhotons.isValid() && TheSuperClusters.isValid() && TheEBRecHits.isValid() && TheEERecHits.isValid() && TheESRecHits.isValid() )
00076 {
00077 std::auto_ptr<EcalHaloData> EcalData( new EcalHaloData( EcalAlgo.Calculate(*TheCaloGeometry, ThePhotons, TheSuperClusters, TheEBRecHits, TheEERecHits, TheESRecHits)));
00078 iEvent.put( EcalData ) ;
00079 }
00080 else
00081 {
00082 std::auto_ptr<EcalHaloData> EcalData( new EcalHaloData() ) ;
00083 iEvent.put(EcalData);
00084 }
00085 return;
00086 }
00087
00088 void EcalHaloDataProducer::beginJob(){return;}
00089 void EcalHaloDataProducer::endJob(){return;}
00090 void EcalHaloDataProducer::beginRun(edm::Run&, const edm::EventSetup&){return;}
00091 void EcalHaloDataProducer::endRun(edm::Run&, const edm::EventSetup&){return;}
00092 EcalHaloDataProducer::~EcalHaloDataProducer(){}