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

#include <jFEXsumETAlgo.h>

Inheritance diagram for LVL1::jFEXsumETAlgo:
Collaboration diagram for LVL1::jFEXsumETAlgo:

Public Member Functions

 jFEXsumETAlgo (const std::string &type, const std::string &name, const IInterface *parent)
 Constructors.
virtual StatusCode initialize () override
 standard Athena-Algorithm method
virtual StatusCode reset () override
virtual ~jFEXsumETAlgo ()
 Destructor.
virtual StatusCode safetyTest () 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 int getTTowerET (unsigned int TTID=0) const override
virtual void buildBarrelSumET () override
virtual void buildFWDSumET () override
virtual std::tuple< int, bool > getETlowerEta (uint bin) const override
virtual std::tuple< int, bool > getETupperEta (uint bin) const override
virtual void setFPGAEnergy (std::unordered_map< int, std::vector< int > > et_map) 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

bool getTTowerSat (unsigned int TTID)
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
std::vector< std::vector< int > > m_FPGA
std::vector< std::vector< int > > m_FPGA_phi02
std::vector< std::vector< int > > m_FPGA_fcal
std::vector< int > m_SumET
std::vector< bool > m_SumETSat
std::unordered_map< int, std::vector< int > > m_map_Etvalues
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 23 of file jFEXsumETAlgo.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

◆ jFEXsumETAlgo()

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

Constructors.

Definition at line 20 of file jFEXsumETAlgo.cxx.

20 : AthAlgTool(type, name, parent) {
21 declareInterface<IjFEXsumETAlgo>(this);
22}
AthAlgTool()
Default constructor:

◆ ~jFEXsumETAlgo()

LVL1::jFEXsumETAlgo::~jFEXsumETAlgo ( )
virtual

Destructor.

Definition at line 25 of file jFEXsumETAlgo.cxx.

25 {
26}

Member Function Documentation

◆ buildBarrelSumET()

void LVL1::jFEXsumETAlgo::buildBarrelSumET ( )
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 89 of file jFEXsumETAlgo.cxx.

90{
91 ATH_MSG_DEBUG("---------------- jFEXsumETAlgo::buildBarrelSumET ----------------");
92
93 m_SumET.clear();
94 m_SumET.resize(8,0);
95 m_SumETSat.clear();
96 m_SumETSat.resize(8,0);
97
98 for(uint iphi=0;iphi<m_FPGA.size();iphi++){
99 for(uint ieta=0;ieta<m_FPGA[iphi].size();ieta++){
100 m_SumET[ieta]+=getTTowerET(m_FPGA[iphi][ieta]);
101 m_SumETSat[ieta] = m_SumETSat[ieta] || getTTowerSat(m_FPGA[iphi][ieta]);
102 }
103 }
104
105}
#define ATH_MSG_DEBUG(x)
unsigned int uint
std::vector< bool > m_SumETSat
std::vector< int > m_SumET
std::vector< std::vector< int > > m_FPGA
virtual int getTTowerET(unsigned int TTID=0) const override
bool getTTowerSat(unsigned int TTID)

◆ buildFWDSumET()

void LVL1::jFEXsumETAlgo::buildFWDSumET ( )
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 108 of file jFEXsumETAlgo.cxx.

109{
110 ATH_MSG_DEBUG("---------------- jFEXsumETAlgo::buildFWDSumET ----------------");
111
112 m_SumET.clear();
113 m_SumET.resize(14,0);
114 m_SumETSat.clear();
115 m_SumETSat.resize(14,0);
116
117 // ECal with resolution of 0.1x0.1
118 for(uint iphi=0;iphi<m_FPGA.size();iphi++){
119 for(uint ieta=0;ieta<m_FPGA[iphi].size();ieta++){
120 m_SumET[ieta]+=getTTowerET(m_FPGA[iphi][ieta]);
121 m_SumETSat.at(ieta) = m_SumETSat.at(ieta) || getTTowerSat(m_FPGA[iphi][ieta]);
122 }
123 }
124
125 // ECal with resolution of 0.2x0.2
126 for(uint iphi=0;iphi<m_FPGA_phi02.size();iphi++){
127 for(uint ieta=0;ieta<m_FPGA_phi02[iphi].size();ieta++){
128 m_SumET[ieta+9]+=getTTowerET(m_FPGA_phi02[iphi][ieta]);
129 m_SumETSat.at(ieta+9) = m_SumETSat.at(ieta+9) || getTTowerSat(m_FPGA_phi02[iphi][ieta]);
130 }
131 }
132
133 // Fcal
134 for(uint iphi=0;iphi<m_FPGA_fcal.size();iphi++){
135 for(uint ieta=0;ieta<m_FPGA_fcal[iphi].size();ieta++){
136 m_SumET[13]+=getTTowerET(m_FPGA_fcal[iphi][ieta]); //All FCAL is considered one slice due to the non-aligment of the FCal layers
137 m_SumETSat.at(13) = m_SumETSat.at(13) || getTTowerSat(m_FPGA_fcal[iphi][ieta]);
138 }
139 }
140
141}
std::vector< std::vector< int > > m_FPGA_fcal
std::vector< std::vector< int > > m_FPGA_phi02

◆ 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

◆ getETlowerEta()

std::tuple< int, bool > LVL1::jFEXsumETAlgo::getETlowerEta ( uint bin) const
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 143 of file jFEXsumETAlgo.cxx.

144{
145 uint max = m_SumET.size() > (bin + 1) ? bin : m_SumET.size();
146 int SumlowEta = 0;
147 bool SumlowEtaSat = false;
148 for(uint ieta=0;ieta<max;ieta++){
149 SumlowEta += m_SumET.at(ieta);
150 SumlowEtaSat = SumlowEtaSat || m_SumETSat.at(ieta);
151 }
152 return {SumlowEta, SumlowEtaSat};
153}
size_t size() const
Number of registered mappings.
#define max(a, b)
Definition cfImp.cxx:41

◆ getETupperEta()

std::tuple< int, bool > LVL1::jFEXsumETAlgo::getETupperEta ( uint bin) const
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 157 of file jFEXsumETAlgo.cxx.

158{
159 uint min = m_SumET.size() > (bin + 1) ? bin : m_SumET.size();
160 int SumhighEta = 0;
161 bool SumhighEtaSat = false;
162 for(uint ieta=min;ieta<m_SumET.size();ieta++){
163 SumhighEta += m_SumET.at(ieta);
164 SumhighEtaSat = SumhighEtaSat || m_SumETSat.at(ieta);
165 }
166 return {SumhighEta, SumhighEtaSat};
167}
#define min(a, b)
Definition cfImp.cxx:40

◆ getTTowerET()

int LVL1::jFEXsumETAlgo::getTTowerET ( unsigned int TTID = 0) const
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 181 of file jFEXsumETAlgo.cxx.

181 {
182 if(TTID == 0) {
183 return 0;
184 }
185
186 auto itr = m_map_Etvalues.find(TTID);
187 if( itr == m_map_Etvalues.end()) {
188 return 0;
189 }
190
191 return (itr->second).at(1);
192}
std::unordered_map< int, std::vector< int > > m_map_Etvalues

◆ getTTowerSat()

bool LVL1::jFEXsumETAlgo::getTTowerSat ( unsigned int TTID)
private

Definition at line 171 of file jFEXsumETAlgo.cxx.

171 {
172 if(TTID == 0) {
173 return false;
174 }
175
176 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(TTID);
177 return tmpTower->getTowerSat();
178}
SG::ReadHandle< jTowerContainer > m_jTowerContainer
bool getTowerSat() const
Definition jTower.h:61

◆ initialize()

StatusCode LVL1::jFEXsumETAlgo::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 28 of file jFEXsumETAlgo.cxx.

28 {
29 ATH_CHECK(m_jTowerContainerKey.initialize());
30 return StatusCode::SUCCESS;
31}
#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::IjFEXsumETAlgo::interfaceID ( )
inlinestaticinherited

Definition at line 40 of file IjFEXsumETAlgo.h.

41{
42 return IID_IjFEXsumETAlgo;
43}
static const InterfaceID IID_IjFEXsumETAlgo("LVL1::IjFEXsumETAlgo", 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::jFEXsumETAlgo::reset ( )
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 45 of file jFEXsumETAlgo.cxx.

45 {
46 m_FPGA.clear();
47 m_FPGA_phi02.clear();
48 m_FPGA_fcal.clear();
49 return StatusCode::SUCCESS;
50}

◆ safetyTest()

StatusCode LVL1::jFEXsumETAlgo::safetyTest ( )
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 34 of file jFEXsumETAlgo.cxx.

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

◆ setFPGAEnergy()

void LVL1::jFEXsumETAlgo::setFPGAEnergy ( std::unordered_map< int, std::vector< int > > et_map)
overridevirtual

Implements LVL1::IjFEXsumETAlgo.

Definition at line 195 of file jFEXsumETAlgo.cxx.

195 {
196 m_map_Etvalues=std::move(et_map);
197}

◆ setup() [1/2]

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

Implements LVL1::IjFEXsumETAlgo.

Definition at line 53 of file jFEXsumETAlgo.cxx.

53 {
54
55 ATH_MSG_DEBUG("---------------- jFEXsumETAlgo::setup ----------------");
57 for(int iphi=0;iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height;iphi++){
58 for(int ieta=8;ieta<16;ieta++){
59 m_FPGA[iphi].push_back(FPGA[iphi][ieta]);
60 }
61 }
62}
static constexpr int jFEX_algoSpace_height

◆ setup() [2/2]

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

Implements LVL1::IjFEXsumETAlgo.

Definition at line 64 of file jFEXsumETAlgo.cxx.

64 {
65
66 ATH_MSG_DEBUG("---------------- jFEXsumETAlgo::setup ----------------");
68 for(int iphi=0;iphi<FEXAlgoSpaceDefs::jFEX_algoSpace_height;iphi++){
69 for(int ieta=8;ieta<17;ieta++){
70 m_FPGA[iphi].push_back(FPGA[iphi][ieta]);
71 }
72 }
73 m_FPGA_phi02.resize(16);
74 for(int iphi=0;iphi<16;iphi++){
75 for(int ieta=17;ieta<21;ieta++){
76 m_FPGA_phi02[iphi].push_back(FPGA[iphi][ieta]);
77 }
78 }
79 m_FPGA_fcal.resize(8);
80 for(int iphi=0;iphi<8;iphi++){
81 for(int ieta=21;ieta<FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width;ieta++){
82 m_FPGA_fcal[iphi].push_back(FPGA[iphi][ieta]);
83 }
84 }
85
86}
static constexpr int jFEX_wide_algoSpace_width

◆ 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_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_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

std::vector<std::vector<int> > LVL1::jFEXsumETAlgo::m_FPGA
private

Definition at line 52 of file jFEXsumETAlgo.h.

◆ m_FPGA_fcal

std::vector<std::vector<int> > LVL1::jFEXsumETAlgo::m_FPGA_fcal
private

Definition at line 54 of file jFEXsumETAlgo.h.

◆ m_FPGA_phi02

std::vector<std::vector<int> > LVL1::jFEXsumETAlgo::m_FPGA_phi02
private

Definition at line 53 of file jFEXsumETAlgo.h.

◆ m_jTowerContainer

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

Definition at line 51 of file jFEXsumETAlgo.h.

◆ m_jTowerContainerKey

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

Definition at line 50 of file jFEXsumETAlgo.h.

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

◆ m_map_Etvalues

std::unordered_map<int,std::vector<int> > LVL1::jFEXsumETAlgo::m_map_Etvalues
private

Definition at line 58 of file jFEXsumETAlgo.h.

◆ m_SumET

std::vector<int> LVL1::jFEXsumETAlgo::m_SumET
private

Definition at line 55 of file jFEXsumETAlgo.h.

◆ m_SumETSat

std::vector<bool> LVL1::jFEXsumETAlgo::m_SumETSat
private

Definition at line 56 of file jFEXsumETAlgo.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: