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 "CaloEvent/CaloCell.h"
11#include "GlobalLArCell.h"
12
14
15#include <map>
16
17namespace GlobalSim {
18
20 struct Feb2MuxInfo {
21 std::string muxName;
23 };
24
25 class GlobalLArCellContainer : public DataVector<GlobalSim::GlobalLArCell> {
26
27 public:
28
30
33
35 struct StatusFlags {
36 bool overflow{false};
37 bool error{false};
38 };
39
41 struct LocSize {
42 double eta{0.0};
43 double phi{0.0};
44 float deta{0.0};
45 float dphi{0.0};
46
47 bool operator<(const LocSize& ls) const {
48 return (eta < ls.eta || (eta==ls.eta && phi < ls.phi));
49 }
50 };
51
53 GlobalLArCellContainer(const std::map<std::string, Feb2MuxInfo>& febMap);
54
57
59 void push_back(const GlobalLArCell& theCell, IdentifierHash hashId);
60
62 const std::unordered_set<std::string>& getFeb2Keys() const { return m_feb2Keys; };
63
65 const std::unordered_set<std::string>& getMuxKeys() const { return m_muxKeys; };
66
68 const std::vector<std::shared_ptr<GlobalLArCell>>& getCellsForFeb2(const std::string& feb2) const;
69
71 const std::shared_ptr<GlobalLArCell> getCellFromHash(IdentifierHash hashId) const;
72
74 Identifier getIDFromLoc(float eta, float phi) const;
75
77 const std::vector<std::string>& getOrderedFeb2sForMux(const std::string& mux) const;
78
81
83 void setFeb2Flags(const std::string& feb2Key, bool overflow, bool error);
84
86 void fillLocToIDMap(Identifier ID, const CaloCell*& cell);
87
89 std::size_t getMaxCellsPerFeb2() const { return m_maxCellsPerFeb2; }
90
92 const std::string& getMuxForFeb2(const std::string& feb2Key) const;
93
95 bool feb2InOverflow(const std::string& feb2Key) const;
96
98 bool feb2InError(const std::string& feb2Key) const;
99
101 bool muxInOverflow(const std::string& muxKey) const;
102
104 bool muxInError(const std::string& muxKey) const;
105
106 private:
107
109 std::map<std::string, StatusFlags> m_feb2Flags;
111 std::map<std::string, StatusFlags> m_muxFlags;
113 std::unordered_set<std::string> m_feb2Keys;
115 std::unordered_set<std::string> m_muxKeys;
117 std::map<std::string, std::vector<std::shared_ptr<GlobalLArCell>>> m_feb2ToCells;
119 std::map<std::string, std::vector<std::string>> m_muxToFeb2Ordered;
121 std::map<std::string, std::string> m_feb2ToMux;
123 std::size_t m_maxCellsPerFeb2 = 0;
125 std::map<IdentifierHash, std::shared_ptr<GlobalLArCell>> m_hashToCells;
127 std::map<LocSize,Identifier> m_cellLocationToID;
128 };
129
130} //namespace GlobalSim
131
133SG_BASE(GlobalSim::GlobalLArCellContainer, DataVector<GlobalSim::GlobalLArCell> );
134
135#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#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.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
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
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::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.
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::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 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.
Helper struct to keep track of correct order of FEB2 for each MUX.
Helper struct to hold cell's eta/phi location and size.
Helper struct to hold overflow and error flags.