From 30dc9c0c6e893ee7867306644a506751bad13338 Mon Sep 17 00:00:00 2001 From: Simon Rothman Date: Wed, 13 Sep 2023 15:39:01 -0500 Subject: [PATCH 1/2] Producer with printouts DRN determinism test instructions Update to combined model; cleanup prints Further cleanup; we'll squash onto this commit --- .../slimming/patPhotonDRNCorrector_cfi.py | 4 ++-- .../plugins/DRNCorrectionProducerT.cc | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/patPhotonDRNCorrector_cfi.py b/PhysicsTools/PatAlgos/python/slimming/patPhotonDRNCorrector_cfi.py index 68ee77d41f1e1..cae2e38452447 100644 --- a/PhysicsTools/PatAlgos/python/slimming/patPhotonDRNCorrector_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/patPhotonDRNCorrector_cfi.py @@ -7,8 +7,8 @@ Client = patPhotonDRNCorrectionProducer.Client.clone( mode = 'Async', allowedTries = 1, - modelName = 'photonObjectEnsemble', - modelConfigPath = 'RecoEgamma/EgammaPhotonProducers/data/models/photonObjectEnsemble/config.pbtxt', + modelName = 'photonObjectCombined', + modelConfigPath = 'RecoEgamma/EgammaPhotonProducers/data/models/photonObjectCombined/config.pbtxt', timeout = 10 ) ) diff --git a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc index 9efcb4bb5e7c7..c708cd9e150ec 100644 --- a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc +++ b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc @@ -211,42 +211,42 @@ void DRNCorrectionProducerT::acquire(edm::Event const& iEvent, edm::EventSetu * gx: (rho, H/E) additional high-level features. * batch{SB}: graph models require explicitely passing the particle index for each vertex */ - auto& inputxECAL = iInput.at("xECAL"); + auto& inputxECAL = iInput.at("xECAL__0"); inputxECAL.setShape(0, nHitsECAL); auto dataxECAL = inputxECAL.allocate(); auto& vdataxECAL = (*dataxECAL)[0]; - auto& inputfECAL = iInput.at("fECAL"); + auto& inputfECAL = iInput.at("fECAL__1"); inputfECAL.setShape(0, nHitsECAL); auto datafECAL = inputfECAL.allocate(); auto& vdatafECAL = (*datafECAL)[0]; - auto& inputGainECAL = iInput.at("gainECAL"); + auto& inputGainECAL = iInput.at("gain__2"); inputGainECAL.setShape(0, nHitsECAL); auto dataGainECAL = inputGainECAL.allocate(); auto& vdataGainECAL = (*dataGainECAL)[0]; - auto& inputGx = iInput.at("gx"); + auto& inputGx = iInput.at("graph_x__5"); inputGx.setShape(0, nValidPart_); auto dataGx = inputGx.allocate(); auto& vdataGx = (*dataGx)[0]; - auto& inputBatchECAL = iInput.at("batchECAL"); + auto& inputBatchECAL = iInput.at("xECAL_batch__6"); inputBatchECAL.setShape(0, nHitsECAL); auto dataBatchECAL = inputBatchECAL.allocate(); auto& vdataBatchECAL = (*dataBatchECAL)[0]; - auto& inputxES = iInput.at("xES"); + auto& inputxES = iInput.at("xES__3"); inputxES.setShape(0, nHitsES); auto dataxES = inputxES.allocate(); auto& vdataxES = (*dataxES)[0]; - auto& inputfES = iInput.at("fES"); + auto& inputfES = iInput.at("fES__4"); inputfES.setShape(0, nHitsES); auto datafES = inputfES.allocate(); auto& vdatafES = (*datafES)[0]; - auto& inputBatchES = iInput.at("batchES"); + auto& inputBatchES = iInput.at("xES_batch__7"); inputBatchES.setShape(0, nHitsES); auto dataBatchES = inputBatchES.allocate(); auto& vdataBatchES = (*dataBatchES)[0]; @@ -346,6 +346,7 @@ void DRNCorrectionProducerT::acquire(edm::Event const& iEvent, edm::EventSetu /* * Convert input tensors to server data format */ + inputxECAL.toServer(dataxECAL); inputfECAL.toServer(datafECAL); inputGainECAL.toServer(dataGainECAL); @@ -368,16 +369,15 @@ void DRNCorrectionProducerT::produce(edm::Event& iEvent, const edm::EventSetu //if there are no particles, the fromServer() call will fail //but we can just put() an empty valueMap if (nPart_) { - const auto& muOut = iOutput.at("mu").fromServer(); - const auto& sigmaOut = iOutput.at("sigma").fromServer(); + const auto& out = iOutput.at("combined_output__0").fromServer(); unsigned i = 0; float mu, sigma, Epred, sigmaPred, rawE; for (unsigned iPart = 0; iPart < nPart_; ++iPart) { const auto& part = particles_->at(iPart); if (!skip(part)) { - mu = correction(muOut[0][0 + 6 * i]); - sigma = resolution(sigmaOut[0][0 + 5 * i]); + mu = correction(out[0][0 + 11 * i]); + sigma = resolution(out[0][6 + 11*i]); ++i; rawE = part.superCluster()->rawEnergy(); From 6b48c07393bf18038f80e90b46735106467a0be4 Mon Sep 17 00:00:00 2001 From: Simon Rothman Date: Wed, 4 Oct 2023 15:44:15 -0500 Subject: [PATCH 2/2] code-format --- RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc index c708cd9e150ec..66312a77ecfd2 100644 --- a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc +++ b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducerT.cc @@ -377,7 +377,7 @@ void DRNCorrectionProducerT::produce(edm::Event& iEvent, const edm::EventSetu const auto& part = particles_->at(iPart); if (!skip(part)) { mu = correction(out[0][0 + 11 * i]); - sigma = resolution(out[0][6 + 11*i]); + sigma = resolution(out[0][6 + 11 * i]); ++i; rawE = part.superCluster()->rawEnergy();