ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
16#ifndef EFEXFPGATOWERIDPROVIDER_H
17#define EFEXFPGATOWERIDPROVIDER_H
18
19
21#include <memory>
22#include <string>
23#include <unordered_map>
24#include <vector>
25
26namespace LVL1 {
33 static const InterfaceID IID_IIeFEXFPGATowerIdProvider("LVL1::eFEXFPGATowerIdProvider", 1 , 0);
34
36
40 struct towerinfo {
44 };
45
46
47 public:
48 static const InterfaceID& interfaceID() { return IID_IIeFEXFPGATowerIdProvider; };
50 eFEXFPGATowerIdProvider(const std::string& type,const std::string& name,const IInterface* parent);
51
54
56 StatusCode initialize();
57
59 StatusCode setAddress(const std::string& inputaddress);
60
71 StatusCode getRankedTowerIDinFPGA(int eFEXID, int FPGAID, int(&towerlist)[10][6]) const;
72
82 StatusCode getRankedTowerIDineFEX(int eFEXID, int(&towerlist)[10][18]) const;
83 bool ifhaveinputfile() const;
84
85 private:
86 bool m_hascsvfile{false};
87
101 StatusCode rankTowerinFPGA(int FPGAindex);
102
104 std::vector<std::unique_ptr<std::vector<int>>> m_towerrankingcache;
105
107 std::unordered_map<int, std::unique_ptr<std::vector<towerinfo>> > m_alltowers;
108
110 bool hasFPGA(int) const;
111
113 StatusCode loadcsv();
114
124 int getFPGAIndex(int eFEXid, int FPGAid) const;
125
126 std::string m_csvaddress;
127
128 // Gaudi::Property<std::string> m_csvaddress_setting { this, "path", "xxx", "path to csv" };
129 };
130}
131
132#endif
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
StatusCode loadcsv()
load the mapping info in the csv file
bool hasFPGA(int) const
check if an FPGA exists in the csv file
std::vector< std::unique_ptr< std::vector< int > > > m_towerrankingcache
Ordered tower Ids in each FPGAs. The index is the index of the FPGA.
StatusCode initialize()
initialize the tool
static const InterfaceID & interfaceID()
bool m_hascsvfile
if the csv file is valid
StatusCode rankTowerinFPGA(int FPGAindex)
rank the tower ids in an FPGA This function determines the order of towers in an FPGA.
int getFPGAIndex(int eFEXid, int FPGAid) const
determine the index of an FPGA
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.
StatusCode getRankedTowerIDinFPGA(int eFEXID, int FPGAID, int(&towerlist)[10][6]) const
obtain ordered tower IDs in an FPGA
StatusCode getRankedTowerIDineFEX(int eFEXID, int(&towerlist)[10][18]) const
obtain ordered tower IDs in an eFEX
std::string m_csvaddress
path to the input csv file
eFEXFPGATowerIdProvider(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
StatusCode setAddress(const std::string &inputaddress)
set path to the csv file and load
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
static const InterfaceID IID_IIeFEXFPGATowerIdProvider("LVL1::eFEXFPGATowerIdProvider", 1, 0)
Sturcture defines the id, eta and phi position of a tower.