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
9
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#include "TStopwatch.h"
22
23#include <map>
24
25class TClonesArray;
26class CbmStsPoint;
27class CbmStsParAsic;
28class CbmStsParModule;
29class CbmStsParSensor;
34class CbmStsParSim;
35class CbmStsSetup;
37
38
54class CbmStsDigitize : public CbmDigitize<CbmStsDigi> {
55
56 public:
59
60
62 virtual ~CbmStsDigitize();
63
64
71 void CreateDigi(Int_t address, UShort_t channel, Long64_t time, UShort_t adc, const CbmMatch& match);
72
73
78
82 virtual void SetParContainers();
83
84
86 virtual void Exec(Option_t* opt);
87
88
90 Int_t GetNofSignalsF() const { return fNofSignalsF; }
91
92
94 Int_t GetNofSignalsB() const { return fNofSignalsB; }
95
96
98 void InitSetup();
99
100
102 virtual InitStatus ReInit();
103
104
111 /*
112 void SetModuleParameterMap(std::map<Int_t, CbmStsDigitizeParameters*> parMap) {
113 fModuleParameterMap = parMap;
114 }
115 */
116
117
130 void SetGlobalAsicParams(UShort_t nChannels, UShort_t nAdc, Double_t dynRange, Double_t threshold,
131 Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate);
132
133
140 void SetGlobalFracDeadChannels(Double_t fraction) { fUserFracDeadChan = fraction; }
141
142
149 void SetGlobalModuleParams(UInt_t nChannels, UInt_t nAsicChannels);
150
151
162 void SetGlobalSensorConditions(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling,
163 Double_t cInterstrip);
164
165
172 void SetModuleParameterFile(const char* fileName);
173
174
183 void SetProcesses(CbmStsELoss eLossModel, Bool_t useLorentzShift = kTRUE, Bool_t useDiffusion = kTRUE,
184 Bool_t useCrossTalk = kTRUE);
185
186
199 void SetReadoutInterval(Double_t value) { fReadoutInterval = value; }
200
201
208 void SetSensorConditionFile(const char* fileName);
209
210
217 void SetSensorParameterFile(const char* fileName);
218
219
232 /*
233 void SetSensorStripPitch(Double_t pitch) {
234 fDigiPar->SetStripPitch(pitch);
235 }
236 */
237
245 void UseOnlyPrimaries(Bool_t flag = kTRUE);
246
248 bool SetAsicParamsFromFile(const char* filename);
249
250 private:
252
253 //std::map<Int_t, CbmStsDigitizeParameters*> fModuleParameterMap; ///< Individual module parameter map
256 TClonesArray* fPoints;
257 TClonesArray* fTracks;
258 TStopwatch fTimer;
259 Double_t fReadoutInterval = -1.;
260
262 std::map<UInt_t, CbmStsSimModule*> fModules{};
263
265 std::map<UInt_t, std::unique_ptr<CbmStsSimSensor>> fSensors{};
266
267 // --- Global user-defined parameter settings
273 Double_t fUserDinactive = 0.;
274 Double_t fUserFracDeadChan = 0.;
275
276 // --- Module and sensor parameters for runtime DB output
281
282 // --- Default sensor parameters (apply to SensorDssdStereo)
283 Double_t fSensorDinact;
284 Double_t fSensorPitch;
285 Double_t fSensorStereoF;
286 Double_t fSensorStereoB;
287
288 // --- Input parameter files
292
293 // --- Time stamps
294 Double_t fTimePointLast;
296 Double_t fTimeDigiFirst;
297 Double_t fTimeDigiLast;
298
299 // --- Event counters
305
306 // --- Run counters
308 Double_t fNofPointsProcTot = 0;
309 Double_t fNofPointsIgnoTot = 0;
310 Double_t fNofSignalsFTot = 0;
311 Double_t fNofSignalsBTot = 0;
312 Double_t fNofDigisTot = 0;
313 Double_t fNofNoiseTot = 0;
314 Double_t fTimeTot = 0.;
315
316
317 // --- List of inactive channels
318 // --- We do not use the base class here since STS channels are identified not only by
319 // --- CbmAddress like in all other detectors, but by address plus channel number.
320 std::map<Int_t, std::set<UShort_t>> fInactiveChannelsSts = {};
321
322
326 Int_t BufferSize() const;
327
328
333 std::string BufferStatus() const;
334
335
337 virtual void Finish();
338
339
341 virtual InitStatus Init();
342
343
347 UInt_t InitModules();
348
349
351 void InitParams();
352
353
357 UInt_t InitSensors();
358
359
368 bool IsChannelActiveSts(Int_t address, UShort_t channel);
369
370
374 void ProcessAnalogBuffers(Double_t readoutTime);
375
376
378 void ProcessMCEvent();
379
380
385 void ProcessPoint(const CbmStsPoint* point, Double_t eventTime, const CbmLink& link);
386
387
400 std::pair<size_t, bool> ReadInactiveChannels();
401
402
403 // --- File name for parsing ASIC parameters from ASCII file for particular Asics setting
404 const char* fAsicParamsFileName = nullptr;
405
413 std::map<std::tuple<UInt_t, Int_t, Int_t>, std::unique_ptr<CbmStsParAsic>> fModuleAsicParams;
414
415
417 void ResetCounters();
418
419
428 void SetGlobalDefaults();
429
430
434
435
437};
438
439#endif
ECbmModuleId
Enumerator for module Identifiers.
Definition CbmDefs.h:45
@ kSts
Silicon Tracking System.
Definition CbmDefs.h:48
CbmStsELoss
Energy loss model used in simulation.
Definition CbmStsDefs.h:49
int Int_t
bool Bool_t
TString fSensorConditionFile
File with sensor conditions.
const char * fAsicParamsFileName
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 fReadoutInterval
Interval for analog buffer readout [ns].
Double_t fSensorPitch
Strip pitch [cm].
CbmStsParAsic * fUserParAsic
User defined, global.
void SetReadoutInterval(Double_t value)
Set readout interval.
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].
Double_t fTimeLastReadout
Time of last readout of analog buffers.
CbmStsParSensor * fUserParSensor
User defined, global.
TString fSensorParameterFile
File with sensor parameters.
CbmStsParSim * fParSim
Simulation settings.
std::map< std::tuple< UInt_t, Int_t, Int_t >, std::unique_ptr< CbmStsParAsic > > fModuleAsicParams
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
Time of last processed StsPoint.
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.
bool SetAsicParamsFromFile(const char *filename)
Set ASIC parameters from ASCII file.
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