ATLAS Offline Software
jFEXFPGA.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // jFEXFPGA.h -
7 // -------------------
8 // begin : 15 10 2019
9 // email : jacob.julian.kempster@cern.ch
10 // ***************************************************************************/
11 
12 #ifndef jFEXFPGA_H
13 #define jFEXFPGA_H
14 
16 #include "AthenaKernel/CLASS_DEF.h"
18 #include "L1CaloFEXSim/jTowerContainer.h" //handle
28 #include "CaloEvent/CaloCellContainer.h" //member
29 
31 #include "TrigConfData/L1Menu.h" //handle
32 
33 #include "StoreGate/ReadHandle.h"
34 
35 #include <vector>
36 #include <memory>
37 #include <unordered_map>
38 
39 class jFEXOutputCollection;
40 class jFEXTOB;
41 
42 namespace LVL1 {
43 
44  //Doxygen class description below:
51  class jFEXFPGA : public AthAlgTool, virtual public IjFEXFPGA {
52 
53  public:
55  jFEXFPGA(const std::string& type,const std::string& name,const IInterface* parent);
56 
58  virtual StatusCode initialize() override;
60  virtual ~jFEXFPGA();
61 
62  virtual StatusCode init(int id, int efexid) override ;
63 
64  virtual StatusCode execute(jFEXOutputCollection* inputOutputCollection, const std::pair<unsigned int, const std::vector<int>&> & jetCalibrationParameters) override ;
65 
66  virtual void reset() override ;
67 
68  virtual int ID() override {return m_id;}
69 
70  virtual void SetTowersAndCells_SG( int [][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width] ) override ;
71  virtual void SetTowersAndCells_SG( int [][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width] ) override ;
72 
74  virtual std::vector <std::unique_ptr<jFEXTOB>> getSmallRJetTOBs() override;
75  virtual std::vector <std::unique_ptr<jFEXTOB>> getLargeRJetTOBs() override;
76 
78  virtual std::vector <std::vector <uint32_t>> getFwdElTOBs() override;
79 
80  /* Retreive Tau TOB words */
81  virtual std::vector<std::unique_ptr<jFEXTOB>> getTauTOBs() override;
82 
84  virtual std::vector<std::unique_ptr<jFEXTOB>> getSumEtTOBs() override;
85 
87  virtual std::vector<std::unique_ptr<jFEXTOB>> getMetTOBs() override;
88 
89  int getTTowerET_EM (unsigned int TTID ) override;
90  int getTTowerET_HAD (unsigned int TTID ) override;
91  int getTTowerET (unsigned int TTID ) override;
92  int getTTowerET_forMET (unsigned int TTID ) override;
93 
95  private:
96 
97  template <class TOBObjectClass> static bool TOBetSort(const TOBObjectClass& i, const TOBObjectClass& j , uint bits, uint mask) {
98  return (((i->getWord() >> bits ) & mask)>((j->getWord() >> bits ) & mask));
99  }
100 
101  static bool etFwdElSort (const std::vector<uint32_t>& i,
102  const std::vector<uint32_t>& j)
103  { return (((i.at(0) >> FEXAlgoSpaceDefs::jEM_etBit ) & 0x7ff )> ((j.at(0) >> FEXAlgoSpaceDefs::jEM_etBit) & 0x7ff ));}
104 
105  std::vector<std::unique_ptr<jFEXTOB>> m_tau_tobwords;
106  std::vector<std::unique_ptr<jFEXTOB>> m_SRJet_tobwords;
107  std::vector<std::unique_ptr<jFEXTOB>> m_LRJet_tobwords;
108  std::vector<std::unique_ptr<jFEXTOB>> m_sumET_tobwords;
109  std::vector<std::unique_ptr<jFEXTOB>> m_Met_tobwords;
110 
111  int m_id{};
112  int m_jfexid{};
113 
114  std::vector<std::vector<uint32_t>> m_FwdEl_tobwords;
115 
118 
119  std::unordered_map<int,jTower> m_jTowersColl;
120  std::unordered_map<int,std::vector<int> > m_map_Etvalues_FPGA;
121  std::unordered_map<int,std::vector<int> > m_map_HAD_Etvalues_FPGA;
122  std::unordered_map<int,std::vector<int> > m_map_EM_Etvalues_FPGA;
123 
124 
125  std::unordered_map<int, jFEXForwardJetsInfo> m_FCALJets;
126  std::unordered_map<uint, jFEXForwardElecInfo> m_ForwardElecs;
127 
128  int m_SRJetET{};
129  int m_LRJetET{};
130 
132 
133  SG::ReadHandleKey<LVL1::jTowerContainer> m_jTowerContainerKey {this, "MyETowers", "jTowerContainer", "Input container for jTowers"};
134  SG::ReadHandleKey<TrigConf::L1Menu> m_l1MenuKey{this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu","Name of the L1Menu object to read configuration from"};
135  ToolHandle<IjFEXSmallRJetAlgo> m_jFEXSmallRJetAlgoTool {this, "jFEXSmallRJetAlgoTool", "LVL1::jFEXSmallRJetAlgo", "Tool that runs the jFEX Small R Jet algorithm"};
136  ToolHandle<IjFEXLargeRJetAlgo> m_jFEXLargeRJetAlgoTool {this, "jFEXLargeRJetAlgoTool", "LVL1::jFEXLargeRJetAlgo", "Tool that runs the jFEX Large R Jet algorithm"};
137  ToolHandle<IjFEXtauAlgo> m_jFEXtauAlgoTool {this, "jFEXtauAlgoTool" , "LVL1::jFEXtauAlgo" , "Tool that runs the jFEX tau algorithm"};
138  ToolHandle<IjFEXsumETAlgo> m_jFEXsumETAlgoTool {this, "jFEXsumETAlgoTool" , "LVL1::jFEXsumETAlgo" , "Tool that runs the jFEX sumET algorithm"};
139  ToolHandle<IjFEXmetAlgo> m_jFEXmetAlgoTool {this, "jFEXmetAlgoTool" , "LVL1::jFEXmetAlgo" , "Tool that runs the jFEX met algorithm"};
140  ToolHandle<IjFEXForwardJetsAlgo> m_jFEXForwardJetsAlgoTool {this, "jFEXForwardJetsAlgoTool" , "LVL1::jFEXForwardJetsAlgo" , "Tool that runs the jFEX FCAL Jets algorithm"};
141  ToolHandle<IjFEXForwardElecAlgo> m_jFEXForwardElecAlgoTool {this, "jFEXForwardElecAlgoTool" , "LVL1::jFEXForwardElecAlgo" , "Tool that runs the jFEX FCAL Electrons algorithm"};
142  ToolHandle<IjFEXPileupAndNoise> m_jFEXPileupAndNoiseTool {this, "jFEXPileupAndNoiseTool", "LVL1::jFEXPileupAndNoise", "Tool that applies Pileup and Noise"};
143  ToolHandle<IjFEXFormTOBs> m_IjFEXFormTOBsTool {this, "IjFEXFormTOBsTool", "LVL1::jFEXFormTOBs", "Tool that forms TOB words"};
144 
145  int getTTowerET_SG(unsigned int TTID);
146  std::string m_jfex_string[6] = {"1C","2C","3C","3A","2A","1A"};
147  };
148 
149 } // end of namespace
150 
151 
152 CLASS_DEF( LVL1::jFEXFPGA , 76081081 , 1 )
153 #endif
IjFEXmetAlgo.h
LVL1::jFEXFPGA::getMetTOBs
virtual std::vector< std::unique_ptr< jFEXTOB > > getMetTOBs() override
Form a tob word out of the potential candidate MET tob.
Definition: jFEXFPGA.cxx:603
LVL1::jFEXFPGA::m_FwdEl_tobwords
std::vector< std::vector< uint32_t > > m_FwdEl_tobwords
Definition: jFEXFPGA.h:114
LVL1::jFEXFPGA::jFEXFPGA
jFEXFPGA(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: jFEXFPGA.cxx:33
IjFEXSmallRJetAlgo.h
LVL1::jFEXFPGA::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: jFEXFPGA.h:134
LVL1::jFEXFPGA::reset
virtual void reset() override
Definition: jFEXFPGA.cxx:60
LVL1::jFEXFPGA::m_LRJetET
int m_LRJetET
Definition: jFEXFPGA.h:129
LVL1::FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width
constexpr static int jFEX_thin_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:26
LVL1::jFEXFPGA::m_jTowerContainerKey
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey
Definition: jFEXFPGA.h:133
LVL1::jFEXFPGA::m_jFEXtauAlgoTool
ToolHandle< IjFEXtauAlgo > m_jFEXtauAlgoTool
Definition: jFEXFPGA.h:137
LVL1::jFEXFPGA::m_jfex_string
std::string m_jfex_string[6]
Definition: jFEXFPGA.h:146
LVL1::jFEXFPGA::m_jFEXSmallRJetAlgoTool
ToolHandle< IjFEXSmallRJetAlgo > m_jFEXSmallRJetAlgoTool
Definition: jFEXFPGA.h:135
LVL1::jFEXFPGA::getTTowerET
int getTTowerET(unsigned int TTID) override
Definition: jFEXFPGA.cxx:645
LVL1::jFEXFPGA::m_Met_tobwords
std::vector< std::unique_ptr< jFEXTOB > > m_Met_tobwords
Definition: jFEXFPGA.h:109
LVL1::jFEXFPGA::m_sumET_tobwords
std::vector< std::unique_ptr< jFEXTOB > > m_sumET_tobwords
Definition: jFEXFPGA.h:108
LVL1::FEXAlgoSpaceDefs::jFEX_algoSpace_height
constexpr static int jFEX_algoSpace_height
Definition: FEXAlgoSpaceDefs.h:27
LVL1::jFEXFPGA::getTTowerET_HAD
int getTTowerET_HAD(unsigned int TTID) override
Definition: jFEXFPGA.cxx:632
SG::ReadHandleKey< LVL1::jTowerContainer >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
IjFEXFPGA.h
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LVL1::jFEXFPGA::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: jFEXFPGA.cxx:44
LVL1::jFEXFPGA::getTauTOBs
virtual std::vector< std::unique_ptr< jFEXTOB > > getTauTOBs() override
Definition: jFEXFPGA.cxx:573
LVL1::jFEXFPGA::m_jFEXForwardJetsAlgoTool
ToolHandle< IjFEXForwardJetsAlgo > m_jFEXForwardJetsAlgoTool
Definition: jFEXFPGA.h:140
LVL1::jFEXFPGA::m_SRJet_tobwords
std::vector< std::unique_ptr< jFEXTOB > > m_SRJet_tobwords
Definition: jFEXFPGA.h:106
LVL1::jFEXFPGA::getTTowerET_forMET
int getTTowerET_forMET(unsigned int TTID) override
Definition: jFEXFPGA.cxx:653
LVL1::jFEXFPGA::m_tau_tobwords
std::vector< std::unique_ptr< jFEXTOB > > m_tau_tobwords
Definition: jFEXFPGA.h:105
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
LVL1::jFEXFPGA::m_jTowersIDs_Wide
int m_jTowersIDs_Wide[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
Definition: jFEXFPGA.h:116
LVL1::jFEXFPGA::m_jFEXsumETAlgoTool
ToolHandle< IjFEXsumETAlgo > m_jFEXsumETAlgoTool
Definition: jFEXFPGA.h:138
LVL1::jFEXFPGA::init
virtual StatusCode init(int id, int efexid) override
Definition: jFEXFPGA.cxx:52
IjFEXForwardElecAlgo.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1::jFEXFPGA::m_ForwardElecs
std::unordered_map< uint, jFEXForwardElecInfo > m_ForwardElecs
Definition: jFEXFPGA.h:126
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1::jFEXFPGA::ID
virtual int ID() override
Definition: jFEXFPGA.h:68
IjFEXtauAlgo.h
LVL1::FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width
constexpr static int jFEX_wide_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:25
AthAlgTool.h
LVL1::jFEXFPGA::getLargeRJetTOBs
virtual std::vector< std::unique_ptr< jFEXTOB > > getLargeRJetTOBs() override
Definition: jFEXFPGA.cxx:542
LVL1::jFEXFPGA::m_FCALJets
std::unordered_map< int, jFEXForwardJetsInfo > m_FCALJets
Definition: jFEXFPGA.h:125
LVL1::jFEXFPGA::TOBetSort
static bool TOBetSort(const TOBObjectClass &i, const TOBObjectClass &j, uint bits, uint mask)
Internal data.
Definition: jFEXFPGA.h:97
LVL1::jFEXFPGA::m_map_Etvalues_FPGA
std::unordered_map< int, std::vector< int > > m_map_Etvalues_FPGA
Definition: jFEXFPGA.h:120
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::jFEXFPGA::getSmallRJetTOBs
virtual std::vector< std::unique_ptr< jFEXTOB > > getSmallRJetTOBs() override
Form a tob word out of the potential candidate SmallRJet tob.
Definition: jFEXFPGA.cxx:526
LVL1::jFEXFPGA::m_sCellsCollection
CaloCellContainer m_sCellsCollection
Definition: jFEXFPGA.h:131
LVL1::jFEXFPGA::m_IjFEXFormTOBsTool
ToolHandle< IjFEXFormTOBs > m_IjFEXFormTOBsTool
Definition: jFEXFPGA.h:143
LVL1::jFEXOutputCollection
Definition: jFEXOutputCollection.h:23
IjFEXPileupAndNoise.h
LVL1::jFEXFPGA::SetTowersAndCells_SG
virtual void SetTowersAndCells_SG(int[][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]) override
Definition: jFEXFPGA.cxx:485
FEXAlgoSpaceDefs.h
LVL1::jFEXFPGA::m_jfexid
int m_jfexid
Definition: jFEXFPGA.h:112
TrigConf::name
Definition: HLTChainList.h:35
IjFEXForwardJetsAlgo.h
jTowerContainer.h
LVL1::jFEXFPGA::m_LRJet_tobwords
std::vector< std::unique_ptr< jFEXTOB > > m_LRJet_tobwords
Definition: jFEXFPGA.h:107
LVL1::jFEXFPGA::getFwdElTOBs
virtual std::vector< std::vector< uint32_t > > getFwdElTOBs() override
sorted Electron tobs
Definition: jFEXFPGA.cxx:560
LVL1::jFEXFPGA::etFwdElSort
static bool etFwdElSort(const std::vector< uint32_t > &i, const std::vector< uint32_t > &j)
Definition: jFEXFPGA.h:101
LVL1::jFEXFPGA::m_jFEXForwardElecAlgoTool
ToolHandle< IjFEXForwardElecAlgo > m_jFEXForwardElecAlgoTool
Definition: jFEXFPGA.h:141
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
LVL1::jFEXFPGA::m_jFEXmetAlgoTool
ToolHandle< IjFEXmetAlgo > m_jFEXmetAlgoTool
Definition: jFEXFPGA.h:139
LVL1::jFEXFPGA::execute
virtual StatusCode execute(jFEXOutputCollection *inputOutputCollection, const std::pair< unsigned int, const std::vector< int > & > &jetCalibrationParameters) override
Definition: jFEXFPGA.cxx:75
LVL1::jFEXFPGA::getSumEtTOBs
virtual std::vector< std::unique_ptr< jFEXTOB > > getSumEtTOBs() override
Form a tob word out of the potential candidate SumET tob.
Definition: jFEXFPGA.cxx:587
LVL1::jFEXFPGA::m_jTowersColl
std::unordered_map< int, jTower > m_jTowersColl
Definition: jFEXFPGA.h:119
LVL1::jFEXFPGA::m_map_EM_Etvalues_FPGA
std::unordered_map< int, std::vector< int > > m_map_EM_Etvalues_FPGA
Definition: jFEXFPGA.h:122
LVL1::jFEXFPGA::m_map_HAD_Etvalues_FPGA
std::unordered_map< int, std::vector< int > > m_map_HAD_Etvalues_FPGA
Definition: jFEXFPGA.h:121
LVL1::jFEXFPGA::m_id
int m_id
Definition: jFEXFPGA.h:111
LVL1::jFEXFPGA::~jFEXFPGA
virtual ~jFEXFPGA()
Destructor.
Definition: jFEXFPGA.cxx:38
IjFEXFormTOBs.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::jFEXFPGA::getTTowerET_EM
int getTTowerET_EM(unsigned int TTID) override
Definition: jFEXFPGA.cxx:619
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
ReadHandle.h
Handle class for reading from StoreGate.
LVL1::IjFEXFPGA
Definition: IjFEXFPGA.h:34
AthAlgTool
Definition: AthAlgTool.h:26
L1Menu.h
LVL1::jFEXFPGA::m_SRJetET
int m_SRJetET
Definition: jFEXFPGA.h:128
LVL1::FEXAlgoSpaceDefs::jEM_etBit
constexpr static int jEM_etBit
Definition: FEXAlgoSpaceDefs.h:111
LVL1::jFEXFPGA::getTTowerET_SG
int getTTowerET_SG(unsigned int TTID)
Definition: jFEXFPGA.cxx:681
CLASS_DEF.h
macros to associate a CLID to a type
IjFEXLargeRJetAlgo.h
IjFEXsumETAlgo.h
LVL1::jFEXFPGA
The jFEXFPGA class defines the structure of a single jFEX FPGA Its purpose is:
Definition: jFEXFPGA.h:51
LVL1::jFEXFPGA::m_jFEXLargeRJetAlgoTool
ToolHandle< IjFEXLargeRJetAlgo > m_jFEXLargeRJetAlgoTool
Definition: jFEXFPGA.h:136
LVL1::jFEXFPGA::m_jFEXPileupAndNoiseTool
ToolHandle< IjFEXPileupAndNoise > m_jFEXPileupAndNoiseTool
Definition: jFEXFPGA.h:142
LVL1::jFEXFPGA::m_jTowersIDs_Thin
int m_jTowersIDs_Thin[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]
Definition: jFEXFPGA.h:117