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();
70 m_feb2ToCells[cellPtr->getFEB2()].push_back(std::make_shared<GlobalLArCell>(*cellPtr));
71 m_hashToCells.insert({hashId, std::make_shared<GlobalLArCell>(*cellPtr)});
78 static const std::vector<std::shared_ptr<GlobalLArCell>> emptyCellVector;
85 return emptyCellVector;
91 const std::shared_ptr<GlobalLArCell> emptyCell;
106 float etamin = location.eta - (0.5*location.deta);
107 float etamax = location.eta + (0.5*location.deta);
109 float phimin = location.phi - (0.5*location.dphi);
110 float phimax = location.phi + (0.5*location.dphi);
112 if(etamin <
eta &&
eta < etamax && phimin <
phi &&
phi < phimax){
124 static const std::vector<std::string> emptyMux;
138 throw std::runtime_error(
"Unknown FEB2 key: " + feb2Key);
147 flags.overflow = overflow;
153 muxFlags.overflow = overflow;
157 muxFlags.error =
error;
163 LocSize cell_LocSize = {cell->eta(), cell->phi(),cell->caloDDE()->deta(),cell->caloDDE()->dphi()};
170 return (it !=
m_feb2Flags.end()) ? it->second.overflow :
false;
177 return (it !=
m_feb2Flags.end()) ? it->second.error :
false;
184 return (it !=
m_muxFlags.end()) ? it->second.overflow :
false;
191 return (it !=
m_muxFlags.end()) ? it->second.error :
false;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::vector< size_t > vec
Data object for each calorimeter readout cell.
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.
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
std::map< LocSize, Identifier > m_cellLocationToID
map for cell HashID lookup from position
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.
Identifier getIDFromLoc(float eta, float phi) const
Get the HashID from an input cell position.
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::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.
bool feb2InError(const std::string &feb2Key) const
Check if a given FEB2 is in error.
void fillLocToIDMap(Identifier ID, const CaloCell *&cell)
Fill the location to HashId map.
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::shared_ptr< GlobalLArCell > getCellFromHash(IdentifierHash hashId) const
Function to get the GlobalLArCell 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 to read in LArStripNeighborhoods, and run the eRatio Algorithm.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Helper struct to hold cell's eta/phi location and size.