CbmRoot
Loading...
Searching...
No Matches
CbmDevEventSink.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: Dominik Smith [committer], Pierre-Alain Loizeau, Volker Friese */
4
5#ifndef CBMDEVICEEVTSINK_H_
6#define CBMDEVICEEVTSINK_H_
7
8#include "CbmDigiEvent.h"
9#include "FairMQDevice.h"
10
11#include <vector>
12
14class FairRunOnline;
15class FairRootManager;
16
17
27class CbmDevEventSink : public FairMQDevice {
28 public:
31
33 virtual ~CbmDevEventSink();
34
35
36 protected:
42 bool HandleCommand(FairMQMessagePtr&, int flag);
43
49 bool HandleData(FairMQParts& parts, int flag);
50
52 virtual void InitTask();
53
54
55 private: // methods
57 void Finish();
58
59
60 private: // members
61 // --- Counters and status flags
62 size_t fNumMessages = 0;
63 size_t fNumTs = 0;
64 uint64_t fPrevTsIndex = 0;
65 bool fFinishDone = false;
67 std::vector<CbmDigiEvent>* fEventVec = nullptr;
68 FairRunOnline* fFairRun = nullptr;
69 FairRootManager* fFairRootMgr = nullptr;
70};
71
72#endif /* CBMDEVICEEVTSINK_H_ */
virtual ~CbmDevEventSink()
Destructor.
CbmDevEventSink()
Constructor.
virtual void InitTask()
Initialization.
FairRootManager * fFairRootMgr
FairRootManager used for ROOT file I/O.
FairRunOnline * fFairRun
FairRunOnline to instantiate FairRootManager.
uint64_t fPrevTsIndex
Index of last processed timeslice.
size_t fNumMessages
Number of received data messages.
std::vector< CbmDigiEvent > * fEventVec
Data output: events.
TimesliceMetaData * fTsMetaData
Data output: TS meta data.
bool HandleCommand(FairMQMessagePtr &, int flag)
Action on command messages.
size_t fNumTs
Number of processed timeslices.
void Finish()
Finishing run.
bool fFinishDone
Keep track of whether the Finish method was already called.
bool HandleData(FairMQParts &parts, int flag)
Action on data messages.