ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalLArCellContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
13
14#include <map>
15
16namespace GlobalSim {
17
19 struct Feb2MuxInfo {
20 std::string muxName;
22 };
23
24 class GlobalLArCellContainer : public DataVector<GlobalSim::GlobalLArCell> {
25
26 public:
27
29
32
34 struct StatusFlags {
35 bool overflow{false};
36 bool error{false};
37 };
38
40 GlobalLArCellContainer(const std::map<std::string, Feb2MuxInfo>& febMap);
41
44
46 void push_back(const GlobalLArCell& theCell, IdentifierHash hashId);
47
49 const std::unordered_set<std::string>& getFeb2Keys() const { return m_feb2Keys; };
50
52 const std::unordered_set<std::string>& getMuxKeys() const { return m_muxKeys; };
53
55 const std::vector<std::shared_ptr<GlobalLArCell>>& getCellsForFeb2(const std::string& feb2) const;
56
58 const std::shared_ptr<GlobalLArCell> getCellFromHash(IdentifierHash hashId) const;
59
61 const std::vector<std::string>& getOrderedFeb2sForMux(const std::string& mux) const;
62
65
67 void setFeb2Flags(const std::string& feb2Key, bool overflow, bool error);
68
70 std::size_t getMaxCellsPerFeb2() const { return m_maxCellsPerFeb2; }
71
73 const std::string& getMuxForFeb2(const std::string& feb2Key) const;
74
76 bool feb2InOverflow(const std::string& feb2Key) const;
77
79 bool feb2InError(const std::string& feb2Key) const;
80
82 bool muxInOverflow(const std::string& muxKey) const;
83
85 bool muxInError(const std::string& muxKey) const;
86
87 private:
88
90 std::map<std::string, StatusFlags> m_feb2Flags;
92 std::map<std::string, StatusFlags> m_muxFlags;
94 std::unordered_set<std::string> m_feb2Keys;
96 std::unordered_set<std::string> m_muxKeys;
98 std::map<std::string, std::vector<std::shared_ptr<GlobalLArCell>>> m_feb2ToCells;
100 std::map<std::string, std::vector<std::string>> m_muxToFeb2Ordered;
102 std::map<std::string, std::string> m_feb2ToMux;
104 std::size_t m_maxCellsPerFeb2 = 0;
106 std::map<IdentifierHash, std::shared_ptr<GlobalLArCell>> m_hashToCells;
107
108 };
109
110} //namespace GlobalSim
111
113SG_BASE(GlobalSim::GlobalLArCellContainer, DataVector<GlobalSim::GlobalLArCell> );
114
115#endif
#define SG_BASE(D, B)
Declare that class D derives from class B.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
Derived DataVector<T>.
Definition DataVector.h:795
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
bool muxInError(const std::string &muxKey) const
Check if a given MUX is in error.
void push_back(const GlobalLArCell &theCell, IdentifierHash hashId)
Reimplementation of the push_back function to fill LArCells.
std::unordered_set< std::string > m_muxKeys
vector of all MUX names
void setFeb2Flags(const std::string &feb2Key, bool overflow, bool error)
Set overflow and error flag for a FEB2.
GlobalLArCellContainer()=default
Default constructor.
std::map< std::string, std::string > m_feb2ToMux
map which acts as lookuptable to get the associated MUX from a FEB2 name
const std::vector< std::shared_ptr< GlobalLArCell > > & getCellsForFeb2(const std::string &feb2) const
Function to get all GlobalLArCells for a given FEB2 name.
bool feb2InOverflow(const std::string &feb2Key) const
Check if a given FEB2 is in overflow.
std::unordered_set< std::string > m_feb2Keys
vector of all FEB2 names
std::map< std::string, StatusFlags > m_muxFlags
map which stores overflow and error bits for each MUX
const std::unordered_set< std::string > & getFeb2Keys() const
Function to return the full list of FEB2 names.
std::size_t getMaxCellsPerFeb2() const
Function to get maximum number of cells per FEB2.
const std::string & getMuxForFeb2(const std::string &feb2Key) const
Function to get the associated MUX name for a given FEB2.
bool muxInOverflow(const std::string &muxKey) const
Check if a given MUX is in overflow.
void setMaxCellsPerFeb2(int n)
Function to set maximum number of cells per FEB2.
bool feb2InError(const std::string &feb2Key) const
Check if a given FEB2 is in error.
std::map< std::string, StatusFlags > m_feb2Flags
map which stores overflow and error bits for each FEB2
std::map< std::string, std::vector< std::string > > m_muxToFeb2Ordered
map which holds the ordered list of FEB2s for each MUX
std::map< IdentifierHash, std::shared_ptr< GlobalLArCell > > m_hashToCells
map for fast look up of cells
const std::vector< std::string > & getOrderedFeb2sForMux(const std::string &mux) const
Function to get ordered list of FEB2s for a given MUX name.
std::map< std::string, std::vector< std::shared_ptr< GlobalLArCell > > > m_feb2ToCells
map which keeps track of which cells are associated with which FEB2
const std::unordered_set< std::string > & getMuxKeys() const
Function to return the full list of MUX names.
const std::shared_ptr< GlobalLArCell > getCellFromHash(IdentifierHash hashId) const
Function to get all GlobalLArCells for a given hash identifier.
std::size_t m_maxCellsPerFeb2
Maximum number of cells per FEB2 in given energy encoding scheme.
This is a "hash" representation of an Identifier.
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
Helper struct to keep track of correct order of FEB2 for each MUX.
Helper struct to hold overflow and error flags.