ATLAS Offline Software
gTowerContainer.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 //***************************************************************************
7 // gTowerContainer - Container for the gFEX towers
8 // -------------------
9 // begin : 01 04 2021
10 // email : cecilia.tosciri@cern.ch
11 //***************************************************************************
12 
13 #ifndef GTOWERCONTAINER_H
14 #define GTOWERCONTAINER_H
16 #include "AthenaKernel/CLASS_DEF.h"
17 #include "L1CaloFEXSim/gTower.h"
18 #include <map>
19 #include <vector>
20 
21 
22 namespace LVL1 {
23 
24 class gTowerContainer : public DataVector<LVL1::gTower>
25 {
26 
27  public:
28 
29 
31  typedef std::vector<const LVL1::gTower> gTowerVector;
32 
34  typedef std::vector<LVL1::gTower> MutablegTowerVector;
35 
38  //gTowerContainer() ;
39 
42 
44  virtual ~gTowerContainer() { };
45 
47  void push_back(int eta, int phi, int nphi, int keybase, int posneg);
48 
50  bool fillContainerMap();
51 
53  int getIDfromFWID(int fwID) const;
54 
56  void print() const;
57 
59  const LVL1::gTower * findTower(int towerID) const;
60 
62  LVL1::gTower * findTower(int towerID);
63 
65  void clearContainerMap();
66 
67  private:
69  IMessageSvc* msgSvc() const;
70 
71  //* @brief Keeps track of the towerID of each gTower associated to each MAP index *.
72  std::unordered_map<int,int> m_map_towerID_containerIndex;
73 
74  //* @brief A map to go from firmware ID to simulated towerID *.
75  std::unordered_map<int,int> m_map_fwID_towerID;
76 };
77 
78 }
79 CLASS_DEF( LVL1::gTowerContainer , 1009563874 , 1 )
80 SG_BASE(LVL1::gTowerContainer, DataVector<LVL1::gTower> );
81 
82 #endif
83 
LVL1::gTowerContainer::m_map_fwID_towerID
std::unordered_map< int, int > m_map_fwID_towerID
Definition: gTowerContainer.h:75
SG_BASE
SG_BASE(LVL1::gTowerContainer, DataVector< LVL1::gTower >)
LVL1::gTowerContainer::~gTowerContainer
virtual ~gTowerContainer()
destructor
Definition: gTowerContainer.h:44
LVL1::gTowerContainer::gTowerContainer
gTowerContainer(size_t n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Sized constructor.
LVL1::gTower
The gTower class is an interface object for gFEX trigger algorithms The purposes are twofold:
Definition: gTower.h:38
LVL1::gTowerContainer::MutablegTowerVector
std::vector< LVL1::gTower > MutablegTowerVector
Return from non-const findTowerVector.
Definition: gTowerContainer.h:34
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
LVL1::gTowerContainer::fillContainerMap
bool fillContainerMap()
utility function to help speed up accessing towers
Definition: gTowerContainer.cxx:85
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
beamspotman.n
n
Definition: beamspotman.py:731
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
LVL1::gTowerContainer
Definition: gTowerContainer.h:25
LVL1::gTowerContainer::print
void print() const
dump (obsolete)
Definition: gTowerContainer.cxx:31
LVL1::gTowerContainer::gTowerVector
std::vector< const LVL1::gTower > gTowerVector
type to be used for the internal lookup table, and to return list of towers
Definition: gTowerContainer.h:31
LVL1::gTowerContainer::getIDfromFWID
int getIDfromFWID(int fwID) const
given a firmware ID, it returns the simulation ID, it can be used to then find towers
Definition: gTowerContainer.cxx:98
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
LVL1::gTowerContainer::msgSvc
IMessageSvc * msgSvc() const
get message service
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LVL1::gTowerContainer::clearContainerMap
void clearContainerMap()
clear map
Definition: gTowerContainer.cxx:79
DataVector< LVL1::gTower >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
LVL1::gTowerContainer::push_back
void push_back(int eta, int phi, int nphi, int keybase, int posneg)
reimplementation of const push_back
Definition: gTowerContainer.cxx:26
LVL1::gTowerContainer::gTowerContainer
gTowerContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition: gTowerContainer.cxx:19
gTower.h
CLASS_DEF.h
macros to associate a CLID to a type
LVL1::gTowerContainer::m_map_towerID_containerIndex
std::unordered_map< int, int > m_map_towerID_containerIndex
Definition: gTowerContainer.h:72
LVL1::gTowerContainer::findTower
const LVL1::gTower * findTower(int towerID) const
fast find method given identifier.
Definition: gTowerContainer.cxx:36