ATLAS Offline Software
jFEXPileupAndNoise.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 // jFEXPileupAndNoise - Algorithm for Pileup and Noise in jFEX
6 // -------------------
7 // begin : 24 05 2021
8 // email : Sergi.Rodriguez@cern.ch
9 //***************************************************************************
10 
11 #ifndef jFEXPileupAndNoise_H
12 #define jFEXPileupAndNoise_H
13 
14 
16 #include "AthenaKernel/CLASS_DEF.h"
23 #include "StoreGate/StoreGateSvc.h"
28 
29 namespace LVL1 {
30 
31  class jFEXPileupAndNoise : public AthAlgTool, virtual public IjFEXPileupAndNoise{
32 
33  public:
35  jFEXPileupAndNoise(const std::string& type, const std::string& name, const IInterface* parent);
36 
38  virtual StatusCode initialize() override;
39  virtual StatusCode safetyTest() override;
40  virtual StatusCode reset() override;
41 
44 
45  virtual std::unordered_map<int,std::vector<int> > GetEt_values() override;
46  virtual std::unordered_map<int,std::vector<int> > Get_EM_Et_values() override;
47  virtual std::unordered_map<int,std::vector<int> > Get_HAD_Et_values() override;
48 
50  virtual ~jFEXPileupAndNoise();
51 
52 
53  virtual std::vector<int> CalculatePileup() override;
54  virtual StatusCode ApplyPileup() override;
55  virtual void ApplyNoise2Jets(bool b) override;
56  virtual void ApplyNoise2Met(bool b) override;
57 
58 
59 protected:
60 
61  private:
62  SG::ReadHandleKey<LVL1::jTowerContainer> m_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "Input container for jTowers"};
64 
65  SG::ReadCondHandleKey<jFEXDBCondData> m_BDToolKey {this, "BDToolKey", "jFEXDBParams", "DB tool key"};
66 
69 
70  int m_etaMAX=0;
71 
72  std::unordered_map<int,int > m_FPGA_ET_EM;
73  std::unordered_map<int,int > m_FPGA_ET_HAD;
74 
75  //rho variables for the pileup
76  int m_rho_EM = 0; //for eta < 3.2
77  int m_rho_HAD1 = 0; //for eta < 1.5
78  int m_rho_HAD2 = 0; //for 1.5 < eta < 1.6
79  int m_rho_HAD3 = 0; //for 1.6 < eta < 3.2
80  int m_rho_FCAL = 0; //for eta > 3.1
81 
82  //TT counters
83  int m_count_rho_EM = 0;
88 
89  //boolean flags
90  bool m_is_FWD = false; // 0 for central, 1 for forward
91  bool m_apply_pileup2jets = false;
92  bool m_apply_pileup2met = false;
93  bool m_apply_noise2jets = false;
94  bool m_apply_noise2met = false;
95 
96  void reset_conters();
97  void SubtractPileup();
98  void ApplyNoiseCuts(std::unordered_map<int,std::vector<int> > & map_Etvalues, int layer);
99  int rhoDivLUT(int ntowers);
100 
101  // SG information
102  int getTTowerEta (const LVL1::jTower *tmpTower );
103  int getTTowerET (const LVL1::jTower *tmpTower );
104  int getET_EM (const LVL1::jTower *tmpTower );
105  int getET_HAD (const LVL1::jTower *tmpTower );
106  int getTTArea_EM (const LVL1::jTower *tmpTower );
107  int getTTArea_HAD (const LVL1::jTower *tmpTower );
108  int getTTAreaINV_EM (const LVL1::jTower *tmpTower );
109  int getTTAreaINV_HAD (const LVL1::jTower *tmpTower );
110 
111  std::unordered_map<int,std::vector<int> > m_map_Etvalues_EM;
112  std::unordered_map<int,std::vector<int> > m_map_Etvalues_HAD;
113  };
114 }//end of namespace
115 
116 
117 CLASS_DEF( LVL1::jFEXPileupAndNoise , 585629 , 1 )
118 
119 #endif
LVL1::jFEXPileupAndNoise::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: jFEXPileupAndNoise.cxx:35
LVL1::jFEXPileupAndNoise::ApplyNoiseCuts
void ApplyNoiseCuts(std::unordered_map< int, std::vector< int > > &map_Etvalues, int layer)
Definition: jFEXPileupAndNoise.cxx:403
LVL1::jFEXPileupAndNoise::getTTowerEta
int getTTowerEta(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:452
LVL1::jFEXPileupAndNoise::m_apply_pileup2jets
bool m_apply_pileup2jets
Definition: jFEXPileupAndNoise.h:91
LVL1::jFEXPileupAndNoise::m_rho_FCAL
int m_rho_FCAL
Definition: jFEXPileupAndNoise.h:80
LVL1::jFEXPileupAndNoise::setup
virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]) override
Definition: jFEXPileupAndNoise.cxx:87
LVL1::FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width
constexpr static int jFEX_thin_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:26
LVL1::jFEXPileupAndNoise::Get_EM_Et_values
virtual std::unordered_map< int, std::vector< int > > Get_EM_Et_values() override
Definition: jFEXPileupAndNoise.cxx:299
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LVL1::jFEXPileupAndNoise::getTTAreaINV_HAD
int getTTAreaINV_HAD(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:484
LVL1::jFEXPileupAndNoise::m_count_rho_HAD1
int m_count_rho_HAD1
Definition: jFEXPileupAndNoise.h:84
LVL1::jFEXPileupAndNoise::m_apply_noise2jets
bool m_apply_noise2jets
Definition: jFEXPileupAndNoise.h:93
LVL1::jFEXPileupAndNoise::getET_EM
int getET_EM(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:460
LVL1::jFEXPileupAndNoise::m_FPGA_ET_EM
std::unordered_map< int, int > m_FPGA_ET_EM
Definition: jFEXPileupAndNoise.h:72
LVL1::jFEXPileupAndNoise::jFEXPileupAndNoise
jFEXPileupAndNoise(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: jFEXPileupAndNoise.cxx:27
LVL1::jFEXPileupAndNoise::reset_conters
void reset_conters()
Definition: jFEXPileupAndNoise.cxx:69
jFEXDBCondData.h
LVL1::jFEXPileupAndNoise::ApplyNoise2Jets
virtual void ApplyNoise2Jets(bool b) override
Definition: jFEXPileupAndNoise.cxx:289
LVL1::jFEXPileupAndNoise::getTTowerET
int getTTowerET(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:456
LVL1::FEXAlgoSpaceDefs::jFEX_algoSpace_height
constexpr static int jFEX_algoSpace_height
Definition: FEXAlgoSpaceDefs.h:27
LVL1::jFEXPileupAndNoise::m_BDToolKey
SG::ReadCondHandleKey< jFEXDBCondData > m_BDToolKey
Definition: jFEXPileupAndNoise.h:65
LVL1::jFEXPileupAndNoise::safetyTest
virtual StatusCode safetyTest() override
Definition: jFEXPileupAndNoise.cxx:45
SG::ReadHandleKey< LVL1::jTowerContainer >
LVL1::jFEXPileupAndNoise::m_FPGA_central
int m_FPGA_central[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]
Definition: jFEXPileupAndNoise.h:67
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::IjFEXPileupAndNoise
Definition: IjFEXPileupAndNoise.h:22
LVL1::jFEXPileupAndNoise::Get_HAD_Et_values
virtual std::unordered_map< int, std::vector< int > > Get_HAD_Et_values() override
Definition: jFEXPileupAndNoise.cxx:351
ReadCondHandle.h
LVL1::jFEXPileupAndNoise
Definition: jFEXPileupAndNoise.h:31
LVL1::jFEXPileupAndNoise::m_rho_HAD1
int m_rho_HAD1
Definition: jFEXPileupAndNoise.h:77
AthAlgorithm.h
LVL1::jFEXPileupAndNoise::m_count_rho_EM
int m_count_rho_EM
Definition: jFEXPileupAndNoise.h:83
LVL1::jFEXPileupAndNoise::m_map_Etvalues_EM
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
Definition: jFEXPileupAndNoise.h:111
LVL1::jFEXPileupAndNoise::getTTArea_HAD
int getTTArea_HAD(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:474
LVL1::jFEXPileupAndNoise::m_rho_HAD3
int m_rho_HAD3
Definition: jFEXPileupAndNoise.h:79
LVL1::jFEXPileupAndNoise::getTTAreaINV_EM
int getTTAreaINV_EM(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:479
LVL1::jFEXPileupAndNoise::m_map_Etvalues_HAD
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD
Definition: jFEXPileupAndNoise.h:112
LVL1::jFEXPileupAndNoise::GetEt_values
virtual std::unordered_map< int, std::vector< int > > GetEt_values() override
Definition: jFEXPileupAndNoise.cxx:424
LVL1::jFEXPileupAndNoise::reset
virtual StatusCode reset() override
Definition: jFEXPileupAndNoise.cxx:56
LVL1::jFEXPileupAndNoise::m_apply_noise2met
bool m_apply_noise2met
Definition: jFEXPileupAndNoise.h:94
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
LVL1::jFEXPileupAndNoise::SubtractPileup
void SubtractPileup()
Definition: jFEXPileupAndNoise.cxx:226
LVL1::jFEXPileupAndNoise::m_jTowerContainerKey
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey
Definition: jFEXPileupAndNoise.h:62
LVL1::FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width
constexpr static int jFEX_wide_algoSpace_width
Definition: FEXAlgoSpaceDefs.h:25
AthAlgTool.h
LVL1::jFEXPileupAndNoise::m_is_FWD
bool m_is_FWD
Definition: jFEXPileupAndNoise.h:90
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_SuperCell_ID.h
Helper class for offline supercell identifiers.
LVL1::jFEXPileupAndNoise::rhoDivLUT
int rhoDivLUT(int ntowers)
Definition: jFEXPileupAndNoise.cxx:219
LVL1::jFEXPileupAndNoise::m_apply_pileup2met
bool m_apply_pileup2met
Definition: jFEXPileupAndNoise.h:92
IjFEXPileupAndNoise.h
FEXAlgoSpaceDefs.h
LVL1::jFEXPileupAndNoise::m_rho_EM
int m_rho_EM
Definition: jFEXPileupAndNoise.h:76
TrigConf::name
Definition: HLTChainList.h:35
LVL1::jFEXPileupAndNoise::m_count_rho_HAD3
int m_count_rho_HAD3
Definition: jFEXPileupAndNoise.h:86
ReadCondHandleKey.h
jTowerContainer.h
LVL1::jFEXPileupAndNoise::m_jTowerContainer
SG::ReadHandle< jTowerContainer > m_jTowerContainer
Definition: jFEXPileupAndNoise.h:63
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LVL1::jFEXPileupAndNoise::m_count_rho_FCAL
int m_count_rho_FCAL
Definition: jFEXPileupAndNoise.h:87
CaloCellContainer.h
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LVL1::jFEXPileupAndNoise::m_etaMAX
int m_etaMAX
Definition: jFEXPileupAndNoise.h:70
LVL1::jFEXPileupAndNoise::getET_HAD
int getET_HAD(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:464
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::jFEXPileupAndNoise::getTTArea_EM
int getTTArea_EM(const LVL1::jTower *tmpTower)
Definition: jFEXPileupAndNoise.cxx:469
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
LVL1::jTower
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
Definition: jTower.h:40
CaloIdManager.h
LVL1::jFEXPileupAndNoise::m_FPGA_forward
int m_FPGA_forward[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
Definition: jFEXPileupAndNoise.h:68
LVL1::jFEXPileupAndNoise::m_FPGA_ET_HAD
std::unordered_map< int, int > m_FPGA_ET_HAD
Definition: jFEXPileupAndNoise.h:73
LVL1::jFEXPileupAndNoise::CalculatePileup
virtual std::vector< int > CalculatePileup() override
Definition: jFEXPileupAndNoise.cxx:106
LVL1::gFEX::FPGA
FPGA
Definition: GTowerHelpers.h:17
LVL1::jFEXPileupAndNoise::ApplyNoise2Met
virtual void ApplyNoise2Met(bool b) override
Definition: jFEXPileupAndNoise.cxx:293
AthAlgTool
Definition: AthAlgTool.h:26
StoreGateSvc.h
CLASS_DEF.h
macros to associate a CLID to a type
LVL1::jFEXPileupAndNoise::~jFEXPileupAndNoise
virtual ~jFEXPileupAndNoise()
Destructor.
Definition: jFEXPileupAndNoise.cxx:32
LVL1::jFEXPileupAndNoise::m_rho_HAD2
int m_rho_HAD2
Definition: jFEXPileupAndNoise.h:78
LVL1::jFEXPileupAndNoise::ApplyPileup
virtual StatusCode ApplyPileup() override
Definition: jFEXPileupAndNoise.cxx:276
LVL1::jFEXPileupAndNoise::m_count_rho_HAD2
int m_count_rho_HAD2
Definition: jFEXPileupAndNoise.h:85