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 
13 // CaloCellDecorator.h, (c) ATLAS Detector software
15 
16 #ifndef DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
17 #define DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
18 
19 #include <string>
20 #include <vector>
21 
24 
25 #include "GaudiKernel/EventContext.h"
33 
34 namespace DerivationFramework {
35 
36 class CaloCellDecorator : public extends<AthAlgTool, IAugmentationTool>
37 {
38 
39 public:
40  using base_class::base_class;
41 
44  virtual StatusCode addBranches() const;
45 
47  {
48 
49  // Vector features, LAr only
50  std::vector<float> cells_E{};
51  std::vector<float> cells_time{};
52  std::vector<float> cells_eta{};
53  std::vector<float> cells_phi{};
54  std::vector<float> cells_x{};
55  std::vector<float> cells_y{};
56  std::vector<float> cells_z{};
57  std::vector<int> cells_gain{};
58  std::vector<int> cells_layer{};
59  std::vector<int> cells_quality{};
60  std::vector<uint64_t> cells_onlId{};
61 
62  // Total number of cells, LAr + Tile
63  int ncells = 0;
64 
65  };
66 
67 private:
68 
69  // LAr cabling
71  this,
72  "CablingKey",
73  "LArOnOffIdMap",
74  "SG Key of LArOnOffIdMapping object"
75  };
76 
77  // Photon containers
79  this,
80  "SGKey_photons",
81  "",
82  "SG key of photon container"
83  };
84 
87  this,
88  "SGKey_photons_decorations_noConf",
89  {},
90  "SG keys for photon decorations not really configurable"
91  };
92 
93  // Electron containers
95  this,
96  "SGKey_electrons",
97  "",
98  "SG key of electron container"
99  };
100 
103  this,
104  "SGKey_electrons_decorations_noConf",
105  {},
106  "SG keys for electrons decorations not really configurable"
107  };
108 
109  /* @brief Decorates e/gamma objects with vector cell features
110  * E, t, eta, phi, layer, x, y, z, gain, quality factor, and online ID
111  * for LAr cells. Tabulates the total number of cells in the topo
112  * cluster for both LAr and Tile.
113  */
117  const EventContext& ctx) const;
118 
119  /*
120  * @brief Loops through cells in an e/gamma topo cluster and adds
121  * them to vectors in output struct
122  */
123  cell_decorations getDecorations(
124  const xAOD::CaloCluster* cluster,
125  const EventContext& ctx) const;
126 };
127 
128 }
129 #endif // DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
DerivationFramework::CaloCellDecorator::cell_decorations::cells_phi
std::vector< float > cells_phi
Definition: CaloCellDecorator.h:53
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::CaloCellDecorator::cell_decorations::cells_y
std::vector< float > cells_y
Definition: CaloCellDecorator.h:55
IAugmentationTool.h
DerivationFramework::CaloCellDecorator::m_SGKey_photons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
Definition: CaloCellDecorator.h:78
DerivationFramework::CaloCellDecorator::~CaloCellDecorator
~CaloCellDecorator()
DerivationFramework::CaloCellDecorator::m_SGKey_electrons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
Definition: CaloCellDecorator.h:94
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
DerivationFramework::CaloCellDecorator::cell_decorations::cells_eta
std::vector< float > cells_eta
Definition: CaloCellDecorator.h:52
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:119
EgammaContainer.h
DerivationFramework::CaloCellDecorator::cell_decorations::ncells
int ncells
Definition: CaloCellDecorator.h:63
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
LArOnOffIdMapping.h
DerivationFramework::CaloCellDecorator::addBranches
virtual StatusCode addBranches() const
Definition: CaloCellDecorator.cxx:85
CaloCluster.h
DerivationFramework::CaloCellDecorator::initialize
StatusCode initialize()
Definition: CaloCellDecorator.cxx:29
DerivationFramework::CaloCellDecorator::cell_decorations::cells_E
std::vector< float > cells_E
Definition: CaloCellDecorator.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::CaloCellDecorator::cell_decorations::cells_onlId
std::vector< uint64_t > cells_onlId
Definition: CaloCellDecorator.h:60
DerivationFramework::CaloCellDecorator::cell_decorations::cells_time
std::vector< float > cells_time
Definition: CaloCellDecorator.h:51
AthAlgTool.h
DerivationFramework::CaloCellDecorator::m_SGKey_photons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
Definition: CaloCellDecorator.h:86
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::CaloCellDecorator::cell_decorations::cells_quality
std::vector< int > cells_quality
Definition: CaloCellDecorator.h:59
DerivationFramework::CaloCellDecorator
Definition: CaloCellDecorator.h:37
ReadCondHandleKey.h
DerivationFramework::CaloCellDecorator::cell_decorations::cells_layer
std::vector< int > cells_layer
Definition: CaloCellDecorator.h:58
DerivationFramework::CaloCellDecorator::cell_decorations::cells_gain
std::vector< int > cells_gain
Definition: CaloCellDecorator.h:57
SG::ReadCondHandleKey< LArOnOffIdMapping >
DerivationFramework::CaloCellDecorator::cell_decorations
Definition: CaloCellDecorator.h:47
DerivationFramework::CaloCellDecorator::cell_decorations::cells_z
std::vector< float > cells_z
Definition: CaloCellDecorator.h:56
WriteDecorHandleKeyArray.h
DerivationFramework::CaloCellDecorator::cell_decorations::cells_x
std::vector< float > cells_x
Definition: CaloCellDecorator.h:54
CaloClusterContainer.h
DerivationFramework::CaloCellDecorator::m_SGKey_electrons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
Definition: CaloCellDecorator.h:102
DerivationFramework::CaloCellDecorator::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: CaloCellDecorator.h:70
DerivationFramework::CaloCellDecorator::getDecorations
cell_decorations getDecorations(const xAOD::CaloCluster *cluster, const EventContext &ctx) const
Definition: CaloCellDecorator.cxx:181