44 RawGBTDecoderDeviceDPL(
bool isDebugMode,
const std::vector<uint16_t>& feeIds,
const CrateMasks& crateMasks,
const ElectronicsDelay& electronicsDelay) : mIsDebugMode(isDebugMode), mFeeIds(feeIds), mCrateMasks(crateMasks), mElectronicsDelay(electronicsDelay) {}
48 auto stop = [
this]() {
49 double scaleFactor = (mNROFs == 0) ? 0. : 1.e6 / mNROFs;
50 LOG(info) <<
"Processing time / " << mNROFs <<
" ROFs: full: " << mTimer.count() * scaleFactor <<
" us decoding: " << mTimerAlgo.count() * scaleFactor <<
" us";
55 mFeeId = mFeeIds[idx];
60 auto tStart = std::chrono::high_resolution_clock::now();
64 auto tAlgoStart = std::chrono::high_resolution_clock::now();
73 std::vector<ROBoard>
data;
74 std::vector<ROFRecord> rofRecords;
76 for (
auto it = parser.
begin(),
end = parser.
end(); it !=
end; ++it) {
77 dh = it.o2DataHeader();
79 gsl::span<const uint8_t> payload(it.data(), it.size());
80 mDecoder->process(payload, o2::raw::RDHUtils::getHeartBeatOrbit(rdhPtr), o2::raw::RDHUtils::getTriggerType(rdhPtr),
data, rofRecords);
83 mTimerAlgo += std::chrono::high_resolution_clock::now() - tAlgoStart;
88 mTimer += std::chrono::high_resolution_clock::now() - tStart;
89 mNROFs += rofRecords.size();
93 std::unique_ptr<LinkDecoder> mDecoder{
nullptr};
94 bool mIsDebugMode{
false};
95 std::vector<uint16_t> mFeeIds{};
96 CrateMasks mCrateMasks{};
97 ElectronicsDelay mElectronicsDelay{};
99 std::chrono::duration<double> mTimer{0};
100 std::chrono::duration<double> mTimerAlgo{0};
101 unsigned int mNROFs{0};
113 o2::framework::adaptFromTask<RawGBTDecoderDeviceDPL>(isDebugMode, feeIds, crateMasks, electronicsDelay)};
A raw page parser for DPL input.
Class interface for the MID link decoder.
Structure to store the readout board information.
Data processor spec for MID GBT raw decoder device.
buffer_type const * raw() const
get pointer to raw block at current position, rdh starts here
The parser handles transparently input in the format of raw pages.
const_iterator end() const
const_iterator begin() const
void snapshot(const Output &spec, T const &object)
ServiceRegistryRef services()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
uint8_t getMask(uint16_t feeId) const
Gets the mask for the feeId.
void init(o2::framework::InitContext &ic)
void run(o2::framework::ProcessingContext &pc)
RawGBTDecoderDeviceDPL(bool isDebugMode, const std::vector< uint16_t > &feeIds, const CrateMasks &crateMasks, const ElectronicsDelay &electronicsDelay)
constexpr o2::header::DataOrigin gDataOriginMID
constexpr o2::header::DataDescription gDataDescriptionRawData
std::unique_ptr< LinkDecoder > createGBTDecoder(const o2::header::RDHAny &rdh, uint16_t feeId, bool isDebugMode, uint8_t mask, const ElectronicsDelay &electronicsDelay)
o2::framework::DataProcessorSpec getRawGBTDecoderSpec(bool isDebugMode, const std::vector< uint16_t > &feeIds, const CrateMasks &crateMasks, const ElectronicsDelay &electronicsDelay)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"