Skip to content
Snippets Groups Projects
Commit a9fb81bc authored by Dominik Smith's avatar Dominik Smith
Browse files

cbm::algo::UnpackSts: Fixed address mapping for walk correction.

parent 7ae28ada
No related branches found
No related tags found
2 merge requests!1206cbm::algo::UnpackSts: Implemented walk correction. Improved asic enumeration.,!1200Draft: Walk correction for cbm::algo::UnpackSts.
Pipeline #22793 passed
......@@ -22,7 +22,6 @@ namespace cbm::algo
UnpackSts::resultType UnpackSts::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr,
const uint64_t tTimeslice)
{
// --- Output data
resultType result = {};
......@@ -127,7 +126,7 @@ namespace cbm::algo
messageTime -= elinkPar.fTimeOffset;
// --- Apply walk correction if applicable
if (!elinkPar.fWalk.empty()) { messageTime += elinkPar.fWalk[message.GetHitAdc() - 1]; }
if (message.GetHitAdc() <= elinkPar.fWalk.size()) { messageTime += elinkPar.fWalk[message.GetHitAdc() - 1]; }
// --- Charge
double charge = elinkPar.fAdcOffset + (message.GetHitAdc() - 1) * elinkPar.fAdcGain;
......
......@@ -168,7 +168,13 @@ namespace cbm::algo
elinkPar.fTimeOffset = 0.;
elinkPar.fAdcOffset = 1.;
elinkPar.fAdcGain = 1.;
elinkPar.fWalk = fStsConfig.WalkMap(elinkPar.fAddress, elinkPar.fAsicNr);
if (elinkPar.fAsicNr < numAsicsPerModuleSts / 2) {
elinkPar.fWalk = fStsConfig.WalkMap(elinkPar.fAddress, elinkPar.fAsicNr);
}
else {
elinkPar.fWalk = fStsConfig.WalkMap(elinkPar.fAddress,
numAsicsPerModuleSts - (elinkPar.fAsicNr - numAsicsPerModuleSts / 2) - 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