Skip to content

Commit bd281c8

Browse files
committed
stf: updates for data header v3
1 parent df47882 commit bd281c8

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/common/SubTimeFrameDPL.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ using namespace o2::header;
3131

3232
void StfToDplAdapter::visit(SubTimeFrame& pStf)
3333
{
34-
#if 0 // TODO: enable when the session is settled
35-
3634
// Pack the Stf header
3735
o2::header::DataHeader lStfDistDataHeader(
3836
gDataDescSubTimeFrame,
@@ -65,7 +63,6 @@ void StfToDplAdapter::visit(SubTimeFrame& pStf)
6563
mMessages.emplace_back(std::move(lDataHeaderMsg));
6664
mMessages.emplace_back(std::move(lDataMsg));
6765
}
68-
#endif
6966

7067
for (auto& lDataIdentMapIter : pStf.mData) {
7168

src/common/SubTimeFrameDataModel.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ using namespace o2::header;
3131
/// SubTimeFrame
3232
////////////////////////////////////////////////////////////////////////////////
3333
SubTimeFrame::SubTimeFrame(uint64_t pStfId)
34-
: mHeader{ pStfId }
34+
: mHeader(pStfId)
3535
{
3636
}
3737

src/common/include/SubTimeFrameDataModel.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ class SubTimeFrame : public IDataModelObject
311311
TimeFrameIdType mId = sInvalidTimeFrameId;
312312
std::uint32_t mFirstOrbit = std::numeric_limits<std::uint32_t>::max();
313313
std::uint32_t mRunNumber = 0;
314+
315+
Header() = default;
316+
explicit Header(TimeFrameIdType pId)
317+
: mId(pId) { }
314318
};
315319

316320
const Header& header() const { return mHeader; }
@@ -342,7 +346,12 @@ class SubTimeFrame : public IDataModelObject
342346
mutable bool mUpdated = false;
343347

344348
public:
345-
void updateFirstOrbit(const std::uint32_t o) { mHeader.mFirstOrbit = std::min(mHeader.mFirstOrbit, o); }
349+
void updateFirstOrbit(const std::uint32_t pOrbit) {
350+
if (pOrbit < mHeader.mFirstOrbit) {
351+
mHeader.mFirstOrbit = pOrbit;
352+
mUpdated = false;
353+
}
354+
}
346355

347356
private:
348357
///
@@ -385,12 +394,13 @@ class SubTimeFrame : public IDataModelObject
385394
// update first orbit if not present in the data (old tf files)
386395
// update tfCounter: TODO: incrementing always for looping of the same data
387396
// update runNumber: TODO: zero for now.
388-
if (mHeader.mFirstOrbit != std::numeric_limits<std::uint32_t>::max()) {
389-
for (StfDataVector::size_type i = 0; i < lTotalCount; i++) {
397+
for (StfDataVector::size_type i = 0; i < lTotalCount; i++) {
398+
if (mHeader.mFirstOrbit != std::numeric_limits<std::uint32_t>::max()) {
390399
lDataVector[i].setFirstOrbit(mHeader.mFirstOrbit);
391-
lDataVector[i].setTfCounter(mHeader.mId);
392-
lDataVector[i].setRunNumber(0);
393400
}
401+
402+
lDataVector[i].setTfCounter(mHeader.mId);
403+
lDataVector[i].setRunNumber(0);
394404
}
395405

396406
assert(lDataVector.empty() ? true :

0 commit comments

Comments
 (0)