ATLAS Offline Software
jFEXDBCondData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 //***************************************************************************
5 // Interface for jFEXBDTool - Tool to read the COOL DB for jFEX
6 // -------------------
7 // begin : 01 08 2023
8 // email : Sergi.Rodriguez@cern.ch
9 //***************************************************************************
11 
12 namespace LVL1 {
13 
14 
16  return m_jJCalibParams[module][range];
17 }
18 
19 const std::vector<int>& jFEXDBCondData::get_jJCalibParams(int module) const {
20  return m_jJCalibParams[module];
21 }
22 
24  return m_PileUpCorrectionJet;
25 }
26 
28  return m_PileUpCorrectionMET;
29 }
30 
33 }
34 
37 }
38 
41 }
42 
45 }
46 
49 }
50 
53 }
54 
57 }
58 
61 }
62 
65 }
66 
69 }
70 
71 std::array<uint16_t,4> jFEXDBCondData::get_NoiseCuts(uint16_t onlineID) const {
72 
73  if(m_sendDefaults){
74  //Sending default values!
75  auto [gEta, gPhi] = DecodeOnlineID(onlineID);
76  gEta = gEta < 0 ? std::abs(gEta+1) : gEta;
77  if(gEta < 15){ // This is LATOME and Tile towers ( |eta| < 1.5 )
78  //{CutJetEM, CutJetHad, CutMetEM, CutMetHad}
79  return m_NoiseCuts.find(0x00f0)->second;
80  }
81  else if (gEta < 32){ // This is LATOME EMB/EMEC and HEC towers (1.5 < |eta| < 3.1)
82  return m_NoiseCuts.find(0x0f00)->second;
83  }
84  else{ // This is FCAL towers (|eta| > 3.1)
85  return m_NoiseCuts.find(0xf000)->second;
86  }
87  }
88  else{
89  auto itr = m_NoiseCuts.find(onlineID);
90  if(itr == m_NoiseCuts.end()) {
91  return m_NoiseCuts_default;
92  }
93 
94  return itr->second;
95  }
96 }
97 
98 std::array<uint16_t,4> jFEXDBCondData::get_PileUpValues(uint16_t onlineID) const {
99 
100  if(m_sendDefaults){
101  return m_PileUpWeight.find(0x0000)->second;
102  }
103  else{
104  auto itr = m_PileUpWeight.find(onlineID);
105 
106  if(itr == m_PileUpWeight.end()) {
107  return m_PileUpWeight_default;
108  }
109 
110  return itr->second;
111  }
112 }
113 
114 void jFEXDBCondData::set_jJCalibParam(const std::vector<std::vector<int>>& params){
116 }
117 
118 void jFEXDBCondData::set_doPileUpJet(bool PileUpCorrectionJet){
119  m_PileUpCorrectionJet = PileUpCorrectionJet;
120 }
121 
122 void jFEXDBCondData::set_doPileUpMet(bool PileUpCorrectionMET){
123  m_PileUpCorrectionMET = PileUpCorrectionMET;
124 }
125 
126 void jFEXDBCondData::set_PUThrLowEm(int PileUpThresholdLowEm){
127  m_PileUpThresholdLowEm = PileUpThresholdLowEm;
128 }
129 
130 void jFEXDBCondData::set_PUThrHighEm(int PileUpThresholdHighEm){
131  m_PileUpThresholdHighEm = PileUpThresholdHighEm;
132 }
133 
134 void jFEXDBCondData::set_PUThrLowHadLar(int PileUpThresholdLowHadLar){
135  m_PileUpThresholdLowHadLar = PileUpThresholdLowHadLar;
136 }
137 
138 void jFEXDBCondData::set_PUThrHighHadLar(int PileUpThresholdHighHadLar){
139  m_PileUpThresholdHighHadLar = PileUpThresholdHighHadLar;
140 }
141 
142 void jFEXDBCondData::set_PUThrLowHadHecOverlap(int PileUpThresholdLowHadHecOverlap){
143  m_PileUpThresholdLowHadHecOverlap = PileUpThresholdLowHadHecOverlap;
144 }
145 
146 void jFEXDBCondData::set_PUThrHighHadHecOverlap(int PileUpThresholdHighHadHecOverlap){
147  m_PileUpThresholdHighHadHecOverlap = PileUpThresholdHighHadHecOverlap;
148 }
149 
150 void jFEXDBCondData::set_PUThrLowHadTrex(int PileUpThresholdLowHadTrex){
151  m_PileUpThresholdLowHadTrex = PileUpThresholdLowHadTrex;
152 }
153 
154 void jFEXDBCondData::set_PUThrHighHadTrex(int PileUpThresholdHighHadTrex){
155  m_PileUpThresholdHighHadTrex = PileUpThresholdHighHadTrex;
156 }
157 
158 void jFEXDBCondData::set_PUThrLowFcal(int PileUpThresholdLowFcal){
159  m_PileUpThresholdLowFcal = PileUpThresholdLowFcal;
160 }
161 
162 void jFEXDBCondData::set_PUThrHighFcal(int PileUpThresholdHighFcal){
163  m_PileUpThresholdHighFcal = PileUpThresholdHighFcal;
164 }
165 
166 void jFEXDBCondData::set_NoiseCuts(const std::unordered_map< uint16_t, std::array<uint16_t,4> >& NoiseCuts){
167 
168  for(auto const& [key, array] : NoiseCuts){
170  }
171 }
172 void jFEXDBCondData::set_PileUpValues(const std::unordered_map< uint16_t, std::array<uint16_t,4> >& PileUpWeight){
173 
174  for(auto const& [key, array] : PileUpWeight){
176  }
177 }
178 
179 void jFEXDBCondData::set_sendDefaults(bool sendDefaults){
180  m_sendDefaults = sendDefaults;
181 }
182 
183  // It returns the GlobalEta and GlobalPhi
184 std::array<int,2> jFEXDBCondData::DecodeOnlineID(uint16_t onlineID) const{
185 
186  int global_eta = (onlineID >> 8) - 0x80;
187  int global_phi = onlineID & 0xff;
188  return {global_eta, global_phi};
189 }
190 
191 }// end of namespace LVL1
LVL1::jFEXDBCondData::get_PUThrHighHadLar
int get_PUThrHighHadLar() const
Definition: jFEXDBCondData.cxx:43
LVL1::jFEXDBCondData::m_NoiseCuts_default
std::array< uint16_t, 4 > m_NoiseCuts_default
Definition: jFEXDBCondData.h:101
LVL1::jFEXDBCondData::m_PileUpThresholdLowHadTrex
int m_PileUpThresholdLowHadTrex
Definition: jFEXDBCondData.h:93
LVL1::jFEXDBCondData::m_PileUpCorrectionMET
bool m_PileUpCorrectionMET
Definition: jFEXDBCondData.h:84
LVL1::jFEXDBCondData::get_PUThrHighHadHecOverlap
int get_PUThrHighHadHecOverlap() const
Definition: jFEXDBCondData.cxx:51
LVL1::jFEXDBCondData::m_PileUpThresholdHighEm
int m_PileUpThresholdHighEm
Definition: jFEXDBCondData.h:88
LVL1::jFEXDBCondData::get_PUThrHighHadTrex
int get_PUThrHighHadTrex() const
Definition: jFEXDBCondData.cxx:59
LVL1::jFEXDBCondData::m_PileUpWeight
std::unordered_map< uint16_t, std::array< uint16_t, 4 > > m_PileUpWeight
Definition: jFEXDBCondData.h:105
LVL1::jFEXDBCondData::get_PUThrHighEm
int get_PUThrHighEm() const
Definition: jFEXDBCondData.cxx:35
LVL1::jFEXDBCondData::get_PUThrLowEm
int get_PUThrLowEm() const
Definition: jFEXDBCondData.cxx:31
LVL1::jFEXDBCondData::m_PileUpThresholdLowEm
int m_PileUpThresholdLowEm
Definition: jFEXDBCondData.h:87
LVL1::jFEXDBCondData::set_jJCalibParam
void set_jJCalibParam(const std::vector< std::vector< int >> &params)
Setters.
Definition: jFEXDBCondData.cxx:114
LVL1::jFEXDBCondData::m_PileUpThresholdLowHadLar
int m_PileUpThresholdLowHadLar
Definition: jFEXDBCondData.h:89
LVL1::jFEXDBCondData::set_PUThrHighEm
void set_PUThrHighEm(int PileUpThresholdHighEm)
Definition: jFEXDBCondData.cxx:130
LVL1::jFEXDBCondData::set_PUThrHighFcal
void set_PUThrHighFcal(int PileUpThresholdHighFcal)
Definition: jFEXDBCondData.cxx:162
LVL1::jFEXDBCondData::set_PUThrHighHadHecOverlap
void set_PUThrHighHadHecOverlap(int PileUpThresholdHighHadHecOverlap)
Definition: jFEXDBCondData.cxx:146
jFEXDBCondData.h
LVL1::jFEXDBCondData::set_PUThrLowHadLar
void set_PUThrLowHadLar(int PileUpThresholdLowHadLar)
Definition: jFEXDBCondData.cxx:134
LVL1::jFEXDBCondData::m_PileUpWeight_default
std::array< uint16_t, 4 > m_PileUpWeight_default
Definition: jFEXDBCondData.h:106
LVL1::jFEXDBCondData::m_PileUpCorrectionJet
bool m_PileUpCorrectionJet
Definition: jFEXDBCondData.h:83
LVL1::jFEXDBCondData::get_PUThrLowHadTrex
int get_PUThrLowHadTrex() const
Definition: jFEXDBCondData.cxx:55
LVL1::jFEXDBCondData::set_doPileUpMet
void set_doPileUpMet(bool PileUpCorrectionMET)
Definition: jFEXDBCondData.cxx:122
LVL1::jFEXDBCondData::DecodeOnlineID
std::array< int, 2 > DecodeOnlineID(uint16_t onlineID) const
Definition: jFEXDBCondData.cxx:184
LVL1::jFEXDBCondData::set_PUThrLowHadHecOverlap
void set_PUThrLowHadHecOverlap(int PileUpThresholdLowHadHecOverlap)
Definition: jFEXDBCondData.cxx:142
LVL1::jFEXDBCondData::get_PileUpValues
std::array< uint16_t, 4 > get_PileUpValues(uint16_t onlineID) const
Definition: jFEXDBCondData.cxx:98
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::jFEXDBCondData::get_PUThrLowHadLar
int get_PUThrLowHadLar() const
Definition: jFEXDBCondData.cxx:39
LVL1::jFEXDBCondData::set_PUThrHighHadTrex
void set_PUThrHighHadTrex(int PileUpThresholdHighHadTrex)
Definition: jFEXDBCondData.cxx:154
LVL1::jFEXDBCondData::m_PileUpThresholdHighHadLar
int m_PileUpThresholdHighHadLar
Definition: jFEXDBCondData.h:90
LVL1::jFEXDBCondData::m_PileUpThresholdLowFcal
int m_PileUpThresholdLowFcal
Definition: jFEXDBCondData.h:95
LVL1::jFEXDBCondData::m_PileUpThresholdHighHadTrex
int m_PileUpThresholdHighHadTrex
Definition: jFEXDBCondData.h:94
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1::jFEXDBCondData::set_PileUpValues
void set_PileUpValues(const std::unordered_map< uint16_t, std::array< uint16_t, 4 > > &PileUpWeight)
Definition: jFEXDBCondData.cxx:172
LVL1::jFEXDBCondData::get_doPileUpJet
bool get_doPileUpJet() const
Definition: jFEXDBCondData.cxx:23
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
LVL1::jFEXDBCondData::set_PUThrLowFcal
void set_PUThrLowFcal(int PileUpThresholdLowFcal)
Definition: jFEXDBCondData.cxx:158
LVL1::jFEXDBCondData::get_doPileUpMet
bool get_doPileUpMet() const
Definition: jFEXDBCondData.cxx:27
LVL1::jFEXDBCondData::m_jJCalibParams
std::vector< std::vector< int > > m_jJCalibParams
Definition: jFEXDBCondData.h:71
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LVL1::jFEXDBCondData::set_PUThrHighHadLar
void set_PUThrHighHadLar(int PileUpThresholdHighHadLar)
Definition: jFEXDBCondData.cxx:138
LVL1::jFEXDBCondData::get_jJCalibParams
const std::vector< int > & get_jJCalibParams(int module) const
Definition: jFEXDBCondData.cxx:19
LVL1::jFEXDBCondData::m_NoiseCuts
std::unordered_map< uint16_t, std::array< uint16_t, 4 > > m_NoiseCuts
Definition: jFEXDBCondData.h:100
lumiFormat.array
array
Definition: lumiFormat.py:91
LVL1::jFEXDBCondData::set_PUThrLowEm
void set_PUThrLowEm(int PileUpThresholdLowEm)
Definition: jFEXDBCondData.cxx:126
LVL1::jFEXDBCondData::get_NoiseCuts
std::array< uint16_t, 4 > get_NoiseCuts(uint16_t onlineID) const
Definition: jFEXDBCondData.cxx:71
LVL1::jFEXDBCondData::set_sendDefaults
void set_sendDefaults(bool sendDefaults)
Definition: jFEXDBCondData.cxx:179
LVL1::jFEXDBCondData::set_doPileUpJet
void set_doPileUpJet(bool PileUpCorrectionJet)
Definition: jFEXDBCondData.cxx:118
LVL1::jFEXDBCondData::get_jJCalibParam
int get_jJCalibParam(int module, int range) const
Getters.
Definition: jFEXDBCondData.cxx:15
LVL1::jFEXDBCondData::m_PileUpThresholdHighFcal
int m_PileUpThresholdHighFcal
Definition: jFEXDBCondData.h:96
LVL1::jFEXDBCondData::m_PileUpThresholdHighHadHecOverlap
int m_PileUpThresholdHighHadHecOverlap
Definition: jFEXDBCondData.h:92
LVL1::jFEXDBCondData::get_PUThrLowHadHecOverlap
int get_PUThrLowHadHecOverlap() const
Definition: jFEXDBCondData.cxx:47
LVL1::jFEXDBCondData::m_sendDefaults
bool m_sendDefaults
Definition: jFEXDBCondData.h:68
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
LVL1::jFEXDBCondData::set_NoiseCuts
void set_NoiseCuts(const std::unordered_map< uint16_t, std::array< uint16_t, 4 > > &NoiseCuts)
Definition: jFEXDBCondData.cxx:166
LVL1::jFEXDBCondData::set_PUThrLowHadTrex
void set_PUThrLowHadTrex(int PileUpThresholdLowHadTrex)
Definition: jFEXDBCondData.cxx:150
LVL1::jFEXDBCondData::get_PUThrHighFcal
int get_PUThrHighFcal() const
Definition: jFEXDBCondData.cxx:67
LVL1::jFEXDBCondData::get_PUThrLowFcal
int get_PUThrLowFcal() const
Definition: jFEXDBCondData.cxx:63
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
LVL1::jFEXDBCondData::m_PileUpThresholdLowHadHecOverlap
int m_PileUpThresholdLowHadHecOverlap
Definition: jFEXDBCondData.h:91