ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::jFEXPileupAndNoise Class Reference

#include <jFEXPileupAndNoise.h>

Inheritance diagram for LVL1::jFEXPileupAndNoise:
Collaboration diagram for LVL1::jFEXPileupAndNoise:

Public Member Functions

 jFEXPileupAndNoise (const std::string &type, const std::string &name, const IInterface *parent)
 Constructors.
virtual StatusCode initialize () override
 standard Athena-Algorithm method
virtual StatusCode safetyTest () override
virtual StatusCode reset () override
virtual void setup (int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]) override
virtual void setup (int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]) override
virtual std::unordered_map< int, std::vector< int > > GetEt_values () const override
virtual std::unordered_map< int, std::vector< int > > Get_EM_Et_values () override
virtual std::unordered_map< int, std::vector< int > > Get_HAD_Et_values () override
virtual ~jFEXPileupAndNoise ()
 Destructor.
virtual std::vector< int > CalculatePileup () override
virtual StatusCode ApplyPileup () override
virtual void ApplyNoise2Jets (bool b) override
virtual void ApplyNoise2Met (bool b) override
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void reset_conters ()
void SubtractPileup ()
void ApplyNoiseCuts (std::unordered_map< int, std::vector< int > > &map_Etvalues, int layer)
int rhoDivLUT (int ntowers) const
int getTTowerEta (const LVL1::jTower *tmpTower) const
int getTTowerET (const LVL1::jTower *tmpTower) const
int getET_EM (const LVL1::jTower *tmpTower) const
int getET_HAD (const LVL1::jTower *tmpTower) const
int getTTArea_EM (const LVL1::jTower *tmpTower) const
int getTTArea_HAD (const LVL1::jTower *tmpTower) const
int getTTAreaINV_EM (const LVL1::jTower *tmpTower) const
int getTTAreaINV_HAD (const LVL1::jTower *tmpTower) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< LVL1::jTowerContainerm_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "Input container for jTowers"}
SG::ReadHandle< jTowerContainerm_jTowerContainer
SG::ReadCondHandleKey< jFEXDBCondDatam_BDToolKey {this, "BDToolKey", "jFEXDBParams", "DB tool key"}
int m_FPGA_central [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width] ={{0}}
int m_FPGA_forward [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width] ={{0}}
int m_etaMAX =0
std::unordered_map< int, int > m_FPGA_ET_EM
std::unordered_map< int, int > m_FPGA_ET_HAD
int m_rho_EM = 0
int m_rho_HAD1 = 0
int m_rho_HAD2 = 0
int m_rho_HAD3 = 0
int m_rho_FCAL = 0
int m_count_rho_EM = 0
int m_count_rho_HAD1 = 0
int m_count_rho_HAD2 = 0
int m_count_rho_HAD3 = 0
int m_count_rho_FCAL = 0
bool m_is_FWD = false
bool m_apply_pileup2jets = false
bool m_apply_pileup2met = false
bool m_apply_noise2jets = false
bool m_apply_noise2met = false
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 27 of file jFEXPileupAndNoise.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ jFEXPileupAndNoise()

LVL1::jFEXPileupAndNoise::jFEXPileupAndNoise ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructors.

Definition at line 16 of file jFEXPileupAndNoise.cxx.

16 : AthAlgTool(type, name, parent) {
17 declareInterface<IjFEXPileupAndNoise>(this);
18}
AthAlgTool()
Default constructor:

◆ ~jFEXPileupAndNoise()

LVL1::jFEXPileupAndNoise::~jFEXPileupAndNoise ( )
virtual

Destructor.

Definition at line 21 of file jFEXPileupAndNoise.cxx.

21 {
22}

Member Function Documentation

◆ ApplyNoise2Jets()

void LVL1::jFEXPileupAndNoise::ApplyNoise2Jets ( bool b)
overridevirtual

◆ ApplyNoise2Met()

void LVL1::jFEXPileupAndNoise::ApplyNoise2Met ( bool b)
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 280 of file jFEXPileupAndNoise.cxx.

◆ ApplyNoiseCuts()

void LVL1::jFEXPileupAndNoise::ApplyNoiseCuts ( std::unordered_map< int, std::vector< int > > & map_Etvalues,
int layer )
private

Definition at line 390 of file jFEXPileupAndNoise.cxx.

390 {
391
392 const LVL1::jTower *tmpTower;
393
394 for(auto [key,vec] : map_Etvalues){
395
396 tmpTower = m_jTowerContainer->findTower(key);
397 int Jet_NoiseCut = tmpTower->getNoiseForJet(layer);
398 int Met_NoiseCut = tmpTower->getNoiseForMet(layer);
399
400 if(m_apply_noise2jets && map_Etvalues[key][0]<=Jet_NoiseCut){ // Et for jets
401 map_Etvalues[key][0]=0.;
402 }
403 if(m_apply_noise2met && map_Etvalues[key][1]<=Met_NoiseCut){ // Et for Met
404 map_Etvalues[key][1]=0.;
405 }
406
407 }
408
409}
std::vector< size_t > vec
SG::ReadHandle< jTowerContainer > m_jTowerContainer
int getNoiseForJet(int layer) const
Definition jTower.cxx:348
int getNoiseForMet(int layer) const
Definition jTower.cxx:339

◆ ApplyPileup()

StatusCode LVL1::jFEXPileupAndNoise::ApplyPileup ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 263 of file jFEXPileupAndNoise.cxx.

263 {
264 SG::ReadCondHandle<jFEXDBCondData> myDBTool = SG::ReadCondHandle<jFEXDBCondData>(m_BDToolKey);
265 if(! myDBTool.isValid()) {
266 ATH_MSG_ERROR("Could not retrieve DB tool " << m_BDToolKey);
267 return StatusCode::FAILURE;
268 }
269
270 m_apply_pileup2jets = myDBTool->get_doPileUpJet();
271 m_apply_pileup2met = myDBTool->get_doPileUpMet();
272
273 return StatusCode::SUCCESS;
274}
#define ATH_MSG_ERROR(x)
SG::ReadCondHandleKey< jFEXDBCondData > m_BDToolKey

◆ CalculatePileup()

std::vector< int > LVL1::jFEXPileupAndNoise::CalculatePileup ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 93 of file jFEXPileupAndNoise.cxx.

93 {
94
96
97 SG::ReadCondHandle<jFEXDBCondData> myDBTool = SG::ReadCondHandle<jFEXDBCondData>(m_BDToolKey/*, ctx*/);
98 if(! myDBTool.isValid()) {
99 ATH_MSG_ERROR("Could not retrieve DB tool " << m_BDToolKey);
100 }
101
102 for(int iphi=0;iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height;iphi++){
103 for(int ieta=0;ieta<m_etaMAX;ieta++){
104
105 int TTID = 0;
106
107 if(m_is_FWD){
108 TTID = m_FPGA_forward[iphi][ieta];
109 }
110 else{
111 TTID = m_FPGA_central[iphi][ieta];
112 }
113
114 if(TTID == 0){
115 continue; //skipping TTID iqual to 0
116 }
117
118 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(TTID);
119
120 int tmp_eta = getTTowerEta(tmpTower);
121 // energies used below are in MeV, but to reproduce firmware behavior we need to truncate at the same position,
122 // i.e., temporarily go back to the granularity used in firmware!
123 int em_granularity = 25;
124 int had_granularity = tmp_eta < 15 ? 500 : 25; //For Tile inputs granularity is 500MeV, for LAr 25MeV
125 //storing the energies
126 int tmp_energy_EM = getET_EM(tmpTower)/em_granularity;
127 int tmp_energy_HAD = getET_HAD(tmpTower)/had_granularity;
128 int tmp_EM_AreaINV = getTTAreaINV_EM(tmpTower);
129 int tmp_HD_AreaINV = getTTAreaINV_HAD(tmpTower);
130 m_FPGA_ET_EM[TTID] = getET_EM(tmpTower);
131 m_FPGA_ET_HAD[TTID] = getET_HAD(tmpTower);
132
133 tmp_energy_EM = (tmp_energy_EM * tmp_EM_AreaINV)/(1<<FEXAlgoSpaceDefs::pu_AreaINV);
134 tmp_energy_HAD= (tmp_energy_HAD* tmp_HD_AreaINV)/(1<<FEXAlgoSpaceDefs::pu_AreaINV);
135
136 //calculating rho's
137
138 // EM layer ( not EM FCAL!! )
139
140 if(tmp_eta < 32 ){
141 if(tmp_energy_EM > myDBTool->get_PUThrLowEm() and tmp_energy_EM < myDBTool->get_PUThrHighEm()) {
142 m_rho_EM += tmp_energy_EM;
144 }
145 }
146
147 // Tile layer
148 if(tmp_eta < 15){
149 if(tmp_energy_HAD > myDBTool->get_PUThrLowHadTrex() and tmp_energy_HAD < myDBTool->get_PUThrHighHadTrex()){
150 m_rho_HAD1 += tmp_energy_HAD;
152 }
153 }
154 // HEC Overlap layer!
155 else if(tmp_eta < 16 ){
156 if(tmp_energy_HAD > myDBTool->get_PUThrLowHadHecOverlap() and tmp_energy_HAD < myDBTool->get_PUThrHighHadHecOverlap()){
157 m_rho_HAD2 += tmp_energy_HAD;
159 }
160 }
161 // Rest of HEC without overlap
162 else if(tmp_eta < 32 ){
163 if(tmp_energy_HAD > myDBTool->get_PUThrLowHadLar() and tmp_energy_HAD < myDBTool->get_PUThrHighHadLar()){
164 m_rho_HAD3 += tmp_energy_HAD;
166 }
167 }
168 // FCAL is treated here!
169 else if(tmp_eta >= 32){
170
171 // Contributes the HAD layer (FCAL2 and FCAL3)
173 if(tmp_energy_HAD > myDBTool->get_PUThrLowFcal() and tmp_energy_HAD < myDBTool->get_PUThrHighFcal()){
174 m_rho_FCAL += tmp_energy_HAD;
176 }
177 }
178 // FCAL1 is EM layer so the energy is suposed to be in the EM layer
179 else{
180 if(tmp_energy_EM > myDBTool->get_PUThrLowFcal() and tmp_energy_EM < myDBTool->get_PUThrHighFcal()){
181 m_rho_FCAL += tmp_energy_EM;
183 }
184 }
185 }
186 }
187 }//end of iphi loop
188
189 //calculating rho values for each region
195
196 //return values in MeV -> m_rho_HAD1 corresponds to TileCal, so 500MeV/count, rest is 25MeV/count
197 //note: do not convert the internal values yet, this needs to happen after the PU correction is applied
198 // to fully reproduce FW behavior!
199 std::vector<int> rho_values {m_rho_EM*25,m_rho_HAD1*500,m_rho_HAD2*25,m_rho_HAD3*25,m_rho_FCAL*25};
200
202
203 return rho_values;
204}
static constexpr unsigned int pu_AreaINV
static constexpr unsigned int pu_rhoLUT
static constexpr int jFEX_FCAL2_start
static constexpr int jFEX_algoSpace_height
std::unordered_map< int, int > m_FPGA_ET_EM
int m_FPGA_central[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]
std::unordered_map< int, int > m_FPGA_ET_HAD
int getTTAreaINV_HAD(const LVL1::jTower *tmpTower) const
int m_FPGA_forward[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
int rhoDivLUT(int ntowers) const
int getTTowerEta(const LVL1::jTower *tmpTower) const
int getET_EM(const LVL1::jTower *tmpTower) const
int getTTAreaINV_EM(const LVL1::jTower *tmpTower) const
int getET_HAD(const LVL1::jTower *tmpTower) const

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ Get_EM_Et_values()

std::unordered_map< int, std::vector< int > > LVL1::jFEXPileupAndNoise::Get_EM_Et_values ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 286 of file jFEXPileupAndNoise.cxx.

286 {
287
288 // map for energies sent to the FPGA
289 m_map_Etvalues_EM.clear();
290
291
292 for(int iphi=0; iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height; iphi++) {
293 for(int ieta=0; ieta<m_etaMAX; ieta++) {
294
295 int TTID = 0;
296
297 if(m_is_FWD) {
298 TTID = m_FPGA_forward[iphi][ieta];
299 }
300 else {
301 TTID = m_FPGA_central[iphi][ieta];
302 }
303
304 if(TTID == 0) continue; //skipping TTID iqual to 0
305 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(TTID);
306
307 // tmp variable to fill the map
308 std::vector<int> v_energies;
309 v_energies.clear();
310 v_energies.resize(2,0);
311
312 //saving the SG energy
313 int tmp_TotalEt_jet=getET_EM(tmpTower);
314 int tmp_TotalEt_met=getET_EM(tmpTower);
315
316 // if true changing the raw energy to the pileup subtracted energy for jets
318 tmp_TotalEt_jet = m_FPGA_ET_EM[TTID];
319 }
320
321 // if true changing the raw energy to the pileup subtracted energy for met
323 tmp_TotalEt_met = m_FPGA_ET_EM[TTID];
324 }
325
326 v_energies[0]=tmp_TotalEt_jet;
327 v_energies[1]=tmp_TotalEt_met;
328
329 m_map_Etvalues_EM.insert(std::make_pair(TTID, v_energies));
330 }
331 }
332
334
335 return m_map_Etvalues_EM;
336}
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
void ApplyNoiseCuts(std::unordered_map< int, std::vector< int > > &map_Etvalues, int layer)

◆ Get_HAD_Et_values()

std::unordered_map< int, std::vector< int > > LVL1::jFEXPileupAndNoise::Get_HAD_Et_values ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 338 of file jFEXPileupAndNoise.cxx.

338 {
339
340 // map for energies sent to the FPGA
341 m_map_Etvalues_HAD.clear();
342
343
344 for(int iphi=0; iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height; iphi++) {
345 for(int ieta=0; ieta<m_etaMAX; ieta++) {
346
347 int TTID = 0;
348
349 if(m_is_FWD) {
350 TTID = m_FPGA_forward[iphi][ieta];
351 }
352 else {
353 TTID = m_FPGA_central[iphi][ieta];
354 }
355
356 if(TTID == 0) continue; //skipping TTID iqual to 0
357 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(TTID);
358
359 // tmp variable to fill the map
360 std::vector<int> v_energies;
361 v_energies.clear();
362 v_energies.resize(2,0);
363
364 //saving the SG energy
365 int tmp_TotalEt_jet=getET_HAD(tmpTower);
366 int tmp_TotalEt_met=getET_HAD(tmpTower);
367
368 // if true changing the raw energy to the pileup subtracted energy for jets
370 tmp_TotalEt_jet = m_FPGA_ET_HAD[TTID];
371 }
372
373 // if true changing the raw energy to the pileup subtracted energy for met
375 tmp_TotalEt_met = m_FPGA_ET_HAD[TTID];
376 }
377
378 v_energies[0]=tmp_TotalEt_jet;
379 v_energies[1]=tmp_TotalEt_met;
380
381 m_map_Etvalues_HAD.insert(std::make_pair(TTID, v_energies));
382 }
383 }
384
386
387 return m_map_Etvalues_HAD;
388}
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD

◆ getET_EM()

int LVL1::jFEXPileupAndNoise::getET_EM ( const LVL1::jTower * tmpTower) const
private

Definition at line 445 of file jFEXPileupAndNoise.cxx.

445 {
446 return tmpTower->getET_EM();
447}
int getET_EM() const
Get EM ET value in MeV.
Definition jTower.h:131

◆ getET_HAD()

int LVL1::jFEXPileupAndNoise::getET_HAD ( const LVL1::jTower * tmpTower) const
private

Definition at line 449 of file jFEXPileupAndNoise.cxx.

449 {
450 return tmpTower->getET_HAD();
451}
int getET_HAD() const
Get HAD ET value in MeV.
Definition jTower.h:134

◆ GetEt_values()

std::unordered_map< int, std::vector< int > > LVL1::jFEXPileupAndNoise::GetEt_values ( ) const
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 411 of file jFEXPileupAndNoise.cxx.

411 {
412
413 // map for energies sent to the FPGA
414 std::unordered_map<int,std::vector<int> > map_Etvalues;
415
416 /*
417 * The vector Et_energy has size 2
418 * Et_energy[0] is used un the Jet algos
419 * Et_energy[1] is used un the Met/SumEt algos
420 */
421 std::vector<int> Et_energy;
422
423 for(auto [key,vec] : m_map_Etvalues_EM){
424
425 Et_energy.clear();
426 Et_energy.resize(2,0);
427
428 Et_energy[0] = m_map_Etvalues_EM.at(key)[0] + m_map_Etvalues_HAD.at(key)[0];
429 Et_energy[1] = m_map_Etvalues_EM.at(key)[1] + m_map_Etvalues_HAD.at(key)[1];
430 map_Etvalues[key] = Et_energy;
431 }
432 return map_Etvalues;
433}

◆ getTTArea_EM()

int LVL1::jFEXPileupAndNoise::getTTArea_EM ( const LVL1::jTower * tmpTower) const
private

Definition at line 454 of file jFEXPileupAndNoise.cxx.

454 {
455 return tmpTower->getTTowerArea(0);
456}
int getTTowerArea(int layer) const
Definition jTower.cxx:322

◆ getTTArea_HAD()

int LVL1::jFEXPileupAndNoise::getTTArea_HAD ( const LVL1::jTower * tmpTower) const
private

Definition at line 459 of file jFEXPileupAndNoise.cxx.

459 {
460 return tmpTower->getTTowerArea(1);
461}

◆ getTTAreaINV_EM()

int LVL1::jFEXPileupAndNoise::getTTAreaINV_EM ( const LVL1::jTower * tmpTower) const
private

Definition at line 464 of file jFEXPileupAndNoise.cxx.

464 {
465 return tmpTower->getTTowerAreaInv(0);
466}
int getTTowerAreaInv(int layer) const
Definition jTower.cxx:330

◆ getTTAreaINV_HAD()

int LVL1::jFEXPileupAndNoise::getTTAreaINV_HAD ( const LVL1::jTower * tmpTower) const
private

Definition at line 469 of file jFEXPileupAndNoise.cxx.

469 {
470 return tmpTower->getTTowerAreaInv(1);
471}

◆ getTTowerET()

int LVL1::jFEXPileupAndNoise::getTTowerET ( const LVL1::jTower * tmpTower) const
private

Definition at line 441 of file jFEXPileupAndNoise.cxx.

441 {
442 return tmpTower->getTotalET();
443}
int getTotalET() const
Get ET sum of all cells in the jTower in MeV.
Definition jTower.cxx:199

◆ getTTowerEta()

int LVL1::jFEXPileupAndNoise::getTTowerEta ( const LVL1::jTower * tmpTower) const
private

Definition at line 437 of file jFEXPileupAndNoise.cxx.

437 {
438 return tmpTower->iEta() < 0 ? std::abs(tmpTower->iEta()+1) : tmpTower->iEta() ;
439}
int iEta() const
Get coordinates of tower.
Definition jTower.cxx:167
setScale setgFexType iEta

◆ initialize()

StatusCode LVL1::jFEXPileupAndNoise::initialize ( )
overridevirtual

standard Athena-Algorithm method

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 24 of file jFEXPileupAndNoise.cxx.

24 {
25
26 ATH_CHECK(m_jTowerContainerKey.initialize());
27 ATH_CHECK( m_BDToolKey.initialize() );
28
29 return StatusCode::SUCCESS;
30}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & LVL1::IjFEXPileupAndNoise::interfaceID ( )
inlinestaticinherited

Definition at line 45 of file IjFEXPileupAndNoise.h.

46{
48}
static const InterfaceID IID_IjFEXPileupAndNoise("LVL1::IjFEXPileupAndNoise", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ reset()

StatusCode LVL1::jFEXPileupAndNoise::reset ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 44 of file jFEXPileupAndNoise.cxx.

44 {
45
46 m_is_FWD=0;
51
53
54 return StatusCode::SUCCESS;
55}

◆ reset_conters()

void LVL1::jFEXPileupAndNoise::reset_conters ( )
private

Definition at line 57 of file jFEXPileupAndNoise.cxx.

57 {
58
59 m_rho_EM = 0;
60 m_rho_HAD1 = 0;
61 m_rho_HAD2 = 0;
62 m_rho_HAD3 = 0;
63 m_rho_FCAL = 0;
64
70}

◆ rhoDivLUT()

int LVL1::jFEXPileupAndNoise::rhoDivLUT ( int ntowers) const
private

Definition at line 206 of file jFEXPileupAndNoise.cxx.

206 {
207
208 //This is to save one bit in the firmware (19 bit will set be set to 1 instead of the 20th bit and rest are 0)
209 if(ntowers == 1) return ((1<<FEXAlgoSpaceDefs::pu_rhoLUT) - 1);
210 return static_cast<int>((1.0/ntowers)*(1<<FEXAlgoSpaceDefs::pu_rhoLUT) );
211}

◆ safetyTest()

StatusCode LVL1::jFEXPileupAndNoise::safetyTest ( )
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 33 of file jFEXPileupAndNoise.cxx.

33 {
34
35 m_jTowerContainer = SG::ReadHandle<jTowerContainer>(m_jTowerContainerKey);
36 if(! m_jTowerContainer.isValid()) {
37 ATH_MSG_ERROR("Could not retrieve jTowerContainer " << m_jTowerContainerKey.key());
38 return StatusCode::FAILURE;
39 }
40
41 return StatusCode::SUCCESS;
42}

◆ setup() [1/2]

void LVL1::jFEXPileupAndNoise::setup ( int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width])
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 74 of file jFEXPileupAndNoise.cxx.

74 {
75
76 ATH_MSG_DEBUG("---------------- jFEXPileupAndNoise::setup ----------------");
77 m_is_FWD = 0; //central region
80}
#define ATH_MSG_DEBUG(x)
static constexpr int jFEX_thin_algoSpace_width

◆ setup() [2/2]

void LVL1::jFEXPileupAndNoise::setup ( int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width])
overridevirtual

Implements LVL1::IjFEXPileupAndNoise.

Definition at line 84 of file jFEXPileupAndNoise.cxx.

84 {
85
86 ATH_MSG_DEBUG("---------------- jFEXPileupAndNoise::setup ----------------");
87 m_is_FWD = 1; //forward region
90}
static constexpr int jFEX_wide_algoSpace_width

◆ SubtractPileup()

void LVL1::jFEXPileupAndNoise::SubtractPileup ( )
private

Definition at line 213 of file jFEXPileupAndNoise.cxx.

213 {
214
215 for(int iphi=0; iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height; iphi++) {
216 for(int ieta=0; ieta<m_etaMAX; ieta++) {
217
218 int TTID = 0;
219
220 if(m_is_FWD) {
221 TTID = m_FPGA_forward[iphi][ieta];
222 }
223 else {
224 TTID = m_FPGA_central[iphi][ieta];
225 }
226
227 if(TTID == 0) continue; //skipping TTID iqual to 0
228
229 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(TTID);
230 int tmp_eta = getTTowerEta(tmpTower);
231 int tmp_EM_Area = getTTArea_EM(tmpTower);
232 int tmp_HD_Area = getTTArea_HAD(tmpTower);
233
234 if(tmp_eta < 32) {
235 m_FPGA_ET_EM[TTID] =m_FPGA_ET_EM[TTID] - ((m_rho_EM * tmp_EM_Area)/(1<<FEXAlgoSpaceDefs::pu_Area)) * 25; //factor 25: jFEX internal counts -> MeV (LAr)
236 }
237
238 if(tmp_eta < 15) {
239 m_FPGA_ET_HAD[TTID]=m_FPGA_ET_HAD[TTID] - ((m_rho_HAD1 * tmp_HD_Area)/(1<<FEXAlgoSpaceDefs::pu_Area)) * 500; //factor 500: jFEX internal counts -> MeV (Tile)
240 }
241 else if(tmp_eta < 16 ) {
242 m_FPGA_ET_HAD[TTID]=m_FPGA_ET_HAD[TTID] - ((m_rho_HAD2 * tmp_HD_Area)/(1<<FEXAlgoSpaceDefs::pu_Area)) * 25; //factor 25: jFEX internal counts -> MeV (LAr)
243 }
244 else if(tmp_eta < 32 ) {
245 m_FPGA_ET_HAD[TTID]=m_FPGA_ET_HAD[TTID] - ((m_rho_HAD3 * tmp_HD_Area)/(1<<FEXAlgoSpaceDefs::pu_Area)) * 25; //factor 25: jFEX internal counts -> MeV (LAr)
246 }
247 else if(tmp_eta >= 32) {
248 // Contributes the HAD layer (FCAL2 and FCAL3)
250 m_FPGA_ET_HAD[TTID] = m_FPGA_ET_HAD[TTID] - ((m_rho_FCAL * (tmp_HD_Area))/(1<<FEXAlgoSpaceDefs::pu_Area)) * 25; //factor 25: jFEX internal counts -> MeV (LAr)
251 }
252 // FCAL1 is EM layer so the energy is suposed to be in the EM layer
253 else{
254 m_FPGA_ET_EM[TTID] = m_FPGA_ET_EM[TTID] - ((m_rho_FCAL * (tmp_EM_Area))/(1<<FEXAlgoSpaceDefs::pu_Area)) * 25; //factor 25: jFEX internal counts -> MeV (LAr)
255 }
256 }
257 }
258 }
259}
static constexpr unsigned int pu_Area
int getTTArea_HAD(const LVL1::jTower *tmpTower) const
int getTTArea_EM(const LVL1::jTower *tmpTower) const

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_apply_noise2jets

bool LVL1::jFEXPileupAndNoise::m_apply_noise2jets = false
private

Definition at line 89 of file jFEXPileupAndNoise.h.

◆ m_apply_noise2met

bool LVL1::jFEXPileupAndNoise::m_apply_noise2met = false
private

Definition at line 90 of file jFEXPileupAndNoise.h.

◆ m_apply_pileup2jets

bool LVL1::jFEXPileupAndNoise::m_apply_pileup2jets = false
private

Definition at line 87 of file jFEXPileupAndNoise.h.

◆ m_apply_pileup2met

bool LVL1::jFEXPileupAndNoise::m_apply_pileup2met = false
private

Definition at line 88 of file jFEXPileupAndNoise.h.

◆ m_BDToolKey

SG::ReadCondHandleKey<jFEXDBCondData> LVL1::jFEXPileupAndNoise::m_BDToolKey {this, "BDToolKey", "jFEXDBParams", "DB tool key"}
private

Definition at line 61 of file jFEXPileupAndNoise.h.

61{this, "BDToolKey", "jFEXDBParams", "DB tool key"};

◆ m_count_rho_EM

int LVL1::jFEXPileupAndNoise::m_count_rho_EM = 0
private

Definition at line 79 of file jFEXPileupAndNoise.h.

◆ m_count_rho_FCAL

int LVL1::jFEXPileupAndNoise::m_count_rho_FCAL = 0
private

Definition at line 83 of file jFEXPileupAndNoise.h.

◆ m_count_rho_HAD1

int LVL1::jFEXPileupAndNoise::m_count_rho_HAD1 = 0
private

Definition at line 80 of file jFEXPileupAndNoise.h.

◆ m_count_rho_HAD2

int LVL1::jFEXPileupAndNoise::m_count_rho_HAD2 = 0
private

Definition at line 81 of file jFEXPileupAndNoise.h.

◆ m_count_rho_HAD3

int LVL1::jFEXPileupAndNoise::m_count_rho_HAD3 = 0
private

Definition at line 82 of file jFEXPileupAndNoise.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etaMAX

int LVL1::jFEXPileupAndNoise::m_etaMAX =0
private

Definition at line 66 of file jFEXPileupAndNoise.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_FPGA_central

int LVL1::jFEXPileupAndNoise::m_FPGA_central[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width] ={{0}}
private

Definition at line 63 of file jFEXPileupAndNoise.h.

63{0}};

◆ m_FPGA_ET_EM

std::unordered_map<int,int > LVL1::jFEXPileupAndNoise::m_FPGA_ET_EM
private

Definition at line 68 of file jFEXPileupAndNoise.h.

◆ m_FPGA_ET_HAD

std::unordered_map<int,int > LVL1::jFEXPileupAndNoise::m_FPGA_ET_HAD
private

Definition at line 69 of file jFEXPileupAndNoise.h.

◆ m_FPGA_forward

int LVL1::jFEXPileupAndNoise::m_FPGA_forward[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width] ={{0}}
private

Definition at line 64 of file jFEXPileupAndNoise.h.

64{0}};

◆ m_is_FWD

bool LVL1::jFEXPileupAndNoise::m_is_FWD = false
private

Definition at line 86 of file jFEXPileupAndNoise.h.

◆ m_jTowerContainer

SG::ReadHandle<jTowerContainer> LVL1::jFEXPileupAndNoise::m_jTowerContainer
private

Definition at line 59 of file jFEXPileupAndNoise.h.

◆ m_jTowerContainerKey

SG::ReadHandleKey<LVL1::jTowerContainer> LVL1::jFEXPileupAndNoise::m_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "Input container for jTowers"}
private

Definition at line 58 of file jFEXPileupAndNoise.h.

58{this, "MyjTowers", "jTowerContainer", "Input container for jTowers"};

◆ m_map_Etvalues_EM

std::unordered_map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::m_map_Etvalues_EM
private

Definition at line 107 of file jFEXPileupAndNoise.h.

◆ m_map_Etvalues_HAD

std::unordered_map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::m_map_Etvalues_HAD
private

Definition at line 108 of file jFEXPileupAndNoise.h.

◆ m_rho_EM

int LVL1::jFEXPileupAndNoise::m_rho_EM = 0
private

Definition at line 72 of file jFEXPileupAndNoise.h.

◆ m_rho_FCAL

int LVL1::jFEXPileupAndNoise::m_rho_FCAL = 0
private

Definition at line 76 of file jFEXPileupAndNoise.h.

◆ m_rho_HAD1

int LVL1::jFEXPileupAndNoise::m_rho_HAD1 = 0
private

Definition at line 73 of file jFEXPileupAndNoise.h.

◆ m_rho_HAD2

int LVL1::jFEXPileupAndNoise::m_rho_HAD2 = 0
private

Definition at line 74 of file jFEXPileupAndNoise.h.

◆ m_rho_HAD3

int LVL1::jFEXPileupAndNoise::m_rho_HAD3 = 0
private

Definition at line 75 of file jFEXPileupAndNoise.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: