CbmRoot
CbmDeviceUnpackTofStar2018.h
Go to the documentation of this file.
1 
8 #ifndef CBMDEVICEUNPACKTOFSTAR2018_H_
9 #define CBMDEVICEUNPACKTOFSTAR2018_H_
10 
11 #include "FairMQDevice.h"
12 
13 #include "rocMess_wGet4v1.h"
14 
15 #include "MicrosliceDescriptor.hpp"
16 #include "Timeslice.hpp"
17 
18 #include "Rtypes.h"
19 #include "TMessage.h"
20 
21 #include <map>
22 #include <vector>
23 
24 class CbmTofUnpackPar;
25 class CbmTbDaqBuffer;
26 class CbmHistManager;
27 class CbmTofDigiExp;
28 class TH1;
29 class TH2;
30 
31 class CbmDeviceUnpackTofStar2018 : public FairMQDevice {
32 public:
35 
36 protected:
37  virtual void InitTask();
38  bool HandleData(FairMQMessagePtr&, int);
39 
40 private:
41  uint64_t fNumMessages;
42 
43  std::vector<std::string> fAllowedChannels = {"tofcomponent", "parameters"};
44 
45 
46  size_t
48  size_t
50  UInt_t fuMinNbGdpb;
51  UInt_t fuCurrNbGdpb;
52 
53  UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
54  UInt_t fuNrOfFebsPerGdpb; // Number of FEBs per GDPB
55  UInt_t fuNrOfGet4PerFeb; // Number of GET4s per FEB
56  UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
57 
58  UInt_t fuNrOfChannelsPerFeet; // Number of channels in each FEET
59  UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
60  UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
61  UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
62 
63  std::vector<int> fMsgCounter;
64  std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
65 
66  UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
67  UInt_t
68  fuGdpbNr; // running number (0 to fNrOfGdpbs) of the GDPB for current message
69  UInt_t
70  fuGet4Id; // running number (0 to fNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
71  UInt_t
72  fuGet4Nr; // running number (0 to fNrOfGet4) of the Get4 chip in the system for current message
73 
74  // CbmHistManager* fHM; ///< Histogram manager
75 
82  std::vector<ULong64_t> fvulCurrentEpoch;
83  std::vector<Bool_t> fvbFirstEpochSeen;
84 
85  Int_t fNofEpochs;
86  ULong64_t fulCurrentEpochTime;
88  Int_t fEquipmentId;
89  Double_t fdMsIndex;
90  Double_t fdTShiftRef;
91 
93  Bool_t fbGet4M24b;
94  Bool_t fbGet4v20;
96 
97  CbmTofDigiExp* fDigi;
98 
99  CbmTofUnpackPar* fUnpackPar;
100 
101  // Variables used for histo filling
102  Double_t fdRefTime;
103  Double_t fdLastDigiTime;
105  Double_t fdEvTime0;
112  std::vector<TH2*> fhRawTotCh;
113  std::vector<TH1*> fhChCount;
114  std::vector<Bool_t> fvbChanThere;
115  std::vector<TH2*> fhChanCoinc;
116  Bool_t fbDetChanThere[64];
118 
119  std::vector<std::vector<ngdpb::Message>> fvmEpSupprBuffer;
120 
121  CbmTbDaqBuffer* fBuffer;
122 
123 
124  ULong64_t fulGdpbTsMsb;
125  ULong64_t fulGdpbTsLsb;
126  ULong64_t fulStarTsMsb;
127  ULong64_t fulStarTsMid;
128  ULong64_t fulGdpbTsFullLast;
129  ULong64_t fulStarTsFullLast;
133 
134  bool CheckTimeslice(const fles::Timeslice& ts);
135  void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor& mdsc);
136  bool IsChannelNameAllowed(std::string channelName);
137 
138  Bool_t InitContainers();
139 
140  Bool_t ReInitContainers();
141  void CreateHistograms();
142 
143  void FillHitInfo(ngdpb::Message);
144  void FillStarTrigInfo(ngdpb::Message);
145  void FillEpochInfo(ngdpb::Message);
146  void PrintSlcInfo(ngdpb::Message);
147  void PrintSysInfo(ngdpb::Message);
148  void PrintGenInfo(ngdpb::Message);
149 
150  Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
151 
152 
153  inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) {
154  return gdpbId * fuNrOfGet4PerGdpb + get4Id;
155  }
156 };
157 
158 // special class to expose protected TMessage constructor
159 class CbmMQTMessage : public TMessage {
160 public:
161  CbmMQTMessage(void* buf, Int_t len) : TMessage(buf, len) {
162  ResetBit(kIsOwner);
163  }
164 };
165 
166 
167 #endif /* CBMDEVICEUNPACKTOFSTAR2018_H_ */
CbmDeviceUnpackTofStar2018::fhRawTRefDig0
TH1 * fhRawTRefDig0
Definition: CbmDeviceUnpackTofStar2018.h:109
CbmDeviceUnpackTofStar2018::FillEpochInfo
void FillEpochInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:599
CbmDeviceUnpackTofStar2018::CbmDeviceUnpackTofStar2018
CbmDeviceUnpackTofStar2018()
Definition: CbmDeviceUnpackTofStar2018.cxx:38
CbmDeviceUnpackTofStar2018::InitTask
virtual void InitTask()
Definition: CbmDeviceUnpackTofStar2018.cxx:99
CbmDeviceUnpackTofStar2018::fuNrOfGet4
UInt_t fuNrOfGet4
Definition: CbmDeviceUnpackTofStar2018.h:59
CbmDeviceUnpackTofStar2018::fvulCurrentEpoch
std::vector< ULong64_t > fvulCurrentEpoch
Definition: CbmDeviceUnpackTofStar2018.h:82
CbmDeviceUnpackTofStar2018::PrintGenInfo
void PrintGenInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:674
CbmDeviceUnpackTofStar2018::fbGet4v20
Bool_t fbGet4v20
Definition: CbmDeviceUnpackTofStar2018.h:94
CbmDeviceUnpackTofStar2018::fuNrOfGet4PerGdpb
UInt_t fuNrOfGet4PerGdpb
Definition: CbmDeviceUnpackTofStar2018.h:60
CbmDeviceUnpackTofStar2018::fbDetChanThere
Bool_t fbDetChanThere[64]
Definition: CbmDeviceUnpackTofStar2018.h:116
CbmDeviceUnpackTofStar2018::fNofEpochs
Int_t fNofEpochs
Definition: CbmDeviceUnpackTofStar2018.h:85
CbmDeviceUnpackTofStar2018::GetArrayIndex
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
Definition: CbmDeviceUnpackTofStar2018.h:153
CbmDeviceUnpackTofStar2018::fdRefTime
Double_t fdRefTime
Definition: CbmDeviceUnpackTofStar2018.h:102
CbmDeviceUnpackTofStar2018::fuGet4Id
UInt_t fuGet4Id
Definition: CbmDeviceUnpackTofStar2018.h:70
CbmDeviceUnpackTofStar2018::fulStarTsMid
ULong64_t fulStarTsMid
Definition: CbmDeviceUnpackTofStar2018.h:127
CbmDeviceUnpackTofStar2018::fuNrOfGdpbs
UInt_t fuNrOfGdpbs
Definition: CbmDeviceUnpackTofStar2018.h:53
CbmDeviceUnpackTofStar2018::fhRawTRefDig1
TH1 * fhRawTRefDig1
Definition: CbmDeviceUnpackTofStar2018.h:110
CbmDeviceUnpackTofStar2018::fNumMessages
uint64_t fNumMessages
Definition: CbmDeviceUnpackTofStar2018.h:41
CbmDeviceUnpackTofStar2018::fuGdpbId
UInt_t fuGdpbId
Definition: CbmDeviceUnpackTofStar2018.h:66
CbmDeviceUnpackTofStar2018::fdEvTime0
Double_t fdEvTime0
Definition: CbmDeviceUnpackTofStar2018.h:105
CbmDeviceUnpackTofStar2018::fEquipmentId
Int_t fEquipmentId
Definition: CbmDeviceUnpackTofStar2018.h:88
CbmDeviceUnpackTofStar2018::fuNrOfFebsPerGdpb
UInt_t fuNrOfFebsPerGdpb
Definition: CbmDeviceUnpackTofStar2018.h:54
CbmMQTMessage
Definition: CbmDeviceEventBuilderEtofStar2019.h:96
CbmDeviceUnpackTofStar2018::fhChanCoinc
std::vector< TH2 * > fhChanCoinc
Definition: CbmDeviceUnpackTofStar2018.h:115
CbmDeviceUnpackTofStar2018::fuStarTokenLast
UInt_t fuStarTokenLast
Definition: CbmDeviceUnpackTofStar2018.h:130
CbmMQTMessage::CbmMQTMessage
CbmMQTMessage(void *buf, Int_t len)
Definition: CbmDeviceUnpackTofStar2018.h:161
CbmDeviceUnpackTofStar2018::PrintSysInfo
void PrintSysInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:686
CbmDeviceUnpackTofStar2018::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmDeviceUnpackTofStar2018.h:49
CbmDeviceUnpackTofStar2018::fulGdpbTsMsb
ULong64_t fulGdpbTsMsb
Definition: CbmDeviceUnpackTofStar2018.h:124
CbmDeviceUnpackTofStar2018::InitContainers
Bool_t InitContainers()
Definition: CbmDeviceUnpackTofStar2018.cxx:143
CbmDeviceUnpackTofStar2018::CheckTimeslice
bool CheckTimeslice(const fles::Timeslice &ts)
Definition: CbmDeviceUnpackTofStar2018.cxx:812
CbmDeviceUnpackTofStar2018::fdLastDigiTime
Double_t fdLastDigiTime
Definition: CbmDeviceUnpackTofStar2018.h:103
CbmDeviceUnpackTofStar2018::fulStarTsFullLast
ULong64_t fulStarTsFullLast
Definition: CbmDeviceUnpackTofStar2018.h:129
CbmDeviceUnpackTofStar2018::fulCurrentEpochTime
ULong64_t fulCurrentEpochTime
Definition: CbmDeviceUnpackTofStar2018.h:86
CbmDeviceUnpackTofStar2018::FillHitInfo
void FillHitInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:512
CbmDeviceUnpackTofStar2018::fhChCount
std::vector< TH1 * > fhChCount
Definition: CbmDeviceUnpackTofStar2018.h:113
CbmDeviceUnpackTofStar2018::fhRawTDigEvT0
TH1 * fhRawTDigEvT0
Definition: CbmDeviceUnpackTofStar2018.h:106
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmDeviceUnpackTofStar2018::fulGdpbTsFullLast
ULong64_t fulGdpbTsFullLast
Definition: CbmDeviceUnpackTofStar2018.h:128
CbmDeviceUnpackTofStar2018::fuStarTrigCmdLast
UInt_t fuStarTrigCmdLast
Definition: CbmDeviceUnpackTofStar2018.h:132
CbmDeviceUnpackTofStar2018::PrintMicroSliceDescriptor
void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor &mdsc)
Definition: CbmDeviceUnpackTofStar2018.cxx:794
CbmDeviceUnpackTofStar2018::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmDeviceUnpackTofStar2018.cxx:188
CbmDeviceUnpackTofStar2018::FillStarTrigInfo
void FillStarTrigInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:717
CbmDeviceUnpackTofStar2018::fbEpochSuppModeOn
Bool_t fbEpochSuppModeOn
Definition: CbmDeviceUnpackTofStar2018.h:92
CbmDeviceUnpackTofStar2018::fuStarDaqCmdLast
UInt_t fuStarDaqCmdLast
Definition: CbmDeviceUnpackTofStar2018.h:131
CbmDeviceUnpackTofStar2018::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
Definition: CbmDeviceUnpackTofStar2018.h:47
CbmDeviceUnpackTofStar2018
Definition: CbmDeviceUnpackTofStar2018.h:31
CbmDeviceUnpackTofStar2018::fdTShiftRef
Double_t fdTShiftRef
Definition: CbmDeviceUnpackTofStar2018.h:90
CbmDeviceUnpackTofStar2018::fulGdpbTsLsb
ULong64_t fulGdpbTsLsb
Definition: CbmDeviceUnpackTofStar2018.h:125
CbmDeviceUnpackTofStar2018::fbMergedEpochsOn
Bool_t fbMergedEpochsOn
Definition: CbmDeviceUnpackTofStar2018.h:95
CbmDeviceUnpackTofStar2018::fuNrOfGet4PerFeb
UInt_t fuNrOfGet4PerFeb
Definition: CbmDeviceUnpackTofStar2018.h:55
CbmDeviceUnpackTofStar2018::~CbmDeviceUnpackTofStar2018
virtual ~CbmDeviceUnpackTofStar2018()
Definition: CbmDeviceUnpackTofStar2018.cxx:791
CbmDeviceUnpackTofStar2018::fuMinNbGdpb
UInt_t fuMinNbGdpb
Definition: CbmDeviceUnpackTofStar2018.h:50
CbmDeviceUnpackTofStar2018::fGdpbIdIndexMap
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Definition: CbmDeviceUnpackTofStar2018.h:64
CbmDeviceUnpackTofStar2018::fdFirstDigiTimeDif
Double_t fdFirstDigiTimeDif
Definition: CbmDeviceUnpackTofStar2018.h:104
CbmDeviceUnpackTofStar2018::IsChannelNameAllowed
bool IsChannelNameAllowed(std::string channelName)
Definition: CbmDeviceUnpackTofStar2018.cxx:122
CbmDeviceUnpackTofStar2018::fhDetChanCoinc
TH2 * fhDetChanCoinc
Definition: CbmDeviceUnpackTofStar2018.h:117
CbmDeviceUnpackTofStar2018::fhRawTDigRef0
TH1 * fhRawTDigRef0
Definition: CbmDeviceUnpackTofStar2018.h:107
CbmDeviceUnpackTofStar2018::HandleData
bool HandleData(FairMQMessagePtr &, int)
Definition: CbmDeviceUnpackTofStar2018.cxx:345
CbmDeviceUnpackTofStar2018::fvmEpSupprBuffer
std::vector< std::vector< ngdpb::Message > > fvmEpSupprBuffer
Definition: CbmDeviceUnpackTofStar2018.h:119
CbmDeviceUnpackTofStar2018::fdMsIndex
Double_t fdMsIndex
Definition: CbmDeviceUnpackTofStar2018.h:89
CbmDeviceUnpackTofStar2018::fuNrOfChannelsPerGet4
UInt_t fuNrOfChannelsPerGet4
Definition: CbmDeviceUnpackTofStar2018.h:56
CbmDeviceUnpackTofStar2018::fuCurrNbGdpb
UInt_t fuCurrNbGdpb
Definition: CbmDeviceUnpackTofStar2018.h:51
CbmDeviceUnpackTofStar2018::fhRawTDigRef
TH1 * fhRawTDigRef
Definition: CbmDeviceUnpackTofStar2018.h:108
CbmDeviceUnpackTofStar2018::fAllowedChannels
std::vector< std::string > fAllowedChannels
Definition: CbmDeviceUnpackTofStar2018.h:43
CbmDeviceUnpackTofStar2018::fBuffer
CbmTbDaqBuffer * fBuffer
Definition: CbmDeviceUnpackTofStar2018.h:121
CbmDeviceUnpackTofStar2018::fvbFirstEpochSeen
std::vector< Bool_t > fvbFirstEpochSeen
Definition: CbmDeviceUnpackTofStar2018.h:83
CbmDeviceUnpackTofStar2018::fuGdpbNr
UInt_t fuGdpbNr
Definition: CbmDeviceUnpackTofStar2018.h:68
CbmDeviceUnpackTofStar2018::CreateHistograms
void CreateHistograms()
Definition: CbmDeviceUnpackTofStar2018.cxx:238
CbmDeviceUnpackTofStar2018::fhRawDigiLastDigi
TH1 * fhRawDigiLastDigi
Definition: CbmDeviceUnpackTofStar2018.h:111
CbmDeviceUnpackTofStar2018::fvbChanThere
std::vector< Bool_t > fvbChanThere
Definition: CbmDeviceUnpackTofStar2018.h:114
CbmDeviceUnpackTofStar2018::fuGet4Nr
UInt_t fuGet4Nr
Definition: CbmDeviceUnpackTofStar2018.h:72
CbmDeviceUnpackTofStar2018::fDigi
CbmTofDigiExp * fDigi
Definition: CbmDeviceUnpackTofStar2018.h:97
CbmDeviceUnpackTofStar2018::fMsgCounter
std::vector< int > fMsgCounter
Definition: CbmDeviceUnpackTofStar2018.h:63
CbmDeviceUnpackTofStar2018::fUnpackPar
CbmTofUnpackPar * fUnpackPar
Definition: CbmDeviceUnpackTofStar2018.h:99
CbmDeviceUnpackTofStar2018::fulStarTsMsb
ULong64_t fulStarTsMsb
Definition: CbmDeviceUnpackTofStar2018.h:126
CbmDeviceUnpackTofStar2018::DoUnpack
Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmDeviceUnpackTofStar2018.cxx:367
CbmDeviceUnpackTofStar2018::fuNrOfChannelsPerFeet
UInt_t fuNrOfChannelsPerFeet
Definition: CbmDeviceUnpackTofStar2018.h:58
CbmDeviceUnpackTofStar2018::fuNrOfChannelsPerGdpb
UInt_t fuNrOfChannelsPerGdpb
Definition: CbmDeviceUnpackTofStar2018.h:61
CbmDeviceUnpackTofStar2018::PrintSlcInfo
void PrintSlcInfo(ngdpb::Message)
Definition: CbmDeviceUnpackTofStar2018.cxx:657
CbmDeviceUnpackTofStar2018::fbGet4M24b
Bool_t fbGet4M24b
Definition: CbmDeviceUnpackTofStar2018.h:93
CbmDeviceUnpackTofStar2018::fhRawTotCh
std::vector< TH2 * > fhRawTotCh
Definition: CbmDeviceUnpackTofStar2018.h:112