CbmRoot
Loading...
Searching...
No Matches
CbmStar2019TofPar.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2019 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmStar2019TofPar header file -----
7// ----- Created 09/09/18 by P.-A. Loizeau -----
8// -------------------------------------------------------------------------
9
10#ifndef CBMSTAR2019TOFPAR_H
11#define CBMSTAR2019TOFPAR_H
12
13#include "FairParGenericSet.h"
14
15#include "TArrayD.h"
16#include "TArrayI.h"
17
18class FairParIo;
19class FairParamList;
20
21
22class CbmStar2019TofPar : public FairParGenericSet {
23
24public:
26 CbmStar2019TofPar(const char* name = "CbmStar2019TofPar", const char* title = "Tof unpacker parameters",
27 const char* context = "Default");
28
29
31 virtual ~CbmStar2019TofPar();
32
34 virtual void clear();
35
36 void putParams(FairParamList*);
37 Bool_t getParams(FairParamList*);
38
39 static constexpr UInt_t GetNbByteMessage() { return kuBytesPerMessage; }
40
41 inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; }
42 inline Int_t GetGdpbId(Int_t i) { return fiGdpbIdArray[i]; }
43 /*
44 inline Int_t GetNrOfFeesPerGdpb() { return fiNrOfFeesPerGdpb; }
45 inline Int_t GetNrOfGet4PerFee() {return fiNrOfGet4PerFee;}
46 inline Int_t GetNrOfChannelsPerGet4() {return fiNrOfChannelsPerGet4;}
47 */
48 static constexpr UInt_t GetNrOfChannelsPerGet4() { return kuNbChannelsPerGet4; }
49 static constexpr UInt_t GetNrOfGet4PerFee() { return kuNbGet4PerFee; }
50 static constexpr UInt_t GetNrOfFeePerGbtx() { return kuNbFeePerGbtx; }
51 static constexpr UInt_t GetNrOfGbtxPerGdpb() { return kuNbGbtxPerGdpb; }
52 static constexpr UInt_t GetNrOfChannelsPerFee() { return kuNbChannelsPerFee; }
53 static constexpr UInt_t GetNrOfChannelsPerGbtx() { return kuNbChannelsPerGbtx; }
54 static constexpr UInt_t GetNrOfChannelsPerGdpb() { return kuNbChannelsPerGdpb; }
55 static constexpr UInt_t GetNrOfGet4PerGbtx() { return kuNbGet4PerGbtx; }
56 static constexpr UInt_t GetNrOfGet4PerGdpb() { return kuNbGet4PerGdpb; }
57 static constexpr UInt_t GetNrOfFeePerGdpb() { return kuNbFeePerGdpb; }
58
60
61 Int_t Get4ChanToPadiChan(UInt_t uChannelInFee);
62 Int_t PadiChanToGet4Chan(UInt_t uChannelInFee);
63
64 Int_t ElinkIdxToGet4Idx(UInt_t uElink);
65 Int_t Get4IdxToElinkIdx(UInt_t uGet4);
66
67 static constexpr UInt_t GetGdpbToSectorOffset() { return kuGdpbToSectorOffset; }
68
69 static constexpr UInt_t GetNrOfPadiThrCodes() { return kuNbPadiThrCodes; }
70 Double_t GetPadiThresholdVal(UInt_t uCode);
71
72 inline Bool_t GetMonitorMode() { return (1 == fiMonitorMode ? kTRUE : kFALSE); }
73 inline Bool_t GetDebugMonitorMode() { return (1 == fiDebugMonitorMode ? kTRUE : kFALSE); }
74
75 inline Int_t GetNrOfGbtx() { return fiNrOfGbtx; }
76 inline Int_t GetNrOfModules() { return fiNrOfModule; }
77 Int_t GetNrOfRpc(UInt_t uGbtx);
78 Int_t GetRpcType(UInt_t uGbtx);
79 Int_t GetRpcSide(UInt_t uGbtx);
80 Int_t GetModuleId(UInt_t uGbtx);
81
82 inline Double_t GetSizeMsInNs() { return fdSizeMsInNs; }
83
85 Double_t GetStarTriggDeadtime(UInt_t uGdpb);
86 Double_t GetStarTriggDelay(UInt_t uGdpb);
87 Double_t GetStarTriggWinSize(UInt_t uGdpb);
88
89private:
92 static const uint32_t kuBytesPerMessage = 8;
94 static const uint32_t kuNbChannelsPerGet4 = 4;
95 static const uint32_t kuNbGet4PerFee = 8;
96 static const uint32_t kuNbFeePerGbtx = 5;
97 static const uint32_t kuNbGbtxPerGdpb = 6;
105 /*
106 const UInt_t kuGet4topadi[ kuNbChannelsPerFee ] = { // provided by Jochen
107 4, 3, 2, 1,
108 24, 23, 22, 21,
109 8, 7, 6, 5,
110 28, 27, 26, 25,
111 12, 11, 10, 9,
112 32, 31, 30, 29,
113 16, 15, 14, 13,
114 20, 19, 18, 17
115 }; //! Map from GET4 channel to PADI channel
116*/
118 // provided by Jochen
119 4, 3, 2, 1, // provided by Jochen
120 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19,
121 18, 17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29};
122
124 // provided by Jochen
125 4, 3, 2, 1, 12, 11, 10, 9, 20, 19, 18, 17, 28, 27, 26, 25,
126 32, 31, 30, 29, 8, 7, 6, 5, 16, 15, 14, 13, 24, 23, 22, 21};
127 const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
128 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
129 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
130 const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
131 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
132 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
134 static const uint32_t kuGdpbToSectorOffset = 13;
135
137 static const uint32_t kuNbPadiThrCodes = 1024; // 0x3FF + 1
138 static const uint32_t kuNbThrMeasPoints = 65;
140 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, 0x0B0, 0x0C0,
141 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190,
142 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200, 0x210, 0x220, 0x230, 0x240, 0x250, 0x260,
143 0x270, 0x280, 0x290, 0x2A0, 0x2B0, 0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330,
144 0x340, 0x350, 0x360, 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF};
145 const Double_t kdThrMeasVal[kuNbThrMeasPoints] = {
146 -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,
147 -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,
148 -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,
149 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,
150 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};
151 std::vector<Double_t> fvdPadiThrCodeToValue;
152
154 Int_t fiMonitorMode; // Enable histograms in event builder processes and algo, 0 = OFF / 1 = ON
155 Int_t
156 fiDebugMonitorMode; // Enable extra debuging histos in bth event builder and monitor processes and algo, 0 = OFF / 1 = ON
157 Int_t fiNrOfGdpb; // Total number of GDPBs
158 TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Tof GDPBs
159 Int_t fiNrOfGbtx; // Total number of Gbtx links
160 Int_t fiNrOfModule; // Total number of Modules
161 TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5
162 TArrayI fiRpcType; // type of Rpcs connected to Gbtx link
163 TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1
164 TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry
165
166 Double_t fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection
167
168 Double_t
169 fdStarTriggAllowedSpread; // Allowed "Jitter" of the triggers in different gDPB relative to each other, used to give a bit of flexibility on TS edges
170 TArrayD fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns
171 TArrayD
172 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
173 TArrayD fdStarTriggerWinSize; // STAR: Array to hold for each gDPB the Size of the trigger window in ns
174
176};
177#endif // CBMSTAR2019TOFPAR_H
Int_t GetRpcType(UInt_t uGbtx)
static constexpr UInt_t GetNrOfChannelsPerFee()
static constexpr UInt_t GetNrOfGet4PerGdpb()
static const uint32_t kuNbChannelsPerFee
static constexpr UInt_t GetNrOfFeePerGdpb()
const UInt_t kuGet4topadi[kuNbChannelsPerFee]
Mapping in Readout chain PCBs.
Int_t GetModuleId(UInt_t uGbtx)
static const uint32_t kuNbGet4PerGdpb
Int_t GetNrOfRpc(UInt_t uGbtx)
Bool_t getParams(FairParamList *)
static const uint32_t kuNbGet4PerGbtx
void putParams(FairParamList *)
Double_t GetStarTriggDeadtime(UInt_t uGdpb)
static constexpr UInt_t GetNrOfGet4PerGbtx()
CbmStar2019TofPar(const char *name="CbmStar2019TofPar", const char *title="Tof unpacker parameters", const char *context="Default")
static const uint32_t kuNbChannelsPerGdpb
static constexpr UInt_t GetNrOfGbtxPerGdpb()
Int_t GetGdpbId(Int_t i)
static const uint32_t kuNbFeePerGbtx
static const uint32_t kuNbGbtxPerGdpb
Double_t GetStarTriggWinSize(UInt_t uGdpb)
static const uint32_t kuGdpbToSectorOffset
Mapping in STAR.
static constexpr UInt_t GetNbByteMessage()
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
Int_t fiMonitorMode
Variables.
const UInt_t kuGet4ToElink[kuNbGet4PerGbtx]
Int_t PadiChanToGet4Chan(UInt_t uChannelInFee)
static const uint32_t kuNbPadiThrCodes
PADI threshold measures and extrapolated code to value map.
static constexpr UInt_t GetNrOfChannelsPerGdpb()
static const uint32_t kuNbGet4PerFee
ClassDef(CbmStar2019TofPar, 1)
static constexpr UInt_t GetGdpbToSectorOffset()
const UInt_t kuPaditoget4[kuNbChannelsPerFee]
Map from GET4 channel to PADI channel.
const Double_t kdThrMeasVal[kuNbThrMeasPoints]
Double_t GetStarTriggAllowedSpread()
static const uint32_t kuNbThrMeasPoints
Int_t Get4IdxToElinkIdx(UInt_t uGet4)
static const uint32_t kuNbChannelsPerGet4
Readout chain.
static const uint32_t kuBytesPerMessage
const UInt_t kuElinkToGet4[kuNbGet4PerGbtx]
Map from PADI channel to GET4 channel.
static constexpr UInt_t GetNrOfChannelsPerGbtx()
Int_t Get4ChanToPadiChan(UInt_t uChannelInFee)
static constexpr UInt_t GetNrOfFeePerGbtx()
Double_t fdStarTriggAllowedSpread
static constexpr UInt_t GetNrOfChannelsPerGet4()
static const uint32_t kuNbChannelsPerGbtx
static constexpr UInt_t GetNrOfPadiThrCodes()
static const uint32_t kuNbFeePerGdpb
static constexpr UInt_t GetNrOfGet4PerFee()
Int_t GetRpcSide(UInt_t uGbtx)
Double_t GetPadiThresholdVal(UInt_t uCode)
const UInt_t kuThrMeasCode[kuNbThrMeasPoints]
Double_t GetStarTriggDelay(UInt_t uGdpb)
std::vector< Double_t > fvdPadiThrCodeToValue