Skip to content
Snippets Groups Projects
Commit c5d56bc1 authored by Pascal Raisig's avatar Pascal Raisig
Browse files

Add automatic TSLength calculation and tsIndex to TimesliceMetaData

Up to now the TS length was hardcoded for the TimesliceMetaData object.
This commit adds an automatic calculation and inserts it
into the stored TimesliceMetaData objects.
parent 490dda2d
No related branches found
No related tags found
1 merge request!155Add automatic TSLength calculation and tsIndex to TimesliceMetaData (mcbm2020 unpacking)
...@@ -259,9 +259,26 @@ Int_t CbmMcbm2018Source::FillBuffer() { ...@@ -259,9 +259,26 @@ Int_t CbmMcbm2018Source::FillBuffer() {
} // if( 0 == tsIndex % fuTsReduction ) } // if( 0 == tsIndex % fuTsReduction )
/// Save the TimeSlice meta-data for access by higher level tasks /// 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()]) new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()])
TimesliceMetaData(ts.descriptor(0, 0).idx); TimesliceMetaData(
ts.descriptor(0, 0).idx, fTSLength, fTSOverlappLength, tsIndex);
return 0; return 0;
} }
......
...@@ -92,6 +92,9 @@ private: ...@@ -92,6 +92,9 @@ private:
UInt_t fTSNumber; UInt_t fTSNumber;
UInt_t fTSCounter; 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; TStopwatch fTimer;
TH1I* fHistoMissedTS; //! TH1I* fHistoMissedTS; //!
......
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