Skip to content
Snippets Groups Projects
Commit cf2cd9b6 authored by Emmanuel Le Guirriec's avatar Emmanuel Le Guirriec
Browse files

Data Handle migration of TauOverlappingElectronLLHDecorator

parent 0ccfa8c1
No related branches found
No related tags found
No related merge requests found
...@@ -102,15 +102,8 @@ StatusCode TauOverlappingElectronLLHDecorator::setEleOlrLhScoreDecorationName(co ...@@ -102,15 +102,8 @@ StatusCode TauOverlappingElectronLLHDecorator::setEleOlrLhScoreDecorationName(co
//______________________________________________________________________________ //______________________________________________________________________________
StatusCode TauOverlappingElectronLLHDecorator::decorate(const xAOD::TauJet& xTau) const StatusCode TauOverlappingElectronLLHDecorator::decorate(const xAOD::TauJet& xTau) const
{ {
SG::ReadHandle<xAOD::ElectronContainer> h_ElectronContainer;
if (m_bNewEvent) if (m_bNewEvent)
{ {
h_ElectronContainer = SG::makeHandle(m_sElectronContainerName);
if (!h_ElectronContainer.isValid()) {
ATH_MSG_FATAL("Electron container with name " << m_sElectronContainerName << " was not found in event store, but is needed for electron OLR. Ensure that it is there with the correct name");
return StatusCode::FAILURE;
}
m_bNewEvent = false; m_bNewEvent = false;
m_bEleOLRMatchAvailable = (xTau.isAvailable<char>(m_sEleOlrPassDecorationName) || xTau.isAvailable<float>(m_sEleOlrLhScoreDecorationName)); m_bEleOLRMatchAvailable = (xTau.isAvailable<char>(m_sEleOlrPassDecorationName) || xTau.isAvailable<float>(m_sEleOlrLhScoreDecorationName));
...@@ -122,6 +115,11 @@ StatusCode TauOverlappingElectronLLHDecorator::decorate(const xAOD::TauJet& xTau ...@@ -122,6 +115,11 @@ StatusCode TauOverlappingElectronLLHDecorator::decorate(const xAOD::TauJet& xTau
if (m_bEleOLRMatchAvailable) if (m_bEleOLRMatchAvailable)
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
SG::ReadHandle<xAOD::ElectronContainer> h_ElectronContainer(m_sElectronContainerName);
if (!h_ElectronContainer.isValid()) {
ATH_MSG_FATAL("Electron container with name " << m_sElectronContainerName << " was not found in event store, but is needed for electron OLR. Ensure that it is there with the correct name");
return StatusCode::FAILURE;
}
const xAOD::Electron * xEleMatch = 0; const xAOD::Electron * xEleMatch = 0;
float fLHScore = -4.; // default if no match was found float fLHScore = -4.; // default if no match was found
......
...@@ -162,7 +162,7 @@ namespace met { ...@@ -162,7 +162,7 @@ namespace met {
SG::ReadHandle<xAOD::ElectronContainer> Electrons(m_ElectronContainerKey); SG::ReadHandle<xAOD::ElectronContainer> Electrons(m_ElectronContainerKey);
if (!Electrons.isValid()) { if (!Electrons.isValid()) {
ATH_MSG_WARNING("Unable to retrieve ElectronContainer: " << Electrons.key()); ATH_MSG_WARNING("Unable to retrieve ElectronContainer: " << Electrons.key());
return StatusCode::SUCCESS; return StatusCode::FAILURE;
} }
/// Photons /// Photons
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment