CbmRoot
Loading...
Searching...
No Matches
CbmDeviceUnpackTofStar2018.h
Go to the documentation of this file.
1/* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
12#ifndef CBMDEVICEUNPACKTOFSTAR2018_H_
13#define CBMDEVICEUNPACKTOFSTAR2018_H_
14
15#include "CbmMqTMessage.h"
16
17#include "MicrosliceDescriptor.hpp"
18#include "Timeslice.hpp"
19
20#include "FairMQDevice.h"
21
22#include "Rtypes.h"
23#include "TMessage.h"
24
25#include <map>
26#include <vector>
27
28#include "rocMess_wGet4v1.h"
29
30class CbmTofUnpackPar;
31class CbmTbDaqBuffer;
32class CbmHistManager;
33class CbmTofDigiExp;
34class TH1;
35class TH2;
36
37class CbmDeviceUnpackTofStar2018 : public FairMQDevice {
38public:
41
42protected:
43 virtual void InitTask();
44 bool HandleData(FairMQMessagePtr&, int);
45
46private:
47 uint64_t fNumMessages;
48
49 std::vector<std::string> fAllowedChannels = {"tofcomponent", "parameters"};
50
51
56
57 UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
58 UInt_t fuNrOfFebsPerGdpb; // Number of FEBs per GDPB
59 UInt_t fuNrOfGet4PerFeb; // Number of GET4s per FEB
60 UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
61
62 UInt_t fuNrOfChannelsPerFeet; // Number of channels in each FEET
63 UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
64 UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
65 UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
66
67 std::vector<int> fMsgCounter;
68 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
69
70 UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
71 UInt_t fuGdpbNr; // running number (0 to fNrOfGdpbs) of the GDPB for current message
72 UInt_t fuGet4Id; // running number (0 to fNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
73 UInt_t fuGet4Nr; // running number (0 to fNrOfGet4) of the Get4 chip in the system for current message
74
75 // CbmHistManager* fHM; ///< Histogram manager
76
83 std::vector<ULong64_t> fvulCurrentEpoch;
84 std::vector<Bool_t> fvbFirstEpochSeen;
85
86 Int_t fNofEpochs;
90 Double_t fdMsIndex;
91 Double_t fdTShiftRef;
92
94 Bool_t fbGet4M24b;
95 Bool_t fbGet4v20;
97
98 CbmTofDigiExp* fDigi;
99
100 CbmTofUnpackPar* fUnpackPar;
101
102 // Variables used for histo filling
103 Double_t fdRefTime;
106 Double_t fdEvTime0;
113 std::vector<TH2*> fhRawTotCh;
114 std::vector<TH1*> fhChCount;
115 std::vector<Bool_t> fvbChanThere;
116 std::vector<TH2*> fhChanCoinc;
117 Bool_t fbDetChanThere[64];
119
120 std::vector<std::vector<ngdpb::Message>> fvmEpSupprBuffer;
121
123
124
125 ULong64_t fulGdpbTsMsb;
126 ULong64_t fulGdpbTsLsb;
127 ULong64_t fulStarTsMsb;
128 ULong64_t fulStarTsMid;
134
135 bool CheckTimeslice(const fles::Timeslice& ts);
136 void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor& mdsc);
137 bool IsChannelNameAllowed(std::string channelName);
138
139 Bool_t InitContainers();
140
141 Bool_t ReInitContainers();
142 void CreateHistograms();
143
144 void FillHitInfo(ngdpb::Message);
145 void FillStarTrigInfo(ngdpb::Message);
146 void FillEpochInfo(ngdpb::Message);
147 void PrintSlcInfo(ngdpb::Message);
148 void PrintSysInfo(ngdpb::Message);
149 void PrintGenInfo(ngdpb::Message);
150
151 Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
152
153
154 inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) { return gdpbId * fuNrOfGet4PerGdpb + get4Id; }
155};
156
157#endif /* CBMDEVICEUNPACKTOFSTAR2018_H_ */
std::vector< std::vector< ngdpb::Message > > fvmEpSupprBuffer
void PrintMicroSliceDescriptor(const fles::MicrosliceDescriptor &mdsc)
std::vector< ULong64_t > fvulCurrentEpoch
Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
bool HandleData(FairMQMessagePtr &, int)
bool IsChannelNameAllowed(std::string channelName)
bool CheckTimeslice(const fles::Timeslice &ts)
std::vector< std::string > fAllowedChannels
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
Histogram manager.
Singleton buffer class for CBM raw data.