CbmRoot
CbmStar2019TofFeeThr.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ----- -----
3 // ----- CbmStar2019TofFeeThr -----
4 // ----- Created 10.07.2018 by P.-A. Loizeau -----
5 // ----- -----
6 // -----------------------------------------------------------------------------
7 
8 #ifndef CbmStar2019TofFeeThr_H
9 #define CbmStar2019TofFeeThr_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 CbmStar2019TofPar;
26 
27 class TCanvas;
28 class TH1;
29 class TH2;
30 class TProfile;
31 class TProfile2D;
32 
34 public:
36  virtual ~CbmStar2019TofFeeThr();
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 
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 
162 
163  ClassDef(CbmStar2019TofFeeThr, 1)
164 };
165 
166 #endif
gdpbv100::Message
Definition: gDpbMessv100.h:133
CbmStar2019TofFeeThr::fuCurrNbGdpb
UInt_t fuCurrNbGdpb
Definition: CbmStar2019TofFeeThr.h:95
CbmStar2019TofFeeThr::ConvertElinkToGet4
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
Definition: CbmStar2019TofFeeThr.h:151
CbmStar2019TofFeeThr::SetIgnoreMsOverlap
void SetIgnoreMsOverlap(Bool_t bEnaFlag=kTRUE)
Definition: CbmStar2019TofFeeThr.h:59
CbmStar2019TofFeeThr::fuCurrentMs
size_t fuCurrentMs
Definition: CbmStar2019TofFeeThr.h:119
CbmStar2019TofFeeThr::fuNrOfGet4PerGdpb
UInt_t fuNrOfGet4PerGdpb
Definition: CbmStar2019TofFeeThr.h:106
CbmStar2019TofFeeThr::fvuGet4ToElink
std::vector< UInt_t > fvuGet4ToElink
Definition: CbmStar2019TofFeeThr.h:150
CbmMcbmUnpack.h
CbmStar2019TofFeeThr::Finish
virtual void Finish()
Definition: CbmStar2019TofFeeThr.cxx:460
CbmStar2019TofFeeThr::fuNrOfChannelsPerGet4
UInt_t fuNrOfChannelsPerGet4
Definition: CbmStar2019TofFeeThr.h:102
CbmStar2019TofFeeThr::fuNbCoreMsPerTs
size_t fuNbCoreMsPerTs
Definition: CbmStar2019TofFeeThr.h:77
CbmStar2019TofFeeThr::fuOverlapMsNb
size_t fuOverlapMsNb
Definition: CbmStar2019TofFeeThr.h:90
CbmStar2019TofFeeThr::CbmStar2019TofFeeThr
CbmStar2019TofFeeThr(const CbmStar2019TofFeeThr &)
CbmStar2019TofFeeThr::fuNrOfGdpbs
UInt_t fuNrOfGdpbs
Definition: CbmStar2019TofFeeThr.h:99
CbmStar2019TofFeeThr::fuGdpbNr
UInt_t fuGdpbNr
Definition: CbmStar2019TofFeeThr.h:124
CbmStar2019TofFeeThr::AddMsComponentToList
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Definition: CbmStar2019TofFeeThr.cxx:212
CbmStar2019TofFeeThr::SetParContainers
void SetParContainers()
Definition: CbmStar2019TofFeeThr.cxx:98
CbmStar2019TofFeeThr::fuNrOfGbtx
UInt_t fuNrOfGbtx
Definition: CbmStar2019TofFeeThr.h:109
CbmStar2019TofFeeThr::fuNrOfFeePerGdpb
UInt_t fuNrOfFeePerGdpb
Definition: CbmStar2019TofFeeThr.h:100
CbmStar2019TofFeeThr::kuNbFeePerGbtx
const UInt_t kuNbFeePerGbtx
Definition: CbmStar2019TofFeeThr.h:111
CbmStar2019TofFeeThr::SetNbMsInTs
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Definition: CbmStar2019TofFeeThr.cxx:221
CbmStar2019TofFeeThr::kuNbGet4PerGbtx
static const UInt_t kuNbGet4PerGbtx
Definition: CbmStar2019TofFeeThr.h:148
CbmStar2019TofFeeThr::ConvertGet4ToElink
UInt_t ConvertGet4ToElink(UInt_t uGet4Idx)
Definition: CbmStar2019TofFeeThr.h:155
CbmStar2019TofFeeThr::fviMsgCounter
std::vector< int > fviMsgCounter
Definition: CbmStar2019TofFeeThr.h:130
CbmStar2019TofFeeThr::fuGet4Id
UInt_t fuGet4Id
Definition: CbmStar2019TofFeeThr.h:126
CbmStar2019TofFeeThr::fGdpbIdIndexMap
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
Definition: CbmStar2019TofFeeThr.h:115
CbmStar2019TofFeeThr::fuGet4Nr
UInt_t fuGet4Nr
Definition: CbmStar2019TofFeeThr.h:128
CbmStar2019TofFeeThr::CreateHistograms
void CreateHistograms()
Definition: CbmStar2019TofFeeThr.cxx:228
CbmStar2019TofFeeThr::SaveAllHistos
void SaveAllHistos(TString sFileName="")
Definition: CbmStar2019TofFeeThr.cxx:485
CbmStar2019TofFeeThr::PrintSlcInfo
void PrintSlcInfo(gdpbv100::Message)
Definition: CbmStar2019TofFeeThr.cxx:424
CbmStar2019TofFeeThr::fbIgnoreOverlapMs
Bool_t fbIgnoreOverlapMs
Definition: CbmStar2019TofFeeThr.h:80
CbmStar2019TofFeeThr::fulCurrentTsIndex
uint64_t fulCurrentTsIndex
Definition: CbmStar2019TofFeeThr.h:118
CbmStar2019TofFeeThr::fdMsIndex
Double_t fdMsIndex
Definition: CbmStar2019TofFeeThr.h:121
CbmStar2019TofFeeThr::DoUnpack
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Definition: CbmStar2019TofFeeThr.cxx:257
CbmStar2019TofFeeThr::fuTotalMsNb
size_t fuTotalMsNb
Definition: CbmStar2019TofFeeThr.h:88
CbmStar2019TofFeeThr::fuNrOfChannelsPerFee
UInt_t fuNrOfChannelsPerFee
Definition: CbmStar2019TofFeeThr.h:104
CbmStar2019TofFeeThr::InitContainers
Bool_t InitContainers()
Definition: CbmStar2019TofFeeThr.cxx:105
CbmStar2019TofFeeThr::CbmStar2019TofFeeThr
CbmStar2019TofFeeThr()
Definition: CbmStar2019TofFeeThr.cxx:44
CbmStar2019TofFeeThr::fvMsComponentsList
std::vector< size_t > fvMsComponentsList
FLES containers.
Definition: CbmStar2019TofFeeThr.h:72
CbmStar2019TofFeeThr::ResetAllHistos
void ResetAllHistos()
Definition: CbmStar2019TofFeeThr.cxx:503
CbmStar2019TofFeeThr::fuNbOverMsPerTs
size_t fuNbOverMsPerTs
Definition: CbmStar2019TofFeeThr.h:78
CbmStar2019TofFeeThr::fvuElinkToGet4
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
Definition: CbmStar2019TofFeeThr.h:149
CbmStar2019TofFeeThr::operator=
CbmStar2019TofFeeThr operator=(const CbmStar2019TofFeeThr &)
CbmStar2019TofFeeThr
Definition: CbmStar2019TofFeeThr.h:33
CbmStar2019TofPar
Definition: CbmStar2019TofPar.h:18
CbmStar2019TofFeeThr::ReInitContainers
Bool_t ReInitContainers()
Definition: CbmStar2019TofFeeThr.cxx:114
CbmStar2019TofFeeThr::fuNrOfChannelsPerGdpb
UInt_t fuNrOfChannelsPerGdpb
Definition: CbmStar2019TofFeeThr.h:107
gDpbMessv100.h
CbmStar2019TofFeeThr::SetMsOverlap
void SetMsOverlap(size_t uOverlapMsNb=1)
Definition: CbmStar2019TofFeeThr.h:62
CbmStar2019TofFeeThr::fvuGet4ToPadi
std::vector< UInt_t > fvuGet4ToPadi
Definition: CbmStar2019TofFeeThr.h:145
CbmStar2019TofFeeThr::fiEquipmentId
Int_t fiEquipmentId
Definition: CbmStar2019TofFeeThr.h:129
CbmStar2019TofFeeThr::fdTsCoreSizeInNs
Double_t fdTsCoreSizeInNs
Definition: CbmStar2019TofFeeThr.h:93
CbmStar2019TofFeeThr::fuNrOfGet4PerFee
UInt_t fuNrOfGet4PerFee
Definition: CbmStar2019TofFeeThr.h:101
CbmStar2019TofFeeThr::fuMinNbGdpb
UInt_t fuMinNbGdpb
Definition: CbmStar2019TofFeeThr.h:94
CbmStar2019TofFeeThr::fUnpackPar
CbmStar2019TofPar * fUnpackPar
Definition: CbmStar2019TofFeeThr.h:98
CbmStar2019TofFeeThr::GetArrayIndex
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
Definition: CbmStar2019TofFeeThr.h:139
CbmStar2019TofFeeThr::fvuPadiToGet4
std::vector< UInt_t > fvuPadiToGet4
Definition: CbmStar2019TofFeeThr.h:144
CbmStar2019TofFeeThr::fuCoreMs
size_t fuCoreMs
Definition: CbmStar2019TofFeeThr.h:91
CbmStar2019TofFeeThr::UseDaqBuffer
void UseDaqBuffer(Bool_t)
Definition: CbmStar2019TofFeeThr.h:72
CbmStar2019TofFeeThr::fuCurrentMsSysId
size_t fuCurrentMsSysId
Definition: CbmStar2019TofFeeThr.h:120
CbmStar2019TofFeeThr::Init
virtual Bool_t Init()
Definition: CbmStar2019TofFeeThr.cxx:87
CbmStar2019TofFeeThr::SetHistoFileName
void SetHistoFileName(TString sFileName="data/HistosTofFeeTest.root")
Definition: CbmStar2019TofFeeThr.h:68
CbmStar2019TofFeeThr::SetMsLimitLevel
void SetMsLimitLevel(size_t uAcceptBoundaryPct=100)
Definition: CbmStar2019TofFeeThr.h:52
CbmStar2019TofFeeThr::fuGdpbId
UInt_t fuGdpbId
Definition: CbmStar2019TofFeeThr.h:122
CbmStar2019TofFeeThr::fuNrOfGet4
UInt_t fuNrOfGet4
Definition: CbmStar2019TofFeeThr.h:105
CbmStar2019TofFeeThr::~CbmStar2019TofFeeThr
virtual ~CbmStar2019TofFeeThr()
Definition: CbmStar2019TofFeeThr.cxx:85
CbmStar2019TofFeeThr::Reset
virtual void Reset()
Definition: CbmStar2019TofFeeThr.cxx:458
CbmStar2019TofFeeThr::kuNbGbtxPerGdpb
const UInt_t kuNbGbtxPerGdpb
Definition: CbmStar2019TofFeeThr.h:112
CbmMcbmUnpack
Definition: CbmMcbmUnpack.h:15
CbmStar2019TofFeeThr::fuMsAcceptsPercent
size_t fuMsAcceptsPercent
OLD, to be cleaned out !!!!!
Definition: CbmStar2019TofFeeThr.h:87
CbmStar2019TofFeeThr::GetMsOverlap
size_t GetMsOverlap()
Definition: CbmStar2019TofFeeThr.h:63
CbmStar2019TofFeeThr::fhGdpbAsicSpiCounts
TH2 * fhGdpbAsicSpiCounts
Histograms.
Definition: CbmStar2019TofFeeThr.h:133
CbmStar2019TofFeeThr::GetMsLimitLevel
size_t GetMsLimitLevel()
Definition: CbmStar2019TofFeeThr.h:55
CbmStar2019TofFeeThr::fsHistoFileFullname
TString fsHistoFileFullname
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Definition: CbmStar2019TofFeeThr.h:83
CbmStar2019TofFeeThr::fdMsSizeInNs
Double_t fdMsSizeInNs
Definition: CbmStar2019TofFeeThr.h:92