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

#include <jFEXSmallRJetAlgo.h>

Inheritance diagram for LVL1::jFEXSmallRJetAlgo:
Collaboration diagram for LVL1::jFEXSmallRJetAlgo:

Public Member Functions

 jFEXSmallRJetAlgo (const std::string &type, const std::string &name, const IInterface *parent)
 Constructors.
virtual StatusCode initialize () override
 standard Athena-Algorithm method
virtual ~jFEXSmallRJetAlgo ()
 Destructor.
virtual StatusCode safetyTest () override
virtual void setup (int inputTable[7][7], int inputTableDisplaced[7][7]) override
virtual unsigned int getTTowerET (unsigned int TTID) const override
virtual void buildSeeds () override
virtual bool isSeedLocalMaxima (int seedThreshold) override
virtual unsigned int getSeedET () const override
virtual unsigned int getSmallClusterET () const override
virtual unsigned int getSmallETRing () const override
virtual unsigned int getTTIDcentre () const override
virtual bool getSRjetSat () const override
virtual void setFPGAEnergy (const 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

void calcSaturation ()
bool getTTowerSat (unsigned int TTID)
bool CalculateLM (int mymatrix[5][5])
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
bool m_JetSaturation = false
int m_jFEXalgoTowerID [7][7] = {{0}}
int m_jFEXalgoTowerID_displaced [7][7] = {{0}}
int m_jFEXalgoSearchWindowSeedET [5][5] = {{0}}
int m_jFEXalgoSearchWindowSeedET_displaced [5][5] = {{0}}
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 28 of file jFEXSmallRJetAlgo.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

◆ jFEXSmallRJetAlgo()

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

Constructors.

Definition at line 18 of file jFEXSmallRJetAlgo.cxx.

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

◆ ~jFEXSmallRJetAlgo()

LVL1::jFEXSmallRJetAlgo::~jFEXSmallRJetAlgo ( )
virtual

Destructor.

Definition at line 25 of file jFEXSmallRJetAlgo.cxx.

26{
27}

Member Function Documentation

◆ buildSeeds()

void LVL1::jFEXSmallRJetAlgo::buildSeeds ( )
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 78 of file jFEXSmallRJetAlgo.cxx.

79{
80
81 for(int mphi = 1; mphi < 6; mphi++) {
82 for(int meta = 1; meta< 6; meta++) {
83
84 int seedTotalET = 0;
85 int seedTotalET_displaced = 0;
86 for(int iphi = -1; iphi < 2; iphi++) {
87 for(int ieta = -1; ieta < 2; ieta++) {
88 //for that TT, build the seed
89 //here we sum TT ET to calculate seed
90 seedTotalET += getTTowerET(m_jFEXalgoTowerID [mphi + iphi][meta + ieta]);
91 seedTotalET_displaced += getTTowerET(m_jFEXalgoTowerID_displaced[mphi + iphi][meta + ieta]);
92 }
93 }
94 m_jFEXalgoSearchWindowSeedET[mphi -1][meta -1] = seedTotalET;
95 m_jFEXalgoSearchWindowSeedET_displaced[mphi -1][meta -1] = seedTotalET_displaced;
96 }
97 }
98}
virtual unsigned int getTTowerET(unsigned int TTID) const override
int m_jFEXalgoSearchWindowSeedET_displaced[5][5]

◆ calcSaturation()

void LVL1::jFEXSmallRJetAlgo::calcSaturation ( )
private

Definition at line 166 of file jFEXSmallRJetAlgo.cxx.

166 {
167
168 m_JetSaturation = false;
169 for(int nphi = -3; nphi< 4; nphi++) {
170 for(int neta = -3; neta< 4; neta++) {
171 int DeltaRSquared = std::pow(nphi,2)+std::pow(neta,2);
172 if(DeltaRSquared < 16) {
174 }
175 }
176 }
177}
bool getTTowerSat(unsigned int TTID)

◆ CalculateLM()

bool LVL1::jFEXSmallRJetAlgo::CalculateLM ( int mymatrix[5][5])
private

Definition at line 101 of file jFEXSmallRJetAlgo.cxx.

101 {
102
103 //here put the 24 conditions to determine if the TT seed is a local maxima.
104 int central_seed = mymatrix[2][2];
105 for (int iphi = 0; iphi < 5; iphi++) {
106 for (int ieta = 0; ieta < 5; ieta++) {
107 //avoid comparing central seed to itself
108 if ((ieta == 2) && (iphi == 2)) {
109 continue;
110 }
111 //strictly less than central
112 if( (iphi > ieta) || (iphi == 0 && ieta == 0) || (iphi == 1 && ieta == 1) ) {
113 if(central_seed < mymatrix[iphi][ieta]) {
114 return false;
115 }
116 }
117 //less than or equal to central
118 if((iphi < ieta) || (iphi == 3 && ieta == 3) || (iphi == 4 && ieta == 4)) {
119 if(central_seed <= mymatrix[iphi][ieta]) {
120 return false;
121 }
122 }
123 }
124 }
125
126 return true;
127}

◆ 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

◆ getSeedET()

unsigned int LVL1::jFEXSmallRJetAlgo::getSeedET ( ) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 145 of file jFEXSmallRJetAlgo.cxx.

145 {
146 // only valid after calling buildSeeds() !
147 return m_jFEXalgoSearchWindowSeedET[2][2];
148}

◆ getSmallClusterET()

unsigned int LVL1::jFEXSmallRJetAlgo::getSmallClusterET ( ) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 152 of file jFEXSmallRJetAlgo.cxx.

152 {
153
154 int SRJetClusterET = 0;
155 for(int nphi = -3; nphi< 4; nphi++) {
156 for(int neta = -3; neta< 4; neta++) {
157 int DeltaRSquared = std::pow(nphi,2)+std::pow(neta,2);
158 if(DeltaRSquared < 16) {
159 SRJetClusterET += getTTowerET(m_jFEXalgoTowerID[3+nphi][3+neta]);
160 }
161 }
162 }
163 return SRJetClusterET;
164}

◆ getSmallETRing()

unsigned int LVL1::jFEXSmallRJetAlgo::getSmallETRing ( ) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 183 of file jFEXSmallRJetAlgo.cxx.

183 {
184 int SmallETRing = getSmallClusterET() - m_jFEXalgoSearchWindowSeedET[3][3];
185 return SmallETRing;
186}
virtual unsigned int getSmallClusterET() const override

◆ getSRjetSat()

bool LVL1::jFEXSmallRJetAlgo::getSRjetSat ( ) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 179 of file jFEXSmallRJetAlgo.cxx.

179 {
180 return m_JetSaturation;
181}

◆ getTTIDcentre()

unsigned int LVL1::jFEXSmallRJetAlgo::getTTIDcentre ( ) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 188 of file jFEXSmallRJetAlgo.cxx.

188 {
189 return m_jFEXalgoTowerID[3][3];
190}

◆ getTTowerET()

unsigned int LVL1::jFEXSmallRJetAlgo::getTTowerET ( unsigned int TTID) const
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 64 of file jFEXSmallRJetAlgo.cxx.

64 {
65 if(TTID == 0) {
66 return 0;
67 }
68
69 if(m_map_Etvalues.find(TTID) != m_map_Etvalues.end()) {
70 return m_map_Etvalues.at(TTID).at(0);
71 }
72
73 //we shouldn't arrive here
74 return 0;
75}
std::unordered_map< int, std::vector< int > > m_map_Etvalues

◆ getTTowerSat()

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

Definition at line 198 of file jFEXSmallRJetAlgo.cxx.

198 {
199 if(TTID == 0) {
200 return false;
201 }
202
203 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(TTID);
204 return tmpTower->getTowerSat();
205}
SG::ReadHandle< jTowerContainer > m_jTowerContainer
bool getTowerSat() const
Definition jTower.h:61

◆ initialize()

StatusCode LVL1::jFEXSmallRJetAlgo::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 28 of file jFEXSmallRJetAlgo.cxx.

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

Definition at line 39 of file IjFEXSmallRJetAlgo.h.

40 {
42 }
static const InterfaceID IID_IjFEXSmallRJetAlgo("LVL1::IjFEXSmallRJetAlgo", 1, 0)

◆ isSeedLocalMaxima()

bool LVL1::jFEXSmallRJetAlgo::isSeedLocalMaxima ( int seedThreshold)
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 130 of file jFEXSmallRJetAlgo.cxx.

130 {
131
132 bool isCentralLM = CalculateLM(m_jFEXalgoSearchWindowSeedET) &&
134
137
138 if(isCentralLM || isDisplacedLM ){
140 return m_jFEXalgoSearchWindowSeedET[2][2] > seedThreshold;
141 }
142 return false;
143}
bool CalculateLM(int mymatrix[5][5])

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

◆ safetyTest()

StatusCode LVL1::jFEXSmallRJetAlgo::safetyTest ( )
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 37 of file jFEXSmallRJetAlgo.cxx.

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

◆ setFPGAEnergy()

void LVL1::jFEXSmallRJetAlgo::setFPGAEnergy ( const std::unordered_map< int, std::vector< int > > & et_map)
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 193 of file jFEXSmallRJetAlgo.cxx.

193 {
194 m_map_Etvalues=et_map;
195}

◆ setup()

void LVL1::jFEXSmallRJetAlgo::setup ( int inputTable[7][7],
int inputTableDisplaced[7][7] )
overridevirtual

Implements LVL1::IjFEXSmallRJetAlgo.

Definition at line 48 of file jFEXSmallRJetAlgo.cxx.

48 {
49
50 for(int phi=0; phi<7; phi++) {
51 for (int eta=0; eta<7; eta++) {
52 m_jFEXalgoTowerID[phi][eta] = inputTable[6-phi][eta];
53 }
54 }
55
56 for(int phi=0; phi<7; phi++) {
57 for (int eta=0; eta<7; eta++) {
58 m_jFEXalgoTowerID_displaced[phi][eta] = inputTableDisplaced[6-phi][eta];
59 }
60 }
61}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method

◆ 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 >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

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

bool LVL1::jFEXSmallRJetAlgo::m_JetSaturation = false
private

Definition at line 58 of file jFEXSmallRJetAlgo.h.

◆ m_jFEXalgoSearchWindowSeedET

int LVL1::jFEXSmallRJetAlgo::m_jFEXalgoSearchWindowSeedET[5][5] = {{0}}
private

Definition at line 62 of file jFEXSmallRJetAlgo.h.

62{{0}};

◆ m_jFEXalgoSearchWindowSeedET_displaced

int LVL1::jFEXSmallRJetAlgo::m_jFEXalgoSearchWindowSeedET_displaced[5][5] = {{0}}
private

Definition at line 63 of file jFEXSmallRJetAlgo.h.

63{{0}};

◆ m_jFEXalgoTowerID

int LVL1::jFEXSmallRJetAlgo::m_jFEXalgoTowerID[7][7] = {{0}}
private

Definition at line 60 of file jFEXSmallRJetAlgo.h.

60{{0}};

◆ m_jFEXalgoTowerID_displaced

int LVL1::jFEXSmallRJetAlgo::m_jFEXalgoTowerID_displaced[7][7] = {{0}}
private

Definition at line 61 of file jFEXSmallRJetAlgo.h.

61{{0}};

◆ m_jTowerContainer

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

Definition at line 54 of file jFEXSmallRJetAlgo.h.

◆ m_jTowerContainerKey

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

Definition at line 53 of file jFEXSmallRJetAlgo.h.

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

◆ m_map_Etvalues

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

Definition at line 65 of file jFEXSmallRJetAlgo.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: