CbmRoot
Loading...
Searching...
No Matches
CbmTimeSlice Class Reference

Bookkeeping of time-slice content. More...

#include <CbmTimeSlice.h>

Inheritance diagram for CbmTimeSlice:
[legend]
Collaboration diagram for CbmTimeSlice:
[legend]

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 CbmMatchGetMatch () 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
 

Detailed Description

Bookkeeping of time-slice content.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Date
17 July 2012

Definition at line 33 of file CbmTimeSlice.h.

Member Enumeration Documentation

◆ 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 & Destructor Documentation

◆ CbmTimeSlice() [1/2]

CbmTimeSlice::CbmTimeSlice ( EType type = kFlexible)

Constructor without time interval.

Use this constructor for the modes kFlexible and kEvent.

Definition at line 33 of file CbmTimeSlice.cxx.

◆ CbmTimeSlice() [2/2]

CbmTimeSlice::CbmTimeSlice ( double start,
double duration )

Standard constructor for a regular (fixed-length) time-slice

Parameters
startStart time of time slice [ns]
durationDuration of time slice [ns]

Definition at line 49 of file CbmTimeSlice.cxx.

◆ ~CbmTimeSlice()

CbmTimeSlice::~CbmTimeSlice ( )

Destructor

Definition at line 65 of file CbmTimeSlice.cxx.

Member Function Documentation

◆ AddData() [1/2]

void CbmTimeSlice::AddData ( ECbmModuleId detector)
inline

Add data to time-slice.

Parameters
detectorSystem ID (ECbmModuleId)

The respective counter will be incremented.

Definition at line 68 of file CbmTimeSlice.h.

References fIsEmpty, and fNofData.

◆ AddData() [2/2]

bool CbmTimeSlice::AddData ( ECbmModuleId detector,
double time )

Add data with time to time-slice.

Parameters
detectorSystem ID (ECbmModuleId)
timeData 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.

◆ GetEndTime()

double CbmTimeSlice::GetEndTime ( ) const

End time of time slice

Returns
End time [ns]

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().

◆ GetLength()

double CbmTimeSlice::GetLength ( ) const
inline

Duration of time slice

Returns
duration [ns]

Definition at line 99 of file CbmTimeSlice.h.

References fLength.

◆ GetMatch()

◆ GetNofData()

int32_t CbmTimeSlice::GetNofData ( ECbmModuleId detector) const

Get size of raw data container for given detector.

Parameters
detectorsystem ID (ECbmModuleId) @value Size of raw data container (number of digis)

Definition at line 116 of file CbmTimeSlice.cxx.

References fNofData.

◆ GetStartTime()

double CbmTimeSlice::GetStartTime ( ) const
inline

Start time of time slice

Returns
start time [ns]

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().

◆ GetTimeDataFirst()

double CbmTimeSlice::GetTimeDataFirst ( ) const
inline

Time stamp of first data.

Returns
Time stamp of first data [ns]

Definition at line 129 of file CbmTimeSlice.h.

References fTimeDataFirst.

Referenced by CbmDaq::CloseTimeSlice().

◆ GetTimeDataLast()

double CbmTimeSlice::GetTimeDataLast ( ) const
inline

Time stamp of last data.

Returns
Time stamp of last data [ns]

Definition at line 135 of file CbmTimeSlice.h.

References fTimeDataLast.

Referenced by CbmDaq::CloseTimeSlice().

◆ IsEmpty()

bool CbmTimeSlice::IsEmpty ( ) const
inline

Check whether time slice contains data

Returns
true if time slice contains data

Definition at line 141 of file CbmTimeSlice.h.

References fNofData.

Referenced by CbmDaq::CloseTimeSlice(), and ToString().

◆ IsEvent()

bool CbmTimeSlice::IsEvent ( ) const
inline

Check for being of type regular

Returns
true if type is regular

Definition at line 147 of file CbmTimeSlice.h.

References fType, and kEvent.

Referenced by CbmDaq::Exec(), CbmDigitize< Digi >::FillTimeSlice(), and CbmTrdClusterFinder::Init().

◆ IsFlexible()

bool CbmTimeSlice::IsFlexible ( ) const
inline

Check for being of type regular

Returns
true if type is regular

Definition at line 153 of file CbmTimeSlice.h.

References fType, and kFlexible.

Referenced by CbmDaq::Exec(), CbmDigitize< Digi >::FillTimeSlice(), and CbmDaq::Finish().

◆ IsRegular()

bool CbmTimeSlice::IsRegular ( ) const
inline

Check for being of type regular

Returns
true if type is 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().

◆ RegisterData() [1/2]

bool CbmTimeSlice::RegisterData ( ECbmModuleId system,
double time )

Register data to time-slice header.

Parameters
systemSystem ID (ECbmModuleId)
timeData 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().

◆ RegisterData() [2/2]

bool CbmTimeSlice::RegisterData ( ECbmModuleId system,
double time,
const CbmMatch & match )

Register data to time-slice header (with match object)

Parameters
systemSystem ID (ECbmModuleId)
timeData time [ns]
matchReference 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().

◆ Reset() [1/2]

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().

◆ Reset() [2/2]

void CbmTimeSlice::Reset ( double start,
double length )

Reset the time slice.

Parameters
startNew start time [ns]
lengthNew 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().

◆ ResetCounters()

void CbmTimeSlice::ResetCounters ( )
private

Reset the time slice bookkeeping.

Definition at line 195 of file CbmTimeSlice.cxx.

References CbmMatch::ClearLinks(), fIsEmpty, fMatch, fNofData, fTimeDataFirst, and fTimeDataLast.

Referenced by Reset(), and Reset().

◆ serialize()

template<class Archive >
void CbmTimeSlice::serialize ( Archive & ar,
const unsigned int  )
inline

Definition at line 216 of file CbmTimeSlice.h.

References fIsEmpty, and fLength.

◆ SetStartTime()

void CbmTimeSlice::SetStartTime ( double time)
inline

Set start time.

Parameters
timeStart time [ns]

Definition at line 208 of file CbmTimeSlice.h.

References fStartTime.

Referenced by CbmTaskUnpack::Exec(), CbmSourceDigiTimeslice::ReadEvent(), and CbmRecoUnpack::Unpack().

◆ ToString()

string CbmTimeSlice::ToString ( ) const

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 237 of file CbmTimeSlice.h.

Member Data Documentation

◆ fIsEmpty

bool CbmTimeSlice::fIsEmpty
private

Flag for containing no data.

Definition at line 226 of file CbmTimeSlice.h.

Referenced by AddData(), AddData(), RegisterData(), ResetCounters(), and serialize().

◆ fLength

double CbmTimeSlice::fLength
private

Length of time-slice [ns].

Definition at line 225 of file CbmTimeSlice.h.

Referenced by GetEndTime(), GetLength(), Reset(), and serialize().

◆ fMatch

CbmMatch CbmTimeSlice::fMatch
private

Link time slice to events.

Definition at line 230 of file CbmTimeSlice.h.

Referenced by GetMatch(), RegisterData(), Reset(), Reset(), ResetCounters(), and ToString().

◆ fNofData

std::map<ECbmModuleId, int32_t> CbmTimeSlice::fNofData
private

SystemId -> Number of digis.

Definition at line 227 of file CbmTimeSlice.h.

Referenced by AddData(), AddData(), GetNofData(), IsEmpty(), RegisterData(), ResetCounters(), and ToString().

◆ fStartTime

double CbmTimeSlice::fStartTime
private

Start time [ns].

Definition at line 224 of file CbmTimeSlice.h.

Referenced by AddData(), GetEndTime(), GetStartTime(), RegisterData(), Reset(), SetStartTime(), and ToString().

◆ fTimeDataFirst

double CbmTimeSlice::fTimeDataFirst
private

Time of first data object.

Definition at line 228 of file CbmTimeSlice.h.

Referenced by AddData(), GetTimeDataFirst(), RegisterData(), ResetCounters(), and ToString().

◆ fTimeDataLast

double CbmTimeSlice::fTimeDataLast
private

Time of last data object.

Definition at line 229 of file CbmTimeSlice.h.

Referenced by AddData(), GetTimeDataLast(), RegisterData(), ResetCounters(), and ToString().

◆ fType

EType CbmTimeSlice::fType
private

Time-slice type.

Definition at line 223 of file CbmTimeSlice.h.

Referenced by AddData(), GetEndTime(), IsEvent(), IsFlexible(), IsRegular(), RegisterData(), Reset(), and ToString().


The documentation for this class was generated from the following files: