CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensorDigitizerTask.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2017 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Michael Deveaux, Philipp Sitzmann [committer] */
4
5// ------------------------------------------------------------------------
6// ----- CbmMvdSensorDigitizerTask header file -----
7// ----- Created 02/02/12 by M. Deveaux -----
8// ------------------------------------------------------------------------
9
17#ifndef CBMMVDSENSORDIGITIZERTASK_H
18#define CBMMVDSENSORDIGITIZERTASK_H 1
19
20#include "CbmMvdSensorTask.h" // for CbmMvdSensorTask
21
22#include <FairTask.h> // for InitStatus
23
24#include <Rtypes.h> // for ClassDef
25#include <RtypesCore.h> // for Double_t, Int_t, Float_t, Bool_t, kTRUE
26#include <TRandom3.h> // for TRandom3
27#include <TStopwatch.h> // for TStopwatch
28#include <TString.h> // for TString
29
30#include <map> // for map
31#include <utility> // for pair
32#include <vector> // for vector
33
36class CbmMvdPoint;
37class CbmMvdSensor;
39class TBuffer;
40class TClass;
41class TClonesArray;
42class TH1F;
43class TH2F;
44class TMemberInspector;
45class TObjArray;
46class TObject;
47class TRefArray;
48
50
51 public:
54 CbmMvdSensorDigitizerTask(Int_t iMode);
55
58
60 virtual void InitTask(CbmMvdSensor* mySensor);
61
63 void SetInputArray(TClonesArray* inputStream);
64 void SetInput(TObject*); //overwrite
65
67 void Exec();
68 void ExecChain();
69
70 TClonesArray* GetOutputArray() { return fOutputBuffer; };
71 TClonesArray* GetMatchArray() { return fDigiMatch; };
72 TClonesArray* GetWriteArray() { return fDigis; };
73
74 InitStatus ReadSensorInformation();
77 void ProduceNoise();
78 Bool_t GetSignalAboveThreshold(CbmMvdPixelCharge* myPixel, Double_t readoutTime);
79 Int_t GetPixelCharge(CbmMvdPixelCharge* myPixel, Double_t readoutTime);
80
81 void ProduceDigis();
83 // Bool_t GetSignalAboveThreshold (CbmMvdPixelCharge* myPixel, Double_t readoutTime);
84 //Int_t GetPixelCharge(CbmMvdPixelCharge* myPixel, Double_t readoutTime);
85 Int_t CheckForHit(CbmMvdPixelCharge* pixel);
86
87
88 void SetProduceNoise() { fproduceNoise = kTRUE; };
89
94 void SetEventMode() { fEventMode = kTRUE; }
95
97 void SetSegmentLength(Double_t segmentLength) { fSegmentLength = segmentLength; }
98 void SetDiffusionCoef(Double_t diffCoeff) { fDiffusionCoefficient = diffCoeff; }
99 void SetElectronsPerKeV(Double_t electronsPerKeV) { fElectronsPerKeV = electronsPerKeV; }
100 void SetWidthOfCluster(Double_t widthOfCluster) { fWidthOfCluster = widthOfCluster; }
101 void SetCutOnDeltaRays(Double_t cutOnDeltaRays) { fCutOnDeltaRays = cutOnDeltaRays; }
102 void SetChargeThreshold(Float_t chargeThreshold) { fChargeThreshold = chargeThreshold; }
103
104 void GetEventInfo(Int_t& inputNr, Int_t& eventNr, Double_t& eventTime);
105
106
107 //protected:
108 public:
109 // ---------- Protected data members ------------------------------------
110
111 // Information about event and sensor status
113 Int_t fEventNr;
114 Int_t fInputNr;
115 Double_t fEventTime;
116
117 // Information about sensor
118 Double_t fEpiTh;
120
124 Double_t fPixelSizeX;
125 Double_t fPixelSizeY;
129
130 Double_t fEsum;
136
138 TH2F* fPosXY;
139 TH1F* fpZ;
141 TH1F* fAngle;
147
148
149 Double_t fLorentzY0;
150 Double_t fLorentzXc;
151 Double_t fLorentzW;
152 Double_t fLorentzA;
153 Double_t fLorentzNorm;
154
155 Double_t fLandauMPV;
156 Double_t fLandauSigma;
157 Double_t fLandauGain;
158 TRandom3* fLandauRandom;
159
160 Double_t fPixelSize;
161 Double_t fPar0;
162 Double_t fPar1;
163 Double_t fPar2;
164
165 Double_t fCompression;
166
169
172 Int_t fEvent;
176
177 TClonesArray* fPixelCharge;
178
179 TClonesArray* fDigis;
180
181 TClonesArray* fDigiMatch;
182
184
185 Bool_t fEventMode{kFALSE};
186
187 std::vector<CbmMvdPixelCharge*> fPixelChargeShort;
188
190 std::map<std::pair<Int_t, Int_t>, CbmMvdPixelCharge*> fChargeMap;
191 std::map<std::pair<Int_t, Int_t>, CbmMvdPixelCharge*>::iterator fChargeMapIt;
192
193
194 private:
196
198 Int_t fMode;
199
200
202 Double_t fSigmaX, fSigmaY; // MAPS resolution in [cm]
203 Double_t fReadoutTime; // MAPS readout time in [s]
204 Double_t fEfficiency; // MAPS detection efficiency
205 Double_t fMergeDist; // Merging distance
206 Double_t fFakeRate; // Fake hit rate
207 Int_t fNPileup; // Number of pile-up background events
208 Int_t fNDeltaElect; // Number of delta electron events
211
212
214 TString fBranchName; // Name of input branch (STSPoint)
215 TString fBgFileName; // Name of background (pileup) file
216 TString fDeltaFileName; // Name of the file containing delta electrons
217 TClonesArray* fInputPoints; // Array of MCPoints (input)
218
219 TRefArray* fPoints; // Array of all MCPoints (including background files)
220
221
223 TRandom3 fRandGen;
224 TStopwatch fTimer;
225
226
230
231
233 Int_t fNEvents;
234 Double_t fNPoints;
235 Double_t fNReal;
236 Double_t fNBg;
237 Double_t fNFake;
238 Double_t fNLost;
239 Double_t fNMerged;
240 Double_t fTime;
241
242 // ----- Private methods ---------------------------------------------
243
244 struct SignalPoint {
245 double x;
246 double y;
247 double z;
248 double sigmaX;
249 double sigmaY;
250 double charge;
251 double eloss;
252 };
253
254
255 typedef std::vector<SignalPoint> SignalPointVec;
256
258
259
261 virtual void SetParContainers();
262
263
265 virtual void ReInit(CbmMvdSensor* mySensor);
266
267
269 virtual void Finish();
270
271
273 void Register();
274
275
277 void Reset();
278
279
281 void PrintParameters() const;
282 std::string ToString() const;
283
288
292 void FlushBuffer(CbmMvdPixelCharge* pixel, Int_t i);
293
299
300
301 private:
304
306};
307
308
309#endif
std::vector< SignalPoint > SignalPointVec
void SetChargeThreshold(Float_t chargeThreshold)
void SetElectronsPerKeV(Double_t electronsPerKeV)
CbmMvdSensorDataSheet * fSensorDataSheet
void SetDiffusionCoef(Double_t diffCoeff)
std::map< std::pair< Int_t, Int_t >, CbmMvdPixelCharge * >::iterator fChargeMapIt
void SetCutOnDeltaRays(Double_t cutOnDeltaRays)
Int_t CheckForHit(CbmMvdPixelCharge *pixel)
ClassDef(CbmMvdSensorDigitizerTask, 1)
void ProduceIonisationPoints(CbmMvdPoint *point)
virtual void InitTask(CbmMvdSensor *mySensor)
virtual void ReInit(CbmMvdSensor *mySensor)
Int_t GetPixelCharge(CbmMvdPixelCharge *myPixel, Double_t readoutTime)
std::vector< CbmMvdPixelCharge * > fPixelChargeShort
CbmMvdSensorDigitizerTask operator=(const CbmMvdSensorDigitizerTask &)
void GetEventInfo(Int_t &inputNr, Int_t &eventNr, Double_t &eventTime)
void FlushBuffer(CbmMvdPixelCharge *pixel, Int_t i)
std::map< std::pair< Int_t, Int_t >, CbmMvdPixelCharge * > fChargeMap
CbmMvdSensorDigitizerTask(const CbmMvdSensorDigitizerTask &)
Bool_t GetSignalAboveThreshold(CbmMvdPixelCharge *myPixel, Double_t readoutTime)
void SetInputArray(TClonesArray *inputStream)
void ProducePixelCharge(CbmMvdPoint *point)
void SetSegmentLength(Double_t segmentLength)
void SetWidthOfCluster(Double_t widthOfCluster)
TClonesArray * fOutputBuffer