37 std::vector<uint16_t> result;
39 result.push_back(entry.first);
58 std::vector<uint8_t> result;
60 result.push_back(entry.first);
73 auto jt = fiberMap.find(asicId);
74 if (jt != fiberMap.end()) {
75 result = fiberMap[asicId].size();
87 for (
auto& entry : map) {
88 uint16_t mod_id = entry.first;
91 for (
const auto& eq_add : entry.second) {
101 const std::map<
size_t, std::map<
size_t, std::map<
size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>>&
105 for (
auto compMap : channelMap) {
106 uint16_t equipmentId = compMap.first;
108 for (
auto asicMap : compMap.second) {
109 uint16_t asicId = asicMap.first;
112 for (
auto chanMap : asicMap.second) {
113 uint16_t chanId = chanMap.first;
114 std::tuple<int32_t, bool, uint8_t, uint16_t> chanPars = chanMap.second;
115 const ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars),
116 std::get<3>(chanPars)};
132 auto jt = fiberMap.find(asicId);
133 if (jt != fiberMap.end()) {
134 auto asic = fiberMap[asicId];
135 if (chanId < asic.size()) {
136 result = asic[chanId];
151 result = equipIter->second;
161 std::stringstream ss;
163 uint16_t equipmentId = comp.first;
164 auto value = comp.second;
165 uint16_t moduleId = value.moduleId;
166 uint16_t fiberId = value.fiberId;
167 ss <<
"Equipment 0x" << std::hex << (int) equipmentId <<
" Module " << moduleId <<
" fiberId " << fiberId <<
"\n";
172 uint16_t equipmentId = asicMap.first;
173 uint16_t numAsics = asicMap.second.size();
174 ss <<
"\n Equipment 0x" << std::hex << (int) equipmentId <<
" nAsics " << numAsics;
177 auto asics = asicMap.second;
178 for (
auto asic : asics) {
179 int asicId = asic.first;
180 auto asicChs = asic.second;
181 uint16_t numChans = asicChs.size();
182 ss <<
"\n " << asicCnt <<
" AsicId " << asicId <<
" nChans " << numChans;
183 for (
size_t chanId = 0; chanId < numChans; chanId++) {
184 auto entry = asicChs.at(chanId);
185 int32_t address = entry.padAddress;
186 bool isMasked = entry.maskFlag;
187 uint8_t tOffset = entry.tOffset;
188 uint16_t thres = entry.lThreshold;
189 ss <<
"\n chanID " << chanId <<
" {pad " << address <<
" mask " << isMasked <<
" time offset[clk] "
190 << (int) tOffset <<
" threshold[" << (thres > 0 ?
"on" :
"off") <<
"]}";
#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.
void InitComponentMap(const std::map< uint32_t, std::vector< uint16_t > > &map)
Initialisation of readout map.
std::vector< uint8_t > GetAsicList(uint16_t equipmentId)
Number of ASICS of a component.
~ReadoutConfig()
Destructor.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
void InitChannelMap(const std::map< size_t, std::map< size_t, std::map< size_t, std::tuple< int32_t, bool, uint8_t, uint16_t > > > > &channelMap)
Initialisation of channel map.
std::map< uint16_t, CompMapping > fReadoutMap
std::map< uint16_t, std::map< uint8_t, std::vector< ChanMapping > > > fChannelMap
CompMapping CompMap(uint16_t equipId)
API: Mapping from component to pair (module id, crob id)