CbmRoot
CbmDeviceMcbmUnpack.h
Go to the documentation of this file.
1 
8 #ifndef CBMDEVICEMCBMUNPACK_H_
9 #define CBMDEVICEMCBMUNPACK_H_
10 
11 #include "FairMQDevice.h"
12 
13 #include "Timeslice.hpp"
14 
15 #include "Rtypes.h"
16 #include "TMessage.h"
17 #include "TObjArray.h"
18 
19 #include <map>
20 #include <vector>
21 
22 class TList;
29 class TimesliceMetaData;
30 
31 class CbmDeviceMcbmUnpack : public FairMQDevice {
32 public:
34  virtual ~CbmDeviceMcbmUnpack();
35 
36 protected:
37  virtual void InitTask();
38  bool HandleData(FairMQMessagePtr&, int);
39  bool HandleCommand(FairMQMessagePtr&, int);
40 
41 private:
43  static const uint16_t kusSysIdSts = 0x10;
44  static const uint16_t kusSysIdMuch = 0x50;
45  static const uint16_t kusSysIdTrd = 0x40;
46  static const uint16_t kusSysIdTof = 0x60;
47  static const uint16_t kusSysIdT0 = 0x90;
48  static const uint16_t kusSysIdRich = 0x30;
49  static const uint16_t kusSysIdPsd = 0x80;
50 
53  false;
54  Bool_t fbComponentsAddedToList = kFALSE;
55 
57  std::string fsChannelNameDataInput = "fullts";
58  std::string fsChannelNameDataOutput = "unpts_0";
59  std::string fsChannelNameCommands = "commands";
60  UInt_t fuDigiMaskedIdT0 = 0x00005006;
61  UInt_t fuDigiMaskId = 0x0001FFFF;
62 
64  std::vector<std::string> fsAllowedChannels = {fsChannelNameDataInput};
65 
67  // TList* fParCList = nullptr;
68  Bool_t InitParameters(TList* fParCList);
69 
71  uint64_t fulNumMessages = 0;
72  uint64_t fulTsCounter = 0;
73 
81 
83  std::vector<std::string> fvsSetTimeOffs = {};
84 
86  size_t fuNbCoreMsPerTs = 0;
87  size_t fuNbOverMsPerTs = 0;
88  Double_t fdMsSizeInNs = 1280000;
89  Double_t fdTsCoreSizeInNs =
90  -1.0;
91  Double_t fdTsOverSizeInNs =
92  -1.0;
93  Double_t fdTsFullSizeInNs =
94  -1.0;
96 
97  bool IsChannelNameAllowed(std::string channelName);
98  Bool_t InitContainers();
99  Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
100  void Finish();
101  bool SendUnpData();
102 };
103 
104 // special class to expose protected TMessage constructor
105 class CbmMQTMessage : public TMessage {
106 public:
107  CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) {
108  ResetBit(kIsOwner);
109  }
110 };
111 
112 
113 #endif /* CBMDEVICEMCBMUNPACK_H_ */
CbmDeviceMcbmUnpack::HandleCommand
bool HandleCommand(FairMQMessagePtr &, int)
CbmMcbm2018UnpackerAlgoTof
Definition: CbmMcbm2018UnpackerAlgoTof.h:35
CbmDeviceMcbmUnpack::fUnpAlgoMuch
CbmMcbm2018UnpackerAlgoMuch * fUnpAlgoMuch
Definition: CbmDeviceMcbmUnpack.h:76
CbmDeviceMcbmUnpack::kusSysIdPsd
static const uint16_t kusSysIdPsd
Definition: CbmDeviceMcbmUnpack.h:49
CbmDeviceMcbmUnpack::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
Definition: CbmDeviceMcbmUnpack.h:89
CbmDeviceMcbmUnpack::fuDigiMaskId
UInt_t fuDigiMaskId
Definition: CbmDeviceMcbmUnpack.h:61
CbmDeviceMcbmUnpack::CbmDeviceMcbmUnpack
CbmDeviceMcbmUnpack()
Definition: CbmDeviceMcbmUnpack.cxx:50
CbmDeviceMcbmUnpack::fulNumMessages
uint64_t fulNumMessages
Statistics & first TS rejection.
Definition: CbmDeviceMcbmUnpack.h:71
TimesliceMetaData
Definition: TimesliceMetaData.h:11
CbmDeviceMcbmUnpack::fsAllowedChannels
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
Definition: CbmDeviceMcbmUnpack.h:64
CbmDeviceMcbmUnpack::fsChannelNameCommands
std::string fsChannelNameCommands
Definition: CbmDeviceMcbmUnpack.h:59
CbmDeviceMcbmUnpack::kusSysIdTof
static const uint16_t kusSysIdTof
Definition: CbmDeviceMcbmUnpack.h:46
CbmDeviceMcbmUnpack::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmDeviceMcbmUnpack.h:87
CbmDeviceMcbmUnpack::fTsMetaData
TimesliceMetaData * fTsMetaData
Total size of all MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmUnpack.h:95
CbmMQTMessage
Definition: CbmDeviceEventBuilderEtofStar2019.h:96
CbmDeviceMcbmUnpack::kusSysIdTrd
static const uint16_t kusSysIdTrd
Definition: CbmDeviceMcbmUnpack.h:45
CbmDeviceMcbmUnpack::InitParameters
Bool_t InitParameters(TList *fParCList)
Parameters management.
Definition: CbmDeviceMcbmUnpack.cxx:202
CbmDeviceMcbmUnpack::fUnpAlgoPsd
CbmMcbm2018UnpackerAlgoPsd * fUnpAlgoPsd
Definition: CbmDeviceMcbmUnpack.h:80
CbmMQTMessage::CbmMQTMessage
CbmMQTMessage(void *buf, Int_t len)
Definition: CbmDeviceMcbmUnpack.h:107
CbmMcbm2018UnpackerAlgoPsd
Definition: CbmMcbm2018UnpackerAlgoPsd.h:30
CbmDeviceMcbmUnpack::fvsSetTimeOffs
std::vector< std::string > fvsSetTimeOffs
Time offsets.
Definition: CbmDeviceMcbmUnpack.h:83
CbmDeviceMcbmUnpack::HandleData
bool HandleData(FairMQMessagePtr &, int)
Definition: CbmDeviceMcbmUnpack.cxx:243
CbmDeviceMcbmUnpack::kusSysIdRich
static const uint16_t kusSysIdRich
Definition: CbmDeviceMcbmUnpack.h:48
CbmDeviceMcbmUnpack::fdTsFullSizeInNs
Double_t fdTsFullSizeInNs
Total size of the overlap MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmUnpack.h:93
CbmDeviceMcbmUnpack::fUnpAlgoRich
CbmMcbm2018UnpackerAlgoRich * fUnpAlgoRich
Definition: CbmDeviceMcbmUnpack.h:79
CbmDeviceMcbmUnpack::fUnpAlgoSts
CbmMcbm2018UnpackerAlgoSts * fUnpAlgoSts
Processing algos.
Definition: CbmDeviceMcbmUnpack.h:75
CbmDeviceMcbmUnpack::fuDigiMaskedIdT0
UInt_t fuDigiMaskedIdT0
Definition: CbmDeviceMcbmUnpack.h:60
CbmDeviceMcbmUnpack::SendUnpData
bool SendUnpData()
Definition: CbmDeviceMcbmUnpack.cxx:302
CbmDeviceMcbmUnpack::Finish
void Finish()
Definition: CbmDeviceMcbmUnpack.cxx:522
CbmDeviceMcbmUnpack::fsChannelNameDataOutput
std::string fsChannelNameDataOutput
Definition: CbmDeviceMcbmUnpack.h:58
CbmDeviceMcbmUnpack::fUnpAlgoTrd
CbmMcbm2018UnpackerAlgoTrdR * fUnpAlgoTrd
Definition: CbmDeviceMcbmUnpack.h:77
CbmMcbm2018UnpackerAlgoSts
Definition: CbmMcbm2018UnpackerAlgoSts.h:37
CbmMcbm2018UnpackerAlgoMuch
Definition: CbmMcbm2018UnpackerAlgoMuch.h:37
CbmDeviceMcbmUnpack::fulTsCounter
uint64_t fulTsCounter
Definition: CbmDeviceMcbmUnpack.h:72
CbmDeviceMcbmUnpack::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Control flags.
Definition: CbmDeviceMcbmUnpack.h:52
CbmDeviceMcbmUnpack::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
TS MetaData storage.
Definition: CbmDeviceMcbmUnpack.h:86
CbmDeviceMcbmUnpack::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmDeviceMcbmUnpack.h:88
CbmMcbm2018UnpackerAlgoRich
Definition: CbmMcbm2018UnpackerAlgoRich.h:44
CbmDeviceMcbmUnpack
Definition: CbmDeviceMcbmUnpack.h:31
CbmDeviceMcbmUnpack::InitContainers
Bool_t InitContainers()
Definition: CbmDeviceMcbmUnpack.cxx:117
CbmDeviceMcbmUnpack::IsChannelNameAllowed
bool IsChannelNameAllowed(std::string channelName)
Definition: CbmDeviceMcbmUnpack.cxx:96
CbmDeviceMcbmUnpack::fUnpAlgoTof
CbmMcbm2018UnpackerAlgoTof * fUnpAlgoTof
Definition: CbmDeviceMcbmUnpack.h:78
CbmDeviceMcbmUnpack::fbComponentsAddedToList
Bool_t fbComponentsAddedToList
Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice.
Definition: CbmDeviceMcbmUnpack.h:54
CbmDeviceMcbmUnpack::~CbmDeviceMcbmUnpack
virtual ~CbmDeviceMcbmUnpack()
Definition: CbmDeviceMcbmUnpack.cxx:428
CbmDeviceMcbmUnpack::kusSysIdT0
static const uint16_t kusSysIdT0
Definition: CbmDeviceMcbmUnpack.h:47
CbmDeviceMcbmUnpack::kusSysIdMuch
static const uint16_t kusSysIdMuch
Definition: CbmDeviceMcbmUnpack.h:44
CbmDeviceMcbmUnpack::kusSysIdSts
static const uint16_t kusSysIdSts
Constants.
Definition: CbmDeviceMcbmUnpack.h:43
CbmDeviceMcbmUnpack::fsChannelNameDataInput
std::string fsChannelNameDataInput
User settings parameters.
Definition: CbmDeviceMcbmUnpack.h:57
CbmDeviceMcbmUnpack::fdTsOverSizeInNs
Double_t fdTsOverSizeInNs
Total size of the core MS in a TS, [nanoseconds].
Definition: CbmDeviceMcbmUnpack.h:91
CbmDeviceMcbmUnpack::DoUnpack
Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmDeviceMcbmUnpack.cxx:438
CbmDeviceMcbmUnpack::InitTask
virtual void InitTask()
Definition: CbmDeviceMcbmUnpack.cxx:59
CbmMcbm2018UnpackerAlgoTrdR
Timeslice unpacker algorithm for Spadic v.2.2 .
Definition: CbmMcbm2018UnpackerAlgoTrdR.h:34