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 if (!m_SGKey_taus.key().empty()) {
77 const std::string
key = m_SGKey_taus.key();
82 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_time");
83 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_energy");
84 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_gain");
85 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_onlId");
86 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_x");
87 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_y");
88 m_SGKey_taus_decorations.emplace_back(
key +
".maxEcell_z");
89 ATH_CHECK(m_SGKey_taus_decorations.initialize());
92 if (!m_SGKey_jets.key().empty()) {
93 const std::string
key = m_SGKey_jets.key();
98 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_time");
99 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_energy");
100 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_gain");
101 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_onlId");
102 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_x");
103 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_y");
104 m_SGKey_jets_decorations.emplace_back(
key +
".maxEcell_z");
105 ATH_CHECK(m_SGKey_jets_decorations.initialize());
108 return StatusCode::SUCCESS;
114 return StatusCode::SUCCESS;
121 const EventContext& ctx = Gaudi::Hive::currentContext();
123 if (!m_SGKey_photons.key().empty()) {
128 m_SGKey_photons_decorations[0], ctx);
130 m_SGKey_photons_decorations[1], ctx);
132 m_SGKey_photons_decorations[2], ctx);
134 m_SGKey_photons_decorations[3], ctx);
136 m_SGKey_photons_decorations[4], ctx);
138 m_SGKey_photons_decorations[5], ctx);
140 m_SGKey_photons_decorations[6], ctx);
143 for (
const auto*
egamma : *importedPhotons) {
146 decorateObject(cluster, ctx);
147 decorationPh0(*
egamma) =
res.maxEcell_time;
148 decorationPh1(*
egamma) =
res.maxEcell_energy;
149 decorationPh2(*
egamma) =
res.maxEcell_gain;
150 decorationPh3(*
egamma) =
res.maxEcell_onlId;
157 if (!m_SGKey_electrons.key().empty()) {
163 std::optional<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> odecorationEl7;
165 if (!m_SGKey_egammaClusters.key().empty()) {
167 m_SGKey_egammaClusters, ctx);
168 egClContainer = egClContainerRH.
ptr();
169 odecorationEl7.
emplace(m_SGKey_electrons_decorations[7], ctx);
174 m_SGKey_electrons_decorations[0], ctx);
176 m_SGKey_electrons_decorations[1], ctx);
178 m_SGKey_electrons_decorations[2], ctx);
180 m_SGKey_electrons_decorations[3], ctx);
182 m_SGKey_electrons_decorations[4], ctx);
184 m_SGKey_electrons_decorations[5], ctx);
186 m_SGKey_electrons_decorations[6], ctx);
189 for (
const auto*
egamma : *importedElectrons) {
191 if (!m_SGKey_egammaClusters.key().empty()) {
194 for (
const auto *clus : *egClContainer) {
195 double dR = clus->p4().DeltaR(cluster->
p4());
196 if (dR < dRMin && dR < m_dRLRTegClusegClusMax) {
198 matchedCluster = clus;
201 cluster = matchedCluster;
202 odecorationEl7.value()(*egamma) = dRMin;
205 decorateObject(cluster, ctx);
206 decorationEl0(*
egamma) =
res.maxEcell_time;
207 decorationEl1(*
egamma) =
res.maxEcell_energy;
208 decorationEl2(*
egamma) =
res.maxEcell_gain;
209 decorationEl3(*
egamma) =
res.maxEcell_onlId;
216 if (!m_SGKey_taus.key().empty()) {
221 m_SGKey_taus_decorations[0], ctx);
223 m_SGKey_taus_decorations[1], ctx);
225 m_SGKey_taus_decorations[2], ctx);
227 m_SGKey_taus_decorations[3], ctx);
229 m_SGKey_taus_decorations[4], ctx);
231 m_SGKey_taus_decorations[5], ctx);
233 m_SGKey_taus_decorations[6], ctx);
236 for (
const auto* tau : *importedTaus) {
238 res.maxEcell_energy = -9999.;
239 for (
size_t i = 0;
i<tau->nClusters();++
i) {
254 decorateObject(cluster, ctx);
260 decorationTau0(*tau) =
res.maxEcell_time;
261 decorationTau1(*tau) =
res.maxEcell_energy;
262 decorationTau2(*tau) =
res.maxEcell_gain;
263 decorationTau3(*tau) =
res.maxEcell_onlId;
264 decorationTau4(*tau) =
res.maxEcell_x;
265 decorationTau5(*tau) =
res.maxEcell_y;
266 decorationTau6(*tau) =
res.maxEcell_z;
270 if (!m_SGKey_jets.key().empty()) {
275 m_SGKey_jets_decorations[0], ctx);
277 m_SGKey_jets_decorations[1], ctx);
279 m_SGKey_jets_decorations[2], ctx);
281 m_SGKey_jets_decorations[3], ctx);
283 m_SGKey_jets_decorations[4], ctx);
285 m_SGKey_jets_decorations[5], ctx);
287 m_SGKey_jets_decorations[6], ctx);
290 for (
const auto*
jet : *importedJets) {
292 res.maxEcell_energy = -9999.;
293 std::vector<const xAOD::CaloCluster*> clusterList;
295 for (
auto part :
jet->getConstituents()) {
304 clusterList.push_back(cluster);
310 for (
unsigned int cidx=0;cidx<iPFO->
nCaloCluster();++cidx) {
312 clusterList.push_back(iPFO->
cluster(cidx));
320 for (
auto cluster : clusterList) {
322 decorateObject(cluster, ctx);
328 decorationJet0(*
jet) =
res.maxEcell_time;
329 decorationJet1(*
jet) =
res.maxEcell_energy;
330 decorationJet2(*
jet) =
res.maxEcell_gain;
331 decorationJet3(*
jet) =
res.maxEcell_onlId;
332 decorationJet4(*
jet) =
res.maxEcell_x;
333 decorationJet5(*
jet) =
res.maxEcell_y;
334 decorationJet6(*
jet) =
res.maxEcell_z;
338 return StatusCode::SUCCESS;
344 const EventContext& ctx)
const
358 ATH_MSG_ERROR(
"Do not have mapping object " << m_cablingKey.key());
364 const CaloCell* cell_maxE =
nullptr;
366 int sampling =
cell->caloDDE()->getSampling();
368 if ((
cell->provenance() & 0x2000)) {
369 if (
cell->energy() > emax) {
370 emax =
cell->energy();
385 result.maxEcell_x = caloDDEl->
x();
386 result.maxEcell_y = caloDDEl->
y();
387 result.maxEcell_z = caloDDEl->
z();