CbmRoot
Loading...
Searching...
No Matches
CbmCosy2019HodoPar.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// ----- CbmCosy2019HodoPar header file -----
7// ----- Created 31/07/19 by P.-A. Loizeau -----
8// -------------------------------------------------------------------------
9
10#ifndef CBMCOSY2019HODOPAR_H
11#define CBMCOSY2019HODOPAR_H
12
13#include "FairParGenericSet.h"
14
15#include "TArrayD.h"
16#include "TArrayI.h"
17
18class FairParIo;
19class FairParamList;
20
21
22class CbmCosy2019HodoPar : public FairParGenericSet {
23
24public:
26 CbmCosy2019HodoPar(const char* name = "CbmCosy2019HodoPar", const char* title = "Much parameters",
27 const char* context = "Default");
28
29
31 virtual ~CbmCosy2019HodoPar();
32
34 virtual void clear();
35
36 void putParams(FairParamList*);
37 Bool_t getParams(FairParamList*);
38
39 static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; }
40 static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; }
41 static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; }
42 static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; }
43 static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; }
44 static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; }
45 static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); }
46 static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; }
47 static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; }
48
49 Int_t ElinkIdxToFebIdx(UInt_t uElink);
50 UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); }
51
52 UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink);
53
54 UInt_t ChannelToFiber(UInt_t uChan);
55 UInt_t ChannelToPixel(UInt_t uChan);
56 UInt_t ChannelToAxis(UInt_t uChan);
57
58 UInt_t GetNbOfModules() { return fuNbModules; }
59 Bool_t CheckModuleIndex(UInt_t uModuleIdx);
60 UInt_t GetModuleAddress(UInt_t uModuleIdx);
61 Double_t GetModuleCenterPosX(UInt_t uModuleIdx);
62 Double_t GetModuleCenterPosY(UInt_t uModuleIdx);
63 Bool_t GetModuleSwapXY(UInt_t uModuleIdx);
64 Bool_t GetModuleInvertX(UInt_t uModuleIdx);
65 Bool_t GetModuleInvertY(UInt_t uModuleIdx);
66
67 UInt_t GetNrOfDpbs() { return fuNrOfDpbs; }
68 UInt_t GetDpbId(UInt_t uDpbIdx);
70 UInt_t GetNrOfFebs() { return GetNrOfCrobs() * kuNbFebsPerCrob; }
71 UInt_t GetNrOfAsics() { return GetNrOfFebs() * kuNbAsicsPerFeb; }
72
73 Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx);
74 Bool_t IsFebActive(UInt_t uFebInSystIdx);
75 Bool_t IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
76 Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
77 Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
78 Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
79 Double_t GetFebAdcBase(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
80 Double_t GetFebAdcThrGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
81 Int_t GetFebAdcThrOffs(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
82
83 UInt_t GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan);
84
85private:
87 static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB
88 static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ?
89 static const UInt_t kuNbFebsPerCrob = 6; // Number of FEBs connected to each CROB for mMuch 2019
90 static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH
91 static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC
92 static const UInt_t kuNbFiberPerAxis = 64; // Number of Fibers per Hodo axis
93 const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
94 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
95 0x0002, 0x0002, 0x0002, 0x0002, 0x0003,
96 0x0003, 0x0003, 0x0003, 0x0003, 0x0004,
97 0x0004, 0x0004, 0x0004, 0x0004, 0x0005,
98 0x0005, 0x0005, 0x0005, 0x0003, 0x0003,
99 0x0003, 0x0003, 0x0003, 0x0004, 0x0004,
100 0x0004, 0x0004, 0x0004, 0x0005, 0x0005,
101 0x0005, 0x0005};
102 // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = {
104 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4,
105 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8};
107 0, 32, 16, 48, 15, 47, 31, 63, 1, 33, 17, 49, 14, 46, 30, 62,
108 2, 34, 18, 50, 13, 45, 29, 61, 3, 35, 19, 51, 12, 44, 28, 60,
109 4, 36, 20, 52, 11, 43, 27, 59, 5, 37, 21, 53, 10, 42, 26, 58,
110 6, 38, 22, 54, 9, 41, 25, 57, 7, 39, 23, 55, 8, 40, 24, 56,
111 0, 32, 16, 48, 15, 47, 31, 63, 1, 33, 17, 49, 14, 46, 30, 62,
112 2, 34, 18, 50, 13, 45, 29, 61, 3, 35, 19, 51, 12, 44, 28, 60,
113 4, 36, 20, 52, 11, 43, 27, 59, 5, 37, 21, 53, 10, 42, 26, 58,
114 6, 38, 22, 54, 9, 41, 25, 57, 7, 39, 23, 55, 8, 40, 24, 56
115*/
116 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62,
117 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12,
118 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42,
119 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, 39, 7, 55, 23,
120 40, 8, 56, 24, 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49,
121 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3,
122 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37,
123 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25,
124 39, 7, 55, 23, 40, 8, 56, 24};
125 const UInt_t kuChannelToPixelMap[kuNbChanPerAsic] = {1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12,
126 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30,
127 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42,
128 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, 57, 61, 59, 63,
129 58, 62, 60, 64, 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11,
130 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29,
131 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41,
132 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56,
133 57, 61, 59, 63, 58, 62, 60, 64};
135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
137 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
138 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
139
141 UInt_t fuNbModules; // Total number of STS modules in the setup
142 TArrayI fiModAddress; // STS address for the first strip of each module
143 TArrayD fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!)
144 TArrayD fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!)
145 TArrayI fiModSwapXY; // Flag telling for each module if the X and Y axis should be swapped
146 TArrayI fiModInvertX; // Flag telling for each module if the X axis should be inverted
147 TArrayI fiModInvertY; // Flag telling for each module if the Y axis should be inverted
148
149 UInt_t fuNrOfDpbs; // Total number of STS DPBs in system
150 TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all STS DPBs
151 TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ]
152 TArrayI
153 fiFebModuleIdx; // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], -1 if inactive
154 TArrayD fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
155 TArrayD fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
156 TArrayD fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
157 TArrayI
158 fiFebAdcThrOffs; // Thr. offset in Units vs Cal. Thr. for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
159
161};
162#endif // CBMCOSY2019HODOPAR_H
UInt_t GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan)
static constexpr UInt_t GetNbCrobsPerDpb()
UInt_t fuNbModules
Map from channel index to Hodoscope Axis (X or Y)
Int_t ElinkIdxToFebIdx(UInt_t uElink)
Double_t GetFebAdcBase(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr UInt_t GetNbElinkPerCrob()
void putParams(FairParamList *)
Int_t GetFebAdcThrOffs(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr UInt_t GetNbAsicsPerFeb()
Bool_t GetModuleSwapXY(UInt_t uModuleIdx)
static constexpr UInt_t GetNbChanPerFeb()
UInt_t GetModuleAddress(UInt_t uModuleIdx)
const UInt_t kuChannelToPlaneMap[kuNbChanPerAsic]
Map from channel index to PMT pixel.
CbmCosy2019HodoPar(const char *name="CbmCosy2019HodoPar", const char *title="Much parameters", const char *context="Default")
static const UInt_t kuNbCrobsPerDpb
Constants.
static constexpr UInt_t GetNbFebsPerCrob()
Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
UInt_t ChannelToPixel(UInt_t uChan)
static constexpr UInt_t GetNbAsicsPerCrob()
Bool_t CheckModuleIndex(UInt_t uModuleIdx)
const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob]
Bool_t getParams(FairParamList *)
static const UInt_t kuNbAsicsPerFeb
static const UInt_t kuNbFiberPerAxis
Bool_t IsFebActive(UInt_t uFebInSystIdx)
Double_t GetModuleCenterPosX(UInt_t uModuleIdx)
UInt_t ChannelToAxis(UInt_t uChan)
const UInt_t kuChannelToFiberMap[kuNbChanPerAsic]
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
Bool_t GetModuleInvertY(UInt_t uModuleIdx)
UInt_t GetDpbId(UInt_t uDpbIdx)
static const UInt_t kuNbFebsPerCrob
Double_t GetModuleCenterPosY(UInt_t uModuleIdx)
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
static const UInt_t kuNbElinksPerCrob
static const UInt_t kuNbChanPerAsic
UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink)
UInt_t ElinkIdxToAsicIdx(UInt_t uElink)
Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr UInt_t GetNbAsicsPerDpb()
UInt_t ChannelToFiber(UInt_t uChan)
static constexpr UInt_t GetNbFebsPerDpb()
const UInt_t kuChannelToPixelMap[kuNbChanPerAsic]
Map from channel index to Hodoscope Fiber.
static constexpr UInt_t GetNbChanPerAsic()
const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob]
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
Bool_t GetModuleInvertX(UInt_t uModuleIdx)
Double_t GetFebAdcThrGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
ClassDef(CbmCosy2019HodoPar, 1)