ATLAS Offline Software
jTowerContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Stolen shamelessly from CaloCellContainer.h and modified as required
6 
7 #ifndef JTOWERCONTAINER_H
8 #define JTOWERCONTAINER_H
9 
20 #include "AthenaKernel/CLASS_DEF.h"
21 #include "L1CaloFEXSim/jTower.h"
22 
24 #include "CxxUtils/PackedArray.h"
25 #include "CxxUtils/CachedValue.h"
27 
28 #include <unordered_map>
29 
30 namespace LVL1 {
31 
32 class jTowerContainer : public DataVector<LVL1::jTower>
33 {
34 
35  public:
36 
37 
39  typedef std::vector<const LVL1::jTower> jTowerVector;
40 
42  typedef std::vector<LVL1::jTower> MutablejTowerVector;
43 
46  //jTowerContainer() ;
47 
50 
52  virtual ~jTowerContainer() { };
53 
55  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);
56 
58  bool fillContainerMap();
59 
61  void print() const;
62 
64  const LVL1::jTower * findTower(int towerID) const;
65 
67  LVL1::jTower * findTower(int towerID);
68 
70  void clearContainerMap();
71 
72  private:
74  IMessageSvc* msgSvc() const;
75 
76  //* @brief Keeps track of the towerID of each jTower associated to each MAP index *.
77  std::unordered_map<int,int> m_map_towerID_containerIndex;
78 };
79 
80 }
81 CLASS_DEF( LVL1::jTowerContainer , 1141097037 , 1 )
83 
84 #endif
85 
jTowerContainer
Container class for jTower.
LVL1::jTowerContainer::jTowerContainer
jTowerContainer(size_t n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Sized constructor.
LVL1::jTowerContainer::print
void print() const
dump (obsolete)
Definition: jTowerContainer.cxx:26
LVL1::jTowerContainer::MutablejTowerVector
std::vector< LVL1::jTower > MutablejTowerVector
Return from non-const findTowerVector.
Definition: jTowerContainer.h:42
LVL1::jTowerContainer::findTower
const LVL1::jTower * findTower(int towerID) const
fast find method given identifier.
Definition: jTowerContainer.cxx:31
LVL1::jTowerContainer::msgSvc
IMessageSvc * msgSvc() const
get message service
LVL1::jTowerContainer::~jTowerContainer
virtual ~jTowerContainer()
destructor
Definition: jTowerContainer.h:52
LVL1::jTowerContainer::fillContainerMap
bool fillContainerMap()
utility function to help speed up accessing towers
Definition: jTowerContainer.cxx:61
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::jTowerContainer::m_map_towerID_containerIndex
std::unordered_map< int, int > m_map_towerID_containerIndex
Definition: jTowerContainer.h:77
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
beamspotman.n
n
Definition: beamspotman.py:731
LVL1::jTowerContainer::jTowerContainer
jTowerContainer(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Main constructor.
Definition: jTowerContainer.cxx:15
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
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:21
LVL1::jTowerContainer
Definition: jTowerContainer.h:33
SG_BASE
SG_BASE(LVL1::jTowerContainer, DataVector< LVL1::jTower >)
LVL1::jTowerContainer::jTowerVector
std::vector< const LVL1::jTower > jTowerVector
type to be used for the internal lookup table, and to return list of towers
Definition: jTowerContainer.h:39
CachedValue.h
Cached value with atomic update.
IdentifierHash.h
findInContainer.h
Define a specializable method for finding the index of an object within a container.
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
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::jTower
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
Definition: jTower.h:40
DataVector< LVL1::jTower >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
PackedArray.h
An array of unsigned values of some bit size, packed tightly.
LVL1::jTowerContainer::clearContainerMap
void clearContainerMap()
clear map
Definition: jTowerContainer.cxx:56
jTower.h
CLASS_DEF.h
macros to associate a CLID to a type