23 declareInterface<DerivationFramework::IAugmentationTool>(
this);
37 if (!m_SGKey_electrons.key().empty()) {
38 const std::string
key = m_SGKey_electrons.key();
40 ATH_CHECK(m_SGKey_electrons.initialize());
43 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_time");
44 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_energy");
45 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_gain");
46 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_onlId");
47 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_x");
48 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_y");
49 m_SGKey_electrons_decorations.emplace_back(
key +
".maxEcell_z");
51 if (!m_SGKey_egammaClusters.key().empty()) {
52 ATH_MSG_INFO(
"Using " << m_SGKey_egammaClusters.key() <<
" to try to match a cluster to the LRT egamma cluster");
53 ATH_CHECK(m_SGKey_egammaClusters.initialize());
54 m_SGKey_electrons_decorations.emplace_back(
key +
".dR");
57 ATH_CHECK(m_SGKey_electrons_decorations.initialize());
60 if (!m_SGKey_photons.key().empty()) {
61 const std::string
key = m_SGKey_photons.key();
66 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_time");
67 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_energy");
68 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_gain");
69 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_onlId");
70 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_x");
71 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_y");
72 m_SGKey_photons_decorations.emplace_back(
key +
".maxEcell_z");
73 ATH_CHECK(m_SGKey_photons_decorations.initialize());
76 return StatusCode::SUCCESS;
82 return StatusCode::SUCCESS;
89 const EventContext& ctx = Gaudi::Hive::currentContext();
91 if (!m_SGKey_photons.key().empty()) {
96 m_SGKey_photons_decorations[0], ctx);
98 m_SGKey_photons_decorations[1], ctx);
100 m_SGKey_photons_decorations[2], ctx);
102 m_SGKey_photons_decorations[3], ctx);
104 m_SGKey_photons_decorations[4], ctx);
106 m_SGKey_photons_decorations[5], ctx);
108 m_SGKey_photons_decorations[6], ctx);
111 for (
const auto*
egamma : *importedPhotons) {
114 decorateObject(cluster, ctx);
115 decorationPh0(*
egamma) =
res.maxEcell_time;
116 decorationPh1(*
egamma) =
res.maxEcell_energy;
117 decorationPh2(*
egamma) =
res.maxEcell_gain;
118 decorationPh3(*
egamma) =
res.maxEcell_onlId;
125 if (!m_SGKey_electrons.key().empty()) {
131 std::optional<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> odecorationEl7;
133 if (!m_SGKey_egammaClusters.key().empty()) {
135 m_SGKey_egammaClusters, ctx);
136 egClContainer = egClContainerRH.
ptr();
137 odecorationEl7.
emplace(m_SGKey_electrons_decorations[7], ctx);
142 m_SGKey_electrons_decorations[0], ctx);
144 m_SGKey_electrons_decorations[1], ctx);
146 m_SGKey_electrons_decorations[2], ctx);
148 m_SGKey_electrons_decorations[3], ctx);
150 m_SGKey_electrons_decorations[4], ctx);
152 m_SGKey_electrons_decorations[5], ctx);
154 m_SGKey_electrons_decorations[6], ctx);
157 for (
const auto*
egamma : *importedElectrons) {
159 if (!m_SGKey_egammaClusters.key().empty()) {
162 for (
const auto *clus : *egClContainer) {
163 double dR = clus->p4().DeltaR(cluster->
p4());
164 if (dR < dRMin && dR < m_dRLRTegClusegClusMax) {
166 matchedCluster = clus;
169 cluster = matchedCluster;
170 odecorationEl7.value()(*egamma) = dRMin;
173 decorateObject(cluster, ctx);
174 decorationEl0(*
egamma) =
res.maxEcell_time;
175 decorationEl1(*
egamma) =
res.maxEcell_energy;
176 decorationEl2(*
egamma) =
res.maxEcell_gain;
177 decorationEl3(*
egamma) =
res.maxEcell_onlId;
184 return StatusCode::SUCCESS;
190 const EventContext& ctx)
const
204 ATH_MSG_ERROR(
"Do not have mapping object " << m_cablingKey.key());
210 const CaloCell* cell_maxE =
nullptr;
212 int sampling =
cell->caloDDE()->getSampling();
214 if ((
cell->provenance() & 0x2000)) {
215 if (
cell->energy() > emax) {
216 emax =
cell->energy();
231 result.maxEcell_x = caloDDEl->
x();
232 result.maxEcell_y = caloDDEl->
y();
233 result.maxEcell_z = caloDDEl->
z();