CbmRoot
CbmStar2019TofPar.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmStar2019TofPar header file -----
3 // ----- Created 09/09/18 by P.-A. Loizeau -----
4 // -------------------------------------------------------------------------
5 
6 #ifndef CBMSTAR2019TOFPAR_H
7 #define CBMSTAR2019TOFPAR_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 CbmStar2019TofPar : public FairParGenericSet {
19 
20 public:
22  CbmStar2019TofPar(const char* name = "CbmStar2019TofPar",
23  const char* title = "Tof unpacker parameters",
24  const char* context = "Default");
25 
26 
28  virtual ~CbmStar2019TofPar();
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  inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; }
39  inline Int_t GetGdpbId(Int_t i) { return fiGdpbIdArray[i]; }
40  /*
41  inline Int_t GetNrOfFeesPerGdpb() { return fiNrOfFeesPerGdpb; }
42  inline Int_t GetNrOfGet4PerFee() {return fiNrOfGet4PerFee;}
43  inline Int_t GetNrOfChannelsPerGet4() {return fiNrOfChannelsPerGet4;}
44  */
45  static constexpr UInt_t GetNrOfChannelsPerGet4() {
46  return kuNbChannelsPerGet4;
47  }
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 
62  inline UInt_t GetNumberOfChannels() {
64  }
65 
66  Int_t Get4ChanToPadiChan(UInt_t uChannelInFee);
67  Int_t PadiChanToGet4Chan(UInt_t uChannelInFee);
68 
69  Int_t ElinkIdxToGet4Idx(UInt_t uElink);
70  Int_t Get4IdxToElinkIdx(UInt_t uGet4);
71 
72  static constexpr UInt_t GetGdpbToSectorOffset() {
73  return kuGdpbToSectorOffset;
74  }
75 
76  static constexpr UInt_t GetNrOfPadiThrCodes() { return kuNbPadiThrCodes; }
77  Double_t GetPadiThresholdVal(UInt_t uCode);
78 
79  inline Bool_t GetMonitorMode() {
80  return (1 == fiMonitorMode ? kTRUE : kFALSE);
81  }
82  inline Bool_t GetDebugMonitorMode() {
83  return (1 == fiDebugMonitorMode ? kTRUE : kFALSE);
84  }
85 
86  inline Int_t GetNrOfGbtx() { return fiNrOfGbtx; }
87  inline Int_t GetNrOfModules() { return fiNrOfModule; }
88  Int_t GetNrOfRpc(UInt_t uGbtx);
89  Int_t GetRpcType(UInt_t uGbtx);
90  Int_t GetRpcSide(UInt_t uGbtx);
91  Int_t GetModuleId(UInt_t uGbtx);
92 
93  inline Double_t GetSizeMsInNs() { return fdSizeMsInNs; }
94 
95  inline Double_t GetStarTriggAllowedSpread() {
97  }
98  Double_t GetStarTriggDeadtime(UInt_t uGdpb);
99  Double_t GetStarTriggDelay(UInt_t uGdpb);
100  Double_t GetStarTriggWinSize(UInt_t uGdpb);
101 
102 private:
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;
111  static const uint32_t kuNbChannelsPerFee =
113  static const uint32_t kuNbChannelsPerGbtx =
115  static const uint32_t kuNbChannelsPerGdpb =
117  static const uint32_t kuNbGet4PerGbtx = kuNbGet4PerFee * kuNbFeePerGbtx;
119  static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb;
121  /*
122  const UInt_t kuGet4topadi[ kuNbChannelsPerFee ] = { // provided by Jochen
123  4, 3, 2, 1,
124  24, 23, 22, 21,
125  8, 7, 6, 5,
126  28, 27, 26, 25,
127  12, 11, 10, 9,
128  32, 31, 30, 29,
129  16, 15, 14, 13,
130  20, 19, 18, 17
131  }; //! Map from GET4 channel to PADI channel
132 */
134  // provided by Jochen
135  4, 3, 2, 1, // provided by Jochen
136  8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19, 18,
137  17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29};
138 
139  const UInt_t
140  kuPaditoget4[kuNbChannelsPerFee] = {// provided by Jochen
141  4, 3, 2, 1, 12, 11, 10, 9, 20,
142  19, 18, 17, 28, 27, 26, 25, 32, 31,
143  30, 29, 8, 7, 6, 5, 16, 15, 14,
144  13, 24, 23, 22, 21};
145  const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {
146  27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
147  10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
148  18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
149  const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {
150  24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
151  13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
152  30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
154  static const uint32_t kuGdpbToSectorOffset = 13;
155 
157  static const uint32_t kuNbPadiThrCodes = 1024; // 0x3FF + 1
158  static const uint32_t kuNbThrMeasPoints = 65;
160  0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0,
161  0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150,
162  0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200,
163  0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x270, 0x280, 0x290, 0x2A0, 0x2B0,
164  0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360,
165  0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF};
166  const Double_t kdThrMeasVal[kuNbThrMeasPoints] = {
167  -652.6, -631.2, -611.4, -590.6, -570.9, -550.0, -529.9, -509.4, -490.6,
168  -469.5, -449.3, -428.5, -408.5, -388.2, -367.8, -347.2, -329.2, -308.2,
169  -287.5, -266.8, -246.9, -226.0, -205.6, -185.0, -165.7, -144.9, -124.4,
170  -103.8, -83.4, -62.9, -42.4, -21.2, -5.3, 15.5, 36.2, 56.8,
171  77.3, 97.8, 118.4, 139.1, 158.7, 179.2, 199.7, 220.2, 240.8,
172  261.1, 281.7, 302.2, 321.3, 341.4, 362.0, 382.2, 402.9, 422.8,
173  443.4, 463.7, 483.7, 503.7, 524.1, 544.3, 565.0, 585.0, 605.5,
174  626.0, 646.1};
175  std::vector<Double_t> fvdPadiThrCodeToValue;
176 
178  Int_t
179  fiMonitorMode; // Enable histograms in event builder processes and algo, 0 = OFF / 1 = ON
180  Int_t
181  fiDebugMonitorMode; // Enable extra debuging histos in bth event builder and monitor processes and algo, 0 = OFF / 1 = ON
182  Int_t fiNrOfGdpb; // Total number of GDPBs
183  TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Tof GDPBs
184  Int_t fiNrOfGbtx; // Total number of Gbtx links
185  Int_t fiNrOfModule; // Total number of Modules
186  TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
187  TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
188  TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
189  TArrayI
190  fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
191 
192  Double_t
193  fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection
194 
195  Double_t
196  fdStarTriggAllowedSpread; // Allowed "Jitter" of the triggers in different gDPB relative to each other, used to give a bit of flexibility on TS edges
197  TArrayD
198  fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns
199  TArrayD
200  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
201  TArrayD
202  fdStarTriggerWinSize; // STAR: Array to hold for each gDPB the Size of the trigger window in ns
203 
205 };
206 #endif // CBMSTAR2019TOFPAR_H
CbmStar2019TofPar::GetNrOfGet4PerGdpb
static constexpr UInt_t GetNrOfGet4PerGdpb()
Definition: CbmStar2019TofPar.h:59
CbmStar2019TofPar::GetNrOfRpc
Int_t GetNrOfRpc(UInt_t uGbtx)
Definition: CbmStar2019TofPar.cxx:207
CbmStar2019TofPar::kuNbChannelsPerGbtx
static const uint32_t kuNbChannelsPerGbtx
Definition: CbmStar2019TofPar.h:113
CbmStar2019TofPar::kuNbFeePerGbtx
static const uint32_t kuNbFeePerGbtx
Definition: CbmStar2019TofPar.h:109
CbmStar2019TofPar::putParams
void putParams(FairParamList *)
Definition: CbmStar2019TofPar.cxx:76
CbmStar2019TofPar::fvdPadiThrCodeToValue
std::vector< Double_t > fvdPadiThrCodeToValue
Definition: CbmStar2019TofPar.h:175
CbmStar2019TofPar::GetNumberOfChannels
UInt_t GetNumberOfChannels()
Definition: CbmStar2019TofPar.h:62
CbmStar2019TofPar::CbmStar2019TofPar
CbmStar2019TofPar(const char *name="CbmStar2019TofPar", const char *title="Tof unpacker parameters", const char *context="Default")
Definition: CbmStar2019TofPar.cxx:18
CbmStar2019TofPar::GetNrOfChannelsPerGdpb
static constexpr UInt_t GetNrOfChannelsPerGdpb()
Definition: CbmStar2019TofPar.h:55
CbmStar2019TofPar::GetStarTriggAllowedSpread
Double_t GetStarTriggAllowedSpread()
Definition: CbmStar2019TofPar.h:95
CbmStar2019TofPar::GetNrOfChannelsPerGet4
static constexpr UInt_t GetNrOfChannelsPerGet4()
Definition: CbmStar2019TofPar.h:45
CbmStar2019TofPar::fdStarTriggerWinSize
TArrayD fdStarTriggerWinSize
Definition: CbmStar2019TofPar.h:202
CbmStar2019TofPar::GetNbByteMessage
static constexpr UInt_t GetNbByteMessage()
Definition: CbmStar2019TofPar.h:36
CbmStar2019TofPar::fiRpcType
TArrayI fiRpcType
Definition: CbmStar2019TofPar.h:187
CbmStar2019TofPar::getParams
Bool_t getParams(FairParamList *)
Definition: CbmStar2019TofPar.cxx:97
CbmStar2019TofPar::GetNrOfGbtx
Int_t GetNrOfGbtx()
Definition: CbmStar2019TofPar.h:86
CbmStar2019TofPar::GetNrOfFeePerGbtx
static constexpr UInt_t GetNrOfFeePerGbtx()
Definition: CbmStar2019TofPar.h:49
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmStar2019TofPar::GetNrOfPadiThrCodes
static constexpr UInt_t GetNrOfPadiThrCodes()
Definition: CbmStar2019TofPar.h:76
CbmStar2019TofPar::kuBytesPerMessage
static const uint32_t kuBytesPerMessage
Definition: CbmStar2019TofPar.h:105
CbmStar2019TofPar::GetNrOfChannelsPerFee
static constexpr UInt_t GetNrOfChannelsPerFee()
Definition: CbmStar2019TofPar.h:51
CbmStar2019TofPar::kuNbGbtxPerGdpb
static const uint32_t kuNbGbtxPerGdpb
Definition: CbmStar2019TofPar.h:110
CbmStar2019TofPar::kuNbPadiThrCodes
static const uint32_t kuNbPadiThrCodes
PADI threshold measures and extrapolated code to value map.
Definition: CbmStar2019TofPar.h:157
CbmStar2019TofPar::kuNbGet4PerFee
static const uint32_t kuNbGet4PerFee
Definition: CbmStar2019TofPar.h:108
CbmStar2019TofPar::kuNbChannelsPerFee
static const uint32_t kuNbChannelsPerFee
Definition: CbmStar2019TofPar.h:111
CbmStar2019TofPar::GetGdpbId
Int_t GetGdpbId(Int_t i)
Definition: CbmStar2019TofPar.h:39
CbmStar2019TofPar::clear
virtual void clear()
Definition: CbmStar2019TofPar.cxx:68
CbmStar2019TofPar::PadiChanToGet4Chan
Int_t PadiChanToGet4Chan(UInt_t uChannelInFee)
Definition: CbmStar2019TofPar.cxx:157
CbmStar2019TofPar::kuNbChannelsPerGet4
static const uint32_t kuNbChannelsPerGet4
Readout chain.
Definition: CbmStar2019TofPar.h:107
CbmStar2019TofPar::fiNrOfGbtx
Int_t fiNrOfGbtx
Definition: CbmStar2019TofPar.h:184
CbmStar2019TofPar::ElinkIdxToGet4Idx
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
Definition: CbmStar2019TofPar.cxx:169
CbmStar2019TofPar::GetNrOfModules
Int_t GetNrOfModules()
Definition: CbmStar2019TofPar.h:87
CbmStar2019TofPar::fiNrOfModule
Int_t fiNrOfModule
Definition: CbmStar2019TofPar.h:185
CbmStar2019TofPar::kuNbThrMeasPoints
static const uint32_t kuNbThrMeasPoints
Definition: CbmStar2019TofPar.h:158
CbmStar2019TofPar::GetMonitorMode
Bool_t GetMonitorMode()
Definition: CbmStar2019TofPar.h:79
CbmStar2019TofPar::Get4ChanToPadiChan
Int_t Get4ChanToPadiChan(UInt_t uChannelInFee)
Definition: CbmStar2019TofPar.cxx:146
CbmStar2019TofPar::kuElinkToGet4
const UInt_t kuElinkToGet4[kuNbGet4PerGbtx]
Map from PADI channel to GET4 channel.
Definition: CbmStar2019TofPar.h:145
CbmStar2019TofPar::GetStarTriggDelay
Double_t GetStarTriggDelay(UInt_t uGdpb)
Definition: CbmStar2019TofPar.cxx:259
CbmStar2019TofPar::~CbmStar2019TofPar
virtual ~CbmStar2019TofPar()
Definition: CbmStar2019TofPar.cxx:63
CbmStar2019TofPar::Get4IdxToElinkIdx
Int_t Get4IdxToElinkIdx(UInt_t uGet4)
Definition: CbmStar2019TofPar.cxx:182
CbmStar2019TofPar::GetModuleId
Int_t GetModuleId(UInt_t uGbtx)
Definition: CbmStar2019TofPar.cxx:237
CbmStar2019TofPar::fdStarTriggAllowedSpread
Double_t fdStarTriggAllowedSpread
Definition: CbmStar2019TofPar.h:196
CbmStar2019TofPar::GetNrOfGet4PerFee
static constexpr UInt_t GetNrOfGet4PerFee()
Definition: CbmStar2019TofPar.h:48
CbmStar2019TofPar::fiNrOfRpc
TArrayI fiNrOfRpc
Definition: CbmStar2019TofPar.h:186
CbmStar2019TofPar::GetStarTriggWinSize
Double_t GetStarTriggWinSize(UInt_t uGdpb)
Definition: CbmStar2019TofPar.cxx:269
CbmStar2019TofPar::kuNbGet4PerGdpb
static const uint32_t kuNbGet4PerGdpb
Definition: CbmStar2019TofPar.h:118
CbmStar2019TofPar::GetNrOfChannelsPerGbtx
static constexpr UInt_t GetNrOfChannelsPerGbtx()
Definition: CbmStar2019TofPar.h:52
CbmStar2019TofPar::kuNbChannelsPerGdpb
static const uint32_t kuNbChannelsPerGdpb
Definition: CbmStar2019TofPar.h:115
CbmStar2019TofPar::GetRpcType
Int_t GetRpcType(UInt_t uGbtx)
Definition: CbmStar2019TofPar.cxx:217
CbmStar2019TofPar
Definition: CbmStar2019TofPar.h:18
CbmStar2019TofPar::ClassDef
ClassDef(CbmStar2019TofPar, 1)
CbmStar2019TofPar::kuGet4topadi
const UInt_t kuGet4topadi[kuNbChannelsPerFee]
Mapping in Readout chain PCBs.
Definition: CbmStar2019TofPar.h:133
CbmStar2019TofPar::fiNrOfGdpb
Int_t fiNrOfGdpb
Definition: CbmStar2019TofPar.h:182
CbmStar2019TofPar::GetNrOfGdpbs
Int_t GetNrOfGdpbs()
Definition: CbmStar2019TofPar.h:38
CbmStar2019TofPar::kuNbFeePerGdpb
static const uint32_t kuNbFeePerGdpb
Definition: CbmStar2019TofPar.h:119
CbmStar2019TofPar::kuGdpbToSectorOffset
static const uint32_t kuGdpbToSectorOffset
Mapping in STAR.
Definition: CbmStar2019TofPar.h:154
CbmStar2019TofPar::fiDebugMonitorMode
Int_t fiDebugMonitorMode
Definition: CbmStar2019TofPar.h:181
CbmStar2019TofPar::GetNrOfGbtxPerGdpb
static constexpr UInt_t GetNrOfGbtxPerGdpb()
Definition: CbmStar2019TofPar.h:50
CbmStar2019TofPar::kuPaditoget4
const UInt_t kuPaditoget4[kuNbChannelsPerFee]
Map from GET4 channel to PADI channel.
Definition: CbmStar2019TofPar.h:140
CbmStar2019TofPar::fiGdpbIdArray
TArrayI fiGdpbIdArray
Definition: CbmStar2019TofPar.h:183
CbmStar2019TofPar::fiModuleId
TArrayI fiModuleId
Definition: CbmStar2019TofPar.h:190
CbmStar2019TofPar::kuThrMeasCode
const UInt_t kuThrMeasCode[kuNbThrMeasPoints]
Definition: CbmStar2019TofPar.h:159
CbmStar2019TofPar::kuNbGet4PerGbtx
static const uint32_t kuNbGet4PerGbtx
Definition: CbmStar2019TofPar.h:117
CbmStar2019TofPar::GetStarTriggDeadtime
Double_t GetStarTriggDeadtime(UInt_t uGdpb)
Definition: CbmStar2019TofPar.cxx:248
CbmStar2019TofPar::GetDebugMonitorMode
Bool_t GetDebugMonitorMode()
Definition: CbmStar2019TofPar.h:82
CbmStar2019TofPar::kuGet4ToElink
const UInt_t kuGet4ToElink[kuNbGet4PerGbtx]
Definition: CbmStar2019TofPar.h:149
CbmStar2019TofPar::fdSizeMsInNs
Double_t fdSizeMsInNs
Definition: CbmStar2019TofPar.h:193
CbmStar2019TofPar::kdThrMeasVal
const Double_t kdThrMeasVal[kuNbThrMeasPoints]
Definition: CbmStar2019TofPar.h:166
CbmStar2019TofPar::GetGdpbToSectorOffset
static constexpr UInt_t GetGdpbToSectorOffset()
Definition: CbmStar2019TofPar.h:72
CbmStar2019TofPar::GetSizeMsInNs
Double_t GetSizeMsInNs()
Definition: CbmStar2019TofPar.h:93
CbmStar2019TofPar::GetPadiThresholdVal
Double_t GetPadiThresholdVal(UInt_t uCode)
Definition: CbmStar2019TofPar.cxx:196
CbmStar2019TofPar::GetNrOfFeePerGdpb
static constexpr UInt_t GetNrOfFeePerGdpb()
Definition: CbmStar2019TofPar.h:60
CbmStar2019TofPar::GetRpcSide
Int_t GetRpcSide(UInt_t uGbtx)
Definition: CbmStar2019TofPar.cxx:227
CbmStar2019TofPar::fiMonitorMode
Int_t fiMonitorMode
Variables.
Definition: CbmStar2019TofPar.h:179
CbmStar2019TofPar::fdStarTriggerDelay
TArrayD fdStarTriggerDelay
Definition: CbmStar2019TofPar.h:200
CbmStar2019TofPar::fdStarTriggerDeadtime
TArrayD fdStarTriggerDeadtime
Definition: CbmStar2019TofPar.h:198
CbmStar2019TofPar::fiRpcSide
TArrayI fiRpcSide
Definition: CbmStar2019TofPar.h:188
CbmStar2019TofPar::GetNrOfGet4PerGbtx
static constexpr UInt_t GetNrOfGet4PerGbtx()
Definition: CbmStar2019TofPar.h:58