ATLAS Offline Software
eFakeTower.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
16 #ifndef EFAKETOWER_H
17 #define EFAKETOWER_H
18 #include <string>
19 #include <unordered_map>
20 #include <vector>
23 #include "L1CaloFEXSim/eTower.h"
28 
29 
30 namespace LVL1 {
51  class eFakeTower: public AthAlgTool, virtual public IeFakeTower
52  {
53  public:
55  eFakeTower(const std::string& type,const std::string& name,const IInterface* parent);
56 
58  virtual StatusCode init(const std::string&) override;
59 
61  ~eFakeTower();
62 
75  virtual int getET(int FPGAid, int eta, int phi, int layer, int cell) const override;
76 
78  virtual StatusCode loadnext() override;
79 
81  virtual StatusCode execute() override;
82 
84  virtual StatusCode seteTowers(eTowerContainer*) override;
85 
86  private:
97  StatusCode changeFPGAET(int tmp_eTowersIDs_subset[][6], int FPGAnumber, int eFEXnumber);
98 
100  StatusCode loadFPGA(int);
101 
103  StatusCode loaddic(int);
104 
116  StatusCode changeTowerET(LVL1::eTower* inputtower, int eta, int phi, int FPGAid) const;
117 
127  int getFPGAnumber(int iefex, int ifpga) const;
128 
129  eTowerContainer* m_eTowerContainer; //the eTowerContainer object for which the Et will be replaced
130 
132  std::vector<int>* loadBlock(const std::string&, int) const;
133 
135 
137  ToolHandle<IeFEXFPGATowerIdProvider> m_eFEXFPGATowerIdProviderTool {this, "eFEXFPGATowerIdProviderTool", "LVL1::eFEXFPGATowerIdProvider", "Tool that provides tower-FPGA mapping"};
138 
139  std::string m_inputfile;
140 
146  std::unordered_map<int, std::unordered_map<int, unsigned int>*> m_alltowers;
147 
149  std::unordered_map<int, std::vector<int>*> m_dict;
150  };
151 }
152 
153 #endif
eTowerContainer.h
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LVL1::eTower
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
Definition: eTower.h:38
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFakeTower::loadBlock
std::vector< int > * loadBlock(const std::string &, int) const
Load the Et or index in a block.
Definition: eFakeTower.cxx:209
LVL1::eFakeTower::getFPGAnumber
int getFPGAnumber(int iefex, int ifpga) const
determine the index of an FPGA
Definition: eFakeTower.cxx:244
LVL1::eFakeTower
Load Et of the test vector.
Definition: eFakeTower.h:52
LVL1::eFakeTower::loadnext
virtual StatusCode loadnext() override
Load the test vector of the next event.
Definition: eFakeTower.cxx:78
eFEXCompression.h
LVL1::eFakeTower::m_eFEXFPGATowerIdProviderTool
ToolHandle< IeFEXFPGATowerIdProvider > m_eFEXFPGATowerIdProviderTool
tool needed for tower-FPGA mapping
Definition: eFakeTower.h:137
LVL1::eFakeTower::execute
virtual StatusCode execute() override
replace the Tower Et with the ones stored in the test vector.
Definition: eFakeTower.cxx:99
LVL1::eFakeTower::loaddic
StatusCode loaddic(int)
load index of Et
Definition: eFakeTower.cxx:201
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthAlgTool.h
LVL1::eFakeTower::getET
virtual int getET(int FPGAid, int eta, int phi, int layer, int cell) const override
obtain the Et of a tower slot
Definition: eFakeTower.cxx:49
LVL1::eFakeTower::m_inputfile
std::string m_inputfile
path to the input directory
Definition: eFakeTower.h:139
LVL1::eFakeTower::m_dict
std::unordered_map< int, std::vector< int > * > m_dict
map for mapping infomation. m_dict[FPGAid] = [ list of supercell id in order ]
Definition: eFakeTower.h:149
LVL1::eFakeTower::m_eTowerContainer
eTowerContainer * m_eTowerContainer
Definition: eFakeTower.h:129
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::eFakeTower::changeTowerET
StatusCode changeTowerET(LVL1::eTower *inputtower, int eta, int phi, int FPGAid) const
Replace the Et in a tower by the ones in the test vector.
Definition: eFakeTower.cxx:154
LVL1::eFakeTower::eFakeTower
eFakeTower(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: eFakeTower.cxx:15
LVL1::eTowerContainer
Definition: eTowerContainer.h:35
LVL1::eFakeTower::m_numberofevents
int m_numberofevents
number of events
Definition: eFakeTower.h:134
LVL1::eFakeTower::seteTowers
virtual StatusCode seteTowers(eTowerContainer *) override
Define the eTowerContainer object for which the Et will be replaced.
Definition: eFakeTower.cxx:131
eFEXFPGATowerIdProvider.h
Provide tower-FPGA mapping.
TrigConf::name
Definition: HLTChainList.h:35
LVL1::eFakeTower::m_alltowers
std::unordered_map< int, std::unordered_map< int, unsigned int > * > m_alltowers
map of all supercell ETs of FPGAs m_alltowers[FPGAid] = (supercell id,ET) supercell id = eta * 1000 +...
Definition: eFakeTower.h:146
LVL1::eFakeTower::init
virtual StatusCode init(const std::string &) override
initiate with the path to the test vector directory
Definition: eFakeTower.cxx:31
LVL1::eFakeTower::changeFPGAET
StatusCode changeFPGAET(int tmp_eTowersIDs_subset[][6], int FPGAnumber, int eFEXnumber)
Replace the Et in an FOGA by the ones in the test vector.
Definition: eFakeTower.cxx:136
IeFakeTower.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::IeFakeTower
Definition: IeFakeTower.h:14
IeFEXSysSim.h
AthAlgTool
Definition: AthAlgTool.h:26
eTower.h
LVL1::eFakeTower::loadFPGA
StatusCode loadFPGA(int)
load the Et in an FPGA
Definition: eFakeTower.cxx:176
LVL1::eFakeTower::~eFakeTower
~eFakeTower()
Destructor.
Definition: eFakeTower.cxx:21