File indexing completed on 2024-04-06 12:26:46
0001 #include "RecoMET/METProducers/interface/EcalHaloDataProducer.h"
0002 #include "FWCore/Framework/interface/ConsumesCollector.h"
0003
0004
0005
0006
0007
0008
0009
0010
0011 using namespace edm;
0012 using namespace std;
0013 using namespace reco;
0014
0015 EcalHaloDataProducer::EcalHaloDataProducer(const edm::ParameterSet& iConfig) : EcalAlgo(consumesCollector()) {
0016
0017 IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
0018 IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
0019 IT_ESRecHit = iConfig.getParameter<edm::InputTag>("ESRecHitLabel");
0020 IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
0021
0022
0023 IT_SuperCluster = iConfig.getParameter<edm::InputTag>("SuperClusterLabel");
0024 IT_Photon = iConfig.getParameter<edm::InputTag>("PhotonLabel");
0025
0026
0027
0028 RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
0029 AngleCut = iConfig.getParameter<double>("AngleCutParam");
0030
0031 EBRecHitEnergyThreshold = (float)iConfig.getParameter<double>("EBRecHitEnergyThresholdParam");
0032 EERecHitEnergyThreshold = (float)iConfig.getParameter<double>("EERecHitEnergyThresholdParam");
0033 ESRecHitEnergyThreshold = (float)iConfig.getParameter<double>("ESRecHitEnergyThresholdParam");
0034 SumEcalEnergyThreshold = (float)iConfig.getParameter<double>("SumEcalEnergyThresholdParam");
0035 NHitsEcalThreshold = iConfig.getParameter<int>("NHitsEcalThresholdParam");
0036
0037 RoundnessCut = iConfig.getParameter<double>("RoundnessCutParam");
0038 AngleCut = iConfig.getParameter<double>("AngleCutParam");
0039
0040 ebrechit_token_ = consumes<EBRecHitCollection>(IT_EBRecHit);
0041 eerechit_token_ = consumes<EERecHitCollection>(IT_EERecHit);
0042 esrechit_token_ = consumes<ESRecHitCollection>(IT_ESRecHit);
0043 hbherechit_token_ = consumes<HBHERecHitCollection>(IT_HBHERecHit);
0044 supercluster_token_ = consumes<reco::SuperClusterCollection>(IT_SuperCluster);
0045 photon_token_ = consumes<reco::PhotonCollection>(IT_Photon);
0046 calogeometry_token_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
0047
0048 produces<EcalHaloData>();
0049 }
0050
0051 void EcalHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup) {
0052
0053 edm::ESHandle<CaloGeometry> TheCaloGeometry = iSetup.getHandle(calogeometry_token_);
0054
0055
0056 edm::Handle<EBRecHitCollection> TheEBRecHits;
0057
0058 iEvent.getByToken(ebrechit_token_, TheEBRecHits);
0059
0060
0061 edm::Handle<EERecHitCollection> TheEERecHits;
0062
0063 iEvent.getByToken(eerechit_token_, TheEERecHits);
0064
0065
0066 edm::Handle<ESRecHitCollection> TheESRecHits;
0067
0068 iEvent.getByToken(esrechit_token_, TheESRecHits);
0069
0070
0071 edm::Handle<HBHERecHitCollection> TheHBHERecHits;
0072 iEvent.getByToken(hbherechit_token_, TheHBHERecHits);
0073
0074
0075 edm::Handle<reco::SuperClusterCollection> TheSuperClusters;
0076
0077 iEvent.getByToken(supercluster_token_, TheSuperClusters);
0078
0079
0080 edm::Handle<reco::PhotonCollection> ThePhotons;
0081
0082 iEvent.getByToken(photon_token_, ThePhotons);
0083
0084
0085 EcalAlgo.SetRoundnessCut(RoundnessCut);
0086 EcalAlgo.SetAngleCut(AngleCut);
0087 EcalAlgo.SetRecHitEnergyThresholds(EBRecHitEnergyThreshold, EERecHitEnergyThreshold, ESRecHitEnergyThreshold);
0088 EcalAlgo.SetPhiWedgeThresholds(SumEcalEnergyThreshold, NHitsEcalThreshold);
0089
0090 iEvent.put(std::make_unique<EcalHaloData>(EcalAlgo.Calculate(
0091 *TheCaloGeometry, ThePhotons, TheSuperClusters, TheEBRecHits, TheEERecHits, TheESRecHits, TheHBHERecHits, iSetup)));
0092
0093 return;
0094 }
0095
0096 EcalHaloDataProducer::~EcalHaloDataProducer() {}