CbmRoot
Loading...
Searching...
No Matches
CbmRichDigitizer.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2024 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Andrey Lebedev [committer], Martin Beyer */
4
14#ifndef CBM_RICH_DIGITIZER
15#define CBM_RICH_DIGITIZER
16
17#include "CbmDefs.h"
18#include "CbmDigitize.h"
19#include "CbmRichDigi.h"
20#include "CbmRichPmt.h"
21#include "CbmRichPmtType.h"
22
23#include <map>
24
25class TClonesArray;
26class CbmRichPoint;
27class CbmLink;
28
37class CbmRichDigitizer : public CbmDigitize<CbmRichDigi> {
38public:
40 CbmRichDigitizer() : CbmDigitize<CbmRichDigi>("RichDigitize") {};
41
43 virtual ~CbmRichDigitizer() = default;
44
47
50
56
58 virtual InitStatus Init();
59
61 virtual void Exec(Option_t* option);
62
64 virtual void Finish();
65
68
70 void SetTimeResolution(Double_t dt) { fTimeResolution = dt; }
71
77 void SetPixelDeadTime(Double_t dt) { fPixelDeadTime = dt; }
78
85 void SetCrossTalkProbability(Double_t horizontal, Double_t vertical, Double_t diagonal)
86 {
87 fCrossTalkProbability[0] = horizontal;
88 fCrossTalkProbability[1] = vertical;
89 fCrossTalkProbability[2] = diagonal;
90 }
91
96 void SetEventNoiseRate(Double_t noise) { fEventNoiseRate = noise; }
97
102 void SetEventNoiseInterval(Double_t dT) { fEventNoiseInterval = dT; }
103
105 void SetDarkRatePerPixel(Double_t darkRate) { fDarkRatePerPixel = darkRate; }
106
112 void SetClusterSignalProbability(Double_t intensity) { fClusterSignalProbability = intensity; }
113
119
121 void SetCollectionEfficiency(Double_t collEff) { fPmt.SetCollectionEfficiency(collEff); }
122
124 // void SetSigmaMirror(Double_t sigMirror) {fSigmaMirror = sigMirror;}
125
126private:
127 Int_t fEventNum {};
128
129 TClonesArray* fRichPoints {nullptr}; // RICH MC points
130 TClonesArray* fRichDigis {nullptr}; // RICH digis (output array)
131 TClonesArray* fRichDigiMatches {nullptr}; // RICH digi matches (output array)
132 TClonesArray* fMcTracks {nullptr}; // Monte-Carlo tracks
133
134 Int_t fNofPoints {}; // total number of MCPoints processed
135 Int_t fNofDigis {}; // total number of digis created
136 Double_t fTimeTot {}; // sum of execution time
137
140
141 Double_t fTimeResolution {1.}; // in ns, time resolution for digis
142 Double_t fPixelDeadTime {50.}; // in ns, deadtime for one pixel
143 // probability of crosstalk depending on direction of neighbour pixel
144 // index 0: horizontal, 1: vertical, 2: diagonal
145 std::array<Double_t, 3> fCrossTalkProbability{0.02, 0.02, 0.005};
146 Double_t fEventNoiseRate {5.}; // noise rate per McRichPoint / per pixel / per second
147 Double_t fEventNoiseInterval {50.}; // in ns, interval to generate event noise signals
148 Double_t fDarkRatePerPixel {1000.}; // dark rate per pixel in Hz
149 Double_t fClusterSignalProbability {0.37}; // cluster intensity
150 UInt_t fClusterSize {0}; // cluster size
151
152 std::map<Int_t, std::vector<std::pair<Double_t, CbmLink*>>>
153 fSignalBuffer {}; // first: pixel address, second: signal buffer
154
155 std::map<Int_t, Double_t> fPixelsLastFiredTime {}; // first: pixel address, second: last fired time
156
161 Int_t ProcessMcEvent();
162
164 void ProcessPoint(CbmRichPoint* point, Int_t pointId, Int_t eventNum, Int_t inputNum);
165
167 void AddSignalToBuffer(Int_t address, Double_t time, const CbmLink& link);
168
174 void AddCrossTalk(Int_t address, Double_t time, const CbmLink& link);
175
181 void AddChargedParticleCluster(Int_t address, Double_t time, Int_t eventNum, Int_t inputNum);
182
187 void AddEventNoise(Int_t eventNum, Int_t inputNum);
188
190 void AddDarkRateNoise(Double_t oldEventTime, Double_t newEventTime);
191
200 Int_t ProcessBuffers(Double_t processTime);
201
203};
204
205#endif
ECbmModuleId
Definition CbmDefs.h:39
@ kRich
Ring-Imaging Cherenkov Detector.
CbmRichPmtTypeEnum
@ CbmRichPmtTypeCosy17NoWls
static constexpr size_t size()
Definition KfSimdPseudo.h:2
Base class template for CBM digitisation tasks.
Definition CbmDigitize.h:44
ClassDef(CbmDigitize, 1)
Class for producing RICH digis from from MCPoints.
CbmRichDigitizer & operator=(const CbmRichDigitizer &)=delete
void SetDetectorType(CbmRichPmtTypeEnum detType)
Int_t ProcessBuffers(Double_t processTime)
Process signals in all buffers until processTime. New Digis are only created until processTime - fPix...
void SetTimeResolution(Double_t dt)
virtual void Exec(Option_t *option)
std::map< Int_t, Double_t > fPixelsLastFiredTime
TClonesArray * fMcTracks
virtual ~CbmRichDigitizer()=default
Int_t ProcessMcEvent()
Process current MC event.
std::map< Int_t, std::vector< std::pair< Double_t, CbmLink * > > > fSignalBuffer
TClonesArray * fRichPoints
void SetEventNoiseRate(Double_t noise)
Set event noise rate per McRichPoint / per pixel / per second : nofNoiseSignals = nofRichPoints * nof...
std::array< Double_t, 3 > fCrossTalkProbability
Double_t fClusterSignalProbability
void SetDarkRatePerPixel(Double_t darkRate)
void SetClusterSize(UInt_t size)
Set cluster size for charged particle clusters. Resulting cluster size : (2*size + 1)*(2*size + 1) pi...
CbmRichDigitizer(const CbmRichDigitizer &)=delete
TClonesArray * fRichDigis
TClonesArray * fRichDigiMatches
void SetEventNoiseInterval(Double_t dT)
Set event noise interval in ns. Add noise signals from: current event time to current event time + ev...
ECbmModuleId GetSystemId() const
Detector system ID.
void ProcessPoint(CbmRichPoint *point, Int_t pointId, Int_t eventNum, Int_t inputNum)
void SetCrossTalkProbability(Double_t horizontal, Double_t vertical, Double_t diagonal)
Set crosstalk probability for horizontal, vertical and diagonal directions.
CbmRichPmtTypeEnum fDetectorType
void SetCollectionEfficiency(Double_t collEff)
virtual InitStatus Init()
void AddEventNoise(Int_t eventNum, Int_t inputNum)
Add additional noise for each event based on fEventNoiseRate and fEventNoiseInterval.
void AddCrossTalk(Int_t address, Double_t time, const CbmLink &link)
Add crosstalk assuming fCrossTalkProbability. Only add maximum one cross talk signal per MC point....
virtual void Finish()
void AddSignalToBuffer(Int_t address, Double_t time, const CbmLink &link)
void AddChargedParticleCluster(Int_t address, Double_t time, Int_t eventNum, Int_t inputNum)
Add additional signals to nearby pixels if a charged particle directly passes through the PMT,...
void SetPixelDeadTime(Double_t dt)
Set pixel dead time between signals (without time smearing). The resulting dead time at digi level is...
void SetClusterSignalProbability(Double_t intensity)
Set charged particle cluster signal probability for direct neighbors. The probability for pixels furt...
void AddDarkRateNoise(Double_t oldEventTime, Double_t newEventTime)
void SetCollectionEfficiency(Double_t collEff)
Set collection efficiency for photoelectrons in PMT optics.
Definition CbmRichPmt.h:50