CbmRoot
CbmStsDigitize.h
Go to the documentation of this file.
1 
6 #ifndef CBMSTSDIGITIZE_H
7 #define CBMSTSDIGITIZE_H 1
8 
9 #include "TStopwatch.h"
10 #include <map>
11 
12 #include "CbmDefs.h"
13 #include "CbmDigitize.h"
14 #include "CbmMatch.h"
15 #include "CbmStsDefs.h"
16 #include "CbmStsDigi.h"
17 #include "CbmStsPhysics.h"
18 #include "CbmStsSimModule.h"
19 #include "CbmStsSimSensor.h"
20 
21 class TClonesArray;
22 class CbmStsPoint;
23 class CbmStsParAsic;
24 class CbmStsParModule;
25 class CbmStsParSensor;
27 class CbmStsParSetModule;
28 class CbmStsParSetSensor;
30 class CbmStsParSim;
31 class CbmStsSetup;
33 
34 
50 class CbmStsDigitize : public CbmDigitize<CbmStsDigi> {
51 
52 public:
55 
56 
58  virtual ~CbmStsDigitize();
59 
60 
67  void CreateDigi(Int_t address,
68  UShort_t channel,
69  Long64_t time,
70  UShort_t adc,
71  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 
129  void SetGlobalAsicParams(UInt_t nAdc,
130  Double_t dynRange,
131  Double_t threshold,
132  Double_t timeResolution,
133  Double_t deadTime,
134  Double_t noise,
135  Double_t zeroNoiseRate);
136 
137 
144  void SetGlobalModuleParams(UInt_t nChannels, UInt_t nAsicChannels);
145 
146 
157  void SetGlobalSensorConditions(Double_t vDep,
158  Double_t vBias,
159  Double_t temperature,
160  Double_t cCoupling,
161  Double_t cInterstrip);
162 
163 
170  void SetModuleParameterFile(const char* fileName);
171 
172 
181  void SetProcesses(CbmStsELoss eLossModel,
182  Bool_t useLorentzShift = kTRUE,
183  Bool_t useDiffusion = kTRUE,
184  Bool_t useCrossTalk = kTRUE);
185 
186 
193  void SetSensorConditionFile(const char* fileName);
194 
195 
202  void SetSensorParameterFile(const char* fileName);
203 
204 
217  /*
218  void SetSensorStripPitch(Double_t pitch) {
219  fDigiPar->SetStripPitch(pitch);
220  }
221  */
222 
230  void UseOnlyPrimaries(Bool_t flag = kTRUE);
231 
232 
233 private:
234  Bool_t fIsInitialised;
235 
236  //std::map<Int_t, CbmStsDigitizeParameters*> fModuleParameterMap; ///< Individual module parameter map
239  TClonesArray* fPoints;
240  TClonesArray* fTracks;
241  TStopwatch fTimer;
242 
244  std::map<UInt_t, CbmStsSimModule*> fModules {};
245 
247  std::map<UInt_t, std::unique_ptr<CbmStsSimSensor>> fSensors {};
248 
249  // --- Global user-defined parameter settings
255  Double_t fUserDinactive = 0.;
256 
257  // --- Module and sensor parameters for runtime DB output
258  CbmStsParSim* fParSim = nullptr;
262 
263  // --- Default sensor parameters (apply to SensorDssdStereo)
264  Double_t fSensorDinact;
265  Double_t fSensorPitch;
266  Double_t fSensorStereoF;
267  Double_t fSensorStereoB;
268 
269  // --- Input parameter files
273 
274  // --- Time of last processed StsPoint (for stream mode)
275  Double_t fTimePointLast;
276 
277  // --- Digi times (for stream mode, in each step)
278  Double_t fTimeDigiFirst;
279  Double_t fTimeDigiLast;
280 
281  // --- Event counters
282  Int_t fNofPointsProc = 0;
283  Int_t fNofPointsIgno = 0;
284  Int_t fNofSignalsF = 0;
285  Int_t fNofSignalsB = 0;
286  Int_t fNofDigis = 0;
287 
288  // --- Run counters
289  Int_t fNofEvents = 0;
290  Double_t fNofPointsProcTot = 0;
291  Double_t fNofPointsIgnoTot = 0;
292  Double_t fNofSignalsFTot = 0;
293  Double_t fNofSignalsBTot = 0;
294  Double_t fNofDigisTot = 0;
295  Double_t fNofNoiseTot = 0;
296  Double_t fTimeTot = 0.;
297 
298 
302  Int_t BufferSize() const;
303 
304 
309  std::string BufferStatus() const;
310 
311 
313  virtual void Finish();
314 
315 
317  virtual InitStatus Init();
318 
319 
323  UInt_t InitModules();
324 
325 
327  void InitParams();
328 
329 
333  UInt_t InitSensors();
334 
335 
339  void ProcessAnalogBuffers(Double_t readoutTime);
340 
341 
343  void ProcessMCEvent();
344 
345 
350  void ProcessPoint(const CbmStsPoint* point,
351  Double_t eventTime = 0.,
352  CbmLink* link = NULL);
353 
354 
356  void ResetCounters();
357 
358 
367  void SetGlobalDefaults();
368 
369 
373 
374 
376 };
377 
378 #endif
CbmMatch
Definition: CbmMatch.h:22
CbmStsDigitize::InitSensors
UInt_t InitSensors()
Instantiate sensors.
Definition: CbmStsDigitize.cxx:518
CbmStsDigitize::fModules
std::map< UInt_t, CbmStsSimModule * > fModules
Definition: CbmStsDigitize.h:244
CbmStsDigitize::fSensorConditionFile
TString fSensorConditionFile
File with sensor conditions.
Definition: CbmStsDigitize.h:271
CbmStsDigitize::fTimeDigiLast
Double_t fTimeDigiLast
Time of last digi sent to DAQ.
Definition: CbmStsDigitize.h:279
CbmStsDigitize::SetGlobalAsicParams
void SetGlobalAsicParams(UInt_t nAdc, Double_t dynRange, Double_t threshold, Double_t timeResolution, Double_t deadTime, Double_t noise, Double_t zeroNoiseRate)
Set individual module parameters.
Definition: CbmStsDigitize.cxx:765
CbmStsDigitize::fTracks
TClonesArray * fTracks
Input array of CbmMCTrack.
Definition: CbmStsDigitize.h:240
CbmStsDigitize::fSensorParameterFile
TString fSensorParameterFile
File with sensor parameters.
Definition: CbmStsDigitize.h:270
CbmStsDigitize::fIsInitialised
Bool_t fIsInitialised
kTRUE if Init() was called
Definition: CbmStsDigitize.h:234
CbmStsParSensorCond
Parameters for operating conditions of a STS sensor.
Definition: CbmStsParSensorCond.h:28
CbmStsDigitize::fNofDigis
Int_t fNofDigis
Number of created digis in Exec.
Definition: CbmStsDigitize.h:286
CbmStsDigitize::fUserParSim
CbmStsParSim * fUserParSim
Settings for simulation.
Definition: CbmStsDigitize.h:250
CbmStsDigitize::BufferSize
Int_t BufferSize() const
Number of signals in the analogue buffers @value nSignals Sum of number of signals in all modules.
Definition: CbmStsDigitize.cxx:101
CbmStsDigitize::fUserParModule
CbmStsParModule * fUserParModule
User defined, global.
Definition: CbmStsDigitize.h:252
CbmStsDigitize
Task class for simulating the detector response of the STS.
Definition: CbmStsDigitize.h:50
CbmStsDigitize::fNofEvents
Int_t fNofEvents
Total number of procesed events.
Definition: CbmStsDigitize.h:289
CbmStsDigitize::ProcessAnalogBuffers
void ProcessAnalogBuffers(Double_t readoutTime)
Definition: CbmStsDigitize.cxx:608
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmStsDigitize::fParSetSensor
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
Definition: CbmStsDigitize.h:260
CbmStsDigitize::fNofSignalsB
Int_t fNofSignalsB
Number of signals on back side.
Definition: CbmStsDigitize.h:285
CbmStsDigitize::fUserParSensor
CbmStsParSensor * fUserParSensor
User defined, global.
Definition: CbmStsDigitize.h:253
CbmStsDigitize::fNofPointsProc
Int_t fNofPointsProc
Number of processed points.
Definition: CbmStsDigitize.h:282
CbmStsDigitize::fNofSignalsF
Int_t fNofSignalsF
Number of signals on front side.
Definition: CbmStsDigitize.h:284
CbmStsDigitize::fPoints
TClonesArray * fPoints
Sensor factory.
Definition: CbmStsDigitize.h:239
CbmStsDigitize::SetSensorConditionFile
void SetSensorConditionFile(const char *fileName)
Set the file name with sensor conditions.
Definition: CbmStsDigitize.cxx:834
CbmStsDigitize::ResetCounters
void ResetCounters()
Reset event counters.
Definition: CbmStsDigitize.cxx:681
CbmStsDigitize::GetNofSignalsF
Int_t GetNofSignalsF() const
Definition: CbmStsDigitize.h:90
CbmStsDigitize::~CbmStsDigitize
virtual ~CbmStsDigitize()
Definition: CbmStsDigitize.cxx:96
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmMatch.h
CbmStsDigitize::fSensorStereoB
Double_t fSensorStereoB
Stereo angle back side [degrees].
Definition: CbmStsDigitize.h:267
CbmStsDigitize::InitSetup
void InitSetup()
Definition: CbmStsDigitize.cxx:590
CbmStsDigitize::ProcessMCEvent
void ProcessMCEvent()
Definition: CbmStsDigitize.cxx:618
CbmStsParSetSensorCond
Parameters container for CbmStsParSensorCond.
Definition: CbmStsParSetSensorCond.h:30
CbmStsDigitize::fNofNoiseTot
Double_t fNofNoiseTot
Total number of noise digis.
Definition: CbmStsDigitize.h:295
CbmStsParSensor
Constructional parameters of a STS sensor.
Definition: CbmStsParSensor.h:38
CbmStsDigi.h
CbmStsDigitize::SetParContainers
virtual void SetParContainers()
Inherited from FairTask.
Definition: CbmStsDigitize.cxx:321
CbmStsDigitize::fNofPointsProcTot
Double_t fNofPointsProcTot
Total number of processed points.
Definition: CbmStsDigitize.h:290
CbmStsDefs.h
CbmStsParSetSensor
Parameters container for CbmStsParSensor.
Definition: CbmStsParSetSensor.h:30
CbmStsELoss
CbmStsELoss
Energy loss model used in simulation.
Definition: CbmStsDefs.h:43
CbmStsDigitize::BufferStatus
std::string BufferStatus() const
Status of the analogue buffers.
Definition: CbmStsDigitize.cxx:118
CbmDigitize
Base class template for CBM digitisation tasks.
Definition: CbmDigitize.h:39
CbmStsParAsic
Parameters of the STS readout ASIC.
Definition: CbmStsParAsic.h:25
CbmStsDigitize::fNofSignalsBTot
Double_t fNofSignalsBTot
Number of signals on back side.
Definition: CbmStsDigitize.h:293
CbmStsDigitize::fNofPointsIgno
Int_t fNofPointsIgno
Number of ignored points.
Definition: CbmStsDigitize.h:283
CbmStsParModule
Parameters for one STS module.
Definition: CbmStsParModule.h:28
CbmStsDigitize::fUserDinactive
Double_t fUserDinactive
Size of inactive sensor border [cm].
Definition: CbmStsDigitize.h:255
CbmStsDigitize::SetSensorParameterFile
void SetSensorParameterFile(const char *fileName)
Set the file name with sensor parameters.
Definition: CbmStsDigitize.cxx:847
CbmStsDigitize::GetNofSignalsB
Int_t GetNofSignalsB() const
Definition: CbmStsDigitize.h:94
CbmStsDigitize::fTimePointLast
Double_t fTimePointLast
Definition: CbmStsDigitize.h:275
CbmStsDigitize::fSensors
std::map< UInt_t, std::unique_ptr< CbmStsSimSensor > > fSensors
Definition: CbmStsDigitize.h:247
CbmStsPhysics.h
CbmStsDigitize::CreateDigi
void CreateDigi(Int_t address, UShort_t channel, Long64_t time, UShort_t adc, const CbmMatch &match)
Definition: CbmStsDigitize.cxx:149
CbmStsDigitize::fTimer
TStopwatch fTimer
ROOT timer.
Definition: CbmStsDigitize.h:241
CbmStsDigitize::CbmStsDigitize
CbmStsDigitize()
Definition: CbmStsDigitize.cxx:70
CbmStsDigitize::fNofDigisTot
Double_t fNofDigisTot
Total number of digis created.
Definition: CbmStsDigitize.h:294
CbmStsSetup
Class representing the top level of the STS setup.
Definition: CbmStsSetup.h:39
CbmStsDigitize::fSetup
CbmStsSetup * fSetup
Definition: CbmStsDigitize.h:237
CbmStsDigitize::ProcessPoint
void ProcessPoint(const CbmStsPoint *point, Double_t eventTime=0., CbmLink *link=NULL)
Definition: CbmStsDigitize.cxx:648
CbmStsDigitize::fParSetModule
CbmStsParSetModule * fParSetModule
Module parameter.
Definition: CbmStsDigitize.h:259
CbmStsDigitize::fSensorDinact
Double_t fSensorDinact
Size of inactive border [cm].
Definition: CbmStsDigitize.h:264
CbmStsDigitize::UseOnlyPrimaries
void UseOnlyPrimaries(Bool_t flag=kTRUE)
Discard processing of secondary tracks.
Definition: CbmStsDigitize.cxx:860
CbmStsDigitize::GetSystemId
ECbmModuleId GetSystemId() const
Detector system ID.
Definition: CbmStsDigitize.h:77
CbmStsSimSensor.h
CbmStsDigitize::fUserParCond
CbmStsParSensorCond * fUserParCond
User defined, global.
Definition: CbmStsDigitize.h:254
CbmStsDigitize::SetGlobalDefaults
void SetGlobalDefaults()
Set global default parameters.
Definition: CbmStsDigitize.cxx:693
CbmStsDigitize::fModuleParameterFile
TString fModuleParameterFile
File with module parameters.
Definition: CbmStsDigitize.h:272
CbmStsDigitize::fNofPointsIgnoTot
Double_t fNofPointsIgnoTot
Total number of ignored points.
Definition: CbmStsDigitize.h:291
CbmStsDigitize::InitModules
UInt_t InitModules()
Instantiate modules.
Definition: CbmStsDigitize.cxx:390
CbmStsDigitize::Exec
virtual void Exec(Option_t *opt)
Definition: CbmStsDigitize.cxx:173
CbmStsDigitize::fSensorPitch
Double_t fSensorPitch
Strip pitch [cm].
Definition: CbmStsDigitize.h:265
CbmStsParSim
Settings for STS simulation (digitizer)
Definition: CbmStsParSim.h:25
CbmStsDigitize::SetGlobalModuleParams
void SetGlobalModuleParams(UInt_t nChannels, UInt_t nAsicChannels)
Set the global module parameters.
Definition: CbmStsDigitize.cxx:782
CbmStsDigitize::fTimeDigiFirst
Double_t fTimeDigiFirst
Time of first digi sent to DAQ.
Definition: CbmStsDigitize.h:278
CbmStsDigitize::ClassDef
ClassDef(CbmStsDigitize, 5)
CbmStsDigitize::fUserParAsic
CbmStsParAsic * fUserParAsic
User defined, global.
Definition: CbmStsDigitize.h:251
CbmStsDigitize::Finish
virtual void Finish()
Definition: CbmStsDigitize.cxx:248
CbmStsParSetModule
Parameters container for CbmStsParModule.
Definition: CbmStsParSetModule.h:30
CbmStsDigitize::operator=
CbmStsDigitize operator=(const CbmStsDigitize &)
CbmStsDigitize::fParSim
CbmStsParSim * fParSim
Simulation settings.
Definition: CbmStsDigitize.h:258
CbmStsDigitize::fSensorFactory
CbmStsSimSensorFactory * fSensorFactory
STS setup interface.
Definition: CbmStsDigitize.h:238
CbmStsDigitize::InitParams
void InitParams()
Initialise the parameters.
Definition: CbmStsDigitize.cxx:413
CbmStsDigitize::ReInit
virtual InitStatus ReInit()
Definition: CbmStsDigitize.cxx:671
CbmStsDigitize::fTimeTot
Double_t fTimeTot
Total execution time.
Definition: CbmStsDigitize.h:296
CbmStsDigitize::fSensorStereoF
Double_t fSensorStereoF
Stereo angle front side [degrees].
Definition: CbmStsDigitize.h:266
CbmStsDigitize::SetModuleParameterFile
void SetModuleParameterFile(const char *fileName)
Set the file name with module parameters.
Definition: CbmStsDigitize.cxx:808
CbmStsSimModule.h
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmStsDigitize::fNofSignalsFTot
Double_t fNofSignalsFTot
Number of signals on front side.
Definition: CbmStsDigitize.h:292
CbmStsSimSensorFactory
Definition: CbmStsSimSensorFactory.h:30
CbmDigitize.h
CbmStsDigitize::Init
virtual InitStatus Init()
Definition: CbmStsDigitize.cxx:336
CbmStsDigitize::fParSetCond
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
Definition: CbmStsDigitize.h:261
CbmStsDigitize::SetGlobalSensorConditions
void SetGlobalSensorConditions(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling, Double_t cInterstrip)
Set the global sensor conditions.
Definition: CbmStsDigitize.cxx:793
CbmStsDigitize::SetProcesses
void SetProcesses(CbmStsELoss eLossModel, Bool_t useLorentzShift=kTRUE, Bool_t useDiffusion=kTRUE, Bool_t useCrossTalk=kTRUE)
Definition: CbmStsDigitize.cxx:817
CbmStsDigitize::CbmStsDigitize
CbmStsDigitize(const CbmStsDigitize &)
CbmDefs.h