Skip to content
Snippets Groups Projects
Commit c903e209 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

topoEgammaBuilder pass EventContext to the ElementLinks ctors

parent 98354263
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39214topoEgammaBuilder pass EventContext to the ElementLinks ctors
......@@ -60,7 +60,7 @@ topoEgammaBuilder::initialize()
m_egammaOQTool.disable();
}
//do we actually do ambiguity
//do we actually do ambiguity
m_doAmbiguity = !m_ambiguityTool.empty();
if (m_doElectrons && m_doPhotons && m_doAmbiguity) {
ATH_CHECK(m_ambiguityTool.retrieve());
......@@ -100,15 +100,15 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
}
SG::WriteHandle<xAOD::ElectronContainer> electronContainer(m_electronOutputKey, ctx);
ATH_CHECK(electronContainer.record(std::make_unique<xAOD::ElectronContainer>(),
std::make_unique<xAOD::ElectronAuxContainer>()));
SG::WriteHandle<xAOD::PhotonContainer> photonContainer(m_photonOutputKey,ctx);
ATH_CHECK(photonContainer.record(std::make_unique<xAOD::PhotonContainer>(),
std::make_unique<xAOD::PhotonAuxContainer>()));
electrons = electronContainer.ptr();
photons = photonContainer.ptr();
......@@ -248,7 +248,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
}
// Do the ambiguity Links
if (m_doElectrons && m_doPhotons) {
ATH_CHECK(doAmbiguityLinks(electrons, photons));
ATH_CHECK(doAmbiguityLinks(ctx,electrons, photons));
}
return StatusCode::SUCCESS;
......@@ -256,6 +256,7 @@ topoEgammaBuilder::execute(const EventContext& ctx) const
StatusCode
topoEgammaBuilder::doAmbiguityLinks(
const EventContext& ctx,
xAOD::ElectronContainer* electronContainer,
xAOD::PhotonContainer* photonContainer) const
{
......@@ -287,7 +288,7 @@ topoEgammaBuilder::doAmbiguityLinks(
if (caloClusterLinks(*(electron->caloCluster())).at(0) ==
caloClusterLinks(*(photon->caloCluster())).at(0)) {
ElementLink<xAOD::EgammaContainer> link(*electronContainer,
electronIndex);
electronIndex,ctx);
ELink(*photon) = link;
break;
}
......@@ -309,7 +310,8 @@ topoEgammaBuilder::doAmbiguityLinks(
if (caloClusterLinks(*(electron->caloCluster())).at(0) ==
caloClusterLinks(*(photon->caloCluster())).at(0)) {
ElementLink<xAOD::EgammaContainer> link(*photonContainer, photonIndex);
ElementLink<xAOD::EgammaContainer> link(
*photonContainer, photonIndex, ctx);
ELink(*electron) = link;
break;
}
......
......@@ -65,17 +65,17 @@ private:
bool getPhoton(const egammaRec* egRec, xAOD::PhotonContainer *photonContainer,
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 **/
StatusCode doAmbiguityLinks(xAOD::ElectronContainer *electronContainer,
xAOD::PhotonContainer *photonContainer) const ;
/** @brief Call a tool using contExecute and electrons, photon containers if given **/
/** @brief Call a tool using contExecute and electrons, photon containers if
* given **/
StatusCode CallTool(const EventContext& ctx,
const ToolHandle<IegammaBaseTool>& tool,
xAOD::ElectronContainer *electronContainer = nullptr,
xAOD::PhotonContainer *photonContainer = nullptr) const;
const ToolHandle<IegammaBaseTool>& tool,
xAOD::ElectronContainer* electronContainer = nullptr,
xAOD::PhotonContainer* photonContainer = nullptr) const;
/** @brief Vector of tools for dressing electrons and photons **/
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