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

Source class for reading from archived time slice data. More...

#include <CbmSourceTs.h>

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

Public Member Functions

 CbmSourceTs (const char *fileName="")
 Constructor.
 
 CbmSourceTs (std::vector< std::string > fileNames)
 Constructor.
 
virtual ~CbmSourceTs ()
 Destructor.
 
 CbmSourceTs (const CbmSourceTs &)=delete
 Copy constructor - not implemented.
 
CbmSourceTsoperator= (const CbmSourceTs &)=delete
 Assignment operator - not implemented.
 
size_t AddInputFile (const char *fileName)
 Add an input file.
 
virtual void Close ()
 Demanded by base class.
 
size_t GetNumTs () const
 Number of processed timeslices.
 
virtual Source_Type GetSourceType ()
 Demanded by base class.
 
fles::Timeslice * GetTimeslice ()
 Pointer to current FLES timeslice.
 
virtual Bool_t Init ()
 Initialisation.
 
virtual Bool_t InitUnpackers ()
 Demanded by base class.
 
virtual Int_t ReadEvent (UInt_t=0)
 Read one time slice from file.
 
virtual Bool_t ReInitUnpackers ()
 Demanded by base class.
 
virtual void Reset ()
 Demanded by base class.
 
virtual void SetParUnpackers ()
 Demanded by base class.
 
virtual Bool_t SpecifyRunId ()
 Demanded by base class.
 

Private Attributes

std::vector< std::string > fFileNames = {}
 
fles::TimesliceSource * fFlesSource = nullptr
 
std::unique_ptr< fles::Timeslice > fFlesTs = nullptr
 
size_t fNumCalls = 0
 

Detailed Description

Source class for reading from archived time slice data.

Author
Volker Friese
Since
14 February 2022

This class allows to read time-slice data from file(s). It interfaces fles::TimesliceAutoSource to cbmroot.

Definition at line 26 of file CbmSourceTs.h.

Constructor & Destructor Documentation

◆ CbmSourceTs() [1/3]

CbmSourceTs::CbmSourceTs ( const char * fileName = "")

Constructor.

Parameters
fileNameName of (single) input file.

More input files can be added by the method AddInputFile.

Definition at line 19 of file CbmSourceTs.cxx.

References AddInputFile().

◆ CbmSourceTs() [2/3]

CbmSourceTs::CbmSourceTs ( std::vector< std::string > fileNames)

Constructor.

Parameters
fileNameVector with name(s) of input file(s).

More input files can be added by the method AddInputFile.

◆ ~CbmSourceTs()

virtual CbmSourceTs::~CbmSourceTs ( )
inlinevirtual

Destructor.

Definition at line 45 of file CbmSourceTs.h.

◆ CbmSourceTs() [3/3]

CbmSourceTs::CbmSourceTs ( const CbmSourceTs & )
delete

Copy constructor - not implemented.

Member Function Documentation

◆ AddInputFile()

size_t CbmSourceTs::AddInputFile ( const char * fileName)

Add an input file.

Parameters
fileNameInput file name
Returns
Number of input files after adding this one

Definition at line 28 of file CbmSourceTs.cxx.

References fFileNames.

Referenced by CbmSourceTs().

◆ Close()

void CbmSourceTs::Close ( )
virtual

Demanded by base class.

Definition at line 38 of file CbmSourceTs.cxx.

◆ GetNumTs()

size_t CbmSourceTs::GetNumTs ( ) const
inline

Number of processed timeslices.

Returns
Number of timeslices

The first call to ReadEvent is in Init, so not timeslice is processed.

Definition at line 72 of file CbmSourceTs.h.

References fNumCalls.

Referenced by ReadEvent().

◆ GetSourceType()

virtual Source_Type CbmSourceTs::GetSourceType ( )
inlinevirtual

Demanded by base class.

Definition at line 76 of file CbmSourceTs.h.

◆ GetTimeslice()

fles::Timeslice * CbmSourceTs::GetTimeslice ( )
inline

Pointer to current FLES timeslice.

Definition at line 81 of file CbmSourceTs.h.

References fFlesTs.

Referenced by CbmTaskUnpack::Exec().

◆ Init()

Bool_t CbmSourceTs::Init ( )
virtual

Initialisation.

Definition at line 43 of file CbmSourceTs.cxx.

References fFileNames, and fFlesSource.

◆ InitUnpackers()

virtual Bool_t CbmSourceTs::InitUnpackers ( )
inlinevirtual

Demanded by base class.

Definition at line 89 of file CbmSourceTs.h.

◆ operator=()

CbmSourceTs & CbmSourceTs::operator= ( const CbmSourceTs & )
delete

Assignment operator - not implemented.

◆ ReadEvent()

Int_t CbmSourceTs::ReadEvent ( UInt_t tsIndex = 0)
virtual

Read one time slice from file.

Definition at line 53 of file CbmSourceTs.cxx.

References fFlesSource, fFlesTs, fNumCalls, and GetNumTs().

◆ ReInitUnpackers()

virtual Bool_t CbmSourceTs::ReInitUnpackers ( )
inlinevirtual

Demanded by base class.

Definition at line 97 of file CbmSourceTs.h.

◆ Reset()

virtual void CbmSourceTs::Reset ( )
inlinevirtual

Demanded by base class.

Definition at line 101 of file CbmSourceTs.h.

◆ SetParUnpackers()

virtual void CbmSourceTs::SetParUnpackers ( )
inlinevirtual

Demanded by base class.

Definition at line 105 of file CbmSourceTs.h.

◆ SpecifyRunId()

virtual Bool_t CbmSourceTs::SpecifyRunId ( )
inlinevirtual

Demanded by base class.

Definition at line 109 of file CbmSourceTs.h.

Member Data Documentation

◆ fFileNames

std::vector<std::string> CbmSourceTs::fFileNames = {}
private

List of input file names

Definition at line 114 of file CbmSourceTs.h.

Referenced by AddInputFile(), and Init().

◆ fFlesSource

fles::TimesliceSource* CbmSourceTs::fFlesSource = nullptr
private

FLES interface

Definition at line 117 of file CbmSourceTs.h.

Referenced by Init(), and ReadEvent().

◆ fFlesTs

std::unique_ptr<fles::Timeslice> CbmSourceTs::fFlesTs = nullptr
private

Pointer to current time slice

Definition at line 120 of file CbmSourceTs.h.

Referenced by GetTimeslice(), and ReadEvent().

◆ fNumCalls

size_t CbmSourceTs::fNumCalls = 0
private

ReadEvent call counter

Definition at line 123 of file CbmSourceTs.h.

Referenced by GetNumTs(), and ReadEvent().


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