CbmRoot
|
CBM task class for filling digis into time slices. More...
#include <CbmDaq.h>
Public Member Functions | |
CbmDaq (Bool_t eventMode=kFALSE) | |
Constructor. More... | |
CbmDaq (Double_t tsLength) | |
Constructor for regular DAQ mode. More... | |
~CbmDaq () | |
Destructor More... | |
virtual void | Exec (Option_t *opt) |
Task execution. More... | |
virtual InitStatus | Init () |
Initialisation. More... | |
void | SetLatency (Double_t time) |
Set the DAQ buffer latency. More... | |
void | SetDigitizer (ECbmModuleId system, CbmDigitizeBase *digitizer) |
Set the digitizer for a given system. More... | |
void | SetTimeSliceLength (Double_t length) |
Set the time-slice length. More... | |
void | StoreAllTimeSlices (Bool_t choice=kTRUE) |
Store all time-slices. More... | |
Private Member Functions | |
Bool_t | CheckOutput () const |
Check the output arrays for being time-sorted. More... | |
void | CloseTimeSlice () |
Int_t | CopyEventList () |
void | FillData (CbmDigi *digi) |
Copy data (digi) from the DaqBuffer into the output array. More... | |
ULong64_t | FillTimeSlice (Bool_t timeLimit, Double_t fillTime=-1.) |
ULong64_t | GetBufferSize () const |
Size of DAQ buffers @value Sum of number of data in all DAQ buffers. More... | |
std::string | GetBufferStatus (Bool_t verbose=kFALSE) const |
Debug output of DAQ buffer status @value String with status of DAQ buffers. More... | |
Double_t | GetBufferTimeFirst () const |
Time of first datum in DAQ buffers @value Minimum time stamp in all DAQ buffers. More... | |
Double_t | GetBufferTimeLast () const |
Time of last datum in DAQ buffers @value Maximum time stamp in all DAQ buffers. More... | |
Bool_t | IsDaqBufferEmpty () const |
Check for empty DAQ buffers. More... | |
void | PrintCurrentEventRange () const |
void | StartNextTimeSlice () |
Start a new time slice in the output tree. More... | |
virtual void | Finish () |
CbmDaq (const CbmDaq &)=delete | |
CbmDaq & | operator= (const CbmDaq &)=delete |
ClassDef (CbmDaq, 4) | |
Private Attributes | |
Bool_t | fIsEventByEvent |
Flag for event-by-event mode. More... | |
Double_t | fTimeSliceLength |
Time-slice length [ns]. More... | |
Double_t | fLatency |
Maximal time disorder of input data [ns]. More... | |
Bool_t | fStoreEmptySlices |
Flag to store also empty time slices. More... | |
Double_t | fTimeEventPrevious |
Time of previous event [ns]. More... | |
Int_t | fNofEvents |
Number of processed events. More... | |
Int_t | fNofDigis |
Total number of processed digis. More... | |
Int_t | fNofDigisIgnored |
Number of ignored digis. More... | |
Int_t | fNofTimeSlices |
Number of time slices. More... | |
Int_t | fNofTimeSlicesEmpty |
Number of empty time slices. More... | |
Double_t | fTimeDigiFirst |
Time of first digi. More... | |
Double_t | fTimeDigiLast |
Time of last digi. More... | |
Double_t | fTimeSliceFirst |
Start time of first time slice. More... | |
Double_t | fTimeSliceLast |
Stop time of last time slice. More... | |
TStopwatch | fTimer |
std::map< ECbmModuleId, TClonesArray * > | fDigis |
Stop watch. More... | |
std::map< ECbmModuleId, CbmDigitizeBase * > | fDigitizers |
Output arrays (digis) More... | |
CbmTimeSlice * | fTimeSlice |
Array of registered digitizers. More... | |
CbmMCEventList | fEventList |
Current time slice. More... | |
CbmMCEventList * | fEventsCurrent |
MC event list (all) More... | |
std::map< Int_t, std::pair< Int_t, Int_t > > | fEventRange |
MC events for current time slice. More... | |
CBM task class for filling digis into time slices.
CbmDaq::CbmDaq | ( | Bool_t | eventMode = kFALSE | ) |
Constructor.
eventMode | If true, run in event-by-event mode |
By default, the DAQ will run in time-based mode with flexible time slices (all data into one time slice). To choose the event-by-event mode, set the argument to true; then, data will be grouped into events, one event per time slice. To select the regular mode with time slices of fixed duration, use the constructor with Double_t argument.
Definition at line 43 of file CbmDaq.cxx.
CbmDaq::CbmDaq | ( | Double_t | tsLength | ) |
Constructor for regular DAQ mode.
tslength | Duration of time slices [ns] |
Definition at line 70 of file CbmDaq.cxx.
CbmDaq::~CbmDaq | ( | ) |
Destructor
Definition at line 97 of file CbmDaq.cxx.
|
privatedelete |
Copy constructor and assignment operator are not allowed.
|
private |
Check the output arrays for being time-sorted.
Definition at line 102 of file CbmDaq.cxx.
References fDigitizers.
Referenced by CloseTimeSlice().
|
private |
|
private |
Close the current time slice The current slice is filled to the tree. It is then reset to the next time slice interval.
Definition at line 112 of file CbmDaq.cxx.
References CheckOutput(), CopyEventList(), fDigitizers, fEventsCurrent, fNofTimeSlices, fNofTimeSlicesEmpty, fStoreEmptySlices, fTimeDigiFirst, fTimeDigiLast, fTimeSlice, fTimeSliceLast, GetBufferStatus(), CbmTimeSlice::GetEndTime(), CbmTimeSlice::GetTimeDataFirst(), CbmTimeSlice::GetTimeDataLast(), CbmTimeSlice::IsEmpty(), PrintCurrentEventRange(), CbmMCEventList::Sort(), and CbmTimeSlice::ToString().
|
private |
Copy the MC events contributing to the current time slice to the output array.
Definition at line 152 of file CbmDaq.cxx.
References fEventList, fEventsCurrent, fTimeSlice, CbmLink::GetEntry(), CbmMCEventList::GetEventTime(), CbmLink::GetFile(), CbmMatch::GetLink(), CbmTimeSlice::GetMatch(), CbmMatch::GetNofLinks(), and CbmMCEventList::Insert().
Referenced by CloseTimeSlice().
|
virtual |
Task execution.
Definition at line 170 of file CbmDaq.cxx.
References CloseTimeSlice(), fEventList, FillTimeSlice(), fLatency, fNofDigis, fNofEvents, fTimeEventPrevious, fTimer, fTimeSlice, GetBufferStatus(), CbmTimeSlice::GetEndTime(), CbmMCEventList::Insert(), CbmTimeSlice::IsEvent(), CbmTimeSlice::IsFlexible(), CbmTimeSlice::IsRegular(), and StartNextTimeSlice().
|
private |
Copy data (digi) from the DaqBuffer into the output array.
digi | Pointer to digi object |
|
private |
Move data from the buffer into the current time slice
checkTime | If true, data will be moved up to fillTime. |
fillTime | Time up to which data are moved |
Definition at line 226 of file CbmDaq.cxx.
References fDigitizers, fTimeSlice, GetBufferStatus(), CbmModuleList::GetModuleNameCaps(), and CbmTimeSlice::ToString().
|
privatevirtual |
At end of run: Process the remaining data in the CbmDaqBuffer
Definition at line 260 of file CbmDaq.cxx.
References CloseTimeSlice(), fEventList, FillTimeSlice(), fNofDigis, fNofDigisIgnored, fNofEvents, fNofTimeSlices, fNofTimeSlicesEmpty, fTimeDigiFirst, fTimeDigiLast, fTimeSlice, fTimeSliceFirst, fTimeSliceLast, GetBufferStatus(), IsDaqBufferEmpty(), CbmTimeSlice::IsFlexible(), CbmTimeSlice::IsRegular(), StartNextTimeSlice(), and CbmMCEventList::ToString().
|
private |
Size of DAQ buffers @value Sum of number of data in all DAQ buffers.
Definition at line 325 of file CbmDaq.cxx.
References fDigitizers.
Referenced by GetBufferStatus().
|
private |
Debug output of DAQ buffer status @value String with status of DAQ buffers.
Definition at line 335 of file CbmDaq.cxx.
References fDigitizers, GetBufferSize(), GetBufferTimeFirst(), GetBufferTimeLast(), CbmModuleList::GetModuleNameCaps(), and IsDaqBufferEmpty().
Referenced by CloseTimeSlice(), Exec(), FillTimeSlice(), and Finish().
|
private |
Time of first datum in DAQ buffers @value Minimum time stamp in all DAQ buffers.
Definition at line 355 of file CbmDaq.cxx.
References fDigitizers.
Referenced by GetBufferStatus().
|
private |
Time of last datum in DAQ buffers @value Maximum time stamp in all DAQ buffers.
Definition at line 370 of file CbmDaq.cxx.
References fDigitizers.
Referenced by GetBufferStatus().
|
virtual |
Initialisation.
Definition at line 385 of file CbmDaq.cxx.
References fEventsCurrent, fIsEventByEvent, fTimeEventPrevious, fTimeSlice, fTimeSliceFirst, fTimeSliceLength, CbmTimeSlice::GetStartTime(), CbmTimeSlice::kEvent, and CbmTimeSlice::kFlexible.
|
private |
Check for empty DAQ buffers.
value True if all DAQ buffers are empty
Definition at line 428 of file CbmDaq.cxx.
References fDigitizers.
Referenced by Finish(), and GetBufferStatus().
|
private |
Screen log of the range of MC events contributing to the current time slice
Definition at line 442 of file CbmDaq.cxx.
References fEventRange.
Referenced by CloseTimeSlice().
void CbmDaq::SetDigitizer | ( | ECbmModuleId | system, |
CbmDigitizeBase * | digitizer | ||
) |
Set the digitizer for a given system.
system | System Id (ECbmModuleId) |
digitizer | Pointer to digitizer instance |
Definition at line 466 of file CbmDaq.cxx.
References fDigitizers.
Referenced by CbmDigitization::Run().
|
inline |
Set the DAQ buffer latency.
time | Buffer latency [ns] |
To decide when a time-slice can be closed (no more data in the time-slice interval will come), the DAQ takes into account a certain time-disordering of digis. The latency is the maximal time difference between the current (event) time and the time-stamp of the digi. It should at least be the maximum dead time of all detectors plus some safety margin accounting for the time resolution of the detectors. The current default of 2,000 ns corresponds to the STS with dead time of 800 ns and time resolution of 5 ns.
Definition at line 88 of file CbmDaq.h.
References fLatency.
|
inline |
Set the time-slice length.
length | Length of a time-slice [ns] |
Definition at line 101 of file CbmDaq.h.
References fTimeSliceLength.
|
private |
Start a new time slice in the output tree.
Definition at line 474 of file CbmDaq.cxx.
References CbmMCEventList::Clear(), fDigitizers, fEventRange, fEventsCurrent, fTimeSlice, fTimeSliceLength, CbmTimeSlice::GetStartTime(), CbmTimeSlice::IsRegular(), and CbmTimeSlice::Reset().
|
inline |
Store all time-slices.
choice | If kTRUE; also empty slices will be stored. |
By default, only time slices containing data are filled into the tree.
Definition at line 109 of file CbmDaq.h.
References fStoreEmptySlices.
Referenced by CbmDigitization::StoreAllTimeSlices().
|
private |
|
private |
Output arrays (digis)
Definition at line 132 of file CbmDaq.h.
Referenced by CheckOutput(), CloseTimeSlice(), FillTimeSlice(), GetBufferSize(), GetBufferStatus(), GetBufferTimeFirst(), GetBufferTimeLast(), IsDaqBufferEmpty(), SetDigitizer(), and StartNextTimeSlice().
|
private |
Current time slice.
Definition at line 134 of file CbmDaq.h.
Referenced by CopyEventList(), Exec(), and Finish().
|
private |
MC events for current time slice.
First and last event in current time slice for each input
Definition at line 139 of file CbmDaq.h.
Referenced by PrintCurrentEventRange(), and StartNextTimeSlice().
|
private |
MC event list (all)
Definition at line 135 of file CbmDaq.h.
Referenced by CloseTimeSlice(), CopyEventList(), Init(), and StartNextTimeSlice().
|
private |
|
private |
Maximal time disorder of input data [ns].
Definition at line 115 of file CbmDaq.h.
Referenced by Exec(), and SetLatency().
|
private |
|
private |
|
private |
|
private |
Number of time slices.
Definition at line 122 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and Finish().
|
private |
Number of empty time slices.
Definition at line 123 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and Finish().
|
private |
Flag to store also empty time slices.
Definition at line 116 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and StoreAllTimeSlices().
|
private |
Time of first digi.
Definition at line 124 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and Finish().
|
private |
Time of last digi.
Definition at line 125 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and Finish().
|
private |
|
private |
Array of registered digitizers.
Definition at line 133 of file CbmDaq.h.
Referenced by CloseTimeSlice(), CopyEventList(), Exec(), FillTimeSlice(), Finish(), Init(), and StartNextTimeSlice().
|
private |
|
private |
Stop time of last time slice.
Definition at line 127 of file CbmDaq.h.
Referenced by CloseTimeSlice(), and Finish().
|
private |
Time-slice length [ns].
Definition at line 114 of file CbmDaq.h.
Referenced by Init(), SetTimeSliceLength(), and StartNextTimeSlice().