ATLAS Offline Software
jFEXmetAlgo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 //***************************************************************************
5 // jFEXmetAlgo - Algorithm for MET Algorithm in jFEX
6 // -------------------
7 // begin : 14 05 2021
8 // email : Sergi.Rodriguez@cern.ch
9 //***************************************************************************
10 
11 #ifndef jFEXmetAlgo_H
12 #define jFEXmetAlgo_H
13 
14 
17 #include "AthenaKernel/CLASS_DEF.h"
19 
24 #include "StoreGate/StoreGateSvc.h"
26 
27 
28 namespace LVL1 {
29 
30  class jFEXmetAlgo : public AthAlgTool, virtual public IjFEXmetAlgo{
31 
32  public:
34  jFEXmetAlgo(const std::string& type, const std::string& name, const IInterface* parent);
35 
37  virtual StatusCode initialize() override;
38  virtual StatusCode reset() override;
39 
41  virtual ~jFEXmetAlgo();
42 
43  virtual StatusCode safetyTest() override;
46 
47  virtual void buildBarrelmet() override;
48  virtual void buildFWDmet() override;
49  virtual int GetMetXComponent() override;
50  virtual int GetMetYComponent() override;
51  virtual int getTTowerET(unsigned int TTID ) override;
52  virtual bool getjXESat() const override;
53  virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map) override;
54 
55 protected:
56 
57  private:
58  SG::ReadHandleKey<LVL1::jTowerContainer> m_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "Input container for jTowers"};
60 
61  std::vector<std::vector<int>> m_FPGA;
62  std::vector<std::vector<int>> m_FPGA_phi02;
63  std::vector<std::vector<int>> m_FPGA_fcal;
64  std::vector<long long> m_met;
65  std::vector<float> m_met_angle;
66  std::vector<long long> m_met_Xcoord;
67  std::vector<long long> m_met_Ycoord;
68  long long m_Totalmet_Xcoord = 0;
69  long long m_Totalmet_Ycoord = 0;
70 
71  bool getTTowerSat(unsigned int TTID );
72  bool m_saturation = false;
73 
74  virtual void buildMetXComponent();
75  virtual void buildMetYComponent();
76 
77  // To avoid using floats in the firmware.
78  static constexpr unsigned int m_firmware_scale = (1 << 9);
79  static constexpr unsigned int m_firmware_bit_offset = 9;
80 
81  std::unordered_map<int,std::vector<int> > m_map_Etvalues;
82 
84  };
85 
86 
87 
88 }//end of namespace
89 
90 
91 //CLASS_DEF( LVL1::jFEXmetAlgo , 121222945 , 1 )
92 
93 #endif
IjFEXmetAlgo.h
LVL1::jFEXmetAlgo::getjXESat
virtual bool getjXESat() const override
Definition: jFEXmetAlgo.cxx:252
LVL1::IjFEXmetAlgo
Definition: IjFEXmetAlgo.h:22
LVL1::jFEXmetAlgo::m_hemisphere
int m_hemisphere
Definition: jFEXmetAlgo.h:83
LVL1::jFEXmetAlgo::buildBarrelmet
virtual void buildBarrelmet() override
Definition: jFEXmetAlgo.cxx:108
LVL1::jFEXmetAlgo::getTTowerET
virtual int getTTowerET(unsigned int TTID) override
Definition: jFEXmetAlgo.cxx:238
LVL1::FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width
constexpr static int jFEX_thin_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:26
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LVL1::jFEXmetAlgo::m_firmware_scale
static constexpr unsigned int m_firmware_scale
Definition: jFEXmetAlgo.h:78
LVL1::jFEXmetAlgo::getTTowerSat
bool getTTowerSat(unsigned int TTID)
Definition: jFEXmetAlgo.cxx:257
LVL1::jFEXmetAlgo::m_firmware_bit_offset
static constexpr unsigned int m_firmware_bit_offset
Definition: jFEXmetAlgo.h:79
LVL1::FEXAlgoSpaceDefs::jFEX_algoSpace_height
constexpr static int jFEX_algoSpace_height
Definition: FEXAlgoSpaceDefs.h:27
LVL1::jFEXmetAlgo::m_FPGA_phi02
std::vector< std::vector< int > > m_FPGA_phi02
Definition: jFEXmetAlgo.h:62
LVL1::jFEXmetAlgo::m_met
std::vector< long long > m_met
Definition: jFEXmetAlgo.h:64
SG::ReadHandleKey< LVL1::jTowerContainer >
LVL1::jFEXmetAlgo::m_saturation
bool m_saturation
Definition: jFEXmetAlgo.h:72
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::jFEXmetAlgo::GetMetYComponent
virtual int GetMetYComponent() override
Definition: jFEXmetAlgo.cxx:232
AthAlgorithm.h
LVL1::jFEXmetAlgo::m_Totalmet_Xcoord
long long m_Totalmet_Xcoord
Definition: jFEXmetAlgo.h:68
LVL1::jFEXmetAlgo::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: jFEXmetAlgo.cxx:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1::jFEXmetAlgo::buildMetYComponent
virtual void buildMetYComponent()
Definition: jFEXmetAlgo.cxx:214
LVL1::FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width
constexpr static int jFEX_wide_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:25
AthAlgTool.h
LVL1::jFEXmetAlgo::m_FPGA
std::vector< std::vector< int > > m_FPGA
Definition: jFEXmetAlgo.h:61
LVL1::jFEXmetAlgo::m_met_Ycoord
std::vector< long long > m_met_Ycoord
Definition: jFEXmetAlgo.h:67
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_SuperCell_ID.h
Helper class for offline supercell identifiers.
LVL1::jFEXmetAlgo::m_jTowerContainerKey
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey
Definition: jFEXmetAlgo.h:58
LVL1::jFEXmetAlgo::safetyTest
virtual StatusCode safetyTest() override
Definition: jFEXmetAlgo.cxx:41
LVL1::jFEXmetAlgo::setFPGAEnergy
virtual void setFPGAEnergy(std::unordered_map< int, std::vector< int > > et_map) override
Definition: jFEXmetAlgo.cxx:267
LVL1::jFEXmetAlgo::m_jTowerContainer
SG::ReadHandle< jTowerContainer > m_jTowerContainer
Definition: jFEXmetAlgo.h:59
FEXAlgoSpaceDefs.h
TrigConf::name
Definition: HLTChainList.h:35
jTowerContainer.h
LVL1::jFEXmetAlgo::jFEXmetAlgo
jFEXmetAlgo(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: jFEXmetAlgo.cxx:27
LVL1::jFEXmetAlgo::m_Totalmet_Ycoord
long long m_Totalmet_Ycoord
Definition: jFEXmetAlgo.h:69
LVL1::jFEXmetAlgo::m_met_Xcoord
std::vector< long long > m_met_Xcoord
Definition: jFEXmetAlgo.h:66
CaloCellContainer.h
LVL1::jFEXmetAlgo::buildMetXComponent
virtual void buildMetXComponent()
Definition: jFEXmetAlgo.cxx:189
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::jFEXmetAlgo::m_FPGA_fcal
std::vector< std::vector< int > > m_FPGA_fcal
Definition: jFEXmetAlgo.h:63
LVL1::jFEXmetAlgo::GetMetXComponent
virtual int GetMetXComponent() override
Definition: jFEXmetAlgo.cxx:208
LVL1::jFEXmetAlgo
Definition: jFEXmetAlgo.h:30
LVL1::jFEXmetAlgo::reset
virtual StatusCode reset() override
Definition: jFEXmetAlgo.cxx:51
LVL1::jFEXmetAlgo::setup
virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width], int hemisphere) override
Definition: jFEXmetAlgo.cxx:59
CaloIdManager.h
LVL1::jFEXmetAlgo::buildFWDmet
virtual void buildFWDmet() override
Definition: jFEXmetAlgo.cxx:131
LVL1::jFEXmetAlgo::m_met_angle
std::vector< float > m_met_angle
Definition: jFEXmetAlgo.h:65
LVL1::gFEX::FPGA
FPGA
Definition: GTowerHelpers.h:17
LVL1::jFEXmetAlgo::~jFEXmetAlgo
virtual ~jFEXmetAlgo()
Destructor.
Definition: jFEXmetAlgo.cxx:32
AthAlgTool
Definition: AthAlgTool.h:26
LVL1::jFEXmetAlgo::m_map_Etvalues
std::unordered_map< int, std::vector< int > > m_map_Etvalues
Definition: jFEXmetAlgo.h:81
StoreGateSvc.h
CLASS_DEF.h
macros to associate a CLID to a type