14 std::map<std::string, std::vector<std::pair<int,std::string>>> tempMap;
17 for (
const auto & [feb2, muxInfo] : febMap) {
21 m_muxFlags.insert({muxInfo.muxName, {
false,
false}});
24 tempMap[muxInfo.muxName].emplace_back(muxInfo.indexOnMux, feb2);
28 for (
auto& [muxName,
vec] : tempMap) {
30 return a.first < b.first;
34 std::vector<std::string> orderedFeb2s;
35 orderedFeb2s.reserve(
vec.size());
36 for (
const auto& [idx, feb2] :
vec) {
37 orderedFeb2s.push_back(feb2);
49 for (
const auto cellPtr : other) {
66 auto cell = std::make_unique<GlobalLArCell>(theCell);
67 auto* cellPtr = cell.get();
77 static const std::vector<GlobalLArCell*> emptyCellVector;
84 return emptyCellVector;
91 static const std::vector<std::string> emptyMux;
105 throw std::runtime_error(
"Unknown FEB2 key: " + feb2Key);
114 flags.overflow = overflow;
120 muxFlags.overflow = overflow;
124 muxFlags.error =
error;
132 return (it !=
m_feb2Flags.end()) ? it->second.overflow :
false;
139 return (it !=
m_feb2Flags.end()) ? it->second.error :
false;
146 return (it !=
m_muxFlags.end()) ? it->second.overflow :
false;
153 return (it !=
m_muxFlags.end()) ? it->second.error :
false;
std::vector< size_t > vec
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)
bool muxInError(const std::string &muxKey) const
Check if a given MUX is in error.
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
std::map< std::string, std::vector< GlobalLArCell * > > m_feb2ToCells
map which keeps track of which cells are associated with which FEB2
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
void push_back(const GlobalLArCell &theCell)
Reimplementation of the push_back function to fill LArCells.
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.
const std::vector< GlobalLArCell * > & getCellsForFeb2(const std::string &feb2) const
Function to get all GlobalLArCells for a given FEB2 name.
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
const std::vector< std::string > & getOrderedFeb2sForMux(const std::string &mux) const
Function to get ordered list of FEB2s for a given MUX name.
std::size_t m_maxCellsPerFeb2
Maximum number of cells per FEB2 in given energy encoding scheme.
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.