Skip to content

Commit 009ee46

Browse files
committed
Add ever-incrementing TF counter to DataHeader
The DataHeader::firstTForbit will not be unique when the same TFs are replayed in loop, this counter will resolve the ambiguity.
1 parent 312f9b5 commit 009ee46

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,10 @@ struct DataHeader : public BaseHeader {
666666
using SplitPayloadPartsType = uint32_t;
667667
using PayloadSizeType = uint64_t;
668668
using TForbitType = uint32_t;
669+
using TFCounterType = uint32_t;
669670

670671
//static data for this header type/version
671-
static constexpr uint32_t sVersion{2};
672+
static constexpr uint32_t sVersion{3};
672673
static constexpr o2::header::HeaderType sHeaderType{String2<uint64_t>("DataHead")};
673674
static constexpr o2::header::SerializationMethod sSerializationMethod{gSerializationMethodNone};
674675

@@ -711,10 +712,15 @@ struct DataHeader : public BaseHeader {
711712
//___NEW STUFF GOES BELOW
712713

713714
///
714-
/// first orbit of time frame as unique identifier within the run
715+
/// first orbit of time frame as unique identifier within the run (unless the TF is replayed), since v2
715716
///
716717
TForbitType firstTForbit;
717718

719+
///
720+
/// ever incrementing TF counter, allows to disentangle even TFs with same firstTForbit in case of replay, since v3
721+
///
722+
TFCounterType tfCounter;
723+
718724
//___the functions:
719725
//__________________________________________________________________________________________________
720726
constexpr DataHeader()
@@ -726,7 +732,8 @@ struct DataHeader : public BaseHeader {
726732
subSpecification(0),
727733
splitPayloadIndex(0),
728734
payloadSize(0),
729-
firstTForbit{0}
735+
firstTForbit{0},
736+
tfCounter(0)
730737
{
731738
}
732739

@@ -740,7 +747,8 @@ struct DataHeader : public BaseHeader {
740747
subSpecification(subspec),
741748
splitPayloadIndex(0),
742749
payloadSize(size),
743-
firstTForbit{0}
750+
firstTForbit{0},
751+
tfCounter(0)
744752
{
745753
}
746754

@@ -754,7 +762,8 @@ struct DataHeader : public BaseHeader {
754762
subSpecification(subspec),
755763
splitPayloadIndex(partIndex),
756764
payloadSize(size),
757-
firstTForbit{0}
765+
firstTForbit{0},
766+
tfCounter(0)
758767
{
759768
}
760769

0 commit comments

Comments
 (0)