CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018TofFeeThr.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// ----- CbmMcbm2018TofFeeThr -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
12#ifndef CbmMcbm2018TofFeeThr_H
13#define CbmMcbm2018TofFeeThr_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:
41 virtual ~CbmMcbm2018TofFeeThr();
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 void SaveAllHistos(TString sFileName = "");
67 void ResetAllHistos();
68
69 void SetHistoFileName(TString sFileName = "data/HistosTofFeeTest.root") { fsHistoFileFullname = sFileName; }
70
71 void UseDaqBuffer(Bool_t) {};
72
73private:
75 std::vector<size_t> fvMsComponentsList;
79
82
85 size_t fuTotalMsNb;
87 size_t fuCoreMs;
88 Double_t fdMsSizeInNs;
92
95 UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
96 UInt_t fuNrOfFeePerGdpb; // Number of FEBs per GDPB
97 UInt_t fuNrOfGet4PerFee; // Number of GET4s per FEE
98 UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
99
100 UInt_t fuNrOfChannelsPerFee; // Number of channels in each FEE
101 UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
102 UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
103 UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
104
106
107 const UInt_t kuNbFeePerGbtx = 5;
108 const UInt_t kuNbGbtxPerGdpb = 6;
109
111 std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
112
114 uint64_t fulCurrentTsIndex; // Idx of the current TS
115 size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
116 size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
117 Double_t fdMsIndex; // Time in ns of current MS from its index
118 UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
119 UInt_t fuGdpbNr; // running number (0 to fuNrOfGdpbs) of the GDPB for current message
120 UInt_t fuGet4Id; // running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
121 UInt_t fuGet4Nr; // running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
123 std::vector<int> fviMsgCounter;
124
126 TH2* fhGdpbAsicSpiCounts = nullptr;
127
128 void CreateHistograms();
129
131
132 inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) { return gdpbId * fuNrOfGet4PerGdpb + get4Id; }
133
135 std::vector<UInt_t> fvuPadiToGet4;
136 std::vector<UInt_t> fvuGet4ToPadi;
137
139 static const UInt_t kuNbGet4PerGbtx = 5 * 8;
140 std::vector<UInt_t> fvuElinkToGet4;
141 std::vector<UInt_t> fvuGet4ToElink;
142 inline UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
143 {
144 return fvuElinkToGet4[uElinkIdx % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uElinkIdx / kuNbGet4PerGbtx);
145 }
146 inline UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
147 {
148 return fvuGet4ToElink[uGet4Idx % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uGet4Idx / kuNbGet4PerGbtx);
149 }
150
152 std::vector<Double_t> fvdPadiThrCodeToValue;
153
156
157 ClassDef(CbmMcbm2018TofFeeThr, 1)
158};
159
160#endif
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::vector< UInt_t > fvuPadiToGet4
void SetHistoFileName(TString sFileName="data/HistosTofFeeTest.root")
std::vector< UInt_t > fvuGet4ToPadi
TString fsHistoFileFullname
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
CbmMcbm2018TofPar * fUnpackPar
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
size_t fuMsAcceptsPercent
OLD, to be cleaned out !!!!!
std::vector< UInt_t > fvuGet4ToElink
std::vector< Double_t > fvdPadiThrCodeToValue
PADI threshold measures and extrapolated code to value map.
void SetIgnoreMsOverlap(Bool_t bEnaFlag=kTRUE)
void SaveAllHistos(TString sFileName="")
TH2 * fhGdpbAsicSpiCounts
Histograms.
CbmMcbm2018TofFeeThr operator=(const CbmMcbm2018TofFeeThr &)
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
static const UInt_t kuNbGet4PerGbtx
void SetMsOverlap(size_t uOverlapMsNb=1)
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
void PrintSlcInfo(gdpbv100::Message)
CbmMcbm2018TofFeeThr(const CbmMcbm2018TofFeeThr &)
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
std::vector< int > fviMsgCounter
std::vector< size_t > fvMsComponentsList
FLES containers.