ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
L1CaloFEXSim
src
eTowerContainer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 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/eTowerContainer.h
"
8
#include "
L1CaloFEXSim/eTower.h
"
9
#include "
AthenaKernel/errorcheck.h
"
10
11
namespace
LVL1
{
12
13
eTowerContainer::eTowerContainer
(
SG::OwnershipPolicy
ownPolicy
) :
14
DataVector
<
LVL1
::
eTower
>(
ownPolicy
)
15
{
16
m_map_towerID_containerIndex
.clear();
17
}
18
19
void
eTowerContainer::push_back
(
float
eta
,
float
phi
,
float
keybase,
int
posneg)
20
{
21
DataVector<LVL1::eTower>::push_back
(std::make_unique<eTower>(
eta
,
phi
,keybase,posneg));
22
}
23
24
void
eTowerContainer::print
()
const
{
25
REPORT_MESSAGE_WITH_CONTEXT
(MSG::WARNING,
"eTowerContainer"
) <<
"eTowerContainer::print not implemented"
;
26
}
27
28
29
const
LVL1::eTower
*
eTowerContainer::findTower
(
int
towerID)
const
{
30
const
auto
it =
m_map_towerID_containerIndex
.find(towerID);
31
if
(it ==
m_map_towerID_containerIndex
.end())
return
nullptr
;
32
const
int
container_index = it->second;
33
if
(container_index < 0) {
34
return
nullptr
;
35
}
36
return
(*
this
)[container_index];
37
}
38
39
LVL1::eTower
*
eTowerContainer::findTower
(
int
towerID) {
40
const
auto
it =
m_map_towerID_containerIndex
.find(towerID);
41
if
(it ==
m_map_towerID_containerIndex
.end())
return
nullptr
;
42
const
int
container_index = it->second;
43
if
(container_index < 0) {
44
return
nullptr
;
45
}
46
return
(*
this
)[container_index];
47
}
48
49
void
eTowerContainer::clearContainerMap
()
50
{
51
m_map_towerID_containerIndex
.clear();
52
}
53
54
bool
eTowerContainer::fillContainerMap
(){
55
clearContainerMap
();
56
size_t
ntowers =
size
();
57
for
(
size_t
itower = 0; itower < ntowers; itower++) {
58
const
eTower
* theTower = (*this)[itower];
59
int
towerID = theTower->
constid
();
60
int
container_index = itower;
61
m_map_towerID_containerIndex
.insert(std::pair<int,int>(towerID,container_index));
62
}
63
return
true
;
64
}
65
66
}
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::eTower >::DataVector
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
DataVector< LVL1::eTower >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
DataVector< LVL1::eTower >::size
size_type size() const noexcept
LVL1::eTowerContainer::print
void print() const
dump (obsolete)
Definition
eTowerContainer.cxx:24
LVL1::eTowerContainer::eTowerContainer
eTowerContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition
eTowerContainer.cxx:13
LVL1::eTowerContainer::clearContainerMap
void clearContainerMap()
clear map
Definition
eTowerContainer.cxx:49
LVL1::eTowerContainer::m_map_towerID_containerIndex
std::unordered_map< int, int > m_map_towerID_containerIndex
Definition
eTowerContainer.h:75
LVL1::eTowerContainer::fillContainerMap
bool fillContainerMap()
utility function to help speed up accessing towers
Definition
eTowerContainer.cxx:54
LVL1::eTowerContainer::findTower
const LVL1::eTower * findTower(int towerID) const
fast find method given identifier.
Definition
eTowerContainer.cxx:29
LVL1::eTowerContainer::push_back
void push_back(float eta, float phi, float keybase, int posneg)
reimplementation of const push_back
Definition
eTowerContainer.cxx:19
LVL1::eTower
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
Definition
eTower.h:38
LVL1::eTower::constid
float constid() const
Definition
eTower.h:71
eTowerContainer.h
eTower.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