27 declareProperty(
"layers",
m_layers = { 0, 1, 2, 3 });
41 if (m_SGKey_photons.empty() and m_SGKey_electrons.empty()) {
42 ATH_MSG_FATAL(
"No e-gamma collection provided for thinning. At least one "
43 "egamma collection (photons/electrons) must be provided!");
44 return StatusCode::FAILURE;
47 ATH_CHECK(m_caloFillRectangularTool.retrieve());
53 &(*m_caloFillRectangularTool));
54 if (m_tool==
nullptr) {
55 ATH_MSG_ERROR(
"Pointer to CaloFillRectantularCluster tool is invalid");
56 return StatusCode::FAILURE;
59 ATH_CHECK(m_SGKey_caloCells.initialize());
61 if (!m_SGKey_electrons.key().empty()) {
62 ATH_MSG_DEBUG(
"Using " << m_SGKey_electrons <<
" for electrons");
63 ATH_CHECK(m_SGKey_electrons.initialize());
65 const char* containerKey = m_SGKey_electrons.key().c_str();
66 for (
int layer : m_layers) {
67 m_SGKey_electrons_decorations.emplace_back(
68 Form(
"%s.E%dx%d_Lr%d", containerKey, m_eta_size, m_phi_size,
layer));
70 ATH_CHECK(m_SGKey_electrons_decorations.initialize());
73 if (!m_SGKey_photons.key().empty()) {
77 const char* containerKey = m_SGKey_photons.key().c_str();
78 for (
int layer : m_layers) {
79 m_SGKey_photons_decorations.emplace_back(
80 Form(
"%s.E%dx%d_Lr%d", containerKey, m_eta_size, m_phi_size,
layer));
82 ATH_CHECK(m_SGKey_photons_decorations.initialize());
85 return StatusCode::SUCCESS;
92 return StatusCode::SUCCESS;
107 if (!m_SGKey_photons.key().empty()) {
114 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decorations;
115 for (
unsigned int i = 0;
i < m_layers.size();
i++) {
116 decorations.emplace_back(
118 m_SGKey_photons_decorations[
i], ctx);
122 for (
const auto*
photon : *importedPhotons) {
123 std::vector<float>
result = decorateObject(ctx,
photon, cellCont);
124 for (
unsigned int i = 0;
i < m_layers.size();
i++) {
125 decorations[
i](*photon) =
result[
i];
132 if (!m_SGKey_electrons.key().empty()) {
140 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decorations;
141 for (
unsigned int i = 0;
i < m_layers.size();
i++) {
142 decorations.emplace_back(
144 m_SGKey_electrons_decorations[
i], ctx);
148 for (
const auto*
electron : *importedElectrons) {
149 std::vector<float>
result = decorateObject(ctx,
electron, cellCont);
150 for (
unsigned int i = 0;
i < m_layers.size();
i++) {
151 decorations[
i](*electron) =
result[
i];
156 return StatusCode::SUCCESS;
161 const EventContext& ctx,
165 std::vector<float>
result;
170 std::unique_ptr<xAOD::CaloCluster> egcClone;
174 egamma->caloCluster()->eta0(),
175 egamma->caloCluster()->phi0(),
176 egamma->caloCluster()->clusterSize());
177 m_tool->makeCorrection(ctx, egcClone.get());
180 for (
unsigned int layer : m_layers) {