ATLAS Offline Software
GainDecorator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // GainDecorator.h, (c) ATLAS Detector software
8 // Decorate egamma objects with the energy and number of cells per layer per
9 // gain
10 
11 #ifndef DERIVATIONFRAMEWORK_GainDecorator_H
12 #define DERIVATIONFRAMEWORK_GainDecorator_H
13 
14 #include <map>
15 #include <string>
16 
19 
20 #include "CaloEvent/CaloCell.h"
24 
25 namespace DerivationFramework {
26 
28  : public AthAlgTool
29  , public IAugmentationTool
30 {
31 public:
32  GainDecorator(const std::string& t,
33  const std::string& n,
34  const IInterface* p);
38  virtual StatusCode addBranches() const;
39  static int getLayer(const CaloCell* cell);
40 
41  struct calculation
42  {
43  std::map<std::pair<int, int>, float> EnoW;
44  std::map<std::pair<int, int>, float> E;
45  std::map<std::pair<int, int>, uint8_t> nCells;
46  };
47 
48 private:
50  m_SGKey_photons{ this, "SGKey_photons", "", "SG key of photon container" };
51 
53  this,
54  "SGKey_electrons",
55  "",
56  "SG key of electron container"
57  };
58 
59  std::string m_decorationPattern;
60  std::map<int, std::string> m_gainNames;
61  std::vector<unsigned int> m_layers;
62 
63  // Name of the decorations
64  std::map<std::pair<int, int>, std::string> m_names_E;
65  std::map<std::pair<int, int>, std::string> m_names_rnoW;
66  std::map<std::pair<int, int>, std::string> m_names_nCells;
67 
70  this,
71  "SGKey_photons_decorations_noConf",
72  {},
73  "SG keys for photon decorations not really configurable"
74  };
75 
78  this,
79  "SGKey_electrons_decorations_noConf",
80  {},
81  "SG keys for electrons decorations not really configurable"
82  };
83 
84  calculation decorateObject(const xAOD::Egamma*& egamma) const;
85 };
86 }
87 
88 #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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
DerivationFramework::GainDecorator::m_SGKey_photons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
Definition: GainDecorator.h:69
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
DerivationFramework::GainDecorator
Definition: GainDecorator.h:30
DerivationFramework::GainDecorator::m_SGKey_electrons_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
Definition: GainDecorator.h:77
DerivationFramework::GainDecorator::finalize
StatusCode finalize()
Definition: GainDecorator.cxx:122
IAugmentationTool.h
DerivationFramework::GainDecorator::GainDecorator
GainDecorator(const std::string &t, const std::string &n, const IInterface *p)
Definition: GainDecorator.cxx:22
DerivationFramework::GainDecorator::calculation::nCells
std::map< std::pair< int, int >, uint8_t > nCells
Definition: GainDecorator.h:45
CaloCell.h
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
DerivationFramework::GainDecorator::m_names_E
std::map< std::pair< int, int >, std::string > m_names_E
Definition: GainDecorator.h:64
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
egamma
Definition: egamma.h:58
DerivationFramework::GainDecorator::calculation::EnoW
std::map< std::pair< int, int >, float > EnoW
Definition: GainDecorator.h:43
EgammaContainer.h
DerivationFramework::GainDecorator::calculation
Definition: GainDecorator.h:42
DerivationFramework::GainDecorator::m_names_rnoW
std::map< std::pair< int, int >, std::string > m_names_rnoW
Definition: GainDecorator.h:65
DerivationFramework::GainDecorator::getLayer
static int getLayer(const CaloCell *cell)
Definition: GainDecorator.cxx:277
DerivationFramework::GainDecorator::m_decorationPattern
std::string m_decorationPattern
Definition: GainDecorator.h:59
DerivationFramework::GainDecorator::m_SGKey_photons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
Definition: GainDecorator.h:50
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::GainDecorator::~GainDecorator
~GainDecorator()
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::GainDecorator::calculation::E
std::map< std::pair< int, int >, float > E
Definition: GainDecorator.h:44
DerivationFramework::GainDecorator::m_names_nCells
std::map< std::pair< int, int >, std::string > m_names_nCells
Definition: GainDecorator.h:66
DerivationFramework::GainDecorator::m_gainNames
std::map< int, std::string > m_gainNames
Definition: GainDecorator.h:60
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
DerivationFramework::GainDecorator::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: GainDecorator.cxx:130
WriteDecorHandleKeyArray.h
DerivationFramework::GainDecorator::m_SGKey_electrons
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
Definition: GainDecorator.h:52
DerivationFramework::GainDecorator::initialize
StatusCode initialize()
Definition: GainDecorator.cxx:70
AthAlgTool
Definition: AthAlgTool.h:26
DerivationFramework::GainDecorator::m_layers
std::vector< unsigned int > m_layers
Definition: GainDecorator.h:61
DerivationFramework::GainDecorator::decorateObject
calculation decorateObject(const xAOD::Egamma *&egamma) const
Definition: GainDecorator.cxx:239