BmnRoot
Loading...
Searching...
No Matches
BmnSsdModule.h
Go to the documentation of this file.
1
7#ifndef BMNSSDMODULE_H
8#define BMNSSDMODULE_H 1
9
10
11#include <map>
12#include <set>
13#include <vector>
14#include "TF1.h"
15#include "TRandom.h"
16#include "BmnSsdCluster.h"
17#include "BmnSsdDigi.h"
18#include "BmnSsdSignal.h"
19#include "BmnSsdElement.h"
20#include "BmnSsdSensor.h"
21
22class TClonesArray;
23class BmnSsdPhysics;
24
25
41{
42
43 public:
44
45
51 BmnSsdModule(UInt_t address = 0, TGeoPhysicalNode* node = nullptr,
52 BmnSsdElement* mother = nullptr);
53
54
55 // Copy constructor and assignment operator not allowed
56 BmnSsdModule(const BmnSsdModule&) = delete;
58
59
61 virtual ~BmnSsdModule();
62
63
68 Double_t AdcToCharge(UShort_t adcChannel);
69
70
74 void AddCluster(BmnSsdCluster* cluster) { fClusters.push_back(cluster); }
75
76
90 void AddSignal(UShort_t channel, Double_t time, Double_t charge,
91 Int_t index = 0, Int_t entry = 0, Int_t file = 0);
92
93
100 void BufferStatus(Int_t& nofSignals,
101 Double_t& timeFirst, Double_t& timeLast);
102
103
110 Int_t ChargeToAdc(Double_t charge);
111
112
114 void ClearClusters() { fClusters.clear(); }
115
116
122 Int_t FindHits(TClonesArray* hitArray, BmnEvent* event = NULL);
123
124
129 static Int_t GetAddressFromName(TString name);
130
131
135 Double_t GetDynamicRange() const { return fDynRange; }
136
137
141 Double_t GetNoise() const { return fNoise; }
142
143
147 Int_t GetNofAdcChannels() const { return fNofAdcChannels; }
148
149
153 UShort_t GetNofChannels() const { return fNofChannels; };
154
155
159 Int_t GetNofClusters() const { return fClusters.size(); }
160
161
165 std::set<UShort_t> GetSetOfDeadChannels() const {return fDeadChannels;}
166
167
171 Double_t GetTimeResolution() const { return fTimeResolution; }
172
173
177 Double_t GetZeroNoiseRate() const { return fZeroNoiseRate; }
178
179
192 void InitAnalogBuffer();
193
194
199 Bool_t IsChannelActive(UShort_t channel) {
200 return ( fDeadChannels.find(channel) == fDeadChannels.end() );
201 }
202
203
207 Bool_t IsSet() const { return fIsSet; }
208
209
218 Int_t ProcessAnalogBuffer(Double_t readoutTime);
219
220
230 void SetParameters(Double_t dynRange, Double_t threshold, Int_t nAdc,
231 Double_t timeResolution, Double_t deadTime,
232 Double_t noise, Double_t zeroNoiseRate,
233 Double_t fracDeadChannels = 0.);
234
235
249 Int_t GenerateNoise(Double_t t1, Double_t t2);
250
251
255 void SetDeadTime(Double_t dTime) { fDeadTime = dTime; }
256
257
259 std::string ToString() const;
260
261
262 private:
263
264 UShort_t fNofChannels;
265 Double_t fDynRange;
266 Double_t fThreshold;
267 Int_t fNofAdcChannels;
268 Double_t fTimeResolution;
269 Double_t fDeadTime;
270 Double_t fNoise;
271 Double_t fZeroNoiseRate;
272 Double_t fNoiseRate;
273 Bool_t fIsSet;
274 std::set <UShort_t> fDeadChannels;
275 TF1* fNoiseCharge;
276
284 typedef std::multiset<BmnSsdSignal*, BmnSsdSignal::Before> sigset;
285 std::map<UShort_t, sigset> fAnalogBuffer;
286
287
289 std::vector<BmnSsdCluster*> fClusters;
290
291
296 void Digitize(UShort_t channel, BmnSsdSignal* signal);
297
298
300 virtual void InitDaughters();
301
302
309 Int_t SetDeadChannels(Double_t percentOfDeadCh);
310
311
312 ClassDef(BmnSsdModule, 2);
313
314};
315
316#endif /* BMNSSDMODULE_H */
Data class for SSD clusters.
Class characterising one event by a collection of links (indices) to data objects,...
Definition BmnEvent.h:26
Data class for SSD clusters.
Class representing an element of the SSD setup.
Class representing an instance of a readout unit in the BMN-SSD.
Int_t GetNofAdcChannels() const
Int_t ProcessAnalogBuffer(Double_t readoutTime)
Double_t GetDynamicRange() const
void AddCluster(BmnSsdCluster *cluster)
Add a cluster to its array.
std::set< UShort_t > GetSetOfDeadChannels() const
Set of dead channels @value Set of dead channels.
Double_t GetTimeResolution() const
void AddSignal(UShort_t channel, Double_t time, Double_t charge, Int_t index=0, Int_t entry=0, Int_t file=0)
std::string ToString() const
Bool_t IsSet() const
Bool_t IsChannelActive(UShort_t channel)
BmnSsdModule(const BmnSsdModule &)=delete
Int_t ChargeToAdc(Double_t charge)
void InitAnalogBuffer()
UShort_t GetNofChannels() const
Number of electronic channels @value Number of ADC channels.
void ClearClusters()
static Int_t GetAddressFromName(TString name)
Get the address from the module name (static)
Int_t GetNofClusters() const
Current number of clusters @value Number of clusters in the buffer.
Int_t GenerateNoise(Double_t t1, Double_t t2)
Generate noise.
virtual ~BmnSsdModule()
Double_t GetZeroNoiseRate() const
Zero threshold noise rate @value Noise rate at zero threshold [1/ns].
Double_t GetNoise() const
void SetParameters(Double_t dynRange, Double_t threshold, Int_t nAdc, Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate, Double_t fracDeadChannels=0.)
BmnSsdModule & operator=(const BmnSsdModule &)=delete
Int_t FindHits(TClonesArray *hitArray, BmnEvent *event=NULL)
void BufferStatus(Int_t &nofSignals, Double_t &timeFirst, Double_t &timeLast)
void SetDeadTime(Double_t dTime)
Double_t AdcToCharge(UShort_t adcChannel)
Auxiliary class for simulating physics processes in Silicon.
Data class for an analog signal in the SSD.