CbmRoot
CbmDeviceEventBuilderEtofStar2019.h
Go to the documentation of this file.
1 
6 #ifndef CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
7 #define CBMDEVICEEVENTBUILDERETOFSTAR2019_H_
8 
9 #include "FairMQDevice.h"
10 
11 #include "TMessage.h"
12 #include "Timeslice.hpp"
13 
14 #include "TStopwatch.h"
15 
17 class CbmStar2019TofPar;
18 
19 class CbmDeviceEventBuilderEtofStar2019 : public FairMQDevice {
20 public:
23 
24  virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
25  virtual void Reset();
26  virtual void Finish();
27 
28  void SetParContainers();
29 
30  Bool_t InitContainers();
31 
32  Bool_t ReInitContainers();
33 
34  void SetSandboxMode(Bool_t bSandboxMode = kTRUE) {
35  fbSandboxMode = bSandboxMode;
36  }
37  void SetEventDumpEnable(Bool_t bDumpEna = kTRUE);
38 
40  void AddMsComponentToList(size_t component, UShort_t usDetectorId);
41  void SetNbMsInTs(size_t /*uCoreMsNb*/, size_t /*uOverlapMsNb*/) {};
42 
44  delete;
47 
48 protected:
49  virtual void InitTask();
50  bool HandleData(FairMQMessagePtr&, int);
51  bool HandleParts(FairMQParts&, int);
52  bool HandleMessage(FairMQMessagePtr&, int);
53  virtual bool SendEvent(std::vector<Int_t>, int);
54  virtual bool SendSubevent(uint, char*, int, int);
55 
56 private:
57  uint64_t fNumMessages;
59  Bool_t
61  Bool_t
63  Bool_t fbSandboxMode;
64  Bool_t
66 
68  TList* fParCList;
69 
71  uint64_t fulTsCounter;
72  uint64_t fNumEvt;
73 
74  bool CheckTimeslice(const fles::Timeslice& ts);
75  bool IsChannelNameAllowed(std::string channelName);
76 
77  std::vector<std::string> fAllowedChannels = {"tofcomponent",
78  "parameters",
79  "etofevts",
80  "syscmd"};
81  std::vector<std::vector<std::string>> fChannelsToSend = {{}, {}, {}};
82 
85  TStopwatch fTimer;
86 
88 
90  std::fstream* fpBinDumpFile;
91  const UInt_t kuBinDumpBegWord = 0xFEEDBEAF;
92  const UInt_t kuBinDumpEndWord = 0xFAEBDEEF;
93 };
94 
95 // special class to expose protected TMessage constructor
96 class CbmMQTMessage : public TMessage {
97 public:
98  CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) {
99  ResetBit(kIsOwner);
100  }
101 };
102 
103 #endif /* CBMDEVICEEVENTBUILDERETOFSTAR2019_H_ */
CbmDeviceEventBuilderEtofStar2019::CheckTimeslice
bool CheckTimeslice(const fles::Timeslice &ts)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:442
CbmDeviceEventBuilderEtofStar2019
Definition: CbmDeviceEventBuilderEtofStar2019.h:19
CbmDeviceEventBuilderEtofStar2019::fbSandboxMode
Bool_t fbSandboxMode
Switch ON the filling of a additional set of histograms.
Definition: CbmDeviceEventBuilderEtofStar2019.h:63
CbmDeviceEventBuilderEtofStar2019::InitTask
virtual void InitTask()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:67
CbmDeviceEventBuilderEtofStar2019::fParCList
TList * fParCList
Switch ON the dumping of the events to a binary file.
Definition: CbmDeviceEventBuilderEtofStar2019.h:68
CbmDeviceEventBuilderEtofStar2019::fUnpackPar
CbmStar2019TofPar * fUnpackPar
Definition: CbmDeviceEventBuilderEtofStar2019.h:87
CbmDeviceEventBuilderEtofStar2019::kuBinDumpEndWord
const UInt_t kuBinDumpEndWord
Definition: CbmDeviceEventBuilderEtofStar2019.h:92
CbmDeviceEventBuilderEtofStar2019::InitContainers
Bool_t InitContainers()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:125
CbmDeviceEventBuilderEtofStar2019::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:223
CbmDeviceEventBuilderEtofStar2019::CbmDeviceEventBuilderEtofStar2019
CbmDeviceEventBuilderEtofStar2019()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:46
CbmDeviceEventBuilderEtofStar2019::fTimer
TStopwatch fTimer
Definition: CbmDeviceEventBuilderEtofStar2019.h:85
CbmDeviceEventBuilderEtofStar2019::fbEventDumpEna
Bool_t fbEventDumpEna
Switch OFF the emission of data toward the STAR DAQ.
Definition: CbmDeviceEventBuilderEtofStar2019.h:65
CbmDeviceEventBuilderEtofStar2019::AddMsComponentToList
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:217
CbmDeviceEventBuilderEtofStar2019::SetEventDumpEnable
void SetEventDumpEnable(Bool_t bDumpEna=kTRUE)
CbmMQTMessage
Definition: CbmDeviceEventBuilderEtofStar2019.h:96
CbmMQTMessage::CbmMQTMessage
CbmMQTMessage(void *buf, Int_t len)
Definition: CbmDeviceEventBuilderEtofStar2019.h:98
CbmDeviceEventBuilderEtofStar2019::HandleMessage
bool HandleMessage(FairMQMessagePtr &, int)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:418
CbmDeviceEventBuilderEtofStar2019::SetNbMsInTs
void SetNbMsInTs(size_t, size_t)
Definition: CbmDeviceEventBuilderEtofStar2019.h:41
CbmDeviceEventBuilderEtofStar2019::fEventBuilderAlgo
CbmStar2019EventBuilderEtofAlgo * fEventBuilderAlgo
Processing algo.
Definition: CbmDeviceEventBuilderEtofStar2019.h:84
CbmDeviceEventBuilderEtofStar2019::fAllowedChannels
std::vector< std::string > fAllowedChannels
Definition: CbmDeviceEventBuilderEtofStar2019.h:77
CbmDeviceEventBuilderEtofStar2019::IsChannelNameAllowed
bool IsChannelNameAllowed(std::string channelName)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:103
CbmStar2019EventBuilderEtofAlgo
Definition: CbmStar2019EventBuilderEtofAlgo.h:31
CbmDeviceEventBuilderEtofStar2019::kuBinDumpBegWord
const UInt_t kuBinDumpBegWord
Definition: CbmDeviceEventBuilderEtofStar2019.h:91
CbmDeviceEventBuilderEtofStar2019::fbDebugMonitorMode
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
Definition: CbmDeviceEventBuilderEtofStar2019.h:62
CbmDeviceEventBuilderEtofStar2019::fbMonitorMode
Bool_t fbMonitorMode
Control flags.
Definition: CbmDeviceEventBuilderEtofStar2019.h:60
CbmDeviceEventBuilderEtofStar2019::HandleParts
bool HandleParts(FairMQParts &, int)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:314
CbmDeviceEventBuilderEtofStar2019::fpBinDumpFile
std::fstream * fpBinDumpFile
Event dump to binary file.
Definition: CbmDeviceEventBuilderEtofStar2019.h:90
CbmDeviceEventBuilderEtofStar2019::fChannelsToSend
std::vector< std::vector< std::string > > fChannelsToSend
Definition: CbmDeviceEventBuilderEtofStar2019.h:81
CbmDeviceEventBuilderEtofStar2019::SendEvent
virtual bool SendEvent(std::vector< Int_t >, int)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:470
CbmDeviceEventBuilderEtofStar2019::SendSubevent
virtual bool SendSubevent(uint, char *, int, int)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:502
CbmDeviceEventBuilderEtofStar2019::Reset
virtual void Reset()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:551
CbmStar2019TofPar
Definition: CbmStar2019TofPar.h:18
CbmDeviceEventBuilderEtofStar2019::Finish
virtual void Finish()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:553
CbmDeviceEventBuilderEtofStar2019::~CbmDeviceEventBuilderEtofStar2019
virtual ~CbmDeviceEventBuilderEtofStar2019()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:63
CbmDeviceEventBuilderEtofStar2019::HandleData
bool HandleData(FairMQMessagePtr &, int)
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:287
CbmDeviceEventBuilderEtofStar2019::CbmDeviceEventBuilderEtofStar2019
CbmDeviceEventBuilderEtofStar2019(const CbmDeviceEventBuilderEtofStar2019 &)=delete
CbmDeviceEventBuilderEtofStar2019::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:279
CbmDeviceEventBuilderEtofStar2019::fNumMessages
uint64_t fNumMessages
Definition: CbmDeviceEventBuilderEtofStar2019.h:57
CbmDeviceEventBuilderEtofStar2019::SetSandboxMode
void SetSandboxMode(Bool_t bSandboxMode=kTRUE)
Definition: CbmDeviceEventBuilderEtofStar2019.h:34
CbmDeviceEventBuilderEtofStar2019::SetParContainers
void SetParContainers()
Definition: CbmDeviceEventBuilderEtofStar2019.cxx:185
CbmDeviceEventBuilderEtofStar2019::fNumEvt
uint64_t fNumEvt
Definition: CbmDeviceEventBuilderEtofStar2019.h:72
CbmDeviceEventBuilderEtofStar2019::fulTsCounter
uint64_t fulTsCounter
Statistics & first TS rejection.
Definition: CbmDeviceEventBuilderEtofStar2019.h:71
CbmDeviceEventBuilderEtofStar2019::operator=
CbmDeviceEventBuilderEtofStar2019 operator=(const CbmDeviceEventBuilderEtofStar2019 &)=delete