CbmRoot
CbmStsParAsic.h
Go to the documentation of this file.
1 
6 #ifndef CBMSTSPARASIC_H
7 #define CBMSTSPARASIC_H 1
8 
9 #include <Rtypes.h> // for THashConsistencyHolder, ClassDefNV
10 #include <RtypesCore.h> // for Double_t, UShort_t, Bool_t, Short_t, kFALSE
11 
12 #include <set>
13 #include <string> // for string
14 
15 class TF1;
16 
26 
27 public:
30 
31 
41  CbmStsParAsic(UShort_t nAdc,
42  Double_t dynRange,
43  Double_t threshold,
44  Double_t timeResol,
45  Double_t deadTime,
46  Double_t noise,
47  Double_t znr);
48 
49 
52 
53 
56 
57 
59  CbmStsParAsic& operator=(const CbmStsParAsic& other);
60 
61 
64 
65 
68 
69 
74  Double_t AdcToCharge(UShort_t adc) const {
75  return fThreshold + fDynRange / Double_t(fNofAdc) * (Double_t(adc) + 0.5);
76  }
77 
78 
85  Short_t ChargeToAdc(Double_t charge) const;
86 
87 
91  Double_t GetDeadTime() const { return fDeadTime; }
92 
93 
97  Double_t GetDynRange() const { return fDynRange; }
98 
99 
103  UShort_t GetNofAdc() const { return fNofAdc; }
104 
105 
109  Double_t GetNoise() const { return fNoise; }
110 
111 
115  Double_t GetNoiseRate() const;
116 
117 
125  Double_t GetRandomNoiseCharge() const;
126 
127 
131  Double_t GetThreshold() const { return fThreshold; }
132 
133 
137  Double_t GetTimeResol() const { return fTimeResolution; }
138 
139 
143  Double_t GetZeroNoiseRate() const { return fZeroNoiseRate; }
144 
145 
150  void Init();
151 
152 
157  Bool_t IsChannelActive(UShort_t channel) const {
158  return fDeadChannels.find(channel) == fDeadChannels.end();
159  }
160 
161 
172  void Set(UShort_t nAdc,
173  Double_t dynRange,
174  Double_t threshold,
175  Double_t timeResol,
176  Double_t deadTime,
177  Double_t noise,
178  Double_t zeroNoiseRate,
179  std::set<UShort_t> deadChannels = {});
180 
181 
183  std::string ToString() const;
184 
185 
186 private:
187  UShort_t fNofAdc = 0;
188  Double_t fDynRange = 0.;
189  Double_t fThreshold = 0.;
190  Double_t fTimeResolution = 0.;
191  Double_t fDeadTime = 0.;
192  Double_t fNoise = 0.;
193  Double_t fZeroNoiseRate = 0.;
194  std::set<UShort_t> fDeadChannels {};
195 
196  Bool_t fIsInit = kFALSE;
197 
200  TF1* fNoiseCharge = nullptr;
201 
203 };
204 
205 #endif /* CBMSTSPARASIC_H */
CbmStsParAsic::GetNoise
Double_t GetNoise() const
Electronic noise RMS.
Definition: CbmStsParAsic.h:109
CbmStsParAsic::GetThreshold
Double_t GetThreshold() const
ADC Threshold.
Definition: CbmStsParAsic.h:131
CbmStsParAsic::GetNoiseRate
Double_t GetNoiseRate() const
Single-channel noise rate.
Definition: CbmStsParAsic.cxx:72
CbmStsParAsic::~CbmStsParAsic
~CbmStsParAsic()
Destructor.
Definition: CbmStsParAsic.cxx:56
CbmStsParAsic::GetZeroNoiseRate
Double_t GetZeroNoiseRate() const
Zero-crossing noise rate.
Definition: CbmStsParAsic.h:143
CbmStsParAsic::ChargeToAdc
Short_t ChargeToAdc(Double_t charge) const
ADC channel for a given charge.
Definition: CbmStsParAsic.cxx:63
CbmStsParAsic::fIsInit
Bool_t fIsInit
Definition: CbmStsParAsic.h:196
CbmStsParAsic::CbmStsParAsic
CbmStsParAsic(UShort_t nAdc, Double_t dynRange, Double_t threshold, Double_t timeResol, Double_t deadTime, Double_t noise, Double_t znr)
Constructor with parameters.
CbmStsParAsic::GetNofAdc
UShort_t GetNofAdc() const
Number of ADC channels.
Definition: CbmStsParAsic.h:103
CbmStsParAsic::CbmStsParAsic
CbmStsParAsic(CbmStsParAsic &&)=default
Move constructor (disabled)
CbmStsParAsic::fTimeResolution
Double_t fTimeResolution
Time resolution [ns].
Definition: CbmStsParAsic.h:190
CbmStsParAsic::fZeroNoiseRate
Double_t fZeroNoiseRate
Zero-crossing noise rate [1/ns].
Definition: CbmStsParAsic.h:193
CbmStsParAsic::fNoise
Double_t fNoise
RMS of noise [e].
Definition: CbmStsParAsic.h:192
CbmStsParAsic::fNofAdc
UShort_t fNofAdc
Number of ADC channels.
Definition: CbmStsParAsic.h:187
CbmStsParAsic
Parameters of the STS readout ASIC.
Definition: CbmStsParAsic.h:25
CbmStsParAsic::CbmStsParAsic
CbmStsParAsic()
Default constructor.
Definition: CbmStsParAsic.h:29
CbmStsParAsic::fThreshold
Double_t fThreshold
Threshold [e].
Definition: CbmStsParAsic.h:189
CbmStsParAsic::ClassDefNV
ClassDefNV(CbmStsParAsic, 2)
CbmStsParAsic::fDeadChannels
std::set< UShort_t > fDeadChannels
Map of dead channels.
Definition: CbmStsParAsic.h:194
CbmStsParAsic::AdcToCharge
Double_t AdcToCharge(UShort_t adc) const
Charge from ADC channel (mean)
Definition: CbmStsParAsic.h:74
CbmStsParAsic::operator=
CbmStsParAsic & operator=(const CbmStsParAsic &other)
Copy assignment operator.
Definition: CbmStsParAsic.cxx:42
CbmStsParAsic::GetDynRange
Double_t GetDynRange() const
Dynamic range of ADC.
Definition: CbmStsParAsic.h:97
CbmStsParAsic::Init
void Init()
Initialisation.
Definition: CbmStsParAsic.cxx:89
CbmStsParAsic::fDynRange
Double_t fDynRange
Dynamic range [e].
Definition: CbmStsParAsic.h:188
CbmStsParAsic::IsChannelActive
Bool_t IsChannelActive(UShort_t channel) const
Check for a channel being active.
Definition: CbmStsParAsic.h:157
CbmStsParAsic::fNoiseCharge
TF1 * fNoiseCharge
Flag for being initialised.
Definition: CbmStsParAsic.h:200
CbmStsParAsic::GetDeadTime
Double_t GetDeadTime() const
Single-channel dead time.
Definition: CbmStsParAsic.h:91
CbmStsParAsic::ToString
std::string ToString() const
Info to string.
Definition: CbmStsParAsic.cxx:132
CbmStsParAsic::Set
void Set(UShort_t nAdc, Double_t dynRange, Double_t threshold, Double_t timeResol, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate, std::set< UShort_t > deadChannels={})
Set parameters.
Definition: CbmStsParAsic.cxx:100
CbmStsParAsic::operator=
CbmStsParAsic & operator=(CbmStsParAsic &&)=default
Move assignment operator (disabled)
CbmStsParAsic::fDeadTime
Double_t fDeadTime
Channel dead time [ns].
Definition: CbmStsParAsic.h:191
CbmStsParAsic::GetRandomNoiseCharge
Double_t GetRandomNoiseCharge() const
Random noise charge.
Definition: CbmStsParAsic.cxx:81
CbmStsParAsic::GetTimeResol
Double_t GetTimeResol() const
Time resolution.
Definition: CbmStsParAsic.h:137