ATLAS Offline Software
CaloCellDecorator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * @file DerivationFrameworkCalo/DerivationFrameworkCalo/CaloCellDecorator.h
7  * @author Gabriel P. Matos <gpinheir@cern.ch>, adapted from MaxCellDecorator by Nikiforos K. Nikiforou and others.
8  * @date Aug, 2025
9  * @brief Adds cell-level features as decorations to e/gamma objects.
10  */
11 
12 #ifndef DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
13 #define DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
14 
15 #include <string>
16 #include <vector>
17 
20 
21 #include "GaudiKernel/EventContext.h"
29 
30 namespace DerivationFramework {
31 
32  class CaloCellDecorator : public extends<AthAlgTool, IAugmentationTool>
33  {
34 
35  public:
36  using base_class::base_class;
37 
39  virtual StatusCode initialize() override final;
40  virtual StatusCode addBranches(const EventContext& ctx) const override final;
41 
43  {
44 
45  // Vector features, LAr only
46  std::vector<float> cells_E{};
47  std::vector<float> cells_time{};
48  std::vector<float> cells_eta{};
49  std::vector<float> cells_phi{};
50  std::vector<float> cells_x{};
51  std::vector<float> cells_y{};
52  std::vector<float> cells_z{};
53  std::vector<int> cells_gain{};
54  std::vector<int> cells_layer{};
55  std::vector<int> cells_quality{};
56  std::vector<uint64_t> cells_onlId{};
57 
58  // Total number of cells, LAr + Tile
59  int ncells = 0;
60 
61  };
62 
63  private:
64 
65  // LAr cabling
67  this,
68  "CablingKey",
69  "LArOnOffIdMap",
70  "SG Key of LArOnOffIdMapping object"
71  };
72 
73  // Photon containers
75  this,
76  "SGKey_photons",
77  "",
78  "SG key of photon container"
79  };
80 
83  this,
84  "SGKey_photons_decorations",
86  "cells_E", "cells_time", "cells_eta", "cells_phi",
87  "cells_x", "cells_y", "cells_z", "cells_gain",
88  "cells_layer", "cells_quality", "cells_onlId", "ncells"},
89  "SG keys for photon decorations"
90  };
91 
92  // Electron containers
94  this,
95  "SGKey_electrons",
96  "",
97  "SG key of electron container"
98  };
99 
102  this,
103  "SGKey_electrons_decorations",
105  "cells_E", "cells_time", "cells_eta", "cells_phi",
106  "cells_x", "cells_y", "cells_z", "cells_gain",
107  "cells_layer", "cells_quality", "cells_onlId", "ncells"},
108  "SG keys for electrons decorations"
109  };
110 
111  /* @brief Decorates e/gamma objects with vector cell features
112  * E, t, eta, phi, layer, x, y, z, gain, quality factor, and online ID
113  * for LAr cells. Tabulates the total number of cells in the topo
114  * cluster for both LAr and Tile.
115  */
119  const EventContext& ctx) const;
120 
121  /*
122  * @brief Loops through cells in an e/gamma topo cluster and adds
123  * them to vectors in output struct
124  */
125  cell_decorations getDecorations(
126  const xAOD::CaloCluster* cluster,
127  const EventContext& ctx) const;
128  };
129 
130 }
131 #endif // DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::CaloCellDecorator::initialize
virtual StatusCode initialize() override final
Definition: CaloCellDecorator.cxx:25
IAugmentationTool.h
DerivationFramework::CaloCellDecorator::m_SGKey_photons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
Definition: CaloCellDecorator.h:74
DerivationFramework::CaloCellDecorator::~CaloCellDecorator
~CaloCellDecorator()
DerivationFramework::CaloCellDecorator::m_SGKey_electrons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
Definition: CaloCellDecorator.h:93
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::CaloCellDecorator::decorateCells
StatusCode decorateCells(const SG::ReadHandleKey< xAOD::EgammaContainer > &contKey, const SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > &decorKeys, const EventContext &ctx) const
Definition: CaloCellDecorator.cxx:83
EgammaContainer.h
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
LArOnOffIdMapping.h
CaloCluster.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::CaloCellDecorator::m_SGKey_photons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
Definition: CaloCellDecorator.h:82
DerivationFramework::CaloCellDecorator::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition: CaloCellDecorator.cxx:50
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::CaloCellDecorator
Definition: CaloCellDecorator.h:33
ReadCondHandleKey.h
SG::ReadCondHandleKey< LArOnOffIdMapping >
DerivationFramework::CaloCellDecorator::cell_decorations
Definition: CaloCellDecorator.h:43
WriteDecorHandleKeyArray.h
CaloClusterContainer.h
DerivationFramework::CaloCellDecorator::m_SGKey_electrons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
Definition: CaloCellDecorator.h:101
DerivationFramework::CaloCellDecorator::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: CaloCellDecorator.h:66
DerivationFramework::CaloCellDecorator::getDecorations
cell_decorations getDecorations(const xAOD::CaloCluster *cluster, const EventContext &ctx) const
Definition: CaloCellDecorator.cxx:145