ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
L1CaloFEXSim
src
jTowerContainer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Code stolen shamelessly from Calorimeter/CaloEvent/src/CaloCellContainer.cxx and modified
6
7
#include "
L1CaloFEXSim/jTowerContainer.h
"
8
#include "
L1CaloFEXSim/jTower.h
"
9
#include "
AthenaKernel/errorcheck.h
"
10
11
namespace
LVL1
{
12
13
jTowerContainer::jTowerContainer
(
SG::OwnershipPolicy
ownPolicy
) :
14
DataVector
<
LVL1
::
jTower
>(
ownPolicy
)
15
{
16
m_map_towerID_containerIndex
.clear();
17
}
18
19
void
jTowerContainer::push_back
(
float
eta
,
float
phi
,
int
towerid,
int
posneg,
float
centre_eta,
float
centre_phi,
int
fcal_layer)
20
{
21
DataVector<LVL1::jTower>::push_back
(std::make_unique<jTower>(
eta
,
phi
,towerid,posneg,centre_eta,centre_phi,fcal_layer));
22
}
23
24
void
jTowerContainer::print
()
const
{
25
REPORT_MESSAGE_WITH_CONTEXT
(MSG::WARNING,
"jTowerContainer"
) <<
"jTowerContainer::print not implemented"
;
26
}
27
28
29
const
LVL1::jTower
*
jTowerContainer::findTower
(
int
towerID)
const
30
{
31
const
auto
it =
m_map_towerID_containerIndex
.find(towerID);
32
if
(it==
m_map_towerID_containerIndex
.cend()) {
33
return
nullptr
;
34
}
35
const
int
container_index = it->second;
36
if
(container_index < 0) {
37
return
nullptr
;
38
}
39
return
(*
this
)[container_index];
40
}
41
42
LVL1::jTower
*
jTowerContainer::findTower
(
int
towerID) {
43
const
auto
it =
m_map_towerID_containerIndex
.find(towerID);
44
if
(it==
m_map_towerID_containerIndex
.cend()) {
45
return
nullptr
;
46
}
47
const
int
container_index = it->second;
48
if
(container_index < 0) {
49
return
nullptr
;
50
}
51
return
(*
this
)[container_index];
52
}
53
54
void
jTowerContainer::clearContainerMap
()
55
{
56
m_map_towerID_containerIndex
.clear();
57
}
58
59
bool
jTowerContainer::fillContainerMap
() {
60
clearContainerMap
();
61
size_t
ntowers =
size
();
62
for
(
size_t
itower = 0; itower < ntowers; itower++) {
63
const
jTower
* theTower = (*this)[itower];
64
int
towerID = theTower->
constid
();
65
int
container_index = itower;
66
m_map_towerID_containerIndex
.insert(std::pair<int,int>(towerID,container_index));
67
}
68
return
true
;
69
}
70
71
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector< LVL1::jTower >::DataVector
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
DataVector< LVL1::jTower >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
DataVector< LVL1::jTower >::size
size_type size() const noexcept
LVL1::jTowerContainer::jTowerContainer
jTowerContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition
jTowerContainer.cxx:13
LVL1::jTowerContainer::fillContainerMap
bool fillContainerMap()
utility function to help speed up accessing towers
Definition
jTowerContainer.cxx:59
LVL1::jTowerContainer::print
void print() const
dump (obsolete)
Definition
jTowerContainer.cxx:24
LVL1::jTowerContainer::push_back
void push_back(float eta, float phi, int towerid, int posneg, float centre_et=0.0, float centre_phi=0.0, int fcal_layer=-1)
reimplementation of const push_back
Definition
jTowerContainer.cxx:19
LVL1::jTowerContainer::clearContainerMap
void clearContainerMap()
clear map
Definition
jTowerContainer.cxx:54
LVL1::jTowerContainer::findTower
const LVL1::jTower * findTower(int towerID) const
fast find method given identifier.
Definition
jTowerContainer.cxx:29
LVL1::jTowerContainer::m_map_towerID_containerIndex
std::unordered_map< int, int > m_map_towerID_containerIndex
Definition
jTowerContainer.h:75
LVL1::jTower
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
Definition
jTower.h:36
LVL1::jTower::constid
float constid() const
Definition
jTower.h:110
jTowerContainer.h
jTower.h
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
SG::OwnershipPolicy
OwnershipPolicy
Definition
OwnershipPolicy.h:16
Generated on
for ATLAS Offline Software by
1.17.0