ATLAS Offline Software
GlobalLArCellContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GLOBALSIM_GLOBALLARCELLCONTAINER_H
6 #define GLOBALSIM_GLOBALLARCELLCONTAINER_H
7 
10 #include "GlobalLArCell.h"
11 
12 #include <map>
13 
14 namespace GlobalSim {
15 
17  struct Feb2MuxInfo {
18  std::string muxName;
19  int indexOnMux{};
20  };
21 
22  class GlobalLArCellContainer : public DataVector<GlobalSim::GlobalLArCell> {
23 
24  public:
25 
27 
30 
32  struct StatusFlags {
33  bool overflow{false};
34  bool error{false};
35  };
36 
38  GlobalLArCellContainer(const std::map<std::string, Feb2MuxInfo>& febMap);
39 
42 
44  void push_back(const GlobalLArCell& theCell);
45 
47  const std::unordered_set<std::string>& getFeb2Keys() const { return m_feb2Keys; };
48 
50  const std::unordered_set<std::string>& getMuxKeys() const { return m_muxKeys; };
51 
53  const std::vector<GlobalLArCell*>& getCellsForFeb2(const std::string& feb2) const;
54 
56  const std::vector<std::string>& getOrderedFeb2sForMux(const std::string& mux) const;
57 
60 
62  void setFeb2Flags(const std::string& feb2Key, bool overflow, bool error);
63 
65  std::size_t getMaxCellsPerFeb2() const { return m_maxCellsPerFeb2; }
66 
68  const std::string& getMuxForFeb2(const std::string& feb2Key) const;
69 
71  bool feb2InOverflow(const std::string& feb2Key) const;
72 
74  bool feb2InError(const std::string& feb2Key) const;
75 
77  bool muxInOverflow(const std::string& muxKey) const;
78 
80  bool muxInError(const std::string& muxKey) const;
81 
82  private:
83 
85  std::map<std::string, StatusFlags> m_feb2Flags;
87  std::map<std::string, StatusFlags> m_muxFlags;
89  std::unordered_set<std::string> m_feb2Keys;
91  std::unordered_set<std::string> m_muxKeys;
93  std::map<std::string, std::vector<GlobalLArCell*>> m_feb2ToCells;
95  std::map<std::string, std::vector<std::string>> m_muxToFeb2Ordered;
97  std::map<std::string, std::string> m_feb2ToMux;
99  std::size_t m_maxCellsPerFeb2 = 0;
100 
101  };
102 
103 } //namespace GlobalSim
104 
106 SG_BASE(GlobalSim::GlobalLArCellContainer, DataVector<GlobalSim::GlobalLArCell> );
107 
108 #endif
GlobalSim::GlobalLArCellContainer::getMaxCellsPerFeb2
std::size_t getMaxCellsPerFeb2() const
Function to get maximum number of cells per FEB2.
Definition: GlobalLArCellContainer.h:65
GlobalSim::Feb2MuxInfo::muxName
std::string muxName
Definition: GlobalLArCellContainer.h:18
GlobalSim::GlobalLArCellContainer::feb2InOverflow
bool feb2InOverflow(const std::string &feb2Key) const
Check if a given FEB2 is in overflow.
Definition: GlobalLArCellContainer.cxx:130
GlobalSim::GlobalLArCellContainer::getOrderedFeb2sForMux
const std::vector< std::string > & getOrderedFeb2sForMux(const std::string &mux) const
Function to get ordered list of FEB2s for a given MUX name.
Definition: GlobalLArCellContainer.cxx:89
GlobalSim::GlobalLArCellContainer::feb2InError
bool feb2InError(const std::string &feb2Key) const
Check if a given FEB2 is in error.
Definition: GlobalLArCellContainer.cxx:137
GlobalSim::GlobalLArCellContainer::GlobalLArCellContainer
GlobalLArCellContainer()=default
Default constructor.
GlobalSim::GlobalLArCellContainer::StatusFlags
Helper struct to hold overflow and error flags.
Definition: GlobalLArCellContainer.h:32
GlobalSim::GlobalLArCellContainer::push_back
void push_back(const GlobalLArCell &theCell)
Reimplementation of the push_back function to fill LArCells.
Definition: GlobalLArCellContainer.cxx:65
GlobalSim::GlobalLArCellContainer::m_muxFlags
std::map< std::string, StatusFlags > m_muxFlags
map which stores overflow and error bits for each MUX
Definition: GlobalLArCellContainer.h:87
GlobalSim::GlobalLArCellContainer::m_muxKeys
std::unordered_set< std::string > m_muxKeys
vector of all MUX names
Definition: GlobalLArCellContainer.h:91
GlobalSim::GlobalLArCellContainer::getMuxKeys
const std::unordered_set< std::string > & getMuxKeys() const
Function to return the full list of MUX names.
Definition: GlobalLArCellContainer.h:50
GlobalSim::GlobalLArCellContainer::getFeb2Keys
const std::unordered_set< std::string > & getFeb2Keys() const
Function to return the full list of FEB2 names.
Definition: GlobalLArCellContainer.h:47
GlobalSim::GlobalLArCellContainer::m_maxCellsPerFeb2
std::size_t m_maxCellsPerFeb2
Maximum number of cells per FEB2 in given energy encoding scheme.
Definition: GlobalLArCellContainer.h:99
GlobalSim::GlobalLArCellContainer::StatusFlags::overflow
bool overflow
Definition: GlobalLArCellContainer.h:33
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
beamspotman.n
n
Definition: beamspotman.py:729
GlobalSim::GlobalLArCellContainer::getCellsForFeb2
const std::vector< GlobalLArCell * > & getCellsForFeb2(const std::string &feb2) const
Function to get all GlobalLArCells for a given FEB2 name.
Definition: GlobalLArCellContainer.cxx:75
GlobalLArCell.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
GlobalSim::GlobalLArCellContainer::m_feb2Keys
std::unordered_set< std::string > m_feb2Keys
vector of all FEB2 names
Definition: GlobalLArCellContainer.h:89
fitman.mux
mux
Definition: fitman.py:547
GlobalSim::GlobalLArCellContainer::m_feb2Flags
std::map< std::string, StatusFlags > m_feb2Flags
map which stores overflow and error bits for each FEB2
Definition: GlobalLArCellContainer.h:85
GlobalSim::Feb2MuxInfo::indexOnMux
int indexOnMux
Definition: GlobalLArCellContainer.h:19
GlobalSim::GlobalLArCellContainer::getMuxForFeb2
const std::string & getMuxForFeb2(const std::string &feb2Key) const
Function to get the associated MUX name for a given FEB2.
Definition: GlobalLArCellContainer.cxx:102
GlobalSim::GlobalLArCellContainer
Definition: GlobalLArCellContainer.h:22
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
GlobalSim::GlobalLArCellContainer::muxInOverflow
bool muxInOverflow(const std::string &muxKey) const
Check if a given MUX is in overflow.
Definition: GlobalLArCellContainer.cxx:144
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
GlobalSim::Feb2MuxInfo
Helper struct to keep track of correct order of FEB2 for each MUX.
Definition: GlobalLArCellContainer.h:17
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:67
GlobalSim::GlobalLArCellContainer::setFeb2Flags
void setFeb2Flags(const std::string &feb2Key, bool overflow, bool error)
Set overflow and error flag for a FEB2.
Definition: GlobalLArCellContainer.cxx:112
GlobalSim::GlobalLArCellContainer::setMaxCellsPerFeb2
void setMaxCellsPerFeb2(int n)
Function to set maximum number of cells per FEB2.
Definition: GlobalLArCellContainer.h:59
GlobalSim::GlobalLArCellContainer::m_feb2ToCells
std::map< std::string, std::vector< GlobalLArCell * > > m_feb2ToCells
map which keeps track of which cells are associated with which FEB2
Definition: GlobalLArCellContainer.h:93
GlobalSim::GlobalLArCellContainer::m_muxToFeb2Ordered
std::map< std::string, std::vector< std::string > > m_muxToFeb2Ordered
map which holds the ordered list of FEB2s for each MUX
Definition: GlobalLArCellContainer.h:95
GlobalSim::GlobalLArCell
Definition: GlobalLArCell.h:14
SG_BASE
SG_BASE(GlobalSim::GlobalLArCellContainer, DataVector< GlobalSim::GlobalLArCell >)
GlobalSim::GlobalLArCellContainer::m_feb2ToMux
std::map< std::string, std::string > m_feb2ToMux
map which acts as lookuptable to get the associated MUX from a FEB2 name
Definition: GlobalLArCellContainer.h:97
error
Definition: IImpactPoint3dEstimator.h:70
CLASS_DEF.h
macros to associate a CLID to a type
GlobalSim::GlobalLArCellContainer::muxInError
bool muxInError(const std::string &muxKey) const
Check if a given MUX is in error.
Definition: GlobalLArCellContainer.cxx:151