CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MuchPar.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// ----- CbmMcbm2018MuchPar header file -----
7// ----- Created 25/07/17 by P.-A. Loizeau ----
8// ----- Modified 07/12/18 by A Kumar -----
9// ----- Modified 20/02/22 by Vikas Singhal -----
10// ----- Modified for 2 GEM and 1 RPC module -----
11// -------------------------------------------------------------------------
12
13#ifndef CBMMCBM2018MUCHPAR_H
14#define CBMMCBM2018MUCHPAR_H
15
16#include "FairParGenericSet.h"
17
18#include "TArrayD.h"
19#include "TArrayI.h"
20
21class FairParIo;
22class FairParamList;
23
24
25class CbmMcbm2018MuchPar : public FairParGenericSet {
26
27public:
29 CbmMcbm2018MuchPar(const char* name = "CbmMcbm2018MuchPar", const char* title = "Much parameters",
30 const char* context = "Default");
31
32
34 virtual ~CbmMcbm2018MuchPar();
35
37 virtual void clear();
38
39 void putParams(FairParamList*);
40 Bool_t getParams(FairParamList*);
41
42 static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; }
43 static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; }
44 static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; }
45 static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; }
46 static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; }
47 static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; }
48 static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); }
49 static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; }
50 static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; }
51
52 Int_t ElinkIdxToFebIdx(UInt_t uElink);
53 /*UInt_t ElinkIdxToAsicIdx( Bool_t bFebType, UInt_t uElink )
54 { return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB( uElink ) :
55 ElinkIdxToAsicIdxFebA( uElink );
56 }*/
57 UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); }
58
59 UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink);
60 /*UInt_t ElinkIdxToAsicIdxFebA( UInt_t uElink );
61 UInt_t ElinkIdxToAsicIdxFebB( UInt_t uElink );*/
62
63 //Common Functions
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 //GEM Module Related Functions
71 UInt_t GetNrOfFebsInGemA() { return fuFebsInGemA; }
72 UInt_t GetNrOfFebsInGemB() { return fuFebsInGemB; }
73 Int_t GetNrOfChannels() { return kuNbChanPerAsic; }
74
75 UInt_t GetFebId(UInt_t);
76 UInt_t GetModule(UInt_t);
77
78
79 Short_t GetPadXA(UShort_t febid, UShort_t channelid);
80 Short_t GetPadYA(UShort_t febid, UShort_t channelid);
81 Short_t GetPadXB(UShort_t febid, UShort_t channelid);
82 Short_t GetPadYB(UShort_t febid, UShort_t channelid);
83 Double_t GetRealX(Int_t);
84 Double_t GetRealPadSize(Int_t);
85
86 Double_t GetRealX(Int_t Channel, Int_t Sector);
87 Double_t GetRealPadSize(Int_t Channel, Int_t Sector);
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
97private:
99 static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB
100 static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ?
101 static const UInt_t kuNbFebsPerCrob = 9; // Number of FEBs connected to each CROB for mMuch 2022
102 static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH
103 static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC
104 // static constexpr UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = {
105 /* *** Inverted ?!?
106 const UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = {
107 0x0026, 0x0024, 0x0022, 0x0027, 0x0025, 0x001F,
108 0x001D, 0x001B, 0x0023, 0x0020, 0xFFFF, 0xFFFF,
109 0x0021, 0x0019, 0x0017, 0x0015, 0x001E, 0x001C,
110 0x0018, 0x0009, 0x0016, 0x0014, 0x000B, 0x0012,
111 0x0010, 0x0011, 0x001A, 0x0013, 0x000E, 0x000A,
112 0x0008, 0x000F, 0x000D, 0x0005, 0x0003, 0x0001,
113 0x000C, 0x0002, 0x0007, 0x0004, 0x0000, 0x0006
114 }; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
115*/
116 const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
117 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
118 0x0002, 0x0002, 0x0002, 0x0002, 0x0003,
119 0x0003, 0x0003, 0x0003, 0x0003, 0x0004,
120 0x0004, 0x0004, 0x0004, 0x0004, 0x0005,
121 0x0005, 0x0005, 0x0005, 0x0006, 0x0006,
122 0x0006, 0x0006, 0x0006, 0x0007, 0x0007,
123 0x0007, 0x0007, 0x0007, 0x0008, 0x0008,
124 0x0008, 0x0008};
125 /*
126 const UInt_t kuCrobMapElinkFebMuch[ kuNbElinksPerCrob ] = {
127 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021,
128 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
129 0x0028, 0x0029, 0x000E, 0x000F, 0x0010, 0x0011,
130 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
131 0x0018, 0x0019, 0x001A, 0x001B, 0x0000, 0x0001,
132 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
133 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D
134 }; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
135*/
136 // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = {
138 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4,
139 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8};
140
141
143
144 UInt_t fuNrOfDpbs; // Total number of MUCH DPBs in system
145 TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all MUCH DPBs
146 TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ]
147 UInt_t fuFebsInGemA; // Number of FEBs connected in GEM Module A
148 UInt_t fuFebsInGemB; // Number of FEBs connected in GEM Module B
149 UInt_t fuFebsInRpc; // Number of FEBs connected in RPC Module
150 TArrayI fnFebsIdsArrayGemA; // Array to hold FEB IDs connected to GEM Module A
151 TArrayI fnFebsIdsArrayGemB; // Array to hold FEB IDs connected to GEM Module B
152 TArrayI fnFebsIdsArrayRpc; // Array to hold FEB IDs connected to RPC Module
153 TArrayI fChannelsToPadXA; // Array which stores the corresponding x position of PAD of entire module A
154 TArrayI fChannelsToPadYA; // Array which stores the corresponding y position of PAD of entire module A
155 TArrayI fChannelsToPadXB; // Array which stores the corresponding x position of PAD of entire module B
156 TArrayI fChannelsToPadYB; // Array which stores the corresponding y position of PAD of entire module B
157 TArrayI fChannelsToPadXRpc; // Array which stores the corresponding x position of PAD of RPC module
158 TArrayI fChannelsToPadYRpc; // Array which stores the corresponding y position of PAD of RPC module
159 TArrayD fRealX; // Array which stores the Real X (starting 18.733 cm) position of PAD
160 TArrayD fRealPadSize; // Array which stores the Real Progressive size of each padX (starting .327 cm )
161
163};
164#endif // CBMMCBM2018MUCHPAR_H
Int_t ElinkIdxToFebIdx(UInt_t uElink)
void putParams(FairParamList *)
CbmMcbm2018MuchPar(const char *name="CbmMcbm2018MuchPar", const char *title="Much parameters", const char *context="Default")
static constexpr UInt_t GetNbElinkPerCrob()
Double_t GetRealPadSize(Int_t)
static const UInt_t kuNbElinksPerCrob
static constexpr UInt_t GetNbFebsPerCrob()
Short_t GetPadXA(UShort_t febid, UShort_t channelid)
static constexpr UInt_t GetNbChanPerAsic()
static constexpr UInt_t GetNbAsicsPerDpb()
const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob]
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
static constexpr UInt_t GetNbAsicsPerCrob()
Short_t GetPadXB(UShort_t febid, UShort_t channelid)
static constexpr UInt_t GetNbChanPerFeb()
UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink)
UInt_t fuNrOfDpbs
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
static const UInt_t kuNbCrobsPerDpb
Constants.
UInt_t GetDpbId(UInt_t uDpbIdx)
Short_t GetPadXRpc(UShort_t febid, UShort_t channelid)
Short_t GetPadYRpc(UShort_t febid, UShort_t channelid)
Short_t GetPadYB(UShort_t febid, UShort_t channelid)
UInt_t ElinkIdxToAsicIdx(UInt_t uElink)
Short_t GetPadYA(UShort_t febid, UShort_t channelid)
static const UInt_t kuNbFebsPerCrob
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
Bool_t IsFebActive(UInt_t uFebInSystIdx)
static const UInt_t kuNbAsicsPerFeb
static const UInt_t kuNbChanPerAsic
static constexpr UInt_t GetNbFebsPerDpb()
static constexpr UInt_t GetNbCrobsPerDpb()
Bool_t getParams(FairParamList *)
ClassDef(CbmMcbm2018MuchPar, 2)
static constexpr UInt_t GetNbAsicsPerFeb()
const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob]