58 std::vector<uint16_t> result;
60 result.push_back(entry.first);
79 std::vector<uint8_t> result;
81 result.push_back(entry.first);
94 auto jt = fiberMap.find(asicId);
95 if (jt != fiberMap.end()) {
96 result = fiberMap[asicId].size();
108 for (
auto& entry : map) {
109 uint16_t mod_id = entry.first;
112 for (
const auto& eq_add : entry.second) {
122 const std::map<
size_t, std::map<
size_t, std::map<
size_t, std::tuple<int32_t, bool, int16_t, uint16_t>>>>&
126 for (
auto compMap : channelMap) {
127 uint16_t equipmentId = compMap.first;
129 for (
auto asicMap : compMap.second) {
130 uint16_t asicId = asicMap.first;
133 for (
auto chanMap : asicMap.second) {
134 uint16_t chanId = chanMap.first;
135 std::tuple<int32_t, bool, int8_t, uint16_t> chanPars = chanMap.second;
136 const ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars),
137 std::get<3>(chanPars)};
153 auto jt = fiberMap.find(asicId);
154 if (jt != fiberMap.end()) {
155 auto asic = fiberMap[asicId];
156 if (chanId < asic.size()) {
157 result = asic[chanId];
172 result = equipIter->second;
182 std::stringstream ss;
184 uint16_t equipmentId = comp.first;
185 auto value = comp.second;
186 uint16_t moduleId = value.moduleId;
187 uint16_t fiberId = value.fiberId;
188 ss <<
"Equipment 0x" << std::hex << (int) equipmentId <<
" Module " << moduleId <<
" fiberId " << fiberId <<
"\n";
193 uint16_t equipmentId = asicMap.first;
194 uint16_t numAsics = asicMap.second.size();
195 ss <<
"\n Equipment 0x" << std::hex << (int) equipmentId <<
" nAsics " << numAsics;
198 auto asics = asicMap.second;
199 for (
auto asic : asics) {
200 int asicId = asic.first;
201 auto asicChs = asic.second;
202 uint16_t numChans = asicChs.size();
203 ss <<
"\n " << asicCnt <<
" AsicId " << asicId <<
" nChans " << numChans;
204 for (
size_t chanId = 0; chanId < numChans; chanId++) {
205 auto entry = asicChs.at(chanId);
206 int32_t address = entry.padAddress;
207 bool isMasked = entry.maskFlag;
208 uint8_t tOffset = entry.tOffset;
209 uint16_t thres = entry.lThreshold;
210 ss <<
"\n chanID " << chanId <<
" {pad " << address <<
" mask " << isMasked <<
" time offset[clk] "
211 << (int) tOffset <<
" threshold[" << (thres > 0 ?
"on" :
"off") <<
"]}";
225 std::stringstream ss;
226 ss <<
"fCalibMap.size=" <<
fCalibMap.size() <<
"\n";
227 for (
const auto& [mod, pars] :
fCalibMap) {
228 ss <<
"Mod 0x" << mod <<
"\n";
230 for (
auto par : pars) {
231 if (ipar %
NFASPCH == 0) ss <<
"\t";
232 ss <<
" " << std::setw(4) << par.gainfee;
#define CBM_YAML_INSTANTIATE(type)
Explicitly instantiate the Read and Dump functions for a type.
std::string PrintCalibMap()
Debug output of readout map.
std::map< uint16_t, std::array< ChanDescriptor, NFASPMOD *NFASPCH > > fCalibMap
reference signal [ADU] to which the FEE gain is refereed
ChanDescriptor GetChannelFeeCalib(uint16_t modId, uint16_t padId)
Retrieve calibration for one channel.
~ReadoutCalib()
Destructor.
ReadoutCalib()
Constructor.
std::vector< uint8_t > GetAsicList(uint16_t equipmentId)
Number of ASICS of a component.
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,...
std::map< uint16_t, CompMapping > fReadoutMap
ReadoutSetup()
Constructor.
std::map< uint16_t, std::map< uint8_t, std::vector< ChanMapping > > > fChannelMap
std::string PrintReadoutMap()
Debug output of readout map.
std::vector< uint16_t > GetEquipmentIds()
Equipment in the configuration.
void InitComponentMap(const std::map< uint32_t, std::vector< uint16_t > > &map)
Initialisation of readout map.
~ReadoutSetup()
Destructor.
size_t GetNumAsics(uint16_t equipmentId)
Number of ASICS of a component.
void InitChannelMap(const std::map< size_t, std::map< size_t, std::map< size_t, std::tuple< int32_t, bool, int16_t, uint16_t > > > > &channelMap)
Initialisation of channel map.
size_t GetNumChans(uint16_t equipmentId, uint16_t asicId)
Number of channels of a component - ASIC pair.
CompMapping CompMap(uint16_t equipId)
API: Mapping from component to pair (module id, crob id)