CbmRoot
Loading...
Searching...
No Matches
CbmDeviceEventBuilderEtofStar2019.h
Go to the documentation of this file.
1/* Copyright (C) 2019 PI-UHd, GSI
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Norbert Herrmann [committer] */
4
10#ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
11#define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
12
13#include "CbmMqTMessage.h"
14
15#include "Timeslice.hpp"
16
17#include "FairMQDevice.h"
18
19#include "TMessage.h"
20#include "TStopwatch.h"
21
24
25class CbmDeviceEventBuilderEtofStar2019 : public FairMQDevice {
26public:
29
30 virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
31 virtual void Reset();
32 virtual void Finish();
33
34 void SetParContainers();
35
36 Bool_t InitContainers();
37
38 Bool_t ReInitContainers();
39
40 void SetSandboxMode(Bool_t bSandboxMode = kTRUE) { fbSandboxMode = bSandboxMode; }
41 void SetEventDumpEnable(Bool_t bDumpEna = kTRUE);
42
44 void AddMsComponentToList(size_t component, UShort_t usDetectorId);
45 void SetNbMsInTs(size_t /*uCoreMsNb*/, size_t /*uOverlapMsNb*/) {};
46
49
50protected:
51 virtual void InitTask();
52 bool HandleData(FairMQMessagePtr&, int);
53 bool HandleParts(FairMQParts&, int);
54 bool HandleMessage(FairMQMessagePtr&, int);
55 virtual bool SendEvent(std::vector<Int_t>, int);
56 virtual bool SendSubevent(uint, char*, int, int);
57
58private:
59 uint64_t fNumMessages;
65
67 TList* fParCList;
68
70 uint64_t fulTsCounter;
71 uint64_t fNumEvt;
72
73 bool CheckTimeslice(const fles::Timeslice& ts);
74 bool IsChannelNameAllowed(std::string channelName);
75
76 std::vector<std::string> fAllowedChannels = {"tofcomponent", "parameters", "etofevts", "syscmd"};
77 std::vector<std::vector<std::string>> fChannelsToSend = {{}, {}, {}};
78
81 TStopwatch fTimer;
82
84
86 std::fstream* fpBinDumpFile;
87 const UInt_t kuBinDumpBegWord = 0xFEEDBEAF;
88 const UInt_t kuBinDumpEndWord = 0xFAEBDEEF;
89};
90
91#endif /* CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ */
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
uint64_t fulTsCounter
Statistics & first TS rejection.
virtual bool SendEvent(std::vector< Int_t >, int)
CbmDeviceEventBuilderEtofStar2019(const CbmDeviceEventBuilderEtofStar2019 &)=delete
void SetEventDumpEnable(Bool_t bDumpEna=kTRUE)
Bool_t fbEventDumpEna
Switch OFF the emission of data toward the STAR DAQ.
std::vector< std::vector< std::string > > fChannelsToSend
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
CbmDeviceEventBuilderEtofStar2019 operator=(const CbmDeviceEventBuilderEtofStar2019 &)=delete
std::fstream * fpBinDumpFile
Event dump to binary file.
Bool_t fbSandboxMode
Switch ON the filling of a additional set of histograms.
CbmStar2019EventBuilderEtofAlgo * fEventBuilderAlgo
Processing algo.
virtual bool SendSubevent(uint, char *, int, int)
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
TList * fParCList
Switch ON the dumping of the events to a binary file.