Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
eFEXFPGATowerIdProvider.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
16 #ifndef EFEXFPGATOWERIDPROVIDER_H
17 #define EFEXFPGATOWERIDPROVIDER_H
18 
21 #include <memory>
22 #include <string>
23 #include <unordered_map>
24 #include <vector>
25 
26 namespace LVL1 {
34 
38  struct towerinfo {
39  int eTowerID;
40  int eTowerEta;
41  int eTowerPhi;
42  };
43 
44 
45  public:
47  eFEXFPGATowerIdProvider(const std::string& type,const std::string& name,const IInterface* parent);
48 
51 
53  StatusCode initialize() override;
54 
56  StatusCode setAddress(const std::string& inputaddress) override;
57 
68  StatusCode getRankedTowerIDinFPGA(int eFEXID, int FPGAID, int(&towerlist)[10][6]) const override;
69 
79  StatusCode getRankedTowerIDineFEX(int eFEXID, int(&towerlist)[10][18]) const override;
80  bool ifhaveinputfile() const override;
81 
82  private:
83  bool m_hascsvfile{false};
84 
98  StatusCode rankTowerinFPGA(int FPGAindex) override;
99 
101  std::vector<std::unique_ptr<std::vector<int>>> m_towerrankingcache;
102 
104  std::unordered_map<int, std::unique_ptr<std::vector<towerinfo>> > m_alltowers;
105 
107  bool hasFPGA(int) const override;
108 
110  StatusCode loadcsv() override;
111 
121  int getFPGAIndex(int eFEXid, int FPGAid) const override;
122 
123  std::string m_csvaddress;
124 
125  // Gaudi::Property<std::string> m_csvaddress_setting { this, "path", "xxx", "path to csv" };
126  };
127 }
128 
129 #endif
LVL1::eFEXFPGATowerIdProvider::getRankedTowerIDinFPGA
StatusCode getRankedTowerIDinFPGA(int eFEXID, int FPGAID, int(&towerlist)[10][6]) const override
obtain ordered tower IDs in an FPGA
Definition: eFEXFPGATowerIdProvider.cxx:59
LVL1::eFEXFPGATowerIdProvider::~eFEXFPGATowerIdProvider
~eFEXFPGATowerIdProvider()
Destructor.
Definition: eFEXFPGATowerIdProvider.cxx:27
LVL1::eFEXFPGATowerIdProvider::m_alltowers
std::unordered_map< int, std::unique_ptr< std::vector< towerinfo > > > m_alltowers
Unordered tower Ids in each FPGAs. The index is the index of the FPGA.
Definition: eFEXFPGATowerIdProvider.h:104
IeFEXFPGATowerIdProvider.h
LVL1::eFEXFPGATowerIdProvider::initialize
StatusCode initialize() override
initialize the tool
Definition: eFEXFPGATowerIdProvider.cxx:18
LVL1::eFEXFPGATowerIdProvider::towerinfo
Sturcture defines the id, eta and phi position of a tower.
Definition: eFEXFPGATowerIdProvider.h:38
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFEXFPGATowerIdProvider::getRankedTowerIDineFEX
StatusCode getRankedTowerIDineFEX(int eFEXID, int(&towerlist)[10][18]) const override
obtain ordered tower IDs in an eFEX
Definition: eFEXFPGATowerIdProvider.cxx:83
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
LVL1::eFEXFPGATowerIdProvider
Provide tower-FPGA mapping Load information stored in a .csv file and provide the IDs of all towers i...
Definition: eFEXFPGATowerIdProvider.h:33
LVL1::eFEXFPGATowerIdProvider::m_towerrankingcache
std::vector< std::unique_ptr< std::vector< int > > > m_towerrankingcache
Ordered tower Ids in each FPGAs. The index is the index of the FPGA.
Definition: eFEXFPGATowerIdProvider.h:101
LVL1::eFEXFPGATowerIdProvider::towerinfo::eTowerPhi
int eTowerPhi
tower Phi index
Definition: eFEXFPGATowerIdProvider.h:41
LVL1::eFEXFPGATowerIdProvider::towerinfo::eTowerEta
int eTowerEta
tower Eta index
Definition: eFEXFPGATowerIdProvider.h:40
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
LVL1::eFEXFPGATowerIdProvider::ifhaveinputfile
bool ifhaveinputfile() const override
Definition: eFEXFPGATowerIdProvider.cxx:137
LVL1::eFEXFPGATowerIdProvider::setAddress
StatusCode setAddress(const std::string &inputaddress) override
set path to the csv file and load
Definition: eFEXFPGATowerIdProvider.cxx:33
TrigConf::name
Definition: HLTChainList.h:35
LVL1::eFEXFPGATowerIdProvider::towerinfo::eTowerID
int eTowerID
tower ID
Definition: eFEXFPGATowerIdProvider.h:39
LVL1::eFEXFPGATowerIdProvider::getFPGAIndex
int getFPGAIndex(int eFEXid, int FPGAid) const override
determine the index of an FPGA
Definition: eFEXFPGATowerIdProvider.cxx:276
LVL1::eFEXFPGATowerIdProvider::rankTowerinFPGA
StatusCode rankTowerinFPGA(int FPGAindex) override
rank the tower ids in an FPGA This function determines the order of towers in an FPGA.
Definition: eFEXFPGATowerIdProvider.cxx:141
LVL1::IeFEXFPGATowerIdProvider
Definition: IeFEXFPGATowerIdProvider.h:15
LVL1::eFEXFPGATowerIdProvider::loadcsv
StatusCode loadcsv() override
load the mapping info in the csv file
Definition: eFEXFPGATowerIdProvider.cxx:189
LVL1::eFEXFPGATowerIdProvider::hasFPGA
bool hasFPGA(int) const override
check if an FPGA exists in the csv file
Definition: eFEXFPGATowerIdProvider.cxx:183
LVL1::eFEXFPGATowerIdProvider::m_csvaddress
std::string m_csvaddress
path to the input csv file
Definition: eFEXFPGATowerIdProvider.h:123
LVL1::eFEXFPGATowerIdProvider::m_hascsvfile
bool m_hascsvfile
if the csv file is valid
Definition: eFEXFPGATowerIdProvider.h:83
LVL1::eFEXFPGATowerIdProvider::eFEXFPGATowerIdProvider
eFEXFPGATowerIdProvider(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: eFEXFPGATowerIdProvider.cxx:12
AthAlgTool
Definition: AthAlgTool.h:26