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

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 29 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 33 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 30 of file CbmTimeSlice.cxx.

◆ CbmTimeSlice() [2/2]

CbmTimeSlice::CbmTimeSlice ( Double_t  start,
Double_t  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 44 of file CbmTimeSlice.cxx.

References kRegular.

◆ ~CbmTimeSlice()

CbmTimeSlice::~CbmTimeSlice ( )

Destructor

Definition at line 58 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 63 of file CbmTimeSlice.h.

References fIsEmpty, and fNofData.

◆ AddData() [2/2]

Bool_t CbmTimeSlice::AddData ( ECbmModuleId  detector,
Double_t  time 
)

Add data with time to time-slice.

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

◆ GetEndTime()

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

◆ GetLength()

Double_t CbmTimeSlice::GetLength ( ) const
inline

Duration of time slice

Returns
duration [ns]

Definition at line 93 of file CbmTimeSlice.h.

References fLength.

◆ GetMatch()

const CbmMatch& CbmTimeSlice::GetMatch ( ) const
inline

Get match object

Returns
Match object

Definition at line 99 of file CbmTimeSlice.h.

References fMatch.

Referenced by CbmDaq::CopyEventList().

◆ GetNofData()

Int_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 108 of file CbmTimeSlice.cxx.

References fNofData.

◆ GetStartTime()

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

◆ GetTimeDataFirst()

Double_t CbmTimeSlice::GetTimeDataFirst ( ) const
inline

Time stamp of first data.

Returns
Time stamp of first data [ns]

Definition at line 123 of file CbmTimeSlice.h.

References fTimeDataFirst.

Referenced by CbmDaq::CloseTimeSlice().

◆ GetTimeDataLast()

Double_t CbmTimeSlice::GetTimeDataLast ( ) const
inline

Time stamp of last data.

Returns
Time stamp of last data [ns]

Definition at line 129 of file CbmTimeSlice.h.

References fTimeDataLast.

Referenced by CbmDaq::CloseTimeSlice().

◆ IsEmpty()

Bool_t CbmTimeSlice::IsEmpty ( ) const
inline

Check whether time slice contains data

Returns
kTRUE if time slice contains data

Definition at line 135 of file CbmTimeSlice.h.

References fNofData.

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

◆ IsEvent()

Bool_t CbmTimeSlice::IsEvent ( ) const
inline

Check for being of type regular

Returns
kTRUE if type is regular

Definition at line 141 of file CbmTimeSlice.h.

References fType, and kEvent.

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

◆ IsFlexible()

Bool_t CbmTimeSlice::IsFlexible ( ) const
inline

Check for being of type regular

Returns
kTRUE if type is regular

Definition at line 147 of file CbmTimeSlice.h.

References fType, and kFlexible.

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

◆ IsRegular()

Bool_t CbmTimeSlice::IsRegular ( ) const
inline

Check for being of type regular

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

◆ RegisterData() [1/2]

Bool_t CbmTimeSlice::RegisterData ( ECbmModuleId  system,
Double_t  time 
)

Register data to time-slice header.

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

◆ RegisterData() [2/2]

Bool_t CbmTimeSlice::RegisterData ( ECbmModuleId  system,
Double_t  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 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().

◆ Reset() [1/2]

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

◆ Reset() [2/2]

void CbmTimeSlice::Reset ( Double_t  start,
Double_t  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 175 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 185 of file CbmTimeSlice.cxx.

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

Referenced by Reset().

◆ serialize()

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

Definition at line 211 of file CbmTimeSlice.h.

References fIsEmpty, and fLength.

◆ SetStartTime()

void CbmTimeSlice::SetStartTime ( Double_t  time)
inline

Set start time.

Parameters
timeStart time [ns]

Definition at line 203 of file CbmTimeSlice.h.

References fStartTime.

◆ ToString()

string CbmTimeSlice::ToString ( ) const

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 231 of file CbmTimeSlice.h.

Member Data Documentation

◆ fIsEmpty

Bool_t CbmTimeSlice::fIsEmpty
private

Flag for containing no data.

Definition at line 220 of file CbmTimeSlice.h.

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

◆ fLength

Double_t CbmTimeSlice::fLength
private

Length of time-slice [ns].

Definition at line 219 of file CbmTimeSlice.h.

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

◆ fMatch

CbmMatch CbmTimeSlice::fMatch
private

Link time slice to events.

Definition at line 224 of file CbmTimeSlice.h.

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

◆ fNofData

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

SystemId -> Number of digis.

Definition at line 221 of file CbmTimeSlice.h.

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

◆ fStartTime

Double_t CbmTimeSlice::fStartTime
private

Start time [ns].

Definition at line 218 of file CbmTimeSlice.h.

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

◆ fTimeDataFirst

Double_t CbmTimeSlice::fTimeDataFirst
private

Time of first data object.

Definition at line 222 of file CbmTimeSlice.h.

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

◆ fTimeDataLast

Double_t CbmTimeSlice::fTimeDataLast
private

Time of last data object.

Definition at line 223 of file CbmTimeSlice.h.

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

◆ fType

EType CbmTimeSlice::fType
private

Time-slice type.

Definition at line 217 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: