1717
1818#include < iostream>
1919#include " Headers/RAWDataHeader.h"
20+ #include " DetectorsRaw/RDHUtils.h"
2021
2122namespace o2
2223{
2324namespace mid
2425{
26+ using RDHUtils = o2::raw::RDHUtils;
27+
2528template <typename T>
2629bool RawFileReader<T>::init(const char * inFilename, bool readContinuous)
2730{
@@ -96,7 +99,7 @@ bool RawFileReader<T>::replaceRDH(size_t headerIndex)
9699 // / Replaces the current RDH with a custom one if needed.
97100 // / This is done to be able to correctly read test data
98101 // / that have a wrong RDH
99- if (mCustomRDH . offsetToNext > 0 ) {
102+ if (RDHUtils::getOffsetToNext ( mCustomRDH ) > 0 ) {
100103 header::RAWDataHeader* rdh = reinterpret_cast <header::RAWDataHeader*>(&mBytes [headerIndex]);
101104 *rdh = mCustomRDH ;
102105 return true ;
@@ -140,13 +143,13 @@ bool RawFileReader<T>::readHB(bool sendCompleteHBs)
140143 mBuffer .setBuffer (mBytes , RawBuffer<T>::ResetMode::bufferOnly);
141144 mBuffer .nextHeader ();
142145 isHBClosed = mBuffer .isHBClosed ();
143- gbtId = mBuffer .getRDH ()-> feeId ;
146+ gbtId = RDHUtils::getFEEID (* mBuffer .getRDH ()) ;
144147 if (gbtId >= crateparams::sNGBTs ) {
145148 // FIXME: this is a problem of the header of some test files
146149 gbtId = 0 ;
147150 }
148- if (mBuffer .getRDH ()-> offsetToNext > raw::sHeaderSizeInBytes ) {
149- read (mBuffer .getRDH ()-> offsetToNext - raw::sHeaderSizeInBytes );
151+ if (RDHUtils::getOffsetToNext (* mBuffer .getRDH ()) > raw::sHeaderSizeInBytes ) {
152+ read (RDHUtils::getOffsetToNext (* mBuffer .getRDH ()) - raw::sHeaderSizeInBytes );
150153 // CAVEAT: to save memory / CPU time, the RawBuffer does not hold a copy of the buffer,
151154 // but just a span of it.
152155 // If we add bytes to mBytes, the vector can go beyond the capacity
@@ -171,4 +174,4 @@ template class RawFileReader<raw::RawUnit>;
171174template class RawFileReader <uint8_t >;
172175
173176} // namespace mid
174- } // namespace o2
177+ } // namespace o2
0 commit comments