Skip to content
Snippets Groups Projects
Commit b5e47a93 authored by David Schledt's avatar David Schledt Committed by Pierre-Alain Loizeau
Browse files

Trd unpacker: Fix for incorrect time

=> The relative microslice time is now added to the timestamp with the correct units
parent 3ae956b9
No related branches found
No related tags found
1 merge request!1711Trd unpacker: Fix for incorrect time
Pipeline #27947 passed
......@@ -333,7 +333,7 @@ void CbmTrdUnpackAlgoR::makeDigi(Spadic::FexWord<0x10> fw, std::uint32_t criid)
// Store the full time information to last full-time member for error message handling
// Get the time information and apply the necessary correction
ULong64_t time = (fw.timestamp - fw.prec_time) * fSpadic->GetClockCycle() + fMsStartTimeRelCC;
ULong64_t time = (fw.timestamp - fw.prec_time) * fSpadic->GetClockCycle() + fMsStartTimeRel;
auto energy = fSpadic->MaxAdcToEnergyCal(fw.maxAdc);
......@@ -381,7 +381,8 @@ bool CbmTrdUnpackAlgoR::unpack(const fles::Timeslice* ts, std::uint16_t icomp, U
// Get the µSlice starttime relative to the timeslice starttime.
// The UTC is already to large for storing it CbmTrdRawMessageSpadic due to a cast, caused by the multiplication with a double used in the raw message
fMsStartTimeRelCC = (msdesc.idx - fTsStartTime) / fSpadic->GetClockCycle();
fMsStartTimeRel = msdesc.idx - fTsStartTime;
fMsStartTimeRelCC = fMsStartTimeRel / fSpadic->GetClockCycle();
// Get the hardware ids from which the current µSlice is coming
std::uint8_t crobId = 0;
......
......@@ -200,6 +200,9 @@ class CbmTrdUnpackAlgoR : public CbmTrdUnpackAlgoBaseR {
/** @brief Number of corrupted EOM frames */
size_t fNrCorruptEom = 0;
/** @brief Start time of the current µSlice relative to the Timeslice start time in ns. */
size_t fMsStartTimeRel = 0;
/** @brief Start time of the current µSlice relative to the Timeslice start time in Spadic CC. */
size_t fMsStartTimeRelCC = 0;
......
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