36 std::vector<uint16_t> result;
38 result.push_back(entry.first);
74 for (
auto& entry : map) {
75 uint16_t mod_id = entry.first;
76 for (uint8_t crob_id = 0; crob_id <
NCROBMOD; crob_id++) {
77 uint16_t eq_id = entry.second[crob_id];
87 const std::map<
size_t, std::map<
size_t, std::map<
size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap)
90 for (
auto compMap : channelMap) {
91 uint16_t equipmentId = compMap.first;
92 uint16_t numAsics = compMap.second.size();
95 for (
auto asicMap : compMap.second) {
96 uint16_t asicId = asicMap.first;
97 uint16_t numChans = asicMap.second.size();
99 for (
auto chanMap : asicMap.second) {
100 uint16_t chanId = chanMap.first;
101 std::tuple<int32_t, bool, uint64_t> chanPars = chanMap.second;
102 ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars)};
134 result = equipIter->second;
144 std::stringstream ss;
146 uint16_t equipmentId = comp.first;
147 auto value = comp.second;
148 uint16_t moduleId = value.moduleId;
149 uint16_t crobId = value.crobId;
150 ss <<
"Equipment " << equipmentId <<
" Module " << moduleId <<
" Crob " << crobId <<
"\n";
155 uint16_t equipmentId = asicMap.first;
156 uint16_t numAsics = asicMap.second.size();
157 ss <<
"\n Equipment " << equipmentId <<
" nAsics " << numAsics;
158 for (
size_t asicId = 0; asicId < numAsics; asicId++) {
160 uint16_t numChans = asicMap.second.at(asicId).size();
161 ss <<
"\n Equipment " << equipmentId <<
" AsicId " << asicId <<
" nChans " << numChans;
162 for (
size_t chanId = 0; chanId < numChans; chanId++) {
163 auto entry = asicMap.second.at(asicId).at(chanId);
164 int32_t address = entry.padAddress;
165 bool isMasked = entry.rPairingFlag;
166 uint64_t daqOffset = entry.daqOffset;
167 ss <<
"\n Equipment " << equipmentId <<
" AsicId " << asicId <<
" chanID " << chanId <<
" pad address "
168 << address <<
" mask " << isMasked <<
" daq offset " << daqOffset;
static constexpr size_t size()
#define CBM_YAML_INSTANTIATE(type)
Explicitly instantiate the Read and Dump functions for a type.
Provides the hardware-to-software address mapping for the CBM-TRD2D.
ReadoutConfig()
Constructor.
ChanMapping ChanMap(uint16_t equipId, uint16_t asic, uint16_t chan)
API: Mapping from component, asic and channel to tuple (pad address, R pairing flag,...
size_t GetNumAsics(uint16_t equipmentId)
Number of ASICS of a component.
std::string PrintReadoutMap()
Debug output of readout map.
size_t GetNumChans(uint16_t equipmentId, uint16_t asicId)
Number of channels of a component - ASIC pair.
~ReadoutConfig()
Destructor.
void InitChannelMap(const std::map< size_t, std::map< size_t, std::map< size_t, std::tuple< int32_t, bool, uint64_t > > > > &channelMap)
Initialisation of channel map.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
void InitComponentMap(const std::map< uint32_t, uint16_t[NCROBMOD]> &crob_map)
Initialisation of readout map.
std::map< uint16_t, std::vector< std::vector< ChanMapping > > > fChannelMap
std::map< uint16_t, CompMapping > fReadoutMap
CompMapping CompMap(uint16_t equipId)
API: Mapping from component to pair (module id, crob id)