CbmRoot
CbmDaq.h
Go to the documentation of this file.
1 
8 #ifndef CBMDAQ_H
9 #define CBMDAQ_H 1
10 
11 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
12 #include <RtypesCore.h> // for Int_t, Double_t, Bool_t, kFALSE, ULong64_t
13 #include <TStopwatch.h> // for TStopwatch
14 
15 #include <FairTask.h> // for FairTask, InitStatus
16 
17 #include <map> // for map
18 #include <string> // for string
19 #include <utility> // for pair
20 
21 #include "CbmDefs.h" // for ECbmModuleId
22 #include "CbmMCEventList.h" // for CbmMCEventList
23 class CbmDigi;
24 class CbmDigitizeBase;
25 class CbmTimeSlice;
26 class TClonesArray;
27 
28 
40 class CbmDaq : public FairTask {
41 
42 public:
53  CbmDaq(Bool_t eventMode = kFALSE);
54 
55 
59  CbmDaq(Double_t tsLength);
60 
61 
63  ~CbmDaq();
64 
65 
67  virtual void Exec(Option_t* opt);
68 
69 
71  virtual InitStatus Init();
72 
73 
88  void SetLatency(Double_t time) { fLatency = time; }
89 
90 
95  void SetDigitizer(ECbmModuleId system, CbmDigitizeBase* digitizer);
96 
97 
101  void SetTimeSliceLength(Double_t length) { fTimeSliceLength = length; }
102 
103 
109  void StoreAllTimeSlices(Bool_t choice = kTRUE) { fStoreEmptySlices = choice; }
110 
111 
112 private:
114  Double_t fTimeSliceLength;
115  Double_t fLatency;
118 
119  Int_t fNofEvents;
120  Int_t fNofDigis;
124  Double_t fTimeDigiFirst;
125  Double_t fTimeDigiLast;
126  Double_t fTimeSliceFirst;
127  Double_t fTimeSliceLast;
128 
129  TStopwatch fTimer;
130  std::map<ECbmModuleId, TClonesArray*> fDigis;
131  std::map<ECbmModuleId, CbmDigitizeBase*>
136 
137 
139  std::map<Int_t, std::pair<Int_t, Int_t>> fEventRange;
140 
141 
145  Bool_t CheckOutput() const;
146 
147 
152  void CloseTimeSlice();
153 
154 
160  Int_t CopyEventList();
161 
162 
166  void FillData(CbmDigi* digi);
167  //TODO: Obsolete, remove
168 
169 
175  ULong64_t FillTimeSlice(Bool_t timeLimit, Double_t fillTime = -1.);
176 
177 
181  ULong64_t GetBufferSize() const;
182 
183 
187  std::string GetBufferStatus(Bool_t verbose = kFALSE) const;
188 
189 
193  Double_t GetBufferTimeFirst() const;
194 
195 
199  Double_t GetBufferTimeLast() const;
200 
201 
205  Bool_t IsDaqBufferEmpty() const;
206 
207 
211  void PrintCurrentEventRange() const;
212 
213 
215  void StartNextTimeSlice();
216 
217 
219  virtual void Finish();
220 
221 
223  CbmDaq(const CbmDaq&) = delete;
224  CbmDaq& operator=(const CbmDaq&) = delete;
225 
227 };
228 
229 #endif /* CBMDAQ_H */
CbmDaq::Exec
virtual void Exec(Option_t *opt)
Task execution.
Definition: CbmDaq.cxx:170
CbmDaq::fDigitizers
std::map< ECbmModuleId, CbmDigitizeBase * > fDigitizers
Output arrays (digis)
Definition: CbmDaq.h:132
CbmDaq::CloseTimeSlice
void CloseTimeSlice()
Definition: CbmDaq.cxx:112
CbmDaq::fTimeSliceLength
Double_t fTimeSliceLength
Time-slice length [ns].
Definition: CbmDaq.h:114
CbmDaq::fTimeSlice
CbmTimeSlice * fTimeSlice
Array of registered digitizers.
Definition: CbmDaq.h:133
CbmDaq::fEventsCurrent
CbmMCEventList * fEventsCurrent
MC event list (all)
Definition: CbmDaq.h:135
CbmDaq::~CbmDaq
~CbmDaq()
Destructor
Definition: CbmDaq.cxx:97
CbmDaq::CbmDaq
CbmDaq(Bool_t eventMode=kFALSE)
Constructor.
Definition: CbmDaq.cxx:43
CbmDaq::PrintCurrentEventRange
void PrintCurrentEventRange() const
Definition: CbmDaq.cxx:442
CbmDaq::SetDigitizer
void SetDigitizer(ECbmModuleId system, CbmDigitizeBase *digitizer)
Set the digitizer for a given system.
Definition: CbmDaq.cxx:466
CbmDaq::fDigis
std::map< ECbmModuleId, TClonesArray * > fDigis
Stop watch.
Definition: CbmDaq.h:130
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmDaq::fTimeEventPrevious
Double_t fTimeEventPrevious
Time of previous event [ns].
Definition: CbmDaq.h:117
CbmDaq::Finish
virtual void Finish()
Definition: CbmDaq.cxx:260
CbmDaq::fTimeSliceFirst
Double_t fTimeSliceFirst
Start time of first time slice.
Definition: CbmDaq.h:126
CbmDaq::Init
virtual InitStatus Init()
Initialisation.
Definition: CbmDaq.cxx:385
CbmDaq::fEventList
CbmMCEventList fEventList
Current time slice.
Definition: CbmDaq.h:134
CbmDaq::ClassDef
ClassDef(CbmDaq, 4)
CbmDaq::fNofEvents
Int_t fNofEvents
Number of processed events.
Definition: CbmDaq.h:119
CbmDaq::fTimer
TStopwatch fTimer
Definition: CbmDaq.h:129
CbmDaq::SetTimeSliceLength
void SetTimeSliceLength(Double_t length)
Set the time-slice length.
Definition: CbmDaq.h:101
CbmDaq::StoreAllTimeSlices
void StoreAllTimeSlices(Bool_t choice=kTRUE)
Store all time-slices.
Definition: CbmDaq.h:109
CbmDaq::GetBufferSize
ULong64_t GetBufferSize() const
Size of DAQ buffers @value Sum of number of data in all DAQ buffers.
Definition: CbmDaq.cxx:325
CbmDaq::FillTimeSlice
ULong64_t FillTimeSlice(Bool_t timeLimit, Double_t fillTime=-1.)
Definition: CbmDaq.cxx:226
CbmDaq::SetLatency
void SetLatency(Double_t time)
Set the DAQ buffer latency.
Definition: CbmDaq.h:88
CbmDaq::fNofTimeSlicesEmpty
Int_t fNofTimeSlicesEmpty
Number of empty time slices.
Definition: CbmDaq.h:123
CbmDaq
CBM task class for filling digis into time slices.
Definition: CbmDaq.h:40
CbmDaq::fTimeSliceLast
Double_t fTimeSliceLast
Stop time of last time slice.
Definition: CbmDaq.h:127
CbmMCEventList
Container class for MC events with number, file and start time.
Definition: CbmMCEventList.h:38
CbmDaq::fNofDigisIgnored
Int_t fNofDigisIgnored
Number of ignored digis.
Definition: CbmDaq.h:121
CbmDaq::fIsEventByEvent
Bool_t fIsEventByEvent
Flag for event-by-event mode.
Definition: CbmDaq.h:113
CbmDaq::StartNextTimeSlice
void StartNextTimeSlice()
Start a new time slice in the output tree.
Definition: CbmDaq.cxx:474
CbmMCEventList.h
CbmDaq::fEventRange
std::map< Int_t, std::pair< Int_t, Int_t > > fEventRange
MC events for current time slice.
Definition: CbmDaq.h:139
CbmDaq::fLatency
Double_t fLatency
Maximal time disorder of input data [ns].
Definition: CbmDaq.h:115
CbmTimeSlice
Bookkeeping of time-slice content.
Definition: CbmTimeSlice.h:29
CbmDaq::CbmDaq
CbmDaq(const CbmDaq &)=delete
CbmDaq::IsDaqBufferEmpty
Bool_t IsDaqBufferEmpty() const
Check for empty DAQ buffers.
Definition: CbmDaq.cxx:428
CbmDaq::fTimeDigiFirst
Double_t fTimeDigiFirst
Time of first digi.
Definition: CbmDaq.h:124
CbmDaq::fStoreEmptySlices
Bool_t fStoreEmptySlices
Flag to store also empty time slices.
Definition: CbmDaq.h:116
CbmDaq::CopyEventList
Int_t CopyEventList()
Definition: CbmDaq.cxx:152
CbmDaq::fNofTimeSlices
Int_t fNofTimeSlices
Number of time slices.
Definition: CbmDaq.h:122
CbmDaq::operator=
CbmDaq & operator=(const CbmDaq &)=delete
CbmDaq::fTimeDigiLast
Double_t fTimeDigiLast
Time of last digi.
Definition: CbmDaq.h:125
CbmDaq::GetBufferTimeFirst
Double_t GetBufferTimeFirst() const
Time of first datum in DAQ buffers @value Minimum time stamp in all DAQ buffers.
Definition: CbmDaq.cxx:355
CbmDigitizeBase
Abstract base class for CBM digitisation tasks.
Definition: CbmDigitizeBase.h:26
CbmDaq::GetBufferStatus
std::string GetBufferStatus(Bool_t verbose=kFALSE) const
Debug output of DAQ buffer status @value String with status of DAQ buffers.
Definition: CbmDaq.cxx:335
CbmDaq::FillData
void FillData(CbmDigi *digi)
Copy data (digi) from the DaqBuffer into the output array.
CbmDaq::CheckOutput
Bool_t CheckOutput() const
Check the output arrays for being time-sorted.
Definition: CbmDaq.cxx:102
CbmDaq::GetBufferTimeLast
Double_t GetBufferTimeLast() const
Time of last datum in DAQ buffers @value Maximum time stamp in all DAQ buffers.
Definition: CbmDaq.cxx:370
CbmDaq::fNofDigis
Int_t fNofDigis
Total number of processed digis.
Definition: CbmDaq.h:120
CbmDefs.h