Skip to content
Snippets Groups Projects
Commit 0157edc9 authored by Dominik Smith's avatar Dominik Smith Committed by Pierre-Alain Loizeau
Browse files

CbmStsUnpackAlgo: Added DPB offset to FEB index calculation in processHitInfo().

parent e2f1b37b
No related branches found
No related tags found
1 merge request!445(Bugfix) CbmStsUnpackAlgo: Added DPB offset to FEB index calculation in processHitInfo().
Pipeline #12485 passed
......@@ -146,6 +146,9 @@ Bool_t CbmStsUnpackAlgo::initParSet(CbmMcbm2018StsPar* parset)
// Get Number of Channels per FEB
fNrChsPerFeb = parset->GetNbChanPerFeb();
// Get Number of FEBs per CROB
fNrFebsPerCrob = parset->GetNbFebsPerCrob();
for (size_t ielink = 0; ielink < fNrElinksPerCrob; ++ielink) {
fElinkIdxToFebIdxVec.emplace_back(parset->ElinkIdxToFebIdx(ielink));
fElinkIdxToAsicIdxVec.emplace_back(
......@@ -451,13 +454,16 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess)
{
const uint16_t usElinkIdx = mess.GetLinkIndexHitBinning();
const uint32_t uCrobIdx = usElinkIdx / fNrElinksPerCrob;
const int32_t uFebIdx = fElinkIdxToFebIdxVec.at(usElinkIdx);
int32_t uFebIdx = fElinkIdxToFebIdxVec.at(usElinkIdx);
if (-1 == uFebIdx) {
LOG(warning) << "CbmAlgoUnpackSts::DoUnpack => "
<< "Wrong elink Idx! Elink raw " << Form("%d remap %d", usElinkIdx, uFebIdx);
return;
}
// Get the asix index
//uFebIdx += ( fuCurrDpbIdx * fNrCrobPerDpb + ____CrobIndexCalculationIfNeeded___() ) * fuNbFebsPerCrob;
uFebIdx += (fuCurrDpbIdx * fNrCrobPerDpb) * fNrFebsPerCrob; //no Crob index calculation for now
// Get the asic index
uint32_t uAsicIdx = getAsicIndex(fuCurrDpbIdx, uCrobIdx, usElinkIdx);
const uint16_t usChan = mess.GetHitChannel();
......@@ -478,6 +484,7 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess)
fvvusLastTsMsbChan[uAsicIdx][usChan] = fvulCurrentTsMsb[fuCurrDpbIdx];
fvvusLastTsMsbCycleChan[uAsicIdx][usChan] = fvuCurrentTsMsbCycle[fuCurrDpbIdx];
// Compute the Full time stamp
const int64_t ulHitTime = getFullTimeStamp(usRawTs);
......
......@@ -246,6 +246,9 @@ protected:
/** @brief Number of CROBs per DPB */
uint32_t fNrCrobPerDpb = 0; //!
/** @brief Number of FEBs per CROB */
uint32_t fNrFebsPerCrob = 0; //!
/** @brief Vector used for the translation between eLink index and FEB index*/
std::vector<int> fElinkIdxToFebIdxVec = {};
......
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