diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonTPExtrapolationTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonTPExtrapolationTool.cxx index bf55252a2ab3dfc8a7cf361c75ea0ef29ac59f9c..47d952183a3b05c1530cb1c8ef871b2bb74964c0 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonTPExtrapolationTool.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/src/MuonTPExtrapolationTool.cxx @@ -41,9 +41,7 @@ MuonTPExtrapolationTool::~MuonTPExtrapolationTool() { //********************************************************************** StatusCode MuonTPExtrapolationTool::initialize() { -#ifndef XAOD_ANALYSIS - ATH_CHECK(m_extrapolator.retrieve()); -#endif + if (!m_is_on_DAOD) ATH_CHECK(m_extrapolator.retrieve()); return StatusCode::SUCCESS; } @@ -62,7 +60,6 @@ bool MuonTPExtrapolationTool::extrapolateAndDecorateTrackParticle(const xAOD::Tr static SG::AuxElement::Accessor<float> acc_Phi("PhiTriggerPivot"); if (!acc_Decorated.isAvailable(*particle) || !acc_Decorated(*particle)) { -#ifndef XAOD_ANALYSIS if (!m_is_on_DAOD) { // in the athena release, we can run the extrapolation if needed const Trk::TrackParameters* pTag = extrapolateToTriggerPivotPlane(*particle); @@ -83,11 +80,6 @@ bool MuonTPExtrapolationTool::extrapolateAndDecorateTrackParticle(const xAOD::Tr if (particle->pt() > 3500) ATH_MSG_WARNING("Pivot plane extrapolation not decorated to a track particle at pt " << particle->pt() << ", eta " << particle->eta() << ", phi " << particle->phi()); return true; } -#else - // in AthAnalysis, we can only give up if the decoration is missing... - ATH_MSG_WARNING("Pivot plane extrapolation not decorated to a track particle at pt " << particle->pt() << ", eta " << particle->eta() << ", phi " << particle->phi()); - return false; -#endif } if (acc_Decorated.isAvailable(*particle) && acc_Decorated(*particle) == 1) { diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.cxx b/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.cxx index 51cf45e8ef490859b3c895bd17a17e485e012bb9..db5f401ce4371b3ac4aafa36fa15ef3da429f1ff 100644 --- a/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.cxx +++ b/Reconstruction/RecoAlgs/IsolationAlgs/src/IsolationBuilder.cxx @@ -798,8 +798,14 @@ StatusCode IsolationBuilder::runLeakage() { ATH_MSG_ERROR("Couldn't retrieve photon container with key: " << m_PhotonContainerName); return StatusCode::FAILURE; } - for (auto ph : *photons) - m_leakTool->applyCorrection(*ph); + xAOD::PhotonContainer::iterator it = photons->begin(), itE = photons->end(); + for (; it != itE; ++it) { + CP::CorrectionCode code = m_leakTool->applyCorrection(**it); + if (code == CP::CorrectionCode::Error){ + ATH_MSG_ERROR("Failed to apply the photon leakage correction"); + return StatusCode::FAILURE; + } + } } if (m_ElectronContainerName.size()) { @@ -808,8 +814,14 @@ StatusCode IsolationBuilder::runLeakage() { ATH_MSG_ERROR("Couldn't retrieve electron container with key: " << m_ElectronContainerName); return StatusCode::FAILURE; } - for (auto el : *electrons) - m_leakTool->applyCorrection(*el); + xAOD::ElectronContainer::iterator it = electrons->begin(), itE = electrons->end(); + for (; it != itE; ++it) { + CP::CorrectionCode code = m_leakTool->applyCorrection(**it); + if (code == CP::CorrectionCode::Error){ + ATH_MSG_ERROR("Failed to apply the electron leakage correction"); + return StatusCode::FAILURE; + } + } } return StatusCode::SUCCESS;