CbmRoot
Loading...
Searching...
No Matches
CbmDevUnpack.h
Go to the documentation of this file.
1/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Dominik Smith [committer] */
4
12#ifndef CBMDEVUNPACK_H
13#define CBMDEVUNPACK_H
14
15#include "CbmMqTMessage.h"
16#include "FairMQDevice.h"
17#include "FairParGenericSet.h"
18#include "Rtypes.h"
19#include "TObjArray.h"
20#include "Timeslice.hpp"
21#include "much/MuchReadoutConfig.h"
22#include "much/UnpackMuch.h"
23#include "sts/StsReadoutConfigLegacy.h"
24#include "sts/UnpackSts.h"
25
26#include <chrono>
27#include <map>
28#include <vector>
29
32
33class CbmDevUnpack : public FairMQDevice {
34 public:
36 virtual ~CbmDevUnpack(){};
37
38 private:
39 std::map<uint16_t, cbm::algo::UnpackSts> fAlgoSts = {};
40 cbm::algo::StsReadoutConfigLegacy fStsConfig{};
41
42 std::map<uint16_t, cbm::algo::UnpackMuch> fAlgoMuch = {};
43 cbm::algo::MuchReadoutConfig fMuchConfig{};
44
46 std::string fsChannelNameDataInput = "ts-request";
47 std::string fsChannelNameDataOutput = "unpts_0";
48 std::string fsChannelNameCommands = "commands";
49
51 size_t fNumMessages = 0;
52 size_t fNumTs = 0;
53
55 virtual void InitTask();
56
58 bool ConditionalRun();
59
61 bool InitAlgos();
62
67 CbmDigiTimeslice DoUnpack(const fles::Timeslice& ts);
68
70 bool SendData(const CbmDigiTimeslice& timeslice, const TimesliceMetaData& TsMetaData);
71};
72
73#endif /* CBMDEVUNPACK_H */
virtual void InitTask()
Read command line parameters for MQ device.
CbmDigiTimeslice DoUnpack(const fles::Timeslice &ts)
Unpack a single timeslice.
size_t fNumMessages
Statistics & first TS rejection.
std::string fsChannelNameCommands
cbm::algo::StsReadoutConfigLegacy fStsConfig
std::map< uint16_t, cbm::algo::UnpackMuch > fAlgoMuch
std::string fsChannelNameDataInput
message queues
cbm::algo::MuchReadoutConfig fMuchConfig
std::map< uint16_t, cbm::algo::UnpackSts > fAlgoSts
bool ConditionalRun()
Called by run loop, does init steps on first TS.
std::string fsChannelNameDataOutput
bool SendData(const CbmDigiTimeslice &timeslice, const TimesliceMetaData &TsMetaData)
Serialize unpacked digi timeslice and send to output channel.
virtual ~CbmDevUnpack()
bool InitAlgos()
Initialize runtime parameters for UnpackSts algos.
Collection of digis from all detector systems within one timeslice.