ATLAS Offline Software
GlobalCellTowerAlgTool.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 #ifndef GLOBALSIM_GLOBALCELLTOWERALGTOOL_H
6 #define GLOBALSIM_GLOBALCELLTOWERALGTOOL_H
7 
8 /*
9  This algorithm simulates the cell towers for the Global Trigger. Input is taken only from LAr cells contained in the
10  GlobalLArCellContainer. Tile cells are not included for now. Cells are placed in towers based on their eta and phi
11  positions and written out as a GenericTOB.
12 */
13 
15 #include "GaudiKernel/ToolHandle.h"
16 
17 #include "../../IGlobalSimAlgTool.h"
18 #include "../Hypothesis/UCL/GenericTob.h"
19 
20 #include <bitset>
21 #include <string>
22 #include <cassert>
23 
24 namespace GlobalSim {
25 
26  class GlobalLArCell;
27  class GlobalLArCellContainer;
28  class GenericTob;
29 
30  class GlobalCellTowerAlgTool: public extends<AthAlgTool, IGlobalSimAlgTool> {
31 
32  public:
33 
35  GlobalCellTowerAlgTool(const std::string& type, const std::string& name, const IInterface* parent);
36 
38  ~GlobalCellTowerAlgTool() override = default;
39 
41  virtual StatusCode initialize() override;
42 
44  virtual StatusCode run(const EventContext& ctx) const override;
45 
47  static std::string toBinary(int value, int width) {
48  assert(width <= 32);
49  return std::bitset<32>(value).to_string().substr(32 - width);
50  }
51 
53  static std::string makeTowerBits(int energy, int etaBin, int phiBin);
54 
56  virtual std::string toString() const override;
57 
58  private:
59 
61  SG::ReadHandleKey<GlobalSim::GlobalLArCellContainer> m_gblLArCellContainerKey {this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"};
62 
64  SG::WriteHandleKey<GenericTobContainer> m_gblCellTowers {this, "GlobalCellTowersKey", "GlobalCellTowers", "Key to the container of generic TOBS containing the cell towers"};
65 
66  };
67 
68 } // namespace GlobalSim
69 
70 #endif
GlobalSim::GlobalCellTowerAlgTool::m_gblLArCellContainerKey
SG::ReadHandleKey< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerKey
Key to the GlobalLArCellContainer.
Definition: GlobalCellTowerAlgTool.h:61
GlobalSim::GlobalCellTowerAlgTool::toBinary
static std::string toBinary(int value, int width)
Helper function to convert floating point values into a bitstream.
Definition: GlobalCellTowerAlgTool.h:47
athena.value
value
Definition: athena.py:124
SG::ReadHandleKey< GlobalSim::GlobalLArCellContainer >
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:149
SG::WriteHandleKey< GenericTobContainer >
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GlobalSim::GlobalCellTowerAlgTool::m_gblCellTowers
SG::WriteHandleKey< GenericTobContainer > m_gblCellTowers
Write key for the output cell towers as a GenericTobContainer.
Definition: GlobalCellTowerAlgTool.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:145
GlobalSim::GlobalCellTowerAlgTool::~GlobalCellTowerAlgTool
~GlobalCellTowerAlgTool() override=default
Main destructor (explicitly defaulted)
GlobalSim::GlobalCellTowerAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Main functional block running for each event.
Definition: GlobalCellTowerAlgTool.cxx:28
GlobalSim::GlobalCellTowerAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition: GlobalCellTowerAlgTool.cxx:18
GlobalSim::GlobalCellTowerAlgTool::makeTowerBits
static std::string makeTowerBits(int energy, int etaBin, int phiBin)
Function which assembles the TOB bitstream for a tower.
Definition: GlobalCellTowerAlgTool.cxx:81
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
GlobalSim::GlobalCellTowerAlgTool
Definition: GlobalCellTowerAlgTool.h:30
GlobalSim::GlobalCellTowerAlgTool::toString
virtual std::string toString() const override
Overriding toString function from base class.
Definition: GlobalCellTowerAlgTool.cxx:90
GlobalSim::GlobalCellTowerAlgTool::GlobalCellTowerAlgTool
GlobalCellTowerAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Main constructor.
Definition: GlobalCellTowerAlgTool.cxx:12