CbmRoot
Loading...
Searching...
No Matches
CbmStsDigitize.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMSTSDIGITIZE_H
11#define CBMSTSDIGITIZE_H 1
12
13#include "CbmDefs.h"
14#include "CbmDigitize.h"
15#include "CbmMatch.h"
16#include "CbmStsDefs.h"
17#include "CbmStsDigi.h"
18#include "CbmStsPhysics.h"
19#include "CbmStsSimModule.h"
20#include "CbmStsSimSensor.h"
21
22#include "TStopwatch.h"
23
24#include <map>
25
26class TClonesArray;
27class CbmStsPoint;
28class CbmStsParAsic;
29class CbmStsParModule;
30class CbmStsParSensor;
35class CbmStsParSim;
36class CbmStsSetup;
38
39
55class CbmStsDigitize : public CbmDigitize<CbmStsDigi> {
56
57public:
60
61
63 virtual ~CbmStsDigitize();
64
65
72 void CreateDigi(Int_t address, UShort_t channel, Long64_t time, UShort_t adc, const CbmMatch& match);
73
74
79
83 virtual void SetParContainers();
84
85
87 virtual void Exec(Option_t* opt);
88
89
91 Int_t GetNofSignalsF() const { return fNofSignalsF; }
92
93
95 Int_t GetNofSignalsB() const { return fNofSignalsB; }
96
97
99 void InitSetup();
100
101
103 virtual InitStatus ReInit();
104
105
112 /*
113 void SetModuleParameterMap(std::map<Int_t, CbmStsDigitizeParameters*> parMap) {
114 fModuleParameterMap = parMap;
115 }
116 */
117
118
131 void SetGlobalAsicParams(UShort_t nChannels, UShort_t nAdc, Double_t dynRange, Double_t threshold,
132 Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate);
133
134
141 void SetGlobalFracDeadChannels(Double_t fraction) { fUserFracDeadChan = fraction; }
142
143
150 void SetGlobalModuleParams(UInt_t nChannels, UInt_t nAsicChannels);
151
152
163 void SetGlobalSensorConditions(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling,
164 Double_t cInterstrip);
165
166
173 void SetModuleParameterFile(const char* fileName);
174
175
184 void SetProcesses(CbmStsELoss eLossModel, Bool_t useLorentzShift = kTRUE, Bool_t useDiffusion = kTRUE,
185 Bool_t useCrossTalk = kTRUE);
186
187
194 void SetSensorConditionFile(const char* fileName);
195
196
203 void SetSensorParameterFile(const char* fileName);
204
205
218 /*
219 void SetSensorStripPitch(Double_t pitch) {
220 fDigiPar->SetStripPitch(pitch);
221 }
222 */
223
231 void UseOnlyPrimaries(Bool_t flag = kTRUE);
232
233
234private:
236
237 //std::map<Int_t, CbmStsDigitizeParameters*> fModuleParameterMap; ///< Individual module parameter map
240 TClonesArray* fPoints;
241 TClonesArray* fTracks;
242 TStopwatch fTimer;
243
245 std::map<UInt_t, CbmStsSimModule*> fModules {};
246
248 std::map<UInt_t, std::unique_ptr<CbmStsSimSensor>> fSensors {};
249
250 // --- Global user-defined parameter settings
256 Double_t fUserDinactive = 0.;
257 Double_t fUserFracDeadChan = 0.;
258
259 // --- Module and sensor parameters for runtime DB output
264
265 // --- Default sensor parameters (apply to SensorDssdStereo)
266 Double_t fSensorDinact;
267 Double_t fSensorPitch;
268 Double_t fSensorStereoF;
269 Double_t fSensorStereoB;
270
271 // --- Input parameter files
275
276 // --- Time of last processed StsPoint (for stream mode)
278
279 // --- Digi times (for stream mode, in each step)
280 Double_t fTimeDigiFirst;
281 Double_t fTimeDigiLast;
282
283 // --- Event counters
284 Int_t fNofPointsProc = 0;
285 Int_t fNofPointsIgno = 0;
286 Int_t fNofSignalsF = 0;
287 Int_t fNofSignalsB = 0;
288 Int_t fNofDigis = 0;
289
290 // --- Run counters
291 Int_t fNofEvents = 0;
292 Double_t fNofPointsProcTot = 0;
293 Double_t fNofPointsIgnoTot = 0;
294 Double_t fNofSignalsFTot = 0;
295 Double_t fNofSignalsBTot = 0;
296 Double_t fNofDigisTot = 0;
297 Double_t fNofNoiseTot = 0;
298 Double_t fTimeTot = 0.;
299
300 // --- List of inactive channels
301 // --- We do not use the base class here since STS channels are identified not only by
302 // --- CbmAddress like in all other detectors, but by address plus channel number.
303 std::map<Int_t, std::set<UShort_t>> fInactiveChannelsSts = {};
304
305
309 Int_t BufferSize() const;
310
311
316 std::string BufferStatus() const;
317
318
320 virtual void Finish();
321
322
324 virtual InitStatus Init();
325
326
330 UInt_t InitModules();
331
332
334 void InitParams();
335
336
340 UInt_t InitSensors();
341
342
351 bool IsChannelActiveSts(Int_t address, UShort_t channel);
352
353
357 void ProcessAnalogBuffers(Double_t readoutTime);
358
359
361 void ProcessMCEvent();
362
363
368 void ProcessPoint(const CbmStsPoint* point, Double_t eventTime, const CbmLink& link);
369
370
383 std::pair<size_t, bool> ReadInactiveChannels();
384
385
387 void ResetCounters();
388
389
398 void SetGlobalDefaults();
399
400
404
405
407};
408
409#endif
ECbmModuleId
Definition CbmDefs.h:39
@ kSts
Silicon Tracking System.
CbmStsELoss
Energy loss model used in simulation.
Definition CbmStsDefs.h:49
Base class template for CBM digitisation tasks.
Definition CbmDigitize.h:44
Task class for simulating the detector response of the STS.
TString fSensorConditionFile
File with sensor conditions.
Double_t fTimeTot
Total execution time.
void SetGlobalDefaults()
Set global default parameters.
UInt_t InitModules()
Instantiate modules.
virtual void Exec(Option_t *opt)
Bool_t fIsInitialised
kTRUE if Init() was called
Double_t fNofPointsIgnoTot
Total number of ignored points.
virtual ~CbmStsDigitize()
CbmStsParModule * fUserParModule
User defined, global.
Double_t fSensorDinact
Size of inactive border [cm].
void SetGlobalFracDeadChannels(Double_t fraction)
Set global fraction of dead channels.
Double_t fSensorStereoB
Stereo angle back side [degrees].
void SetSensorParameterFile(const char *fileName)
Set the file name with sensor parameters.
TClonesArray * fTracks
Input array of CbmMCTrack.
void SetSensorConditionFile(const char *fileName)
Set the file name with sensor conditions.
Int_t fNofSignalsF
Number of signals on front side.
TClonesArray * fPoints
Sensor factory.
Double_t fSensorPitch
Strip pitch [cm].
CbmStsParAsic * fUserParAsic
User defined, global.
ClassDef(CbmStsDigitize, 5)
std::map< UInt_t, std::unique_ptr< CbmStsSimSensor > > fSensors
virtual InitStatus Init()
Double_t fNofSignalsFTot
Number of signals on front side.
void SetGlobalModuleParams(UInt_t nChannels, UInt_t nAsicChannels)
Set the global module parameters.
Int_t fNofPointsProc
Number of processed points.
ECbmModuleId GetSystemId() const
Detector system ID.
Double_t fTimeDigiFirst
Time of first digi sent to DAQ.
CbmStsSimSensorFactory * fSensorFactory
STS setup interface.
TStopwatch fTimer
ROOT timer.
void ProcessAnalogBuffers(Double_t readoutTime)
Int_t fNofDigis
Number of created digis in Exec.
Int_t BufferSize() const
Number of signals in the analogue buffers @value nSignals Sum of number of signals in all modules.
TString fModuleParameterFile
File with module parameters.
CbmStsDigitize(const CbmStsDigitize &)
Double_t fNofDigisTot
Total number of digis created.
Double_t fSensorStereoF
Stereo angle front side [degrees].
CbmStsParSensor * fUserParSensor
User defined, global.
TString fSensorParameterFile
File with sensor parameters.
CbmStsParSim * fParSim
Simulation settings.
void SetGlobalAsicParams(UShort_t nChannels, UShort_t nAdc, Double_t dynRange, Double_t threshold, Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate)
Set individual module parameters.
void UseOnlyPrimaries(Bool_t flag=kTRUE)
Discard processing of secondary tracks.
Int_t GetNofSignalsB() const
virtual InitStatus ReInit()
Double_t fNofPointsProcTot
Total number of processed points.
CbmStsParSetModule * fParSetModule
Module parameter.
std::map< UInt_t, CbmStsSimModule * > fModules
virtual void Finish()
CbmStsSetup * fSetup
Double_t fNofNoiseTot
Total number of noise digis.
void ProcessPoint(const CbmStsPoint *point, Double_t eventTime, const CbmLink &link)
CbmStsParSim * fUserParSim
Settings for simulation.
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
Int_t GetNofSignalsF() const
bool IsChannelActiveSts(Int_t address, UShort_t channel)
Test if the channel of a digi object is set active.
void CreateDigi(Int_t address, UShort_t channel, Long64_t time, UShort_t adc, const CbmMatch &match)
std::pair< size_t, bool > ReadInactiveChannels()
Read the list of inactive channels from file.
std::string BufferStatus() const
Status of the analogue buffers.
void SetProcesses(CbmStsELoss eLossModel, Bool_t useLorentzShift=kTRUE, Bool_t useDiffusion=kTRUE, Bool_t useCrossTalk=kTRUE)
Double_t fUserFracDeadChan
Fraction of inactive ASIC channels.
void InitParams()
Initialise the parameters.
std::map< Int_t, std::set< UShort_t > > fInactiveChannelsSts
Int_t fNofEvents
Total number of processed events.
void SetGlobalSensorConditions(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling, Double_t cInterstrip)
Set the global sensor conditions.
void SetModuleParameterFile(const char *fileName)
Set the file name with module parameters.
CbmStsParSensorCond * fUserParCond
User defined, global.
Int_t fNofPointsIgno
Number of ignored points.
Double_t fTimePointLast
Int_t fNofSignalsB
Number of signals on back side.
Double_t fNofSignalsBTot
Number of signals on back side.
UInt_t InitSensors()
Instantiate sensors.
Double_t fUserDinactive
Size of inactive sensor border [cm].
void ResetCounters()
Reset event counters.
CbmStsDigitize operator=(const CbmStsDigitize &)
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
virtual void SetParContainers()
Inherited from FairTask.
Double_t fTimeDigiLast
Time of last digi sent to DAQ.
Parameters of the STS readout ASIC.
Parameters for one STS module.
Parameters for operating conditions of a STS sensor.
Constructional parameters of a STS sensor.
Parameters container for CbmStsParModule.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
Settings for STS simulation (digitizer)
Class representing the top level of the STS setup.
Definition CbmStsSetup.h:43