66 void ReadoutConfig::Init(
const std::map<
size_t, std::map<
size_t, std::map<size_t, size_t>>>& addressMap,
67 std::map<
size_t, std::map<
size_t, std::map<
size_t, std::map<size_t, size_t>>>>& channelMap)
70 for (
auto compMap : addressMap) {
71 uint16_t equipmentId = compMap.first;
72 uint16_t numCrobs = compMap.second.size();
75 for (
auto crobMap : compMap.second) {
76 uint16_t crobId = crobMap.first;
77 uint16_t numElinks = crobMap.second.size();
80 for (
auto elinkMap : crobMap.second) {
81 uint16_t elinkId = elinkMap.first;
82 uint16_t address = elinkMap.second;
83 fReadoutMap[equipmentId][crobId][elinkId] = address;
89 for (
auto compMap : channelMap) {
90 uint16_t equipmentId = compMap.first;
91 uint16_t numCrobs = compMap.second.size();
94 for (
auto crobMap : compMap.second) {
95 uint16_t crobId = crobMap.first;
96 uint16_t numElinks = crobMap.second.size();
99 for (
auto elinkMap : crobMap.second) {
100 uint16_t elinkId = elinkMap.first;
101 uint16_t numChans = elinkMap.second.size();
102 fChannelMap[equipmentId][crobId][elinkId].resize(numChans);
104 for (
auto chanMap : elinkMap.second) {
105 uint16_t chanId = chanMap.first;
106 uint32_t address = chanMap.second;
107 fChannelMap[equipmentId][crobId][elinkId][chanId] = address;
117 std::pair<int32_t, std::vector<uint32_t>>
ReadoutConfig::Map(uint16_t equipmentId, uint16_t crobId, uint16_t elinkId)
119 std::pair<int32_t, std::vector<uint32_t>> result;
125 result.first =
fReadoutMap[equipmentId][crobId][elinkId];
126 result.second =
fChannelMap[equipmentId][crobId][elinkId];
160 std::stringstream ss;
163 uint16_t equipmentId = compMap.first;
164 uint16_t numCrobs = compMap.second.size();
165 ss <<
"\n Equipment " << equipmentId <<
" nCrobs " << numCrobs;
166 for (
size_t crobId = 0; crobId < numCrobs; crobId++) {
168 uint16_t numElinks = compMap.second.at(crobId).size();
169 ss <<
"\n Equipment " << equipmentId <<
" CrobId " << crobId <<
" nElinks " << numElinks;
170 for (
size_t elinkId = 0; elinkId < numElinks; elinkId++) {
172 uint16_t address = compMap.second.at(crobId).at(elinkId);
173 ss <<
"\n Equipment " << equipmentId <<
" CrobId " << crobId <<
" elinkID " << elinkId <<
" address "
177 ss <<
"\n Channels ";
178 auto vec =
fChannelMap[equipmentId][crobId][elinkId];
179 std::copy(vec.begin(), vec.end() - 1, std::ostream_iterator<uint32_t>(ss,
" "));
void Init(const std::map< size_t, std::map< size_t, std::map< size_t, size_t > > > &addressMap, std::map< size_t, std::map< size_t, std::map< size_t, std::map< size_t, size_t > > > > &channelMap)
Initialisation of readout map.
std::pair< int32_t, std::vector< uint32_t > > Map(uint16_t equipId, uint16_t crob, uint16_t elink)
API: Mapping from component, crob and elink to pair (ASIC address, channel addresses)