ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
16#ifndef DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
17#define DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
18
19#include <cstdint>
20#include <string>
21#include <vector>
22
24#include "GaudiKernel/EventContext.h"
25
29
31
34
37
38// Cell timing recovery tool
41
42namespace DerivationFramework {
43
44 class CaloCellDecorator : public extends<AthAlgTool, IAugmentationTool>
45 {
46
47 public:
48 using base_class::base_class;
49
51 virtual StatusCode initialize() override final;
52 virtual StatusCode addBranches(const EventContext& ctx) const override final;
53
54 private:
55
56 // LAr cabling
57 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{
58 this,
59 "CablingKey",
60 "LArOnOffIdMap",
61 "SG Key of LArOnOffIdMapping object"
62 };
63
64 // Photon container
66 { this, "SGKey_photons", "", "SG key of photon container" };
67
68 // Electron container
70 { this, "SGKey_electrons", "", "SG key of electron container" };
71
72 // Calo cell container
74 { this, "SGKey_CaloCells", "AllCalo", "SG key of calo cell container" };
75
76 // Calo detector description manager
78 this,
79 "CaloDetDescrManager",
80 "CaloDetDescrManager",
81 "SG Key for CaloDetDescrManager in the Condition Store"
82 };
83
84 // Photon decorators
87 this,
88 "SGKey_photons_decorations",
89 m_SGKey_photons, { "cells_E", "cells_time", "cells_eta", "cells_phi",
90 "cells_x", "cells_y", "cells_z", "cells_gain",
91 "cells_layer", "cells_quality", "cells_onlId", "cells_clusterOriginInfo" } ,
92 "SG keys for photon decorations"
93 };
94
95 // Electron decorators
98 this,
99 "SGKey_electrons_decorations",
100 m_SGKey_electrons, { "cells_E", "cells_time", "cells_eta", "cells_phi",
101 "cells_x", "cells_y", "cells_z", "cells_gain",
102 "cells_layer", "cells_quality", "cells_onlId", "cells_clusterOriginInfo" } ,
103 "SG keys for electrons decorations"
104 };
105
107 ToolHandle<IegammaCellRecoveryTool> m_egammaCellRecoveryTool{
108 this,
109 "egammaCellRecoveryTool",
110 "egammaCellRecoveryTool/egammaCellRecoveryTool",
111 "Optional tool that adds cells in L2 or L3 "
112 "that could have been rejected by timing cut"
113 };
114
116 ToolHandle<IegammaLargeClusterCellRecoveryTool> m_egammaLargeClusterCellRecoveryTool{
117 this,
118 "egammaLargeClusterCellRecoveryTool",
119 "",
120 "Optional tool that collects cells in a 7x11 cluster around the hottest cell"
121 };
122
125 {
126 std::vector<float> cells_E{};
127 std::vector<float> cells_time{};
128 std::vector<float> cells_eta{};
129 std::vector<float> cells_phi{};
130 std::vector<float> cells_x{};
131 std::vector<float> cells_y{};
132 std::vector<float> cells_z{};
133 std::vector<int> cells_gain{};
134 std::vector<int> cells_layer{};
135 std::vector<int> cells_quality{};
136 std::vector<uint64_t> cells_onlId{};
137 std::vector<uint8_t> cells_clusterOriginInfo{};
138 };
139
149 uint8_t mask = 0x0;
150 size_t index = -1;
151 };
152
160 StatusCode decorateCells(
163 const EventContext& ctx) const;
164
167 const xAOD::CaloCluster* cluster,
168 const CaloCellContainer* caloCells,
169 const CaloDetDescrManager* cmgr,
170 const EventContext& ctx) const;
171
173 inline int layerFromSampling(int s) const {
174
175 // LAr EMB and EMEC
176 if (s == CaloCell_ID::PreSamplerB || s == CaloCell_ID::PreSamplerE) return 0;
177 if (s == CaloCell_ID::EMB1 || s == CaloCell_ID::EME1) return 1;
178 if (s == CaloCell_ID::EMB2 || s == CaloCell_ID::EME2) return 2;
179 if (s == CaloCell_ID::EMB3 || s == CaloCell_ID::EME3) return 3;
180
181 // Anything else
182 return -1;
183 }
184 };
185
186}
187#endif // DERIVATIONFRAMEWORK_CALOCELLDECORATOR_H
Definition of CaloDetDescrManager.
Property holding a SG store/key/clid from which a ReadHandle is made.
Container class for CaloCell.
This class provides the client interface for accessing the detector description information common to...
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
ToolHandle< IegammaLargeClusterCellRecoveryTool > m_egammaLargeClusterCellRecoveryTool
Pointer to egammaLargeClusterCellRecoveryTool.
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
StatusCode decorateCells(const SG::ReadHandleKey< xAOD::EgammaContainer > &contKey, const SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > &decorKeys, const EventContext &ctx) const
Decorates e/gamma objects with vector cell features E, t, eta, phi, layer, x, y, z,...
CellDecorationData getDecorations(const xAOD::CaloCluster *cluster, const CaloCellContainer *caloCells, const CaloDetDescrManager *cmgr, const EventContext &ctx) const
Loops through cells and adds to decoration struct.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
int layerFromSampling(int s) const
Inline to get calorimeter sampling.
virtual StatusCode initialize() override final
SG::ReadHandleKey< CaloCellContainer > m_SGKey_CaloCells
Property holding a SG store/key/clid from which a ReadHandle is made.
THE reconstruction tool.
Forward declaration.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
Definition index.py:1
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Struct to keep track of where cell came from e.g.
#define private