CbmRoot
Loading...
Searching...
No Matches
CbmMuchUnpackPar.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// ----- CbmMuchUnpackPar header file -----
7// ----- Created 22/02/22 by P.-A. Loizeau -----
8// ----- Modified 07/12/18 by A Kumar -----
9// ----- Modified 07/02/25 by Vikas Singhal -----
10// -------------------------------------------------------------------------
11
12#ifndef CBMMUCHUNPACKPAR_H
13#define CBMMUCHUNPACKPAR_H
14
15#include "FairParGenericSet.h"
16
17#include "TArrayD.h"
18#include "TArrayI.h"
19
20class FairParIo;
21class FairParamList;
22
23
24class CbmMuchUnpackPar : public FairParGenericSet {
25
26public:
28 CbmMuchUnpackPar(const char* name = "CbmMuchUnpackPar", const char* title = "Much parameters",
29 const char* context = "Default");
30
31
33 virtual ~CbmMuchUnpackPar();
34
36 virtual void clear();
37
38 void putParams(FairParamList*);
39 Bool_t getParams(FairParamList*);
40
41 void SetElinkFebMap2022(Bool_t bFlag = kTRUE) { fbElinkFebMap2022 = bFlag; }
42
43 static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; }
44 static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; }
45 static constexpr UInt_t GetNbElinkPerDpb() { return kuNbCrobsPerDpb * kuNbElinksPerCrob; }
46 static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; }
47 static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; }
48 static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; }
49 static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; }
50 static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); }
51 static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; }
52 static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; }
53
54
56 Int_t ElinkIdxToFebIdx(UInt_t uElink);
57 /*UInt_t ElinkIdxToAsicIdx( Bool_t bFebType, UInt_t uElink )
58 { return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB( uElink ) :
59 ElinkIdxToAsicIdxFebA( uElink );
60 }*/
61 //UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); }
62
63 //UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink);
64 /*UInt_t ElinkIdxToAsicIdxFebA( UInt_t uElink );
65 UInt_t ElinkIdxToAsicIdxFebB( UInt_t uElink );*/
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 //inline Int_t GetFebsIdsFromArray(Int_t i) { return fnFebsIdsArray[i]; }
73 UInt_t GetNrOfFebsInGemA() { return fuFebsInGemA; }
74 UInt_t GetNrOfFebsInGemB() { return fuFebsInGemB; }
76
77 int32_t GetFebId(UInt_t);
78 UInt_t GetModule(UInt_t);
79
80
81 Short_t GetPadXA(UShort_t febid, UShort_t channelid);
82 Short_t GetPadYA(UShort_t febid, UShort_t channelid);
83 Short_t GetPadXB(UShort_t febid, UShort_t channelid);
84 Short_t GetPadYB(UShort_t febid, UShort_t channelid);
85 Double_t GetRealX(Int_t);
86 Double_t GetRealPadSize(Int_t);
87
88 Double_t GetRealX(Int_t Channel, Int_t Sector);
89 Double_t GetRealPadSize(Int_t Channel, Int_t Sector);
90
91 //RPC Module Related Functions
92 UInt_t GetNrOfFebsInRpc() { return fuFebsInRpc; }
93 Short_t GetPadXRpc(UShort_t febid, UShort_t channelid);
94 Short_t GetPadYRpc(UShort_t febid, UShort_t channelid);
95
96 Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx);
97 Bool_t IsFebActive(UInt_t uFebInSystIdx);
98 Bool_t IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
99 Bool_t IsFebPulser(UInt_t uFebInSystIdx);
100 Bool_t IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
101 Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
102 Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
103
104
105private:
107 static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB
108 static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ?
109 static const UInt_t kuNbFebsPerCrob = 9; // Number of FEBs connected to each CROB for mMuch 2019
110 static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH
111 static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC
112 // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = {
113
114 // Elink to Feb mapping in 2022
115 const Int_t kiCrobMapElinkFebIdx_2022[kuNbElinksPerCrob] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2,
116 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5,
117 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8};
118 // Elink to Feb mapping changed during May 2024 (earlier 5,5,4 now 4,4,6) // Change done on 07/02/2025
119 const Int_t kiCrobMapElinkFebIdx_2024[kuNbElinksPerCrob] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
120 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
121 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8};
124
125
127
128 UInt_t fuNrOfDpbs; // Total number of MUCH DPBs in system
129 TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all MUCH DPBs
130 TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ]
131 UInt_t fuFebsInGemA; // Number of FEBs connected in GEM Module A
132 UInt_t fuFebsInGemB; // Number of FEBs connected in GEM Module B
133 UInt_t fuFebsInRpc; // Number of FEBs connected in RPC Module
134 TArrayI fnFebsIdsArrayGemA; // Array to hold FEB IDs connected to GEM Module A
135 TArrayI fnFebsIdsArrayGemB; // Array to hold FEB IDs connected to GEM Module B
136 TArrayI fnFebsIdsArrayRpc; // Array to hold FEB IDs connected to RPC Module
137 TArrayI fChannelsToPadXA; // Array which stores the corresponding x position of PAD of entire module A
138 TArrayI fChannelsToPadYA; // Array which stores the corresponding y position of PAD of entire module A
139 TArrayI fChannelsToPadXB; // Array which stores the corresponding x position of PAD of entire module B
140 TArrayI fChannelsToPadYB; // Array which stores the corresponding y position of PAD of entire module B
141 TArrayI fChannelsToPadXRpc; // Array which stores the corresponding x position of PAD of RPC module
142 TArrayI fChannelsToPadYRpc; // Array which stores the corresponding y position of PAD of RPC module
143 TArrayD fRealX; // Array which stores the Real X (starting 18.733 cm) position of PAD
144 TArrayD fRealPadSize; // Array which stores the Real Progressive size of each padX (starting .327 cm )
145
147};
148#endif // CBMMUCHUNPACKPAR_H
int Int_t
bool Bool_t
static constexpr UInt_t GetNbAsicsPerCrob()
Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Short_t GetPadXA(UShort_t febid, UShort_t channelid)
static const UInt_t kuNbAsicsPerFeb
static const UInt_t kuNbFebsPerCrob
void SetElinkFebMap2022(Bool_t bFlag=kTRUE)
UInt_t GetModule(UInt_t)
void putParams(FairParamList *)
Short_t GetPadYA(UShort_t febid, UShort_t channelid)
Short_t GetPadXB(UShort_t febid, UShort_t channelid)
UInt_t fuNrOfDpbs
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
Short_t GetPadYRpc(UShort_t febid, UShort_t channelid)
const Int_t kiCrobMapElinkFebIdx_2024[kuNbElinksPerCrob]
static const UInt_t kuNbCrobsPerDpb
Constants.
virtual void clear()
Short_t GetPadYB(UShort_t febid, UShort_t channelid)
static constexpr UInt_t GetNbChanPerFeb()
int32_t GetFebId(UInt_t)
Int_t ElinkIdxToFebIdx(UInt_t uElink)
Convert from eLink index to FEB Connection ( 0 to kuNbFebsPerCrob)
static const UInt_t kuNbChanPerAsic
Bool_t IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Bool_t getParams(FairParamList *)
static constexpr UInt_t GetNbFebsPerCrob()
static constexpr UInt_t GetNbCrobsPerDpb()
const Int_t kiCrobMapElinkFebIdx_2022[kuNbElinksPerCrob]
static constexpr UInt_t GetNbAsicsPerDpb()
Short_t GetPadXRpc(UShort_t febid, UShort_t channelid)
ClassDef(CbmMuchUnpackPar, 1)
static constexpr UInt_t GetNbAsicsPerFeb()
static constexpr UInt_t GetNbElinkPerDpb()
Double_t GetRealX(Int_t)
Double_t GetRealPadSize(Int_t)
Bool_t IsFebActive(UInt_t uFebInSystIdx)
static const UInt_t kuNbElinksPerCrob
static constexpr UInt_t GetNbFebsPerDpb()
CbmMuchUnpackPar(const char *name="CbmMuchUnpackPar", const char *title="Much parameters", const char *context="Default")
static constexpr UInt_t GetNbElinkPerCrob()
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
Bool_t IsFebPulser(UInt_t uFebInSystIdx)
static constexpr UInt_t GetNbChanPerAsic()
UInt_t GetDpbId(UInt_t uDpbIdx)
Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)