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. | |
CbmTimeSlice (double start, double duration) | |
~CbmTimeSlice () | |
void | AddData (ECbmModuleId detector) |
Add data to time-slice. | |
bool | AddData (ECbmModuleId detector, double time) |
Add data with time to time-slice. | |
int32_t | GetNofData (ECbmModuleId detector) const |
Get size of raw data container for given detector. | |
double | GetLength () const |
const CbmMatch & | GetMatch () const |
double | GetStartTime () const |
double | GetEndTime () const |
double | GetTimeDataFirst () const |
Time stamp of first data. | |
double | GetTimeDataLast () const |
Time stamp of last data. | |
bool | IsEmpty () const |
bool | IsEvent () const |
bool | IsFlexible () const |
bool | IsRegular () const |
bool | RegisterData (ECbmModuleId system, double time) |
Register data to time-slice header. | |
bool | RegisterData (ECbmModuleId system, double time, const CbmMatch &match) |
Register data to time-slice header (with match object) | |
void | Reset () |
Reset the time slice. | |
void | Reset (double start, double length) |
Reset the time slice. | |
void | SetStartTime (double time) |
Set start time. | |
std::string | ToString () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Private Member Functions | |
void | ResetCounters () |
Reset the time slice bookkeeping. | |
Private Attributes | |
EType | fType |
Time-slice type. | |
double | fStartTime |
Start time [ns]. | |
double | fLength |
Length of time-slice [ns]. | |
bool | fIsEmpty |
Flag for containing no data. | |
std::map< ECbmModuleId, int32_t > | fNofData |
SystemId -> Number of digis. | |
double | fTimeDataFirst |
Time of first data object. | |
double | fTimeDataLast |
Time of last data object. | |
CbmMatch | fMatch |
Link time slice to events. | |
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 37 of file CbmTimeSlice.h.
Constructor without time interval.
Use this constructor for the modes kFlexible and kEvent.
Definition at line 33 of file CbmTimeSlice.cxx.
CbmTimeSlice::CbmTimeSlice | ( | double | start, |
double | 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 49 of file CbmTimeSlice.cxx.
CbmTimeSlice::~CbmTimeSlice | ( | ) |
Destructor
Definition at line 65 of file CbmTimeSlice.cxx.
|
inline |
Add data to time-slice.
detector | System ID (ECbmModuleId) |
The respective counter will be incremented.
Definition at line 68 of file CbmTimeSlice.h.
bool CbmTimeSlice::AddData | ( | ECbmModuleId | detector, |
double | time ) |
Add data with time to time-slice.
detector | System ID (ECbmModuleId) |
time | Data time [ns] @value false if time is out of time-slice bounds; else true |
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 70 of file CbmTimeSlice.cxx.
References fIsEmpty, fNofData, fStartTime, fTimeDataFirst, fTimeDataLast, fType, GetEndTime(), and kRegular.
double 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 101 of file CbmTimeSlice.cxx.
References fLength, fStartTime, fType, kEvent, kFlexible, and kRegular.
Referenced by AddData(), CbmDaq::CloseTimeSlice(), CbmDaq::Exec(), cbm::ca::MCModule::FillMCPoint(), CbmDigitize< Digi >::FillTimeSlice(), CbmTrdModuleSim2D::FlushBuffer(), CbmTrdModuleSimR::FlushBuffer(), RegisterData(), and ToString().
|
inline |
Duration of time slice
Definition at line 99 of file CbmTimeSlice.h.
References fLength.
|
inline |
Get match object
Definition at line 105 of file CbmTimeSlice.h.
References fMatch.
Referenced by CbmMuchHitFinderQa::ClusterDeconvQa(), CbmDaq::CopyEventList(), CbmMuchTransportQa::Exec(), CbmStsFindTracksQa::Exec(), CbmTrackingTrdQa::Exec(), CbmMuchDigitizerQa::PrintFrontLayerPoints(), and CbmMuchDigitizerQa::ProcessMCPoints().
int32_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 116 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 114 of file CbmTimeSlice.h.
References fStartTime.
Referenced by CbmTrdModuleSimR::CleanUp(), CbmBuildEventsIdeal::Exec(), CbmTofBuildDigiEvents::Exec(), cbm::ca::MCModule::FillMCPoint(), CbmDigitize< Digi >::FillTimeSlice(), CbmEvBuildSource::GetNextTimeSlice(), CbmDaq::Init(), CbmRecEventHeaderConverter::ProcessData(), and CbmDaq::StartNextTimeSlice().
|
inline |
Time stamp of first data.
Definition at line 129 of file CbmTimeSlice.h.
References fTimeDataFirst.
Referenced by CbmDaq::CloseTimeSlice().
|
inline |
Time stamp of last data.
Definition at line 135 of file CbmTimeSlice.h.
References fTimeDataLast.
Referenced by CbmDaq::CloseTimeSlice().
|
inline |
Check whether time slice contains data
Definition at line 141 of file CbmTimeSlice.h.
References fNofData.
Referenced by CbmDaq::CloseTimeSlice(), and ToString().
|
inline |
Check for being of type regular
Definition at line 147 of file CbmTimeSlice.h.
Referenced by CbmDaq::Exec(), CbmDigitize< Digi >::FillTimeSlice(), and CbmTrdClusterFinder::Init().
|
inline |
Check for being of type regular
Definition at line 153 of file CbmTimeSlice.h.
References fType, and kFlexible.
Referenced by CbmDaq::Exec(), CbmDigitize< Digi >::FillTimeSlice(), and CbmDaq::Finish().
|
inline |
Check for being of type regular
Definition at line 159 of file CbmTimeSlice.h.
References fType, and kRegular.
Referenced by CbmDaq::Exec(), CbmDigitize< Digi >::FillTimeSlice(), CbmDaq::Finish(), CbmTrdModuleSim2D::FlushBuffer(), and CbmDaq::StartNextTimeSlice().
bool CbmTimeSlice::RegisterData | ( | ECbmModuleId | system, |
double | time ) |
Register data to time-slice header.
system | System ID (ECbmModuleId) |
time | Data time [ns] @value false if time is out of time-slice bounds; else true |
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 126 of file CbmTimeSlice.cxx.
References fIsEmpty, fNofData, fStartTime, fTimeDataFirst, fTimeDataLast, fType, GetEndTime(), and kRegular.
Referenced by CbmDigitize< Digi >::FillTimeSlice(), and RegisterData().
bool CbmTimeSlice::RegisterData | ( | ECbmModuleId | system, |
double | 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 false if time is out of time-slice bounds; else true |
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 156 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 174 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fMatch, fType, kRegular, and ResetCounters().
Referenced by CbmRecoUnpack::Reset(), and CbmDaq::StartNextTimeSlice().
void CbmTimeSlice::Reset | ( | double | start, |
double | 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 184 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fLength, fMatch, fStartTime, and ResetCounters().
|
private |
Reset the time slice bookkeeping.
Definition at line 195 of file CbmTimeSlice.cxx.
References CbmMatch::ClearLinks(), fIsEmpty, fMatch, fNofData, fTimeDataFirst, and fTimeDataLast.
|
inline |
Definition at line 216 of file CbmTimeSlice.h.
|
inline |
Set start time.
time | Start time [ns] |
Definition at line 208 of file CbmTimeSlice.h.
References fStartTime.
Referenced by CbmTaskUnpack::Exec(), CbmSourceDigiTimeslice::ReadEvent(), and CbmRecoUnpack::Unpack().
string CbmTimeSlice::ToString | ( | ) | const |
Status to string
Definition at line 207 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 237 of file CbmTimeSlice.h.
|
private |
Flag for containing no data.
Definition at line 226 of file CbmTimeSlice.h.
Referenced by AddData(), AddData(), RegisterData(), ResetCounters(), and serialize().
|
private |
Length of time-slice [ns].
Definition at line 225 of file CbmTimeSlice.h.
Referenced by GetEndTime(), GetLength(), Reset(), and serialize().
|
private |
Link time slice to events.
Definition at line 230 of file CbmTimeSlice.h.
Referenced by GetMatch(), RegisterData(), Reset(), Reset(), ResetCounters(), and ToString().
|
private |
SystemId -> Number of digis.
Definition at line 227 of file CbmTimeSlice.h.
Referenced by AddData(), AddData(), GetNofData(), IsEmpty(), RegisterData(), ResetCounters(), and ToString().
|
private |
Start time [ns].
Definition at line 224 of file CbmTimeSlice.h.
Referenced by AddData(), GetEndTime(), GetStartTime(), RegisterData(), Reset(), SetStartTime(), and ToString().
|
private |
Time of first data object.
Definition at line 228 of file CbmTimeSlice.h.
Referenced by AddData(), GetTimeDataFirst(), RegisterData(), ResetCounters(), and ToString().
|
private |
Time of last data object.
Definition at line 229 of file CbmTimeSlice.h.
Referenced by AddData(), GetTimeDataLast(), RegisterData(), ResetCounters(), and ToString().
|
private |
Time-slice type.
Definition at line 223 of file CbmTimeSlice.h.
Referenced by AddData(), GetEndTime(), IsEvent(), IsFlexible(), IsRegular(), RegisterData(), Reset(), and ToString().