Skip to content

Commit

Permalink
Fix ES data getting to be compliant with newer CMSSW
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrothman committed Mar 3, 2022
1 parent f3fee7c commit 32c5854
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions RecoEgamma/EgammaTools/plugins/DRNCorrectionProducertT.cc
Expand Up @@ -124,6 +124,9 @@ class DRNCorrectionProducerT : public TritonEDProducer<> {
edm::InputTag EBRecHitsName_, EERecHitsName_, ESRecHitsName_;
edm::EDGetTokenT<EcalRecHitCollection> EBRecHitsToken_, EERecHitsToken_, ESRecHitsToken_;

edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> pedToken_;
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;

size_t nPart_, nValidPart_;

bool isEB(const T& part);
Expand All @@ -132,8 +135,8 @@ class DRNCorrectionProducerT : public TritonEDProducer<> {
};

template <typename T>
DRNCorrectionProducerT<T>::DRNCorrectionProducerT(const edm::ParameterSet& iConfig)
: TritonEDProducer<>(iConfig, "DRNCorrectionProducerT"),
DRNCorrectionProducerT<T>::DRNCorrectionProducerT(const edm::ParameterSet& iConfig) :
TritonEDProducer<>(iConfig),
particleSource_{iConfig.getParameter<edm::InputTag>("particleSource")},
particleToken_(consumes(particleSource_)),
rhoName_{iConfig.getParameter<edm::InputTag>("rhoName")},
Expand All @@ -143,8 +146,9 @@ DRNCorrectionProducerT<T>::DRNCorrectionProducerT(const edm::ParameterSet& iConf
ESRecHitsName_{iConfig.getParameter<edm::InputTag>("reducedEcalRecHitsES")},
EBRecHitsToken_(consumes<EcalRecHitCollection>(EBRecHitsName_)),
EERecHitsToken_(consumes<EcalRecHitCollection>(EERecHitsName_)),
ESRecHitsToken_(consumes<EcalRecHitCollection>(ESRecHitsName_))
{
ESRecHitsToken_(consumes<EcalRecHitCollection>(ESRecHitsName_)),
pedToken_(esConsumes()),
geomToken_(esConsumes()){
produces<edm::ValueMap<std::pair<float, float>>>();
}

Expand Down Expand Up @@ -179,12 +183,9 @@ void DRNCorrectionProducerT<T>::acquire(edm::Event const& iEvent, edm::EventSetu
edm::Handle<EcalRecHitCollection> EERecHits = iEvent.getHandle(EERecHitsToken_);
edm::Handle<EcalRecHitCollection> ESRecHits = iEvent.getHandle(ESRecHitsToken_);

edm::ESHandle<EcalPedestals> ped;
edm::ESHandle<CaloGeometry> pG;
const auto& ped = &iSetup.getData(pedToken_);
const auto& geo = &iSetup.getData(geomToken_);

iSetup.get<EcalPedestalsRcd>().get(ped);
iSetup.get<CaloGeometryRecord>().get(pG);
const CaloGeometry* geo = pG.product();
const CaloSubdetectorGeometry* ecalEBGeom =
static_cast<const CaloSubdetectorGeometry*>(geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel));
const CaloSubdetectorGeometry* ecalEEGeom =
Expand Down
4 changes: 2 additions & 2 deletions RecoEgamma/EgammaTools/plugins/EGRegressionModifierDRN.cc
Expand Up @@ -161,7 +161,7 @@ void EGRegressionModifierDRN::modifyObject(reco::GsfElectron& ele) const {

throw cms::Exception("EGRegressionModifierDRN")
<< "Electron energy corrections not fully implemented yet:" << std::endl
<< "Still need E/p combination" << std::endl;
<< "Still need E/p combination" << std::endl
<< "Do not enable DRN for electrons" << std::endl;

const std::pair<float, float> trackerCombo(1.0, 1.0); //TODO: compute E/p combination
Expand All @@ -183,7 +183,7 @@ void EGRegressionModifierDRN::modifyObject(pat::Electron& ele) const {

throw cms::Exception("EGRegressionModifierDRN")
<< "Electron energy corrections not fully implemented yet:" << std::endl
<< "Still need E/p combination" << std::endl;
<< "Still need E/p combination" << std::endl
<< "Do not enable DRN for electrons" << std::endl;

const std::pair<float, float> trackerCombo(1.0, 1.0); //TODO: compute E/p combination
Expand Down

0 comments on commit 32c5854

Please sign in to comment.