ATLAS Offline Software
GainDecorator.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 // Decorate egamma objects with the energy and number of cells per layer per
6 // gain
7 
8 #ifndef DERIVATIONFRAMEWORK_GainDecorator_H
9 #define DERIVATIONFRAMEWORK_GainDecorator_H
10 
11 
14 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 class CaloCell;
23 
24 namespace DerivationFramework {
25 
26  class GainDecorator : public extends<AthAlgTool, IAugmentationTool>
27  {
28  public:
29 
30  using base_class::base_class;
31 
32  virtual StatusCode initialize() override final;
33  virtual StatusCode addBranches(const EventContext& ctx) const override final;
34  static int getLayer(const CaloCell* cell); // TODO Why is this public?
35 
36  struct calculation
37  {
38  std::map<std::pair<int, int>, float> EnoW;
39  std::map<std::pair<int, int>, float> E;
40  std::map<std::pair<int, int>, uint8_t> nCells;
41  };
42 
43  private:
45  this, "SGKey_photons", "", "SG key of photon container" };
46 
48  this, "SGKey_electrons", "", "SG key of electron container" };
49 
50  Gaudi::Property< std::map<int, std::string> > m_gainNames{this, "gain_names",
51  { { CaloGain::LARHIGHGAIN, "Hi" },
52  { CaloGain::LARMEDIUMGAIN, "Med" },
53  { CaloGain::LARLOWGAIN, "Low" } } };
54  Gaudi::Property< std::vector<unsigned int> > m_layers{this, "layers", { 0, 1, 2, 3 }};
55 
56  // // Name of the decorations
57  std::vector<std::pair<int, int>> m_names_E;
58 
61  this,
62  "SGKey_photons_decorations",
63  m_SGKey_photons, {},
64  "SG keys for photon decorations not really configurable"
65  };
66 
69  this,
70  "SGKey_electrons_decorations",
72  "SG keys for electrons decorations not really configurable"
73  };
74 
75  calculation decorateObject(const xAOD::Egamma*& egamma) const;
76  };
77 }
78 
79 #endif // DERIVATIONFRAMEWORK_GainDecorator_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
DerivationFramework::GainDecorator::m_SGKey_photons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
Definition: GainDecorator.h:60
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:553
DerivationFramework::GainDecorator
Definition: GainDecorator.h:27
DerivationFramework::GainDecorator::m_SGKey_electrons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
Definition: GainDecorator.h:68
DerivationFramework::GainDecorator::m_layers
Gaudi::Property< std::vector< unsigned int > > m_layers
Definition: GainDecorator.h:54
IAugmentationTool.h
DerivationFramework::GainDecorator::calculation::nCells
std::map< std::pair< int, int >, uint8_t > nCells
Definition: GainDecorator.h:40
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::GainDecorator::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition: GainDecorator.cxx:51
egamma
Definition: egamma.h:58
DerivationFramework::GainDecorator::calculation::EnoW
std::map< std::pair< int, int >, float > EnoW
Definition: GainDecorator.h:38
EgammaContainer.h
DerivationFramework::GainDecorator::calculation
Definition: GainDecorator.h:37
DerivationFramework::GainDecorator::getLayer
static int getLayer(const CaloCell *cell)
Definition: GainDecorator.cxx:183
DerivationFramework::GainDecorator::m_SGKey_photons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
Definition: GainDecorator.h:44
DerivationFramework::GainDecorator::initialize
virtual StatusCode initialize() override final
Definition: GainDecorator.cxx:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::GainDecorator::m_gainNames
Gaudi::Property< std::map< int, std::string > > m_gainNames
Definition: GainDecorator.h:50
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::GainDecorator::calculation::E
std::map< std::pair< int, int >, float > E
Definition: GainDecorator.h:39
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
WriteDecorHandleKeyArray.h
DerivationFramework::GainDecorator::m_SGKey_electrons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
Definition: GainDecorator.h:47
DerivationFramework::GainDecorator::m_names_E
std::vector< std::pair< int, int > > m_names_E
Definition: GainDecorator.h:57
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
DerivationFramework::GainDecorator::decorateObject
calculation decorateObject(const xAOD::Egamma *&egamma) const
Definition: GainDecorator.cxx:145