Skip to content
Snippets Groups Projects
Commit 2fc78bd5 authored by Dominik Smith's avatar Dominik Smith Committed by Volker Friese
Browse files

Bugfix for STS unpacker in algo namespace: Fixed channel mapping and adc calibration.

parent f19c0e50
No related branches found
No related tags found
1 merge request!1042Bugfix: Fixed channel mapping and adc calibration for STS Unpacker in Algo namespace.
Pipeline #20646 passed
......@@ -115,7 +115,7 @@ namespace cbm::algo
// Type 0 had the connector at the right side, type 1 at the left side.
// For type 0, the mapping of FEB to module side as above applies,
// for type 1, it has to be inverted.
bool modType[numModules] = {0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1};
bool modType[numModules] = {0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1};
// Module addresses (CbmStsAddress)
int32_t modAddress[numModules];
......@@ -127,11 +127,11 @@ namespace cbm::algo
modAddress[5] = 0x10008412;
modAddress[6] = 0x10018412;
modAddress[7] = 0x101FFC02;
modAddress[8] = 0x10008012;
modAddress[9] = 0x10018012;
modAddress[10] = 0x10008812;
modAddress[11] = 0x10018812;
modAddress[12] = 0x10028812;
modAddress[8] = 0x10008812;
modAddress[9] = 0x10018812;
modAddress[10] = 0x10028812;
modAddress[11] = 0x10008012;
modAddress[12] = 0x10018012;
// Constructing the map (equipmentId, eLink) -> (module, ASIC within module)
......@@ -149,6 +149,8 @@ namespace cbm::algo
int16_t feb = elink2Feb[elinkId]; // FEB within CROB
if (feb != -1) {
int16_t module = feb2module[comp][crob][feb]; // Module index
moduleAddress = modAddress[module];
if (module != -1) {
assert(module < numModules);
bool moduleType = modType[module]; // 0 or 1
......@@ -157,8 +159,7 @@ namespace cbm::algo
uint32_t asicIndex = (febType == 0 ? elink2AsicFebA[elinkId] : elink2AsicFebB[elinkId]);
uint32_t asicInFeb = asicIndex % numAsicsPerFeb; // ASIC number within FEB
moduleAddress = modAddress[module];
asicInModule = (moduleSide == 0 ? asicInFeb : asicInFeb + numAsicsPerFeb);
asicInModule = (moduleSide == 1 ? asicInFeb : asicInFeb + numAsicsPerFeb);
}
}
fReadoutMap[equipment][elink] = std::make_pair(moduleAddress, asicInModule);
......
......@@ -113,7 +113,8 @@ namespace cbm::algo
channel = message.GetHitChannel() + fParams.fNumChansPerAsic * asicNr;
}
else { // back side (p side)
channel = numChansPerModule - message.GetHitChannel() + 1;
channel = numChansPerModule - message.GetHitChannel()
- fParams.fNumChansPerAsic * (asicNr - fParams.fNumAsicsPerModule / 2) - 1;
}
// --- Expand time stamp to time within timeslice (in clock cycle)
......
......@@ -255,8 +255,8 @@ InitStatus CbmTaskUnpack::Init()
elinkPar.fAddress = mapEntry.first; // Module address for this elink
elinkPar.fAsicNr = mapEntry.second; // ASIC number within module
elinkPar.fTimeOffset = 0.;
elinkPar.fAdcOffset = 0.;
elinkPar.fAdcGain = 0.;
elinkPar.fAdcOffset = 1.;
elinkPar.fAdcGain = 1.;
// TODO: Add parameters for time and ADC calibration
par->fElinkParams.push_back(elinkPar);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment