CbmRoot
Loading...
Searching...
No Matches
CbmMQTsaMultiSamplerTof.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2019 PI-UHd, GSI
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Norbert Herrmann [committer] */
4
12#ifndef CBMMQTSAMULTISAMPLERTOF_H_
13#define CBMMQTSAMULTISAMPLERTOF_H_
14
15
16#include "MicrosliceDescriptor.hpp"
17#include "StorableTimeslice.hpp"
18#include "Timeslice.hpp"
19#include "TimesliceSource.hpp"
20
21#include "FairMQDevice.h"
22
23#include <ctime>
24#include <string>
25#include <vector>
26
27class CbmMQTsaMultiSamplerTof : public FairMQDevice {
28public:
31
32protected:
34
35 std::string fFileName;
36 std::string fDirName;
37
38 std::vector<std::string> fInputFileList;
39 uint64_t fFileCounter;
40 std::string fHost;
41 uint64_t fPort;
43
44 uint64_t fTSNumber;
45 uint64_t fTSCounter;
47
48 int fMaxMemory = 0;
49
50 virtual void InitTask();
51 virtual bool ConditionalRun();
52
53private:
55
56 bool CheckTimeslice(const fles::Timeslice& ts);
57 void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor& mdsc);
58 bool SendData(const fles::StorableTimeslice& component);
59 void CalcRuntime();
60 bool IsChannelNameAllowed(std::string);
61 bool IsChannelUp(std::string);
62 bool CreateAndSendComponent(const fles::Timeslice&, int);
63 bool SendData(const fles::StorableTimeslice&, int);
64 bool CreateAndCombineComponents(const fles::Timeslice&, int);
65 bool AppendData(const fles::StorableTimeslice&, int);
66 bool SendTs();
67 void SendSysCmdStop();
68
69 fles::TimesliceSource* fSource;
70 std::chrono::steady_clock::time_point fTime;
71
72
73 // The vector fAllowedChannels contain the list of defined channel names
74 // which are used for connecting the different devices. For the time
75 // being the correct connection are done checking the names. A connection
76 // using the name stscomponent will receive timeslices containing the
77 // sts component only. The corresponding system ids are defined in the
78 // vector fSysId. At startup it is checked which channels are defined
79 // in the startup script such that later on only timeslices whith the
80 // corresponding data are send to the correct channels.
81 // TODO: Up to now we have three disconnected vectors which is very
82 // error prone. Find a better solution
83
84 std::vector<std::string> fAllowedChannels = {"stscomponent", "trdcomponent", "tofcomponent", "syscmd", "syscmdin"};
85 std::vector<int> fSysId = {16, 64, 96};
86
87
88 std::vector<int> fComponentsToSend = {0, 0, 0};
89 std::vector<std::vector<std::string>> fChannelsToSend = {{}, {}, {}};
90};
91
92#endif /* CBMMQTSAMULTISAMPLERTOF_H_ */
fles::TimesliceSource * fSource
std::chrono::steady_clock::time_point fTime
std::vector< std::string > fAllowedChannels
std::vector< std::string > fInputFileList
List of input files.
bool CreateAndCombineComponents(const fles::Timeslice &, int)
bool SendData(const fles::StorableTimeslice &component)
bool AppendData(const fles::StorableTimeslice &, int)
std::vector< std::vector< std::string > > fChannelsToSend
bool CheckTimeslice(const fles::Timeslice &ts)
bool CreateAndSendComponent(const fles::Timeslice &, int)
std::vector< int > fComponentsToSend
void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor &mdsc)