Skip to content
Snippets Groups Projects
Commit 8c5e5fb2 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'topoEgammaBuilder_pass_eventContext_toElLinks' into 'master'

topoEgammaBuilder pass EventContext to the ElementLinks ctors

See merge request atlas/athena!39214
parents 30ef9742 c903e209
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ topoEgammaBuilder::initialize() ...@@ -60,7 +60,7 @@ topoEgammaBuilder::initialize()
m_egammaOQTool.disable(); m_egammaOQTool.disable();
} }
//do we actually do ambiguity //do we actually do ambiguity
m_doAmbiguity = !m_ambiguityTool.empty(); m_doAmbiguity = !m_ambiguityTool.empty();
if (m_doElectrons && m_doPhotons && m_doAmbiguity) { if (m_doElectrons && m_doPhotons && m_doAmbiguity) {
ATH_CHECK(m_ambiguityTool.retrieve()); ATH_CHECK(m_ambiguityTool.retrieve());
...@@ -100,15 +100,15 @@ topoEgammaBuilder::execute(const EventContext& ctx) const ...@@ -100,15 +100,15 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
} }
SG::WriteHandle<xAOD::ElectronContainer> electronContainer(m_electronOutputKey, ctx); SG::WriteHandle<xAOD::ElectronContainer> electronContainer(m_electronOutputKey, ctx);
ATH_CHECK(electronContainer.record(std::make_unique<xAOD::ElectronContainer>(), ATH_CHECK(electronContainer.record(std::make_unique<xAOD::ElectronContainer>(),
std::make_unique<xAOD::ElectronAuxContainer>())); std::make_unique<xAOD::ElectronAuxContainer>()));
SG::WriteHandle<xAOD::PhotonContainer> photonContainer(m_photonOutputKey,ctx); SG::WriteHandle<xAOD::PhotonContainer> photonContainer(m_photonOutputKey,ctx);
ATH_CHECK(photonContainer.record(std::make_unique<xAOD::PhotonContainer>(), ATH_CHECK(photonContainer.record(std::make_unique<xAOD::PhotonContainer>(),
std::make_unique<xAOD::PhotonAuxContainer>())); std::make_unique<xAOD::PhotonAuxContainer>()));
electrons = electronContainer.ptr(); electrons = electronContainer.ptr();
photons = photonContainer.ptr(); photons = photonContainer.ptr();
...@@ -248,7 +248,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const ...@@ -248,7 +248,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
} }
// Do the ambiguity Links // Do the ambiguity Links
if (m_doElectrons && m_doPhotons) { if (m_doElectrons && m_doPhotons) {
ATH_CHECK(doAmbiguityLinks(electrons, photons)); ATH_CHECK(doAmbiguityLinks(ctx,electrons, photons));
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -256,6 +256,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const ...@@ -256,6 +256,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
StatusCode StatusCode
topoEgammaBuilder::doAmbiguityLinks( topoEgammaBuilder::doAmbiguityLinks(
const EventContext& ctx,
xAOD::ElectronContainer* electronContainer, xAOD::ElectronContainer* electronContainer,
xAOD::PhotonContainer* photonContainer) const xAOD::PhotonContainer* photonContainer) const
{ {
...@@ -287,7 +288,7 @@ topoEgammaBuilder::doAmbiguityLinks( ...@@ -287,7 +288,7 @@ topoEgammaBuilder::doAmbiguityLinks(
if (caloClusterLinks(*(electron->caloCluster())).at(0) == if (caloClusterLinks(*(electron->caloCluster())).at(0) ==
caloClusterLinks(*(photon->caloCluster())).at(0)) { caloClusterLinks(*(photon->caloCluster())).at(0)) {
ElementLink<xAOD::EgammaContainer> link(*electronContainer, ElementLink<xAOD::EgammaContainer> link(*electronContainer,
electronIndex); electronIndex,ctx);
ELink(*photon) = link; ELink(*photon) = link;
break; break;
} }
...@@ -309,7 +310,8 @@ topoEgammaBuilder::doAmbiguityLinks( ...@@ -309,7 +310,8 @@ topoEgammaBuilder::doAmbiguityLinks(
if (caloClusterLinks(*(electron->caloCluster())).at(0) == if (caloClusterLinks(*(electron->caloCluster())).at(0) ==
caloClusterLinks(*(photon->caloCluster())).at(0)) { caloClusterLinks(*(photon->caloCluster())).at(0)) {
ElementLink<xAOD::EgammaContainer> link(*photonContainer, photonIndex); ElementLink<xAOD::EgammaContainer> link(
*photonContainer, photonIndex, ctx);
ELink(*electron) = link; ELink(*electron) = link;
break; break;
} }
......
...@@ -65,17 +65,17 @@ private: ...@@ -65,17 +65,17 @@ private:
bool getPhoton(const egammaRec* egRec, xAOD::PhotonContainer *photonContainer, bool getPhoton(const egammaRec* egRec, xAOD::PhotonContainer *photonContainer,
const unsigned int author, uint8_t type) const; const unsigned int author, uint8_t type) const;
/** @brief Do the final ambiguity **/
StatusCode doAmbiguityLinks(const EventContext& ctx,
xAOD::ElectronContainer* electronContainer,
xAOD::PhotonContainer* photonContainer) const;
/** @brief Do the final ambiguity **/ /** @brief Call a tool using contExecute and electrons, photon containers if
StatusCode doAmbiguityLinks(xAOD::ElectronContainer *electronContainer, * given **/
xAOD::PhotonContainer *photonContainer) const ;
/** @brief Call a tool using contExecute and electrons, photon containers if given **/
StatusCode CallTool(const EventContext& ctx, StatusCode CallTool(const EventContext& ctx,
const ToolHandle<IegammaBaseTool>& tool, const ToolHandle<IegammaBaseTool>& tool,
xAOD::ElectronContainer *electronContainer = nullptr, xAOD::ElectronContainer* electronContainer = nullptr,
xAOD::PhotonContainer *photonContainer = nullptr) const; xAOD::PhotonContainer* photonContainer = nullptr) const;
/** @brief Vector of tools for dressing electrons and photons **/ /** @brief Vector of tools for dressing electrons and photons **/
ToolHandleArray<IegammaBaseTool> m_egammaTools {this, ToolHandleArray<IegammaBaseTool> m_egammaTools {this,
......
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