CbmRoot
|
Bookkeeping of time-slice content. More...
#include <CbmTimeSlice.h>
Public Types | |
enum | EType { kRegular = 0, kFlexible = 1, kEvent = 2 } |
Time-slice type enumerator. More... | |
Public Member Functions | |
CbmTimeSlice (EType type=kFlexible) | |
Constructor without time interval. More... | |
CbmTimeSlice (Double_t start, Double_t duration) | |
~CbmTimeSlice () | |
void | AddData (ECbmModuleId detector) |
Add data to time-slice. More... | |
Bool_t | AddData (ECbmModuleId detector, Double_t time) |
Add data with time to time-slice. More... | |
Int_t | GetNofData (ECbmModuleId detector) const |
Get size of raw data container for given detector. More... | |
Double_t | GetLength () const |
const CbmMatch & | GetMatch () const |
Double_t | GetStartTime () const |
Double_t | GetEndTime () const |
Double_t | GetTimeDataFirst () const |
Time stamp of first data. More... | |
Double_t | GetTimeDataLast () const |
Time stamp of last data. More... | |
Bool_t | IsEmpty () const |
Bool_t | IsEvent () const |
Bool_t | IsFlexible () const |
Bool_t | IsRegular () const |
Bool_t | RegisterData (ECbmModuleId system, Double_t time) |
Register data to time-slice header. More... | |
Bool_t | RegisterData (ECbmModuleId system, Double_t time, const CbmMatch &match) |
Register data to time-slice header (with match object) More... | |
void | Reset () |
Reset the time slice. More... | |
void | Reset (Double_t start, Double_t length) |
Reset the time slice. More... | |
void | SetStartTime (Double_t time) |
Set start time. More... | |
std::string | ToString () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Private Member Functions | |
void | ResetCounters () |
Reset the time slice bookkeeping. More... | |
Private Attributes | |
EType | fType |
Time-slice type. More... | |
Double_t | fStartTime |
Start time [ns]. More... | |
Double_t | fLength |
Length of time-slice [ns]. More... | |
Bool_t | fIsEmpty |
Flag for containing no data. More... | |
std::map< ECbmModuleId, Int_t > | fNofData |
SystemId -> Number of digis. More... | |
Double_t | fTimeDataFirst |
Time of first data object. More... | |
Double_t | fTimeDataLast |
Time of last data object. More... | |
CbmMatch | fMatch |
Link time slice to events. More... | |
Friends | |
class | boost::serialization::access |
enum CbmTimeSlice::EType |
Time-slice type enumerator.
Enumerator | |
---|---|
kRegular | |
kFlexible | Regular time slice with fixed-size time interval. |
kEvent | Flexible time slice; no fixed time limits. |
Definition at line 33 of file CbmTimeSlice.h.
Constructor without time interval.
Use this constructor for the modes kFlexible and kEvent.
Definition at line 30 of file CbmTimeSlice.cxx.
CbmTimeSlice::CbmTimeSlice | ( | Double_t | start, |
Double_t | duration | ||
) |
Standard constructor for a regular (fixed-length) time-slice
start | Start time of time slice [ns] |
duration | Duration of time slice [ns] |
Definition at line 44 of file CbmTimeSlice.cxx.
References kRegular.
CbmTimeSlice::~CbmTimeSlice | ( | ) |
Destructor
Definition at line 58 of file CbmTimeSlice.cxx.
|
inline |
Add data to time-slice.
detector | System ID (ECbmModuleId) |
The respective counter will be incremented.
Definition at line 63 of file CbmTimeSlice.h.
Bool_t CbmTimeSlice::AddData | ( | ECbmModuleId | detector, |
Double_t | time | ||
) |
Add data with time to time-slice.
detector | System ID (ECbmModuleId) |
time | Data time [ns] @value kFALSE if time is out of time-slice bounds; else kTRUE |
The respective counter will be incremented. Time of data is checked with time-slice bounds. Time of first and last data are updated.
Definition at line 63 of file CbmTimeSlice.cxx.
References fIsEmpty, fNofData, fStartTime, fTimeDataFirst, fTimeDataLast, fType, GetEndTime(), and kRegular.
Double_t CbmTimeSlice::GetEndTime | ( | ) | const |
End time of time slice
If the type of the time slice is kEvent, the method returns the event time.
Definition at line 94 of file CbmTimeSlice.cxx.
References fLength, fStartTime, fType, kEvent, kFlexible, and kRegular.
Referenced by AddData(), CbmDaq::CloseTimeSlice(), CbmDaq::Exec(), CbmDigitize< CbmTrdDigi >::FillTimeSlice(), CbmTrdModuleSimT::FlushBuffer(), CbmTrdModuleSimR::FlushBuffer(), CbmL1::ReadMCPoint(), RegisterData(), and ToString().
|
inline |
Duration of time slice
Definition at line 93 of file CbmTimeSlice.h.
References fLength.
|
inline |
Get match object
Definition at line 99 of file CbmTimeSlice.h.
References fMatch.
Referenced by CbmDaq::CopyEventList().
Int_t CbmTimeSlice::GetNofData | ( | ECbmModuleId | detector | ) | const |
Get size of raw data container for given detector.
detector | system ID (ECbmModuleId) @value Size of raw data container (number of digis) |
Definition at line 108 of file CbmTimeSlice.cxx.
References fNofData.
|
inline |
Start time of time slice
If the type of the time slice is kEvent, the method returns the event time.
Definition at line 108 of file CbmTimeSlice.h.
References fStartTime.
Referenced by CbmTrdModuleSimR::CleanUp(), CbmGlobalTrackingTask::Exec(), CbmTofBuildDigiEvents::Exec(), CbmDigitize< CbmTrdDigi >::FillTimeSlice(), CbmEvBuildSource::GetNextTimeSlice(), CbmDaq::Init(), CbmL1::ReadMCPoint(), and CbmDaq::StartNextTimeSlice().
|
inline |
Time stamp of first data.
Definition at line 123 of file CbmTimeSlice.h.
References fTimeDataFirst.
Referenced by CbmDaq::CloseTimeSlice().
|
inline |
Time stamp of last data.
Definition at line 129 of file CbmTimeSlice.h.
References fTimeDataLast.
Referenced by CbmDaq::CloseTimeSlice().
|
inline |
Check whether time slice contains data
Definition at line 135 of file CbmTimeSlice.h.
References fNofData.
Referenced by CbmDaq::CloseTimeSlice(), and ToString().
|
inline |
Check for being of type regular
Definition at line 141 of file CbmTimeSlice.h.
Referenced by CbmDaq::Exec(), and CbmDigitize< CbmTrdDigi >::FillTimeSlice().
|
inline |
Check for being of type regular
Definition at line 147 of file CbmTimeSlice.h.
References fType, and kFlexible.
Referenced by CbmDaq::Exec(), CbmDigitize< CbmTrdDigi >::FillTimeSlice(), and CbmDaq::Finish().
|
inline |
Check for being of type regular
Definition at line 153 of file CbmTimeSlice.h.
References fType, and kRegular.
Referenced by CbmDaq::Exec(), CbmDigitize< CbmTrdDigi >::FillTimeSlice(), CbmDaq::Finish(), and CbmDaq::StartNextTimeSlice().
Bool_t CbmTimeSlice::RegisterData | ( | ECbmModuleId | system, |
Double_t | time | ||
) |
Register data to time-slice header.
system | System ID (ECbmModuleId) |
time | Data time [ns] @value kFALSE if time is out of time-slice bounds; else kTRUE |
The respective counter will be incremented. Time of data is checked with time-slice bounds. Time of first and last data are updated.
Definition at line 117 of file CbmTimeSlice.cxx.
References fIsEmpty, fNofData, fStartTime, fTimeDataFirst, fTimeDataLast, fType, GetEndTime(), and kRegular.
Referenced by CbmDigitize< CbmTrdDigi >::FillTimeSlice(), and RegisterData().
Bool_t CbmTimeSlice::RegisterData | ( | ECbmModuleId | system, |
Double_t | time, | ||
const CbmMatch & | match | ||
) |
Register data to time-slice header (with match object)
system | System ID (ECbmModuleId) |
time | Data time [ns] |
match | Reference to digi match object @value kFALSE if time is out of time-slice bounds; else kTRUE |
The respective counter will be incremented. Time of data is checked with time-slice bounds. Time of first and last data are updated. The match objects of the time slice is updated.
Definition at line 147 of file CbmTimeSlice.cxx.
References CbmMatch::AddLink(), fMatch, CbmLink::GetEntry(), CbmLink::GetFile(), CbmMatch::GetLink(), CbmMatch::GetNofLinks(), CbmLink::GetWeight(), and RegisterData().
void CbmTimeSlice::Reset | ( | ) |
Reset the time slice.
Reset time-slice bookkeeping. Cannot be used in mode kRegular.
Definition at line 166 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fMatch, fType, kRegular, and ResetCounters().
Referenced by CbmDaq::StartNextTimeSlice().
void CbmTimeSlice::Reset | ( | Double_t | start, |
Double_t | length | ||
) |
Reset the time slice.
start | New start time [ns] |
length | New length [ns] |
Reset start time, length and counters. If used in mode kFlexible or kEvent, the arguments are ignored.
Definition at line 175 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fLength, fMatch, fStartTime, and ResetCounters().
|
private |
Reset the time slice bookkeeping.
Definition at line 185 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fIsEmpty, fMatch, fNofData, fTimeDataFirst, and fTimeDataLast.
Referenced by Reset().
|
inline |
Definition at line 211 of file CbmTimeSlice.h.
|
inline |
Set start time.
time | Start time [ns] |
Definition at line 203 of file CbmTimeSlice.h.
References fStartTime.
string CbmTimeSlice::ToString | ( | ) | const |
Status to string
Definition at line 196 of file CbmTimeSlice.cxx.
References fMatch, fNofData, fStartTime, fTimeDataFirst, fTimeDataLast, fType, GetEndTime(), CbmModuleList::GetModuleNameCaps(), CbmMatch::GetNofLinks(), IsEmpty(), kEvent, kFlexible, and kRegular.
Referenced by CbmDaq::CloseTimeSlice(), and CbmDaq::FillTimeSlice().
|
friend |
Definition at line 231 of file CbmTimeSlice.h.
|
private |
Flag for containing no data.
Definition at line 220 of file CbmTimeSlice.h.
Referenced by AddData(), RegisterData(), ResetCounters(), and serialize().
|
private |
Length of time-slice [ns].
Definition at line 219 of file CbmTimeSlice.h.
Referenced by GetEndTime(), GetLength(), Reset(), and serialize().
|
private |
Link time slice to events.
Definition at line 224 of file CbmTimeSlice.h.
Referenced by GetMatch(), RegisterData(), Reset(), ResetCounters(), and ToString().
|
private |
SystemId -> Number of digis.
Definition at line 221 of file CbmTimeSlice.h.
Referenced by AddData(), GetNofData(), IsEmpty(), RegisterData(), ResetCounters(), and ToString().
|
private |
Start time [ns].
Definition at line 218 of file CbmTimeSlice.h.
Referenced by AddData(), GetEndTime(), GetStartTime(), RegisterData(), Reset(), SetStartTime(), and ToString().
|
private |
Time of first data object.
Definition at line 222 of file CbmTimeSlice.h.
Referenced by AddData(), GetTimeDataFirst(), RegisterData(), ResetCounters(), and ToString().
|
private |
Time of last data object.
Definition at line 223 of file CbmTimeSlice.h.
Referenced by AddData(), GetTimeDataLast(), RegisterData(), ResetCounters(), and ToString().
|
private |
Time-slice type.
Definition at line 217 of file CbmTimeSlice.h.
Referenced by AddData(), GetEndTime(), IsEvent(), IsFlexible(), IsRegular(), RegisterData(), Reset(), and ToString().