ATLAS Offline Software
Loading...
Searching...
No Matches
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
14namespace GlobalSim {
15
17 struct Feb2MuxInfo {
18 std::string muxName;
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
106SG_BASE(GlobalSim::GlobalLArCellContainer, DataVector<GlobalSim::GlobalLArCell> );
107
108#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.
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
const std::unordered_set< std::string > & getFeb2Keys() const
Function to return the full list of FEB2 names.
void push_back(const GlobalLArCell &theCell)
Reimplementation of the push_back function to fill LArCells.
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.
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.
const std::unordered_set< std::string > & getMuxKeys() const
Function to return the full list of MUX names.
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...
Helper struct to keep track of correct order of FEB2 for each MUX.
Helper struct to hold overflow and error flags.