CbmRoot
CbmMcbm2018TofPar.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMcbm2018TofPar header file -----
3 // ----- Created 09/09/18 by P.-A. Loizeau -----
4 // -------------------------------------------------------------------------
5 
6 #ifndef CBMMCBM2018TOFPAR_H
7 #define CBMMCBM2018TOFPAR_H
8 
9 #include "FairParGenericSet.h"
10 
11 #include "TArrayD.h"
12 #include "TArrayI.h"
13 
14 class FairParIo;
15 class FairParamList;
16 
17 
18 class CbmMcbm2018TofPar : public FairParGenericSet {
19 
20 public:
22  CbmMcbm2018TofPar(const char* name = "CbmMcbm2018TofPar",
23  const char* title = "Tof unpacker parameters",
24  const char* context = "Default");
25 
26 
28  virtual ~CbmMcbm2018TofPar();
29 
31  virtual void clear();
32 
33  void putParams(FairParamList*);
34  Bool_t getParams(FairParamList*);
35 
36  static constexpr UInt_t GetNbByteMessage() { return kuBytesPerMessage; }
37 
38  Int_t Get4ChanToPadiChan(UInt_t uChannelInFee);
39  Int_t PadiChanToGet4Chan(UInt_t uChannelInFee);
40 
41  Int_t ElinkIdxToGet4Idx(UInt_t uElink);
42  Int_t Get4IdxToElinkIdx(UInt_t uGet4);
43 
44  static constexpr UInt_t GetNrOfPadiThrCodes() { return kuNbPadiThrCodes; }
45  Double_t GetPadiThresholdVal(UInt_t uCode);
46 
47  // static constexpr UInt_t GetNrOfChannelsPerGet4() { return kuNbChannelsPerGet4; }
48  // static constexpr UInt_t GetNrOfGet4PerFee() { return kuNbGet4PerFee; }
49  static constexpr UInt_t GetNrOfFeePerGbtx() { return kuNbFeePerGbtx; }
50  static constexpr UInt_t GetNrOfGbtxPerGdpb() { return kuNbGbtxPerGdpb; }
51  static constexpr UInt_t GetNrOfChannelsPerFee() { return kuNbChannelsPerFee; }
52  static constexpr UInt_t GetNrOfChannelsPerGbtx() {
53  return kuNbChannelsPerGbtx;
54  }
55  static constexpr UInt_t GetNrOfChannelsPerGdpb() {
56  return kuNbChannelsPerGdpb;
57  }
58  static constexpr UInt_t GetNrOfGet4PerGbtx() { return kuNbGet4PerGbtx; }
59  static constexpr UInt_t GetNrOfGet4PerGdpb() { return kuNbGet4PerGdpb; }
60  static constexpr UInt_t GetNrOfFeePerGdpb() { return kuNbFeePerGdpb; }
61  inline UInt_t GetNumberOfChannels() {
63  }
64 
66  inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; }
67  inline Int_t GetGdpbId(Int_t i) { return fiGdpbIdArray[i]; }
68  inline Int_t GetNrOfFeesPerGdpb() { return fiNrOfFeesPerGdpb; }
69  inline Int_t GetNrOfGet4PerFee() { return fiNrOfGet4PerFee; }
70  inline Int_t GetNrOfChannelsPerGet4() { return fiNrOfChannelsPerGet4; }
71 
72  inline Int_t GetNrOfGbtx() { return fiNrOfGbtx; }
73  inline Int_t GetNrOfModules() { return fiNrOfModule; }
74  inline Int_t GetNrOfRpc(Int_t i) { return fiNrOfRpc[i]; }
75  inline Int_t GetRpcType(Int_t i) { return fiRpcType[i]; }
76  inline Int_t GetRpcSide(Int_t i) { return fiRpcSide[i]; }
77  inline Int_t GetModuleId(Int_t i) { return fiModuleId[i]; }
78 
79  inline Int_t GetNbMsTot() { return fiNbMsTot; }
80  inline Int_t GetNbMsOverlap() { return fiNbMsOverlap; }
81  inline Double_t GetSizeMsInNs() { return fdSizeMsInNs; }
82 
83  inline Double_t GetStarTriggDeadtime(Int_t gdpb) {
84  return fdStarTriggerDeadtime[gdpb];
85  }
86  inline Double_t GetStarTriggDelay(Int_t gdpb) {
87  return fdStarTriggerDelay[gdpb];
88  }
89  inline Double_t GetStarTriggWinSize(Int_t gdpb) {
90  return fdStarTriggerWinSize[gdpb];
91  }
92  inline Double_t GetTsDeadtimePeriod() { return fdTsDeadtimePeriod; }
93 
94 private:
97  static const uint32_t kuBytesPerMessage = 8;
99  static const uint32_t kuNbChannelsPerGet4 = 4;
100  static const uint32_t kuNbGet4PerFee = 8;
101  static const uint32_t kuNbFeePerGbtx = 5;
102  static const uint32_t kuNbGbtxPerGdpb = 6;
103  static const uint32_t kuNbChannelsPerFee =
105  static const uint32_t kuNbChannelsPerGbtx =
107  static const uint32_t kuNbChannelsPerGdpb =
109  static const uint32_t kuNbGet4PerGbtx = kuNbGet4PerFee * kuNbFeePerGbtx;
111  static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb;
113  const UInt_t
114  kuGet4topadi[kuNbChannelsPerFee] = {3, 2, 1, 0, 7, 6, 5, 4, 11,
115  10, 9, 8, 15, 14, 13, 12, 19, 18,
116  17, 16, 23, 22, 21, 20, 27, 26, 25,
117  24, 31, 30, 29, 28};
118 
119  const UInt_t
120  kuPaditoget4[kuNbChannelsPerFee] = {3, 2, 1, 0, 7, 6, 5, 4, 11,
121  10, 9, 8, 15, 14, 13, 12, 19, 18,
122  17, 16, 23, 22, 21, 20, 27, 26, 25,
123  24, 31, 30, 29, 28};
124  const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {
125  27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
126  10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
127  18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
128  const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {
129  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 
134  static const uint32_t kuNbPadiThrCodes = 1024; // 0x3FF + 1
135  static const uint32_t kuNbThrMeasPoints = 65;
137  0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0,
138  0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150,
139  0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200,
140  0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x270, 0x280, 0x290, 0x2A0, 0x2B0,
141  0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360,
142  0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF};
143  const Double_t kdThrMeasVal[kuNbThrMeasPoints] = {
144  -652.6, -631.2, -611.4, -590.6, -570.9, -550.0, -529.9, -509.4, -490.6,
145  -469.5, -449.3, -428.5, -408.5, -388.2, -367.8, -347.2, -329.2, -308.2,
146  -287.5, -266.8, -246.9, -226.0, -205.6, -185.0, -165.7, -144.9, -124.4,
147  -103.8, -83.4, -62.9, -42.4, -21.2, -5.3, 15.5, 36.2, 56.8,
148  77.3, 97.8, 118.4, 139.1, 158.7, 179.2, 199.7, 220.2, 240.8,
149  261.1, 281.7, 302.2, 321.3, 341.4, 362.0, 382.2, 402.9, 422.8,
150  443.4, 463.7, 483.7, 503.7, 524.1, 544.3, 565.0, 585.0, 605.5,
151  626.0, 646.1};
152  std::vector<Double_t> fvdPadiThrCodeToValue;
153 
154  Int_t fiNrOfGdpb; // Total number of GDPBs
155  TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Tof GDPBs
156 
157  Int_t fiNrOfFeesPerGdpb; // Number of FEEs which are connected to one GDPB
158  Int_t
159  fiNrOfGet4PerFee; // Number of GET4 chips which are connected to one FEB
160  Int_t fiNrOfChannelsPerGet4; // Number of channels per GET4
161 
162  Int_t fiNrOfGbtx; // Total number of Gbtx links
163  Int_t fiNrOfModule; // Total number of Modules
164  TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
165  TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
166  TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
167  TArrayI
168  fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
169 
170  Int_t fiNbMsTot; // Total number of MS per link in TS
171  Int_t fiNbMsOverlap; // Number of overlap MS per TS
172  Double_t
173  fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection
174 
175  TArrayD
176  fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns
177  TArrayD
178  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
179  TArrayD
180  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 #endif // CBMMCBM2018TOFPAR_H
CbmMcbm2018TofPar::GetNrOfChannelsPerGdpb
static constexpr UInt_t GetNrOfChannelsPerGdpb()
Definition: CbmMcbm2018TofPar.h:55
CbmMcbm2018TofPar::PadiChanToGet4Chan
Int_t PadiChanToGet4Chan(UInt_t uChannelInFee)
Definition: CbmMcbm2018TofPar.cxx:159
CbmMcbm2018TofPar::fdStarTriggerDelay
TArrayD fdStarTriggerDelay
Definition: CbmMcbm2018TofPar.h:178
CbmMcbm2018TofPar::fiNrOfFeesPerGdpb
Int_t fiNrOfFeesPerGdpb
Definition: CbmMcbm2018TofPar.h:157
CbmMcbm2018TofPar::ElinkIdxToGet4Idx
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
Definition: CbmMcbm2018TofPar.cxx:172
CbmMcbm2018TofPar::fvdPadiThrCodeToValue
std::vector< Double_t > fvdPadiThrCodeToValue
Definition: CbmMcbm2018TofPar.h:152
CbmMcbm2018TofPar::fdTsDeadtimePeriod
Double_t fdTsDeadtimePeriod
Definition: CbmMcbm2018TofPar.h:182
CbmMcbm2018TofPar::GetNbMsTot
Int_t GetNbMsTot()
Definition: CbmMcbm2018TofPar.h:79
CbmMcbm2018TofPar::GetGdpbId
Int_t GetGdpbId(Int_t i)
Definition: CbmMcbm2018TofPar.h:67
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMcbm2018TofPar::kdThrMeasVal
const Double_t kdThrMeasVal[kuNbThrMeasPoints]
Definition: CbmMcbm2018TofPar.h:143
CbmMcbm2018TofPar::kuThrMeasCode
const UInt_t kuThrMeasCode[kuNbThrMeasPoints]
Definition: CbmMcbm2018TofPar.h:136
CbmMcbm2018TofPar::GetNrOfChannelsPerFee
static constexpr UInt_t GetNrOfChannelsPerFee()
Definition: CbmMcbm2018TofPar.h:51
CbmMcbm2018TofPar::kuBytesPerMessage
static const uint32_t kuBytesPerMessage
Definition: CbmMcbm2018TofPar.h:97
CbmMcbm2018TofPar::GetStarTriggDelay
Double_t GetStarTriggDelay(Int_t gdpb)
Definition: CbmMcbm2018TofPar.h:86
CbmMcbm2018TofPar::fiModuleId
TArrayI fiModuleId
Definition: CbmMcbm2018TofPar.h:168
CbmMcbm2018TofPar::fiNrOfGdpb
Int_t fiNrOfGdpb
Definition: CbmMcbm2018TofPar.h:154
CbmMcbm2018TofPar::kuNbGbtxPerGdpb
static const uint32_t kuNbGbtxPerGdpb
Definition: CbmMcbm2018TofPar.h:102
CbmMcbm2018TofPar::GetTsDeadtimePeriod
Double_t GetTsDeadtimePeriod()
Definition: CbmMcbm2018TofPar.h:92
CbmMcbm2018TofPar::kuNbGet4PerGdpb
static const uint32_t kuNbGet4PerGdpb
Definition: CbmMcbm2018TofPar.h:110
CbmMcbm2018TofPar::GetNrOfFeePerGbtx
static constexpr UInt_t GetNrOfFeePerGbtx()
Definition: CbmMcbm2018TofPar.h:49
CbmMcbm2018TofPar::fiNbMsTot
Int_t fiNbMsTot
Definition: CbmMcbm2018TofPar.h:170
CbmMcbm2018TofPar::fiGdpbIdArray
TArrayI fiGdpbIdArray
Definition: CbmMcbm2018TofPar.h:155
CbmMcbm2018TofPar::GetNrOfGbtx
Int_t GetNrOfGbtx()
Definition: CbmMcbm2018TofPar.h:72
CbmMcbm2018TofPar::GetNrOfGbtxPerGdpb
static constexpr UInt_t GetNrOfGbtxPerGdpb()
Definition: CbmMcbm2018TofPar.h:50
CbmMcbm2018TofPar::GetNbMsOverlap
Int_t GetNbMsOverlap()
Definition: CbmMcbm2018TofPar.h:80
CbmMcbm2018TofPar::GetNrOfChannelsPerGbtx
static constexpr UInt_t GetNrOfChannelsPerGbtx()
Definition: CbmMcbm2018TofPar.h:52
CbmMcbm2018TofPar::fdStarTriggerWinSize
TArrayD fdStarTriggerWinSize
Definition: CbmMcbm2018TofPar.h:180
CbmMcbm2018TofPar::fdStarTriggerDeadtime
TArrayD fdStarTriggerDeadtime
Definition: CbmMcbm2018TofPar.h:176
CbmMcbm2018TofPar::GetNbByteMessage
static constexpr UInt_t GetNbByteMessage()
Definition: CbmMcbm2018TofPar.h:36
CbmMcbm2018TofPar::GetNrOfGdpbs
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Definition: CbmMcbm2018TofPar.h:66
CbmMcbm2018TofPar::getParams
Bool_t getParams(FairParamList *)
Definition: CbmMcbm2018TofPar.cxx:103
CbmMcbm2018TofPar::clear
virtual void clear()
Definition: CbmMcbm2018TofPar.cxx:71
CbmMcbm2018TofPar::fdSizeMsInNs
Double_t fdSizeMsInNs
Definition: CbmMcbm2018TofPar.h:173
CbmMcbm2018TofPar::kuNbThrMeasPoints
static const uint32_t kuNbThrMeasPoints
Definition: CbmMcbm2018TofPar.h:135
CbmMcbm2018TofPar::GetNrOfRpc
Int_t GetNrOfRpc(Int_t i)
Definition: CbmMcbm2018TofPar.h:74
CbmMcbm2018TofPar::GetNrOfModules
Int_t GetNrOfModules()
Definition: CbmMcbm2018TofPar.h:73
CbmMcbm2018TofPar::kuGet4ToElink
const UInt_t kuGet4ToElink[kuNbGet4PerGbtx]
Definition: CbmMcbm2018TofPar.h:128
CbmMcbm2018TofPar::kuNbChannelsPerGbtx
static const uint32_t kuNbChannelsPerGbtx
Definition: CbmMcbm2018TofPar.h:105
CbmMcbm2018TofPar::Get4IdxToElinkIdx
Int_t Get4IdxToElinkIdx(UInt_t uGet4)
Definition: CbmMcbm2018TofPar.cxx:186
CbmMcbm2018TofPar::GetNumberOfChannels
UInt_t GetNumberOfChannels()
Definition: CbmMcbm2018TofPar.h:61
CbmMcbm2018TofPar::kuNbFeePerGdpb
static const uint32_t kuNbFeePerGdpb
Definition: CbmMcbm2018TofPar.h:111
CbmMcbm2018TofPar::fiNrOfChannelsPerGet4
Int_t fiNrOfChannelsPerGet4
Definition: CbmMcbm2018TofPar.h:160
CbmMcbm2018TofPar::fiNrOfGbtx
Int_t fiNrOfGbtx
Definition: CbmMcbm2018TofPar.h:162
CbmMcbm2018TofPar::kuNbChannelsPerGet4
static const uint32_t kuNbChannelsPerGet4
Readout chain.
Definition: CbmMcbm2018TofPar.h:99
CbmMcbm2018TofPar::fiNrOfGet4PerFee
Int_t fiNrOfGet4PerFee
Definition: CbmMcbm2018TofPar.h:159
CbmMcbm2018TofPar::GetNrOfGet4PerGbtx
static constexpr UInt_t GetNrOfGet4PerGbtx()
Definition: CbmMcbm2018TofPar.h:58
CbmMcbm2018TofPar::kuNbChannelsPerFee
static const uint32_t kuNbChannelsPerFee
Definition: CbmMcbm2018TofPar.h:103
CbmMcbm2018TofPar::GetNrOfPadiThrCodes
static constexpr UInt_t GetNrOfPadiThrCodes()
Definition: CbmMcbm2018TofPar.h:44
CbmMcbm2018TofPar::kuGet4topadi
const UInt_t kuGet4topadi[kuNbChannelsPerFee]
Mapping in Readout chain PCBs.
Definition: CbmMcbm2018TofPar.h:114
CbmMcbm2018TofPar::fiNrOfRpc
TArrayI fiNrOfRpc
Definition: CbmMcbm2018TofPar.h:164
CbmMcbm2018TofPar::GetModuleId
Int_t GetModuleId(Int_t i)
Definition: CbmMcbm2018TofPar.h:77
CbmMcbm2018TofPar::fiNrOfModule
Int_t fiNrOfModule
Definition: CbmMcbm2018TofPar.h:163
CbmMcbm2018TofPar::fiRpcSide
TArrayI fiRpcSide
Definition: CbmMcbm2018TofPar.h:166
CbmMcbm2018TofPar::GetStarTriggDeadtime
Double_t GetStarTriggDeadtime(Int_t gdpb)
Definition: CbmMcbm2018TofPar.h:83
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018TofPar::CbmMcbm2018TofPar
CbmMcbm2018TofPar(const char *name="CbmMcbm2018TofPar", const char *title="Tof unpacker parameters", const char *context="Default")
Definition: CbmMcbm2018TofPar.cxx:18
CbmMcbm2018TofPar::GetNrOfChannelsPerGet4
Int_t GetNrOfChannelsPerGet4()
Definition: CbmMcbm2018TofPar.h:70
CbmMcbm2018TofPar::GetSizeMsInNs
Double_t GetSizeMsInNs()
Definition: CbmMcbm2018TofPar.h:81
CbmMcbm2018TofPar::GetRpcType
Int_t GetRpcType(Int_t i)
Definition: CbmMcbm2018TofPar.h:75
CbmMcbm2018TofPar::kuNbChannelsPerGdpb
static const uint32_t kuNbChannelsPerGdpb
Definition: CbmMcbm2018TofPar.h:107
CbmMcbm2018TofPar::kuNbFeePerGbtx
static const uint32_t kuNbFeePerGbtx
Definition: CbmMcbm2018TofPar.h:101
CbmMcbm2018TofPar::GetNrOfGet4PerGdpb
static constexpr UInt_t GetNrOfGet4PerGdpb()
Definition: CbmMcbm2018TofPar.h:59
CbmMcbm2018TofPar::~CbmMcbm2018TofPar
virtual ~CbmMcbm2018TofPar()
Definition: CbmMcbm2018TofPar.cxx:66
CbmMcbm2018TofPar::putParams
void putParams(FairParamList *)
Definition: CbmMcbm2018TofPar.cxx:79
CbmMcbm2018TofPar::GetNrOfFeePerGdpb
static constexpr UInt_t GetNrOfFeePerGdpb()
Definition: CbmMcbm2018TofPar.h:60
CbmMcbm2018TofPar::ClassDef
ClassDef(CbmMcbm2018TofPar, 1)
CbmMcbm2018TofPar::kuNbPadiThrCodes
static const uint32_t kuNbPadiThrCodes
PADI threshold measures and extrapolated code to value map.
Definition: CbmMcbm2018TofPar.h:134
CbmMcbm2018TofPar::GetRpcSide
Int_t GetRpcSide(Int_t i)
Definition: CbmMcbm2018TofPar.h:76
CbmMcbm2018TofPar::Get4ChanToPadiChan
Int_t Get4ChanToPadiChan(UInt_t uChannelInFee)
Definition: CbmMcbm2018TofPar.cxx:147
CbmMcbm2018TofPar::GetStarTriggWinSize
Double_t GetStarTriggWinSize(Int_t gdpb)
Definition: CbmMcbm2018TofPar.h:89
CbmMcbm2018TofPar::kuNbGet4PerGbtx
static const uint32_t kuNbGet4PerGbtx
Definition: CbmMcbm2018TofPar.h:109
CbmMcbm2018TofPar::fiNbMsOverlap
Int_t fiNbMsOverlap
Definition: CbmMcbm2018TofPar.h:171
CbmMcbm2018TofPar::kuNbGet4PerFee
static const uint32_t kuNbGet4PerFee
Definition: CbmMcbm2018TofPar.h:100
CbmMcbm2018TofPar::GetNrOfGet4PerFee
Int_t GetNrOfGet4PerFee()
Definition: CbmMcbm2018TofPar.h:69
CbmMcbm2018TofPar::fiRpcType
TArrayI fiRpcType
Definition: CbmMcbm2018TofPar.h:165
CbmMcbm2018TofPar::kuPaditoget4
const UInt_t kuPaditoget4[kuNbChannelsPerFee]
Map from GET4 channel to PADI channel.
Definition: CbmMcbm2018TofPar.h:120
CbmMcbm2018TofPar::GetNrOfFeesPerGdpb
Int_t GetNrOfFeesPerGdpb()
Definition: CbmMcbm2018TofPar.h:68
CbmMcbm2018TofPar::kuElinkToGet4
const UInt_t kuElinkToGet4[kuNbGet4PerGbtx]
Map from PADI channel to GET4 channel.
Definition: CbmMcbm2018TofPar.h:124
CbmMcbm2018TofPar::GetPadiThresholdVal
Double_t GetPadiThresholdVal(UInt_t uCode)
Definition: CbmMcbm2018TofPar.cxx:201