47 return StatusCode::SUCCESS;
56 if (!m_SGKey_photons.key().empty()) {
61 m_SGKey_photons_decorations[0], ctx);
63 m_SGKey_photons_decorations[1], ctx);
65 m_SGKey_photons_decorations[2], ctx);
67 m_SGKey_photons_decorations[3], ctx);
69 m_SGKey_photons_decorations[4], ctx);
71 m_SGKey_photons_decorations[5], ctx);
73 m_SGKey_photons_decorations[6], ctx);
76 for (
const auto*
egamma : *importedPhotons) {
79 decorateObject(cluster, ctx);
80 decorationPh0(*
egamma) =
res.maxEcell_time;
81 decorationPh1(*
egamma) =
res.maxEcell_energy;
82 decorationPh2(*
egamma) =
res.maxEcell_gain;
83 decorationPh3(*
egamma) =
res.maxEcell_onlId;
90 if (!m_SGKey_electrons.key().empty()) {
96 std::optional<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> odecorationEl7;
98 if (!m_SGKey_egammaClusters.key().empty()) {
100 m_SGKey_egammaClusters, ctx);
101 egClContainer = egClContainerRH.
ptr();
102 odecorationEl7.
emplace(m_SGKey_electrons_decorations[7], ctx);
107 m_SGKey_electrons_decorations[0], ctx);
109 m_SGKey_electrons_decorations[1], ctx);
111 m_SGKey_electrons_decorations[2], ctx);
113 m_SGKey_electrons_decorations[3], ctx);
115 m_SGKey_electrons_decorations[4], ctx);
117 m_SGKey_electrons_decorations[5], ctx);
119 m_SGKey_electrons_decorations[6], ctx);
122 for (
const auto*
egamma : *importedElectrons) {
124 if (!m_SGKey_egammaClusters.key().empty()) {
127 for (
const auto *clus : *egClContainer) {
128 double dR = clus->p4().DeltaR(cluster->
p4());
129 if (dR < dRMin && dR < m_dRLRTegClusegClusMax) {
131 matchedCluster = clus;
134 cluster = matchedCluster;
135 odecorationEl7.value()(*egamma) = dRMin;
138 decorateObject(cluster, ctx);
139 decorationEl0(*
egamma) =
res.maxEcell_time;
140 decorationEl1(*
egamma) =
res.maxEcell_energy;
141 decorationEl2(*
egamma) =
res.maxEcell_gain;
142 decorationEl3(*
egamma) =
res.maxEcell_onlId;
149 if (!m_SGKey_taus.key().empty()) {
154 m_SGKey_taus_decorations[0], ctx);
156 m_SGKey_taus_decorations[1], ctx);
158 m_SGKey_taus_decorations[2], ctx);
160 m_SGKey_taus_decorations[3], ctx);
162 m_SGKey_taus_decorations[4], ctx);
164 m_SGKey_taus_decorations[5], ctx);
166 m_SGKey_taus_decorations[6], ctx);
169 for (
const auto* tau : *importedTaus) {
171 res.maxEcell_energy = -9999.;
172 for (
size_t i = 0;
i<tau->nClusters();++
i) {
187 decorateObject(cluster, ctx);
193 decorationTau0(*tau) =
res.maxEcell_time;
194 decorationTau1(*tau) =
res.maxEcell_energy;
195 decorationTau2(*tau) =
res.maxEcell_gain;
196 decorationTau3(*tau) =
res.maxEcell_onlId;
197 decorationTau4(*tau) =
res.maxEcell_x;
198 decorationTau5(*tau) =
res.maxEcell_y;
199 decorationTau6(*tau) =
res.maxEcell_z;
203 if (!m_SGKey_jets.key().empty()) {
208 m_SGKey_jets_decorations[0], ctx);
210 m_SGKey_jets_decorations[1], ctx);
212 m_SGKey_jets_decorations[2], ctx);
214 m_SGKey_jets_decorations[3], ctx);
216 m_SGKey_jets_decorations[4], ctx);
218 m_SGKey_jets_decorations[5], ctx);
220 m_SGKey_jets_decorations[6], ctx);
223 for (
const auto*
jet : *importedJets) {
224 if (
jet->numConstituents() == 0)
continue;
227 res.maxEcell_energy = -9999.;
228 std::vector<const xAOD::CaloCluster*> clusterList;
235 for (
size_t i=0;
i<
jet->numConstituents();++
i) {
237 ATH_MSG_WARNING(
"Tried to call fillEperSamplingFE with a jet constituent that is not a FlowElement!");
244 auto originalFE =
dynamic_cast<const xAOD::FlowElement*
>(*originalObject(*constit));
245 if(originalFE && !originalFE->isCharged()){
248 clusterList.push_back(cluster);
255 for (
size_t i=0;
i<
jet->numConstituents();++
i) {
257 ATH_MSG_WARNING(
"Tried to call fillEperSamplingCluster with a jet constituent that is not a cluster!");
263 clusterList.push_back(cluster);
268 for (
size_t i=0;
i<
jet->numConstituents();++
i) {
274 for (
unsigned int cidx=0;cidx<iPFO->
nCaloCluster();++cidx) {
276 clusterList.push_back(iPFO->
cluster(cidx));
283 for (
auto cluster : clusterList) {
285 decorateObject(cluster, ctx);
291 decorationJet0(*
jet) =
res.maxEcell_time;
292 decorationJet1(*
jet) =
res.maxEcell_energy;
293 decorationJet2(*
jet) =
res.maxEcell_gain;
294 decorationJet3(*
jet) =
res.maxEcell_onlId;
295 decorationJet4(*
jet) =
res.maxEcell_x;
296 decorationJet5(*
jet) =
res.maxEcell_y;
297 decorationJet6(*
jet) =
res.maxEcell_z;
301 return StatusCode::SUCCESS;
307 const EventContext& ctx)
const
321 ATH_MSG_ERROR(
"Do not have mapping object " << m_cablingKey.key());
327 const CaloCell* cell_maxE =
nullptr;
329 int sampling =
cell->caloDDE()->getSampling();
331 if ((
cell->provenance() & 0x2000)) {
332 if (
cell->energy() > emax) {
333 emax =
cell->energy();
348 result.maxEcell_x = caloDDEl->
x();
349 result.maxEcell_y = caloDDEl->
y();
350 result.maxEcell_z = caloDDEl->
z();