CbmRoot
Loading...
Searching...
No Matches
CbmDigitizeBase.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMDIGITIZEBASE_H
11#define CBMDIGITIZEBASE_H 1
12
13#include "CbmDefs.h" // for ECbmModuleId
14
15#include <FairTask.h> // for FairTask
16
17#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
18#include <RtypesCore.h> // for Bool_t, Double_t, Int_t, kTRUE, ULong64_t
19
20#include <set>
21#include <string> // for string
22
23class CbmTimeSlice;
24
25
33class CbmDigitizeBase : public FairTask {
34
35 public:
38
39
43 CbmDigitizeBase(const char* name);
44
45
47 virtual ~CbmDigitizeBase();
48
49
57 virtual Bool_t CheckOutput() = 0;
58
59
65 virtual void ClearOutput() = 0;
66
67
75 virtual void FillCustomData(Double_t /*fillTime*/, Bool_t /*limit*/ = kTRUE) {}
76
77
85 virtual ULong64_t FillTimeSlice(CbmTimeSlice* timeSlice) = 0;
86
87
96 virtual ULong64_t FillTimeSlice(CbmTimeSlice*, Double_t tMax) = 0;
97
98
107 void GetEventInfo();
108
109
113 Double_t GetEventTime() const { return fCurrentEventTime; }
114
115
119 virtual ULong64_t GetDaqBufferSize() const = 0;
120
121
125 virtual std::string GetDaqBufferStatus() const = 0;
126
127
131 virtual Double_t GetDaqBufferTimeFirst() const = 0;
132
133
137 virtual ECbmModuleId GetSystemId() const = 0;
138
142 virtual Double_t GetLatency() const = 0;
143
144
148 virtual Double_t GetDaqBufferTimeLast() const = 0;
149
150
154 void SetCreateMatches(Bool_t choice = kTRUE) { fCreateMatches = choice; }
155
156
160 void SetEventMode(Bool_t choice = kTRUE) { fEventMode = choice; }
161
162
169 void SetInactiveChannelFile(const char* fileName) { fInactiveChannelFileName = fileName; }
170
171
175 void SetProduceNoise(Bool_t choice = kTRUE) { fProduceNoise = choice; }
176
177
181 void SetRunStartTime(Double_t time) { fRunStartTime = time; }
182
183
184 protected:
185 Bool_t fEventMode;
188 Double_t fRunStartTime = 0;
194 std::set<uint32_t> fInactiveChannels = {};
195
203 virtual std::pair<size_t, bool> ReadInactiveChannels();
204
205
206 private:
209
210
212 void operator=(const CbmDigitizeBase&) = delete;
213
214
216};
217
218#endif /* CBMDIGITIZEBASE_H */
ECbmModuleId
Definition CbmDefs.h:39
Abstract base class for CBM digitisation tasks.
virtual void FillCustomData(Double_t, Bool_t=kTRUE)
Fill custom data into time slice.
virtual std::pair< size_t, bool > ReadInactiveChannels()
Set of inactive channels, indicated by CbmAddress.
Int_t fCurrentEvent
Number of current input.
TString fInactiveChannelFileName
Time of current MC event [ns].
virtual std::string GetDaqBufferStatus() const =0
Status of DAQ buffer @value Status string of the DAQ buffer.
std::set< uint32_t > fInactiveChannels
Name of file with inactive channels.
virtual ECbmModuleId GetSystemId() const =0
Detector system ID.
virtual ULong64_t GetDaqBufferSize() const =0
Size of DAQ buffer @value Number of data in the DAQ buffer.
virtual ~CbmDigitizeBase()
Destructor.
Double_t fRunStartTime
Flag for creation of links to MC.
void SetInactiveChannelFile(const char *fileName)
Set the file containing the list of inactive channels.
virtual ULong64_t FillTimeSlice(CbmTimeSlice *, Double_t tMax)=0
Fill data into the current time slice.
virtual Double_t GetDaqBufferTimeLast() const =0
Time of last datum in DAQ buffer @value Time of last datum in DAQ buffer.
CbmDigitizeBase()
Constructor.
void GetEventInfo()
Get event information.
virtual Double_t GetDaqBufferTimeFirst() const =0
Time of first datum in DAQ buffer @value Time of first datum in DAQ buffer.
Double_t GetEventTime() const
Current event time @value Start time of current event [ns].
ClassDef(CbmDigitizeBase, 3)
Int_t fCurrentInput
Start time of run [ns].
Double_t fCurrentEventTime
Number of current MC entry.
Int_t fCurrentMCEntry
Number of current MC event.
CbmDigitizeBase(const CbmDigitizeBase &)=delete
Copy constructor forbidden.
Bool_t fCreateMatches
Flag for production of inter-event noise.
void operator=(const CbmDigitizeBase &)=delete
Assignment operator forbidden.
virtual ULong64_t FillTimeSlice(CbmTimeSlice *timeSlice)=0
Fill data into the current time slice.
void SetRunStartTime(Double_t time)
Set the run start time.
virtual Bool_t CheckOutput()=0
Check the output arrays.
virtual Double_t GetLatency() const =0
Detector system ID.
void SetCreateMatches(Bool_t choice=kTRUE)
Set creation of links to MC.
virtual void ClearOutput()=0
Clear the output arrays.
Bool_t fProduceNoise
Flag for event-by-event mode.
void SetProduceNoise(Bool_t choice=kTRUE)
Set production of inter-event noise.
void SetEventMode(Bool_t choice=kTRUE)
Set event-by-event mode.
Bookkeeping of time-slice content.