CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018StsPar.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// ----- CbmMcbm2018StsPar header file -----
7// ----- Created 25/09/18 by P.-A. Loizeau -----
8// -------------------------------------------------------------------------
9
10#ifndef CBMMCBM2018STSPAR_H
11#define CBMMCBM2018STSPAR_H
12
13#include "FairParGenericSet.h"
14
15#include "TArrayD.h"
16#include "TArrayI.h"
17
18class FairParIo;
19class FairParamList;
20
21
22class CbmMcbm2018StsPar : public FairParGenericSet {
23
24public:
26 CbmMcbm2018StsPar(const char* name = "CbmMcbm2018StsPar", const char* title = "Sts parameters",
27 const char* context = "Default");
28
29
31 virtual ~CbmMcbm2018StsPar();
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 GetNbElinkPerDpb() { return kuNbCrobsPerDpb * kuNbElinksPerCrob; }
42 static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; }
43 static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; }
44 static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; }
45 static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; }
46 static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); }
47 static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; }
48 static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; }
49
50 static constexpr Double_t GetStereoAngle() { return kdStereoAngle; }
51 static constexpr Double_t GetPitchMm() { return kdPitchMm; }
52 static constexpr Double_t GetSensorSzX() { return kdSensorsSzX; }
53 static constexpr Double_t GetSensorSzY() { return kdSensorsSzY; }
54 static constexpr Double_t GetCenterStripP() { return kiCenterStripP; }
55 static constexpr Double_t GetCenterStripN() { return kiCenterStripN; }
56 static constexpr Double_t GetCenterPosX() { return kdCenterPosX; }
57 static constexpr Double_t GetCenterPosY() { return kdCenterPosY; }
58
59 Double_t GetStereoAngleTan() const { return kdStereoAngleTan; }
60
61 Int_t ElinkIdxToFebIdx(UInt_t uElink);
62 UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink)
63 {
64 return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB(uElink) : ElinkIdxToAsicIdxFebA(uElink);
65 }
66 UInt_t ElinkIdxToAsicIdxFebA(UInt_t uElink);
67 UInt_t ElinkIdxToAsicIdxFebB(UInt_t uElink);
68
69 UInt_t GetNbOfModules() { return fuNbModules; }
70 Bool_t CheckModuleIndex(UInt_t uModuleIdx);
71 UInt_t GetModuleType(UInt_t uModuleIdx);
72 UInt_t GetModuleAddress(UInt_t uModuleIdx);
73 Double_t GetModuleCenterPosX(UInt_t uModuleIdx);
74 Double_t GetModuleCenterPosY(UInt_t uModuleIdx);
75
76 UInt_t GetNrOfDpbs() { return fuNrOfDpbs; }
77 UInt_t GetDpbId(UInt_t uDpbIdx);
79 UInt_t GetNrOfFebs() { return GetNrOfCrobs() * kuNbFebsPerCrob; }
80 UInt_t GetNrOfAsics() { return GetNrOfFebs() * kuNbAsicsPerFeb; }
81
82 Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx);
83 Bool_t IsFebActive(UInt_t uFebInSystIdx);
84 Bool_t IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
85 Bool_t IsFebPulser(UInt_t uFebInSystIdx);
86 Bool_t IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
87 Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
88 Int_t GetFebModuleSide(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
89 Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
90 Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
91 Double_t GetFebAdcBase(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
92 Double_t GetFebAdcThrGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
93 Int_t GetFebAdcThrOffs(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx);
94
95 // Bool_t ComputeModuleCoordinates( UInt_t uModuleIdx, Int_t iChanN, Int_t iChanP, Double_t & dPosX, Double_t & dPosY );
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 = 5; // Number of FEBs connected to each DPB
102 static const UInt_t kuNbAsicsPerFeb = 8; // Number of ASICs connected in each FEB
103 static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC
104 // static constexpr UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = {
106 0x0021, 0x0023, 0x0025, 0x0020, 0x0022, 0x0018, 0x001A, 0x001C, 0x0024, 0x0027, 0xFFFF, 0xFFFF, 0x0026, 0x001E,
107 0x0010, 0x0012, 0x0019, 0x001B, 0x001F, 0x000E, 0x0011, 0x0013, 0x000C, 0x0015, 0x0017, 0x0016, 0x001D, 0x0014,
108 0x0009, 0x000D, 0x000F, 0x0008, 0x000A, 0x0002, 0x0004, 0x0006, 0x000B, 0x0005, 0x0000, 0x0003, 0x0007, 0x0001,
109 };
110 // static constexpr UInt_t kuCrobMapElinkFebB[ kuNbElinksPerCrob ] = {
111 const UInt_t kuCrobMapElinkFebB[kuNbElinksPerCrob] = {0x0027, 0x0025, 0x0023, 0x0026, 0x0024, 0x001E, 0x001C, 0x001A,
112 0x0022, 0x0021, 0xFFFF, 0xFFFF, 0x0020, 0x0018, 0x0016, 0x0014,
113 0x001F, 0x001D, 0x0019, 0x0008, 0x0017, 0x0015, 0x000A, 0x0013,
114 0x0011, 0x0010, 0x001B, 0x0012, 0x000F, 0x000B, 0x0009, 0x000E,
115 0x000C, 0x0004, 0x0002, 0x0000, 0x000D, 0x0003, 0x0006, 0x0005,
116 0x0001, 0x0007};
117 // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = {
119 4, 4, 4, 4, 4, 3, 3, 3, 4, 4, -1, -1, 4, 3, 2, 2, 3, 3, 3, 1, 2, 2,
120 1, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0};
121
123 static constexpr Double_t kdStereoAngle = 7.5; // [Deg]
124 static const Double_t kdStereoAngleTan; // [] See cxx file for assignation
125 static constexpr Double_t kdPitchMm = 0.058; // [mm]
126 static constexpr Double_t kdSensorsSzX = 60; // [mm], active is 59.570 mm (kiNbStrips*kdPitchMm)
127 static constexpr Double_t kdSensorsSzY = 60; // [mm], active is 59.570 mm
128 static constexpr Int_t kiCenterStripP = 512; // []
129 static constexpr Int_t kiCenterStripN = 512; // []
130 static constexpr Double_t kdCenterPosX = 0.0; // [mm] Top Center
131 static constexpr Double_t kdCenterPosY = 59.570 / 2.0; // [mm] Top Center
132
134 UInt_t fuNbModules; // Total number of STS modules in the setup
135 TArrayI fiModuleType; // Type of each module: 0 for connectors on the right, 1 for connectors on the left
136 TArrayI fiModAddress; // STS address for the first strip of each module
137 TArrayD fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!)
138 TArrayD fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!)
139
140 UInt_t fuNrOfDpbs; // Total number of STS DPBs in system
141 TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all STS DPBs
142 TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ]
143 TArrayI
144 fiFebPulserFlag; // Array to hold the pulser flag for all FEBs, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 1 if pulser, 0 if standard
145 TArrayI
146 fiFebModuleIdx; // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], -1 if inactive
147 TArrayI
148 fiFebModuleSide; // STS module side for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive
149 TArrayD fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
150 TArrayD fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
151 TArrayD fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
152 TArrayI
153 fiFebAdcThrOffs; // Thr. offset in Units vs Cal. Thr. for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ]
154
156};
157#endif // CBMMCBM2018STSPAR_H
static constexpr Double_t GetCenterPosY()
CbmMcbm2018StsPar(const char *name="CbmMcbm2018StsPar", const char *title="Sts parameters", const char *context="Default")
UInt_t fuNbModules
Variables.
Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr UInt_t GetNbAsicsPerDpb()
static constexpr Double_t kdCenterPosY
UInt_t GetDpbId(UInt_t uDpbIdx)
static constexpr UInt_t GetNbFebsPerDpb()
const UInt_t kuCrobMapElinkFebA[kuNbElinksPerCrob]
Int_t ElinkIdxToFebIdx(UInt_t uElink)
Bool_t CheckModuleIndex(UInt_t uModuleIdx)
Int_t GetFebAdcThrOffs(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static const UInt_t kuNbCrobsPerDpb
Constants.
static const UInt_t kuNbElinksPerCrob
ClassDef(CbmMcbm2018StsPar, 2)
Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr Int_t kiCenterStripN
Double_t GetModuleCenterPosY(UInt_t uModuleIdx)
static constexpr Double_t kdStereoAngle
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
Bool_t IsFebActive(UInt_t uFebInSystIdx)
UInt_t GetModuleType(UInt_t uModuleIdx)
static constexpr UInt_t GetNbFebsPerCrob()
static constexpr UInt_t GetNbAsicsPerFeb()
static constexpr UInt_t GetNbElinkPerCrob()
static constexpr Double_t kdPitchMm
Bool_t getParams(FairParamList *)
static constexpr Double_t kdSensorsSzX
Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
const UInt_t kuCrobMapElinkFebB[kuNbElinksPerCrob]
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
static constexpr UInt_t GetNbAsicsPerCrob()
static constexpr Double_t GetStereoAngle()
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
static constexpr UInt_t GetNbCrobsPerDpb()
static constexpr Double_t GetCenterPosX()
static constexpr UInt_t GetNbElinkPerDpb()
static const UInt_t kuNbChanPerAsic
static constexpr Double_t GetCenterStripN()
static const UInt_t kuNbFebsPerCrob
UInt_t ElinkIdxToAsicIdxFebA(UInt_t uElink)
void putParams(FairParamList *)
static constexpr Double_t GetCenterStripP()
static constexpr Double_t GetSensorSzY()
UInt_t ElinkIdxToAsicIdxFebB(UInt_t uElink)
Double_t GetFebAdcThrGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr Double_t kdCenterPosX
Double_t GetStereoAngleTan() const
static const UInt_t kuNbAsicsPerFeb
static const Double_t kdStereoAngleTan
Constants assignation.
UInt_t GetModuleAddress(UInt_t uModuleIdx)
static constexpr Double_t kdSensorsSzY
Double_t GetFebAdcBase(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink)
static constexpr Double_t GetPitchMm()
const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob]
Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb )
Bool_t IsFebPulser(UInt_t uFebInSystIdx)
static constexpr Int_t kiCenterStripP
Int_t GetFebModuleSide(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
static constexpr UInt_t GetNbChanPerAsic()
Double_t GetModuleCenterPosX(UInt_t uModuleIdx)
static constexpr Double_t GetSensorSzX()
static constexpr UInt_t GetNbChanPerFeb()