ATLAS Offline Software
Loading...
Searching...
No Matches
eTowerContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Code stolen shamelessly from Calorimeter/CaloEvent/src/CaloCellContainer.cxx and modified
6
10
11namespace LVL1{
12
18
19void 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
25 REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "eTowerContainer") << "eTowerContainer::print not implemented";
26}
27
28
29const LVL1::eTower * eTowerContainer::findTower(int towerID) const{
30 const auto it = m_map_towerID_containerIndex.find(towerID);
31
32 const int container_index = it->second;
33 if (container_index < 0) {
34 return nullptr;
35 }
36 return (*this)[container_index];
37}
38
40 const auto it = m_map_towerID_containerIndex.find(towerID);
41
42 const int container_index = it->second;
43 if (container_index < 0) {
44 return nullptr;
45 }
46 return (*this)[container_index];
47}
48
53
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}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
SG::OwnershipPolicy ownPolicy() const
size_type size() const noexcept
void print() const
dump (obsolete)
eTowerContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
void clearContainerMap()
clear map
std::unordered_map< int, int > m_map_towerID_containerIndex
bool fillContainerMap()
utility function to help speed up accessing towers
const LVL1::eTower * findTower(int towerID) const
fast find method given identifier.
void push_back(float eta, float phi, float keybase, int posneg)
reimplementation of const push_back
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
Definition eTower.h:38
float constid() const
Definition eTower.h:71
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
OwnershipPolicy