CbmRoot
CbmMcbm2018TofFeeThr.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmMcbm2018TofFeeThr -----
4 // ----- Created 10.07.2018 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmMcbm2018TofFeeThr_H
9 #define CbmMcbm2018TofFeeThr_H
10 
11 #include "Timeslice.hpp"
12 #include "gDpbMessv100.h"
13 //#include "CbmTofStarData.h"
14 //#include "CbmTofStarData2018.h"
15 
16 #include "CbmMcbmUnpack.h"
17 
18 #include "Rtypes.h"
19 #include "TClonesArray.h"
20 
21 #include <chrono>
22 #include <map>
23 #include <vector>
24 
25 class CbmMcbm2018TofPar;
26 
27 class TCanvas;
28 class TH1;
29 class TH2;
30 class TProfile;
31 class TProfile2D;
32 
34 public:
36  virtual ~CbmMcbm2018TofFeeThr();
37 
38  virtual Bool_t Init();
39 
40  virtual Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
41 
42  virtual void Reset();
43 
44  virtual void Finish();
45 
46  void SetParContainers();
47 
48  Bool_t InitContainers();
49 
50  Bool_t ReInitContainers();
51 
52  void SetMsLimitLevel(size_t uAcceptBoundaryPct = 100) {
53  fuMsAcceptsPercent = uAcceptBoundaryPct;
54  }
55  size_t GetMsLimitLevel() { return fuMsAcceptsPercent; }
56 
57  virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId);
58  virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb);
59  void SetIgnoreMsOverlap(Bool_t bEnaFlag = kTRUE) {
60  fbIgnoreOverlapMs = bEnaFlag;
61  }
62  void SetMsOverlap(size_t uOverlapMsNb = 1) { fuOverlapMsNb = uOverlapMsNb; }
63  size_t GetMsOverlap() { return fuOverlapMsNb; }
64 
65  void SaveAllHistos(TString sFileName = "");
66  void ResetAllHistos();
67 
68  void SetHistoFileName(TString sFileName = "data/HistosTofFeeTest.root") {
69  fsHistoFileFullname = sFileName;
70  }
71 
72  void UseDaqBuffer(Bool_t) {};
73 
74 private:
76  std::vector<size_t> fvMsComponentsList;
77  size_t fuNbCoreMsPerTs;
78  size_t fuNbOverMsPerTs;
79  Bool_t
81 
84 
86  size_t
88  size_t fuTotalMsNb;
89  size_t
91  size_t fuCoreMs;
92  Double_t fdMsSizeInNs;
93  Double_t fdTsCoreSizeInNs;
94  UInt_t fuMinNbGdpb;
95  UInt_t fuCurrNbGdpb;
96 
99  UInt_t fuNrOfGdpbs; // Total number of GDPBs in the system
100  UInt_t fuNrOfFeePerGdpb; // Number of FEBs per GDPB
101  UInt_t fuNrOfGet4PerFee; // Number of GET4s per FEE
102  UInt_t fuNrOfChannelsPerGet4; // Number of channels in each GET4
103 
104  UInt_t fuNrOfChannelsPerFee; // Number of channels in each FEE
105  UInt_t fuNrOfGet4; // Total number of Get4 chips in the system
106  UInt_t fuNrOfGet4PerGdpb; // Number of GET4s per GDPB
107  UInt_t fuNrOfChannelsPerGdpb; // Number of channels per GDPB
108 
109  UInt_t fuNrOfGbtx;
110 
111  const UInt_t kuNbFeePerGbtx = 5;
112  const UInt_t kuNbGbtxPerGdpb = 6;
113 
115  std::map<UInt_t, UInt_t> fGdpbIdIndexMap;
116 
118  uint64_t fulCurrentTsIndex; // Idx of the current TS
119  size_t fuCurrentMs; // Idx of the current MS in TS (0 to fuTotalMsNb)
120  size_t fuCurrentMsSysId; // SysId of the current MS in TS (0 to fuTotalMsNb)
121  Double_t fdMsIndex; // Time in ns of current MS from its index
122  UInt_t fuGdpbId; // Id (hex number) of the GDPB for current message
123  UInt_t
124  fuGdpbNr; // running number (0 to fuNrOfGdpbs) of the GDPB for current message
125  UInt_t
126  fuGet4Id; // running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
127  UInt_t
128  fuGet4Nr; // running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
130  std::vector<int> fviMsgCounter;
131 
133  TH2* fhGdpbAsicSpiCounts = nullptr;
134 
135  void CreateHistograms();
136 
138 
139  inline Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id) {
140  return gdpbId * fuNrOfGet4PerGdpb + get4Id;
141  }
142 
144  std::vector<UInt_t> fvuPadiToGet4;
145  std::vector<UInt_t> fvuGet4ToPadi;
146 
148  static const UInt_t kuNbGet4PerGbtx = 5 * 8;
149  std::vector<UInt_t> fvuElinkToGet4;
150  std::vector<UInt_t> fvuGet4ToElink;
151  inline UInt_t ConvertElinkToGet4(UInt_t uElinkIdx) {
152  return fvuElinkToGet4[uElinkIdx % kuNbGet4PerGbtx]
153  + kuNbGet4PerGbtx * (uElinkIdx / kuNbGet4PerGbtx);
154  }
155  inline UInt_t ConvertGet4ToElink(UInt_t uGet4Idx) {
156  return fvuGet4ToElink[uGet4Idx % kuNbGet4PerGbtx]
157  + kuNbGet4PerGbtx * (uGet4Idx / kuNbGet4PerGbtx);
158  }
159 
161  std::vector<Double_t> fvdPadiThrCodeToValue;
162 
165 
166  ClassDef(CbmMcbm2018TofFeeThr, 1)
167 };
168 
169 #endif
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmMcbm2018TofFeeThr::fuCurrentMs
size_t fuCurrentMs
Definition: CbmMcbm2018TofFeeThr.h:119
CbmMcbm2018TofFeeThr::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmMcbm2018TofFeeThr.cxx:117
CbmMcbm2018TofFeeThr::fuCurrNbGdpb
UInt_t fuCurrNbGdpb
Definition: CbmMcbm2018TofFeeThr.h:95
CbmMcbm2018TofFeeThr::GetArrayIndex
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
Definition: CbmMcbm2018TofFeeThr.h:139
CbmMcbm2018TofFeeThr::fvdPadiThrCodeToValue
std::vector< Double_t > fvdPadiThrCodeToValue
PADI threshold measures and extrapolated code to value map.
Definition: CbmMcbm2018TofFeeThr.h:161
CbmMcbm2018TofFeeThr::SetMsOverlap
void SetMsOverlap(size_t uOverlapMsNb=1)
Definition: CbmMcbm2018TofFeeThr.h:62
CbmMcbm2018TofFeeThr::fuGet4Nr
UInt_t fuGet4Nr
Definition: CbmMcbm2018TofFeeThr.h:128
CbmMcbm2018TofFeeThr::fvuPadiToGet4
std::vector< UInt_t > fvuPadiToGet4
Definition: CbmMcbm2018TofFeeThr.h:144
CbmMcbm2018TofFeeThr::SetIgnoreMsOverlap
void SetIgnoreMsOverlap(Bool_t bEnaFlag=kTRUE)
Definition: CbmMcbm2018TofFeeThr.h:59
CbmMcbm2018TofFeeThr::GetMsLimitLevel
size_t GetMsLimitLevel()
Definition: CbmMcbm2018TofFeeThr.h:55
CbmMcbm2018TofFeeThr::fsHistoFileFullname
TString fsHistoFileFullname
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmMcbm2018TofFeeThr.h:83
CbmMcbm2018TofFeeThr::SetParContainers
void SetParContainers()
Definition: CbmMcbm2018TofFeeThr.cxx:101
CbmMcbm2018TofFeeThr::fuNrOfChannelsPerGdpb
UInt_t fuNrOfChannelsPerGdpb
Definition: CbmMcbm2018TofFeeThr.h:107
CbmMcbm2018TofFeeThr::fviMsgCounter
std::vector< int > fviMsgCounter
Definition: CbmMcbm2018TofFeeThr.h:130
CbmMcbm2018TofFeeThr::kuNbGet4PerGbtx
static const UInt_t kuNbGet4PerGbtx
Definition: CbmMcbm2018TofFeeThr.h:148
CbmMcbm2018TofFeeThr::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmMcbm2018TofFeeThr.h:78
CbmMcbm2018TofFeeThr::fuNrOfGet4
UInt_t fuNrOfGet4
Definition: CbmMcbm2018TofFeeThr.h:105
CbmMcbm2018TofFeeThr::fuGet4Id
UInt_t fuGet4Id
Definition: CbmMcbm2018TofFeeThr.h:126
CbmMcbm2018TofFeeThr::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Definition: CbmMcbm2018TofFeeThr.h:93
CbmMcbm2018TofFeeThr::ConvertGet4ToElink
UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
Definition: CbmMcbm2018TofFeeThr.h:155
CbmMcbm2018TofFeeThr::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmMcbm2018TofFeeThr.h:92
CbmMcbmUnpack.h
CbmMcbm2018TofFeeThr::fuNrOfFeePerGdpb
UInt_t fuNrOfFeePerGdpb
Definition: CbmMcbm2018TofFeeThr.h:100
CbmMcbm2018TofFeeThr
Definition: CbmMcbm2018TofFeeThr.h:33
CbmMcbm2018TofFeeThr::fuNrOfChannelsPerGet4
UInt_t fuNrOfChannelsPerGet4
Definition: CbmMcbm2018TofFeeThr.h:102
CbmMcbm2018TofFeeThr::UseDaqBuffer
void UseDaqBuffer(Bool_t)
Definition: CbmMcbm2018TofFeeThr.h:72
CbmMcbm2018TofFeeThr::SetMsLimitLevel
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
Definition: CbmMcbm2018TofFeeThr.h:52
CbmMcbm2018TofFeeThr::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmMcbm2018TofFeeThr.h:77
CbmMcbm2018TofFeeThr::SetHistoFileName
void SetHistoFileName(TString sFileName="data/HistosTofFeeTest.root")
Definition: CbmMcbm2018TofFeeThr.h:68
CbmMcbm2018TofFeeThr::Reset
virtual void Reset()
Definition: CbmMcbm2018TofFeeThr.cxx:489
CbmMcbm2018TofFeeThr::Finish
virtual void Finish()
Definition: CbmMcbm2018TofFeeThr.cxx:491
CbmMcbm2018TofFeeThr::fuNrOfGet4PerFee
UInt_t fuNrOfGet4PerFee
Definition: CbmMcbm2018TofFeeThr.h:101
CbmMcbm2018TofFeeThr::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmMcbm2018TofFeeThr.cxx:300
CbmMcbm2018TofFeeThr::InitContainers
Bool_t InitContainers()
Definition: CbmMcbm2018TofFeeThr.cxx:108
CbmMcbm2018TofFeeThr::ConvertElinkToGet4
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
Definition: CbmMcbm2018TofFeeThr.h:151
CbmMcbm2018TofFeeThr::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmMcbm2018TofFeeThr.h:90
CbmMcbm2018TofFeeThr::fuTotalMsNb
size_t fuTotalMsNb
Definition: CbmMcbm2018TofFeeThr.h:88
CbmMcbm2018TofFeeThr::fuGdpbId
UInt_t fuGdpbId
Definition: CbmMcbm2018TofFeeThr.h:122
CbmMcbm2018TofFeeThr::ResetAllHistos
void ResetAllHistos()
Definition: CbmMcbm2018TofFeeThr.cxx:534
CbmMcbm2018TofFeeThr::fiEquipmentId
Int_t fiEquipmentId
Definition: CbmMcbm2018TofFeeThr.h:129
CbmMcbm2018TofFeeThr::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmMcbm2018TofFeeThr.cxx:264
CbmMcbm2018TofFeeThr::fuNrOfGbtx
UInt_t fuNrOfGbtx
Definition: CbmMcbm2018TofFeeThr.h:109
CbmMcbm2018TofFeeThr::fuMinNbGdpb
UInt_t fuMinNbGdpb
Definition: CbmMcbm2018TofFeeThr.h:94
CbmMcbm2018TofFeeThr::fdMsIndex
Double_t fdMsIndex
Definition: CbmMcbm2018TofFeeThr.h:121
CbmMcbm2018TofFeeThr::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
FLES containers.
Definition: CbmMcbm2018TofFeeThr.h:72
CbmMcbm2018TofFeeThr::fuNrOfChannelsPerFee
UInt_t fuNrOfChannelsPerFee
Definition: CbmMcbm2018TofFeeThr.h:104
CbmMcbm2018TofFeeThr::fhGdpbAsicSpiCounts
TH2 * fhGdpbAsicSpiCounts
Histograms.
Definition: CbmMcbm2018TofFeeThr.h:133
CbmMcbm2018TofFeeThr::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmMcbm2018TofFeeThr.h:80
CbmMcbm2018TofFeeThr::kuNbFeePerGbtx
const UInt_t kuNbFeePerGbtx
Definition: CbmMcbm2018TofFeeThr.h:111
CbmMcbm2018TofFeeThr::fvuGet4ToPadi
std::vector< UInt_t > fvuGet4ToPadi
Definition: CbmMcbm2018TofFeeThr.h:145
CbmMcbm2018TofFeeThr::fuCurrentMsSysId
size_t fuCurrentMsSysId
Definition: CbmMcbm2018TofFeeThr.h:120
CbmMcbm2018TofFeeThr::operator=
CbmMcbm2018TofFeeThr operator=(const CbmMcbm2018TofFeeThr &)
CbmMcbm2018TofFeeThr::PrintSlcInfo
void PrintSlcInfo(gdpbv100::Message)
Definition: CbmMcbm2018TofFeeThr.cxx:459
gDpbMessv100.h
CbmMcbm2018TofFeeThr::CreateHistograms
void CreateHistograms()
Definition: CbmMcbm2018TofFeeThr.cxx:271
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018TofFeeThr::fUnpackPar
CbmMcbm2018TofPar * fUnpackPar
Definition: CbmMcbm2018TofFeeThr.h:98
CbmMcbm2018TofFeeThr::~CbmMcbm2018TofFeeThr
virtual ~CbmMcbm2018TofFeeThr()
Definition: CbmMcbm2018TofFeeThr.cxx:88
CbmMcbm2018TofFeeThr::fuCoreMs
size_t fuCoreMs
Definition: CbmMcbm2018TofFeeThr.h:91
CbmMcbm2018TofFeeThr::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmMcbm2018TofFeeThr.cxx:255
CbmMcbm2018TofFeeThr::Init
virtual Bool_t Init()
Definition: CbmMcbm2018TofFeeThr.cxx:90
CbmMcbm2018TofFeeThr::fGdpbIdIndexMap
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
Definition: CbmMcbm2018TofFeeThr.h:115
CbmMcbm2018TofFeeThr::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
OLD, to be cleaned out !!!!!
Definition: CbmMcbm2018TofFeeThr.h:87
CbmMcbm2018TofFeeThr::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmMcbm2018TofFeeThr.cxx:516
CbmMcbm2018TofFeeThr::fulCurrentTsIndex
uint64_t fulCurrentTsIndex
Definition: CbmMcbm2018TofFeeThr.h:118
CbmMcbm2018TofFeeThr::fuGdpbNr
UInt_t fuGdpbNr
Definition: CbmMcbm2018TofFeeThr.h:124
CbmMcbm2018TofFeeThr::CbmMcbm2018TofFeeThr
CbmMcbm2018TofFeeThr(const CbmMcbm2018TofFeeThr &)
CbmMcbm2018TofFeeThr::fuNrOfGet4PerGdpb
UInt_t fuNrOfGet4PerGdpb
Definition: CbmMcbm2018TofFeeThr.h:106
CbmMcbm2018TofFeeThr::fuNrOfGdpbs
UInt_t fuNrOfGdpbs
Definition: CbmMcbm2018TofFeeThr.h:99
CbmMcbm2018TofFeeThr::GetMsOverlap
size_t GetMsOverlap()
Definition: CbmMcbm2018TofFeeThr.h:63
CbmMcbm2018TofFeeThr::fvuElinkToGet4
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
Definition: CbmMcbm2018TofFeeThr.h:149
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmMcbm2018TofFeeThr::CbmMcbm2018TofFeeThr
CbmMcbm2018TofFeeThr()
Definition: CbmMcbm2018TofFeeThr.cxx:47
CbmMcbm2018TofFeeThr::kuNbGbtxPerGdpb
const UInt_t kuNbGbtxPerGdpb
Definition: CbmMcbm2018TofFeeThr.h:112
CbmMcbm2018TofFeeThr::fvuGet4ToElink
std::vector< UInt_t > fvuGet4ToElink
Definition: CbmMcbm2018TofFeeThr.h:150