CbmRoot
Loading...
Searching...
No Matches
CbmCheckDataFormatGdpb2018.h
Go to the documentation of this file.
1/* Copyright (C) 2019 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmCheckDataFormatGdpb2018 -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmCheckDataFormatGdpb2018_H
13#define CbmCheckDataFormatGdpb2018_H
14
15#include "Timeslice.hpp"
16
17#include "gDpbMessv100.h"
18//#include "CbmTofStarData.h"
19//#include "CbmTofStarData2018.h"
20
21#include "CbmMcbmUnpack.h"
22
23#include "Rtypes.h"
24#include "TClonesArray.h"
25
26#include <chrono>
27#include <map>
28#include <vector>
29
31
32class TCanvas;
33class TH1;
34class TH2;
35class TProfile;
36class TProfile2D;
37
39public:
42
43 virtual Bool_t Init();
44
45 virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
46
47 virtual void Reset();
48
49 virtual void Finish();
50
51 void SetParContainers();
52
53 Bool_t InitContainers();
54
55 Bool_t ReInitContainers();
56
57 void SetMsLimitLevel(size_t uAcceptBoundaryPct = 100) { fuMsAcceptsPercent = uAcceptBoundaryPct; }
59
60 virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId);
61 virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb);
62 void SetIgnoreMsOverlap(Bool_t bEnaFlag = kTRUE) { fbIgnoreOverlapMs = bEnaFlag; }
63 void SetMsOverlap(size_t uOverlapMsNb = 1) { fuOverlapMsNb = uOverlapMsNb; }
64 size_t GetMsOverlap() { return fuOverlapMsNb; }
65
66 inline void SetDiamondDpbIdx(UInt_t uIdx = 2) { fuDiamondDpbIdx = uIdx; }
67
68 inline void SetHistoFilename(TString sNameIn) { fsHistoFilename = sNameIn; }
69
70 void SaveAllHistos(TString sFileName = "");
71 void ResetAllHistos();
72
73 void UseDaqBuffer(Bool_t) {};
74
75private:
77 std::vector<size_t> fvMsComponentsList;
81
84 size_t fuTotalMsNb;
86 size_t fuCoreMs;
87 Double_t fdMsSizeInNs;
91
94 UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
95 UInt_t fuNrOfFeePerGdpb; // Number of FEBs per GDPB
96 UInt_t fuNrOfGet4PerFee; // Number of GET4s per FEE
97 UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
98
99 UInt_t fuNrOfChannelsPerFee; // Number of channels in each FEE
100 UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
101 UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
102 UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
103
106 std::vector<Int_t> fviNrOfRpc;
107 std::vector<Int_t> fviRpcType;
108 std::vector<Int_t> fviRpcSide;
109 std::vector<Int_t> fviModuleId;
110
111 const UInt_t kuNbFeePerGbtx = 5;
112 const UInt_t kuNbGbtxPerGdpb = 6;
113
117
119 uint64_t fulCurrentTsIndex; // Idx of the current TS
120 size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
121 size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
122 Double_t fdMsIndex; // Time in ns of current MS from its index
123 UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
124 UInt_t fuGdpbNr; // running number (0 to fuNrOfGdpbs) of the GDPB for current message
125 UInt_t fuGet4Id; // running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
126 UInt_t fuGet4Nr; // running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
128
135 std::vector<ULong64_t> fvulCurrentEpoch;
136 /*
137 std::vector< Bool_t > fvbFirstEpochSeen; //!
138 std::vector< ULong64_t > fvulCurrentEpochCycle; //! Epoch cycle from the Ms Start message and Epoch counter flip
139 std::vector< ULong64_t > fvulCurrentEpochFull; //! Epoch + Epoch Cycle
140*/
144 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
145
147 // Flesnet
148 TCanvas* fcMsSizeAll;
150 std::vector<TH1*> fvhMsSzPerLink;
151 std::vector<TProfile*> fvhMsSzTimePerLink;
152
153 // Messages types and flags
170 std::vector<TH2*> fvhGdpbGet4MessType;
171 std::vector<TH2*> fvhGdpbGet4ChanErrors;
176
177 std::vector<UInt_t> fvuGdpbNbEpochPerMs;
178 std::vector<std::vector<UInt_t>> fvvuChanNbHitsPerMs;
179 std::vector<TH1*> fhEpochsPerMs_gDPB;
180 std::vector<TH2*> fhEpochsPerMsPerTs_gDPB;
181 std::vector<TH1*> fhEpochsDiff_gDPB;
182 std::vector<TH2*> fhEpochsDiffPerTs_gDPB;
183 std::vector<TH2*> fhEpochsJumpBitsPre_gDPB;
184 std::vector<TH2*> fhEpochsJumpBitsNew_gDPB;
185 std::vector<TH2*> fhEpochsJumpDigitsPre_gDPB;
186 std::vector<TH2*> fhEpochsJumpDigitsNew_gDPB;
187 std::vector<TH2*> fhStartEpochPerMs_gDPB;
188 std::vector<TH2*> fhCloseEpochPerMs_gDPB;
189 std::vector<TH2*> fhHitsPerMsFirstChan_gDPB;
190 std::vector<TProfile2D*> fvhChannelRatePerMs_gDPB;
191
193 TCanvas* fcSummary = nullptr;
194 std::vector<TCanvas*> fcFormatGdpb;
195
196
197 void CreateHistograms();
198
200 std::chrono::time_point<std::chrono::system_clock> fTimeLastHistoSaving;
201
204
205 ClassDef(CbmCheckDataFormatGdpb2018, 1)
206};
207
208#endif
CbmCheckDataFormatGdpb2018 operator=(const CbmCheckDataFormatGdpb2018 &)
std::vector< TProfile2D * > fvhChannelRatePerMs_gDPB
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
std::vector< TH2 * > fhEpochsJumpBitsNew_gDPB
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
std::vector< std::vector< UInt_t > > fvvuChanNbHitsPerMs
void SaveAllHistos(TString sFileName="")
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
std::vector< TH2 * > fvhGdpbGet4MessType
Per GET4 in gDPB.
std::vector< TCanvas * > fcFormatGdpb
TH2 * fhGet4MessType
Per GET4 in system.
void SetMsOverlap(size_t uOverlapMsNb=1)
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
std::vector< TH2 * > fhEpochsJumpBitsPre_gDPB
std::vector< TH2 * > fhEpochsJumpDigitsNew_gDPB
std::vector< TProfile * > fvhMsSzTimePerLink
TCanvas * fcMsSizeAll
Histograms and histogram control variables.
std::vector< ULong64_t > fvulCurrentEpoch
void SetIgnoreMsOverlap(Bool_t bEnaFlag=kTRUE)
TH2 * fhPatternMissmatch
Pattern messages per gDPB.
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
CbmCheckDataFormatGdpb2018(const CbmCheckDataFormatGdpb2018 &)
std::vector< TH2 * > fhHitsPerMsFirstChan_gDPB
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< size_t > fvMsComponentsList
FLES containers.
std::vector< TH2 * > fhEpochsJumpDigitsPre_gDPB