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// -------------------------------------------------------------------------
10
11#ifndef CBMMUCHUNPACKPAR_H
12#define CBMMUCHUNPACKPAR_H
13
14#include "FairParGenericSet.h"
15
16#include "TArrayD.h"
17#include "TArrayI.h"
18
19class FairParIo;
20class FairParamList;
21
22
23class CbmMuchUnpackPar : public FairParGenericSet {
24
25public:
27 CbmMuchUnpackPar(const char* name = "CbmMuchUnpackPar", const char* title = "Much parameters",
28 const char* context = "Default");
29
30
32 virtual ~CbmMuchUnpackPar();
33
35 virtual void clear();
36
37 void putParams(FairParamList*);
38 Bool_t getParams(FairParamList*);
39
40 static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; }
41 static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; }
42 static constexpr UInt_t GetNbElinkPerDpb() { return kuNbCrobsPerDpb * kuNbElinksPerCrob; }
43 static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; }
44 static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; }
45 static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; }
46 static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; }
47 static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); }
48 static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; }
49 static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; }
50
51
53 Int_t ElinkIdxToFebIdx(UInt_t uElink);
54 /*UInt_t ElinkIdxToAsicIdx( Bool_t bFebType, UInt_t uElink )
55 { return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB( uElink ) :
56 ElinkIdxToAsicIdxFebA( uElink );
57 }*/
58 //UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); }
59
60 //UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink);
61 /*UInt_t ElinkIdxToAsicIdxFebA( UInt_t uElink );
62 UInt_t ElinkIdxToAsicIdxFebB( UInt_t uElink );*/
63
64 UInt_t GetNrOfDpbs() { return fuNrOfDpbs; }
65 UInt_t GetDpbId(UInt_t uDpbIdx);
67 UInt_t GetNrOfFebs() { return GetNrOfCrobs() * kuNbFebsPerCrob; }
68 UInt_t GetNrOfAsics() { return GetNrOfFebs() * kuNbAsicsPerFeb; }
69 //inline Int_t GetFebsIdsFromArray(Int_t i) { return fnFebsIdsArray[i]; }
70 UInt_t GetNrOfFebsInGemA() { return fuFebsInGemA; }
71 UInt_t GetNrOfFebsInGemB() { return fuFebsInGemB; }
72 Int_t GetNrOfChannels() { return kuNbChanPerAsic; }
73
74 int32_t GetFebId(UInt_t);
75 UInt_t GetModule(UInt_t);
76
77
78 Short_t GetPadXA(UShort_t febid, UShort_t channelid);
79 Short_t GetPadYA(UShort_t febid, UShort_t channelid);
80 Short_t GetPadXB(UShort_t febid, UShort_t channelid);
81 Short_t GetPadYB(UShort_t febid, UShort_t channelid);
82 Double_t GetRealX(Int_t);
83 Double_t GetRealPadSize(Int_t);
84
85 Double_t GetRealX(Int_t Channel, Int_t Sector);
86 Double_t GetRealPadSize(Int_t Channel, Int_t Sector);
87
88 //RPC Module Related Functions
89 UInt_t GetNrOfFebsInRpc() { return fuFebsInRpc; }
90 Short_t GetPadXRpc(UShort_t febid, UShort_t channelid);
91 Short_t GetPadYRpc(UShort_t febid, UShort_t channelid);
92
93 Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx);
94 Bool_t IsFebActive(UInt_t uFebInSystIdx);
95 Bool_t IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
96 Bool_t IsFebPulser(UInt_t uFebInSystIdx);
97 Bool_t IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
98 Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
99 Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
100
101
102private:
104 static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB
105 static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ?
106 static const UInt_t kuNbFebsPerCrob = 9; // Number of FEBs connected to each CROB for mMuch 2019
107 static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH
108 static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC
109 // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = {
110 const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4,
111 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8};
113
114
116
117 UInt_t fuNrOfDpbs; // Total number of MUCH DPBs in system
118 TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all MUCH DPBs
119 TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ]
120 UInt_t fuFebsInGemA; // Number of FEBs connected in GEM Module A
121 UInt_t fuFebsInGemB; // Number of FEBs connected in GEM Module B
122 UInt_t fuFebsInRpc; // Number of FEBs connected in RPC Module
123 TArrayI fnFebsIdsArrayGemA; // Array to hold FEB IDs connected to GEM Module A
124 TArrayI fnFebsIdsArrayGemB; // Array to hold FEB IDs connected to GEM Module B
125 TArrayI fnFebsIdsArrayRpc; // Array to hold FEB IDs connected to RPC Module
126 TArrayI fChannelsToPadXA; // Array which stores the corresponding x position of PAD of entire module A
127 TArrayI fChannelsToPadYA; // Array which stores the corresponding y position of PAD of entire module A
128 TArrayI fChannelsToPadXB; // Array which stores the corresponding x position of PAD of entire module B
129 TArrayI fChannelsToPadYB; // Array which stores the corresponding y position of PAD of entire module B
130 TArrayI fChannelsToPadXRpc; // Array which stores the corresponding x position of PAD of RPC module
131 TArrayI fChannelsToPadYRpc; // Array which stores the corresponding y position of PAD of RPC module
132 TArrayD fRealX; // Array which stores the Real X (starting 18.733 cm) position of PAD
133 TArrayD fRealPadSize; // Array which stores the Real Progressive size of each padX (starting .327 cm )
134
136};
137#endif // CBMMUCHUNPACKPAR_H
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
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)
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()
static constexpr UInt_t GetNbAsicsPerDpb()
Short_t GetPadXRpc(UShort_t febid, UShort_t channelid)
ClassDef(CbmMuchUnpackPar, 1)
static constexpr UInt_t GetNbAsicsPerFeb()
const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob]
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)