diff --git a/fles/mcbm2018/CbmMcbm2018Source.cxx b/fles/mcbm2018/CbmMcbm2018Source.cxx index a4006f72f62ff2b1d7f90482b72b3b5f2e996fb5..0db535ca17644197346095a646ebb37164b7605d 100644 --- a/fles/mcbm2018/CbmMcbm2018Source.cxx +++ b/fles/mcbm2018/CbmMcbm2018Source.cxx @@ -259,9 +259,26 @@ Int_t CbmMcbm2018Source::FillBuffer() { } // if( 0 == tsIndex % fuTsReduction ) /// Save the TimeSlice meta-data for access by higher level tasks - /// TODO: do not hard-code the duration here! + if (fTSCounter == 1) { + auto nMsInTs = ts.num_core_microslices(); + if (nMsInTs > 1) { + // This assumes that we have a component 0 and component independent ms/ts settings! + auto msDescA = ts.descriptor(0, 0); + auto msDescB = ts.descriptor(0, 1); + auto msLength = msDescB.idx - msDescA.idx; + fTSLength = msLength * nMsInTs; + fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs); + } else { + LOG(warning) + << "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate " + "TimesliceMetaData information - single microslice timeslices -> " + "TS duration can not be calculated with the given method. Hence, " + "TimesliceMetaData duration values are filled with 0"; + } + } new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()]) - TimesliceMetaData(ts.descriptor(0, 0).idx); + TimesliceMetaData( + ts.descriptor(0, 0).idx, fTSLength, fTSOverlappLength, tsIndex); return 0; } diff --git a/fles/mcbm2018/CbmMcbm2018Source.h b/fles/mcbm2018/CbmMcbm2018Source.h index e6af90ff438004d104a81c871c433825dc3e9975..06ad5480ec982dcf5e28da8e1443a2abc88cf737 100644 --- a/fles/mcbm2018/CbmMcbm2018Source.h +++ b/fles/mcbm2018/CbmMcbm2018Source.h @@ -92,6 +92,9 @@ private: UInt_t fTSNumber; UInt_t fTSCounter; + ULong64_t fTSLength = 0; // used for the creation of the TimesliceMetaData + ULong64_t fTSOverlappLength = + 0; // used for the creation of the TimesliceMetaData TStopwatch fTimer; TH1I* fHistoMissedTS; //!