CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018TofPar.h
Go to the documentation of this file.
1/* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMcbm2018TofPar header file -----
7// ----- Created 09/09/18 by P.-A. Loizeau -----
8// -------------------------------------------------------------------------
9
10#ifndef CBMMCBM2018TOFPAR_H
11#define CBMMCBM2018TOFPAR_H
12
13#include "FairParGenericSet.h"
14#include "TArrayD.h"
15#include "TArrayI.h"
16
17class FairParIo;
18class FairParamList;
19
20
21class CbmMcbm2018TofPar : public FairParGenericSet {
22
23 public:
25 CbmMcbm2018TofPar(const char* name = "CbmMcbm2018TofPar", const char* title = "Tof unpacker parameters",
26 const char* context = "Default");
27
28
30 virtual ~CbmMcbm2018TofPar();
31
33 virtual void clear();
34
35 void putParams(FairParamList*);
36 Bool_t getParams(FairParamList*);
37
38 static constexpr UInt_t GetNbByteMessage() { return kuBytesPerMessage; }
39
40 Int_t Get4ChanToPadiChan(UInt_t uChannelInFee);
41 Int_t PadiChanToGet4Chan(UInt_t uChannelInFee);
42
43 Int_t ElinkIdxToGet4Idx(UInt_t uElink);
44 Int_t Get4IdxToElinkIdx(UInt_t uGet4);
45 Int_t ElinkIdxToGet4IdxA(UInt_t uElink);
46 Int_t Get4IdxToElinkIdxA(UInt_t uGet4);
47
48 static constexpr UInt_t GetNrOfPadiThrCodes() { return kuNbPadiThrCodes; }
49 Double_t GetPadiThresholdVal(UInt_t uCode);
50
51 // static constexpr UInt_t GetNrOfChannelsPerGet4() { return kuNbChannelsPerGet4; }
52 // static constexpr UInt_t GetNrOfGet4PerFee() { return kuNbGet4PerFee; }
53 static constexpr UInt_t GetNrOfFeePerGbtx() { return kuNbFeePerGbtx; }
54 static constexpr UInt_t GetNrOfGbtxPerGdpb() { return kuNbGbtxPerGdpb; }
55 static constexpr UInt_t GetNrOfChannelsPerFee() { return kuNbChannelsPerFee; }
56 static constexpr UInt_t GetNrOfChannelsPerGbtx() { return kuNbChannelsPerGbtx; }
57 static constexpr UInt_t GetNrOfChannelsPerGdpb() { return kuNbChannelsPerGdpb; }
58 static constexpr UInt_t GetNrOfGet4PerGbtx() { return kuNbGet4PerGbtx; }
59 static constexpr UInt_t GetNrOfGet4PerGdpb() { return kuNbGet4PerGdpb; }
60 static constexpr UInt_t GetNrOfFeePerGdpb() { return kuNbFeePerGdpb; }
62
64 inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; }
65 inline Int_t GetGdpbId(Int_t i) { return fiGdpbIdArray[i]; }
69
70 inline Int_t GetNrOfGbtx() { return fiNrOfGbtx; }
71 inline Int_t GetNrOfModules() { return fiNrOfModule; }
72 inline Int_t GetNrOfRpc(Int_t i) { return fiNrOfRpc[i]; }
73 inline Int_t GetRpcType(Int_t i) { return fiRpcType[i]; }
74 inline Int_t GetRpcSide(Int_t i) { return fiRpcSide[i]; }
75 inline Int_t GetModuleId(Int_t i) { return fiModuleId[i]; }
76 inline std::vector<Int_t> GetRpcChUidMap() { return fviRpcChUId; }
77
78 inline Int_t GetNbMsTot() { return fiNbMsTot; }
79 inline Int_t GetNbMsOverlap() { return fiNbMsOverlap; }
80 inline Double_t GetSizeMsInNs() { return fdSizeMsInNs; }
81
82 inline Double_t GetStarTriggDeadtime(Int_t gdpb) { return fdStarTriggerDeadtime[gdpb]; }
83 inline Double_t GetStarTriggDelay(Int_t gdpb) { return fdStarTriggerDelay[gdpb]; }
84 inline Double_t GetStarTriggWinSize(Int_t gdpb) { return fdStarTriggerWinSize[gdpb]; }
85 inline Double_t GetTsDeadtimePeriod() { return fdTsDeadtimePeriod; }
86
87 inline bool CheckBmonComp(uint32_t uCompId) { return ((uCompId & 0xFFF0) == 0xABF0); }
88 //inline bool CheckInnerComp(uint32_t uCompId) { return ((uCompId & 0xFFF0) == 0xBBC0); }
89 inline bool CheckInnerComp(uint32_t uCompId) { return ((uCompId & 0xFF00) == 0xBB00); }
90
91 private:
93 void BuildChannelsUidMapCbm(UInt_t& uCh, UInt_t uGbtx);
94 void BuildChannelsUidMapStar(UInt_t& uCh, UInt_t uGbtx);
95 void BuildChannelsUidMapBmon(UInt_t& uCh, UInt_t uGbtx);
96 void BuildChannelsUidMapBmon_2022(UInt_t& uCh, UInt_t uGbtx);
97 void BuildChannelsUidMapCern(UInt_t& uCh, UInt_t uGbtx);
98 void BuildChannelsUidMapCera(UInt_t& uCh, UInt_t uGbtx);
99 void BuildChannelsUidMapStar2(UInt_t& uCh, UInt_t uGbtx);
100 void BuildChannelsUidMapStar2A(UInt_t& uCh, UInt_t uGbtx);
101 void BuildChannelsUidMapBuc(UInt_t& uCh, UInt_t uGbtx);
102
105 static const uint32_t kuBytesPerMessage = 8;
107 static const uint32_t kuNbChannelsPerGet4 = 4;
108 static const uint32_t kuNbGet4PerFee = 8;
109 static const uint32_t kuNbFeePerGbtx = 5;
110 static const uint32_t kuNbGbtxPerGdpb = 6;
119 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12,
120 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28};
121
123 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12,
124 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28};
125
126 const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
127 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
128 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
129 const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
130 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
131 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
132
133 const UInt_t kuElinkToGet4A[kuNbGet4PerGbtx] = {0, 16, 8, 17, 1, 18, 9, 19, 2, 20, 10, 21, 3, 22,
134 11, 23, 4, 24, 12, 25, 5, 26, 13, 27, 6, 28, 14, 29,
135 7, 30, 15, 31, 32, 33, 34, 35, 36, 37, 38, 39};
136 const UInt_t kuGet4ToElinkA[kuNbGet4PerGbtx] = {0, 4, 8, 12, 16, 20, 24, 28, 2, 6, 10, 14, 18, 22,
137 26, 30, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23,
138 25, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39};
139
140 static const uint32_t kuNbPadiThrCodes = 1024; // 0x3FF + 1
141 static const uint32_t kuNbThrMeasPoints = 65;
143 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, 0x0B0, 0x0C0,
144 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190,
145 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200, 0x210, 0x220, 0x230, 0x240, 0x250, 0x260,
146 0x270, 0x280, 0x290, 0x2A0, 0x2B0, 0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330,
147 0x340, 0x350, 0x360, 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF};
148 const Double_t kdThrMeasVal[kuNbThrMeasPoints] = {
149 -652.6, -631.2, -611.4, -590.6, -570.9, -550.0, -529.9, -509.4, -490.6, -469.5, -449.3, -428.5, -408.5,
150 -388.2, -367.8, -347.2, -329.2, -308.2, -287.5, -266.8, -246.9, -226.0, -205.6, -185.0, -165.7, -144.9,
151 -124.4, -103.8, -83.4, -62.9, -42.4, -21.2, -5.3, 15.5, 36.2, 56.8, 77.3, 97.8, 118.4,
152 139.1, 158.7, 179.2, 199.7, 220.2, 240.8, 261.1, 281.7, 302.2, 321.3, 341.4, 362.0, 382.2,
153 402.9, 422.8, 443.4, 463.7, 483.7, 503.7, 524.1, 544.3, 565.0, 585.0, 605.5, 626.0, 646.1};
154 std::vector<Double_t> fvdPadiThrCodeToValue;
155
157
158 Int_t fiNrOfGdpb; // Total number of GDPBs
159 TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Tof GDPBs
160
161 Int_t fiNrOfFeesPerGdpb; // Number of FEEs which are connected to one GDPB
162 Int_t fiNrOfGet4PerFee; // Number of GET4 chips which are connected to one FEB
163 Int_t fiNrOfChannelsPerGet4; // Number of channels per GET4
164
165 Int_t fiNrOfGbtx; // Total number of Gbtx links
166 Int_t fiNrOfModule; // Total number of Modules
167 TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
168 TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
169 TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
170 TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
171 std::vector<Int_t> fviRpcChUId = {}; // UID/address for each channel, build from type, side and module
172
173 Int_t fiNbMsTot; // Total number of MS per link in TS
174 Int_t fiNbMsOverlap; // Number of overlap MS per TS
175 Double_t fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection
176
177 TArrayD fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns
178 TArrayD
179 fdStarTriggerDelay; // STAR: Array to hold for each gDPB the Delay in ns to subtract when looking for beginning of coincidence of data with trigger window
180 TArrayD fdStarTriggerWinSize; // STAR: Array to hold for each gDPB the Size of the trigger window in ns
181 Double_t
182 fdTsDeadtimePeriod; // Period (ns) in the first MS of each TS where events with missing triggers should be built using the overlap MS of previous TS (overlap events)
183
185};
186
188 public:
190 CbmMcbm2018BmonPar(const char* name = "CbmMcbm2018BmonPar", const char* title = "Bmon unpacker parameters",
191 const char* context = "Default")
192 : CbmMcbm2018TofPar(name, title, context){};
193
194 private:
195 // just an alias for the Parameter container to allow two instances
197};
198#endif // CBMMCBM2018TOFPAR_H
int Int_t
bool Bool_t
ClassDef(CbmMcbm2018BmonPar, 1)
CbmMcbm2018BmonPar(const char *name="CbmMcbm2018BmonPar", const char *title="Bmon unpacker parameters", const char *context="Default")
static constexpr UInt_t GetNrOfFeePerGdpb()
Int_t GetModuleId(Int_t i)
const UInt_t kuPaditoget4[kuNbChannelsPerFee]
Map from GET4 channel to PADI channel.
void BuildChannelsUidMapCera(UInt_t &uCh, UInt_t uGbtx)
static constexpr UInt_t GetNbByteMessage()
static const uint32_t kuNbGet4PerGbtx
std::vector< Int_t > GetRpcChUidMap()
void BuildChannelsUidMapBuc(UInt_t &uCh, UInt_t uGbtx)
Int_t Get4IdxToElinkIdxA(UInt_t uGet4)
static constexpr UInt_t GetNrOfGet4PerGdpb()
void putParams(FairParamList *)
ClassDef(CbmMcbm2018TofPar, 1)
void BuildChannelsUidMapBmon_2022(UInt_t &uCh, UInt_t uGbtx)
static constexpr UInt_t GetNrOfChannelsPerGbtx()
static constexpr UInt_t GetNrOfFeePerGbtx()
Int_t GetRpcSide(Int_t i)
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
static const uint32_t kuNbGbtxPerGdpb
Double_t GetStarTriggWinSize(Int_t gdpb)
Int_t GetNrOfRpc(Int_t i)
static const uint32_t kuNbGet4PerGdpb
Int_t GetGdpbId(Int_t i)
static const uint32_t kuBytesPerMessage
CbmMcbm2018TofPar(const char *name="CbmMcbm2018TofPar", const char *title="Tof unpacker parameters", const char *context="Default")
std::vector< Int_t > fviRpcChUId
Double_t GetStarTriggDelay(Int_t gdpb)
const UInt_t kuElinkToGet4[kuNbGet4PerGbtx]
Map from PADI channel to GET4 channel.
Double_t GetStarTriggDeadtime(Int_t gdpb)
static const uint32_t kuNbPadiThrCodes
PADI threshold measures and extrapolated code to value map.
void BuildChannelsUidMapBmon(UInt_t &uCh, UInt_t uGbtx)
const UInt_t kuThrMeasCode[kuNbThrMeasPoints]
Int_t Get4IdxToElinkIdx(UInt_t uGet4)
Bool_t getParams(FairParamList *)
const UInt_t kuGet4ToElink[kuNbGet4PerGbtx]
const UInt_t kuElinkToGet4A[kuNbGet4PerGbtx]
void BuildChannelsUidMapStar2A(UInt_t &uCh, UInt_t uGbtx)
const UInt_t kuGet4ToElinkA[kuNbGet4PerGbtx]
void BuildChannelsUidMapStar(UInt_t &uCh, UInt_t uGbtx)
Double_t GetTsDeadtimePeriod()
Double_t GetPadiThresholdVal(UInt_t uCode)
std::vector< Double_t > fvdPadiThrCodeToValue
const Double_t kdThrMeasVal[kuNbThrMeasPoints]
void BuildChannelsUidMapCbm(UInt_t &uCh, UInt_t uGbtx)
static const uint32_t kuNbThrMeasPoints
Int_t Get4ChanToPadiChan(UInt_t uChannelInFee)
static constexpr UInt_t GetNrOfGet4PerGbtx()
void BuildChannelsUidMapCern(UInt_t &uCh, UInt_t uGbtx)
bool CheckInnerComp(uint32_t uCompId)
Int_t GetRpcType(Int_t i)
static const uint32_t kuNbFeePerGbtx
static constexpr UInt_t GetNrOfChannelsPerGdpb()
static const uint32_t kuNbFeePerGdpb
Int_t PadiChanToGet4Chan(UInt_t uChannelInFee)
void BuildChannelsUidMapStar2(UInt_t &uCh, UInt_t uGbtx)
static const uint32_t kuNbGet4PerFee
static const uint32_t kuNbChannelsPerGbtx
static constexpr UInt_t GetNrOfGbtxPerGdpb()
static const uint32_t kuNbChannelsPerFee
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
static constexpr UInt_t GetNrOfPadiThrCodes()
Int_t ElinkIdxToGet4IdxA(UInt_t uElink)
static const uint32_t kuNbChannelsPerGdpb
bool CheckBmonComp(uint32_t uCompId)
const UInt_t kuGet4topadi[kuNbChannelsPerFee]
Mapping in Readout chain PCBs.
static constexpr UInt_t GetNrOfChannelsPerFee()
static const uint32_t kuNbChannelsPerGet4
Readout chain.