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

Source class for reading from files resulting from online processing (containing raw Digis) More...

#include <CbmSourceDigiTimeslice.h>

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

Public Member Functions

 CbmSourceDigiTimeslice (const char *fileName="")
 Constructor.
 
 CbmSourceDigiTimeslice (const CbmSourceDigiTimeslice &)=delete
 Copy constructor - not implemented.
 
CbmSourceDigiTimesliceoperator= (const CbmSourceDigiTimeslice &)=delete
 Assignment operator - not implemented.
 
virtual ~CbmSourceDigiTimeslice ()
 Destructor.
 
virtual void Close ()
 Close source after end of run.
 
virtual Source_Type GetSourceType ()
 Source type.
 
virtual Bool_t Init ()
 Initialisation.
 
virtual Bool_t InitUnpackers ()
 Initialise unpackers (forced by base class, not relevant here)
 
Int_t ReadEvent (UInt_t=0)
 Read one time slice from file.
 
virtual Bool_t ReInitUnpackers ()
 Re-Initialise unpackers (forced by base class, not relevant here)
 
virtual void Reset ()
 Reset (forced by base class, not relevant here)
 
virtual void SetParUnpackers ()
 Set unpacker parameters (forced by base class, not relevant here)
 
void SetSourceType (Source_Type type)
 Set the Source Type.
 
Bool_t SpecifyRunId ()
 Set Run ID (forced by base class, not relevant here)
 

Private Member Functions

template<typename TVecobj >
Bool_t RegisterVector (FairRootManager *ioman, std::vector< TVecobj > *&vec)
 
template<typename TVecobj >
std::enable_if< std::is_member_function_pointer< decltype(&TVecobj::GetTime)>::value, void >::type Timesort (std::vector< TVecobj > *vec=nullptr)
 

Private Attributes

std::string fInputFileName = {}
 
std::unique_ptr< cbm::algo::RecoResultsInputArchivefArchive = nullptr
 
std::vector< CbmBmonDigi > * fBmonDigis = nullptr
 
std::vector< CbmStsDigi > * fStsDigis = nullptr
 
std::vector< CbmMuchDigi > * fMuchDigis = nullptr
 
std::vector< CbmTrdDigi > * fTrdDigis = nullptr
 
std::vector< CbmTofDigi > * fTofDigis = nullptr
 
std::vector< CbmRichDigi > * fRichDigis = nullptr
 
Source_Type fSourceType = Source_Type::kONLINE
 type of source that is currently used
 
CbmTimeSlicefTimeslice = nullptr
 
CbmTsEventHeaderfTsEventHeader = nullptr
 
size_t fNumTs = 0
 

Detailed Description

Source class for reading from files resulting from online processing (containing raw Digis)

Author
Pierre-Alain loizeau <p.-a.loizeau
Since
21 March 2024

The online process creates std::vector of Digis for each detector per timeslice. These are saved to file using the BOOST streamer. This class allows to read such files and get the Digis into the ROOT tree for offline analysis. It creates a branches containing the Digis vector with names following established conventions; one tree entry corresponds to one timelice.

Definition at line 32 of file CbmSourceDigiTimeslice.h.

Constructor & Destructor Documentation

◆ CbmSourceDigiTimeslice() [1/2]

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

Constructor.

Parameters
fileNameName of (single) input file.

More input files can be added by the method AddInputFile.

Definition at line 18 of file CbmSourceDigiTimeslice.cxx.

◆ CbmSourceDigiTimeslice() [2/2]

CbmSourceDigiTimeslice::CbmSourceDigiTimeslice ( const CbmSourceDigiTimeslice & )
delete

Copy constructor - not implemented.

◆ ~CbmSourceDigiTimeslice()

virtual CbmSourceDigiTimeslice::~CbmSourceDigiTimeslice ( )
inlinevirtual

Destructor.

Definition at line 49 of file CbmSourceDigiTimeslice.h.

Member Function Documentation

◆ Close()

void CbmSourceDigiTimeslice::Close ( )
virtual

Close source after end of run.

Definition at line 23 of file CbmSourceDigiTimeslice.cxx.

References fBmonDigis, fMuchDigis, fNumTs, fRichDigis, fStsDigis, fTofDigis, and fTrdDigis.

◆ GetSourceType()

virtual Source_Type CbmSourceDigiTimeslice::GetSourceType ( )
inlinevirtual

Source type.

Returns
FairSource::Source_Type

Definition at line 57 of file CbmSourceDigiTimeslice.h.

References fSourceType.

◆ Init()

Bool_t CbmSourceDigiTimeslice::Init ( )
virtual

◆ InitUnpackers()

virtual Bool_t CbmSourceDigiTimeslice::InitUnpackers ( )
inlinevirtual

Initialise unpackers (forced by base class, not relevant here)

Definition at line 63 of file CbmSourceDigiTimeslice.h.

◆ operator=()

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

Assignment operator - not implemented.

◆ ReadEvent()

Int_t CbmSourceDigiTimeslice::ReadEvent ( UInt_t = 0)

Read one time slice from file.

FIXME: Add PSD and FSD to the output of RawDigis in algo/global and reco/app

Definition at line 126 of file CbmSourceDigiTimeslice.cxx.

References fArchive, fBmonDigis, fMuchDigis, fNumTs, fRichDigis, fStsDigis, fTimeslice, fTofDigis, fTrdDigis, fTsEventHeader, CbmTimeSlice::SetStartTime(), CbmTsEventHeader::SetTsIndex(), CbmTsEventHeader::SetTsStartTime(), and Timesort().

◆ RegisterVector()

template<typename TVecobj >
Bool_t CbmSourceDigiTimeslice::RegisterVector ( FairRootManager * ioman,
std::vector< TVecobj > *& vec )
private

Definition at line 39 of file CbmSourceDigiTimeslice.cxx.

Referenced by Init().

◆ ReInitUnpackers()

virtual Bool_t CbmSourceDigiTimeslice::ReInitUnpackers ( )
inlinevirtual

Re-Initialise unpackers (forced by base class, not relevant here)

Definition at line 69 of file CbmSourceDigiTimeslice.h.

◆ Reset()

virtual void CbmSourceDigiTimeslice::Reset ( )
inlinevirtual

Reset (forced by base class, not relevant here)

Definition at line 72 of file CbmSourceDigiTimeslice.h.

◆ SetParUnpackers()

virtual void CbmSourceDigiTimeslice::SetParUnpackers ( )
inlinevirtual

Set unpacker parameters (forced by base class, not relevant here)

Definition at line 75 of file CbmSourceDigiTimeslice.h.

◆ SetSourceType()

void CbmSourceDigiTimeslice::SetSourceType ( Source_Type type)
inline

Set the Source Type.

Parameters
typeSource type

Definition at line 80 of file CbmSourceDigiTimeslice.h.

References fSourceType.

◆ SpecifyRunId()

Bool_t CbmSourceDigiTimeslice::SpecifyRunId ( )
inline

Set Run ID (forced by base class, not relevant here)

Definition at line 83 of file CbmSourceDigiTimeslice.h.

◆ Timesort()

template<typename TVecobj >
std::enable_if< std::is_member_function_pointer< decltype(&TVecobj::GetTime)>::value, void >::type CbmSourceDigiTimeslice::Timesort ( std::vector< TVecobj > * vec = nullptr)
inlineprivate

Definition at line 124 of file CbmSourceDigiTimeslice.h.

Referenced by ReadEvent().

Member Data Documentation

◆ fArchive

std::unique_ptr<cbm::algo::RecoResultsInputArchive> CbmSourceDigiTimeslice::fArchive = nullptr
private

Input archive

Definition at line 91 of file CbmSourceDigiTimeslice.h.

Referenced by Init(), and ReadEvent().

◆ fBmonDigis

std::vector<CbmBmonDigi>* CbmSourceDigiTimeslice::fBmonDigis = nullptr
private

Branch vectors of Digis

Definition at line 94 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fInputFileName

std::string CbmSourceDigiTimeslice::fInputFileName = {}
private

Input file name

Definition at line 88 of file CbmSourceDigiTimeslice.h.

Referenced by Init().

◆ fMuchDigis

std::vector<CbmMuchDigi>* CbmSourceDigiTimeslice::fMuchDigis = nullptr
private

Definition at line 96 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fNumTs

size_t CbmSourceDigiTimeslice::fNumTs = 0
private

Time-slice counter

Definition at line 117 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), and ReadEvent().

◆ fRichDigis

std::vector<CbmRichDigi>* CbmSourceDigiTimeslice::fRichDigis = nullptr
private

Definition at line 99 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fSourceType

Source_Type CbmSourceDigiTimeslice::fSourceType = Source_Type::kONLINE
private

type of source that is currently used

Remarks
currently we use kONLINE as default, since, kFILE skipps the first TS probably due to obsolete reasons (to be checked PR072021)

Definition at line 105 of file CbmSourceDigiTimeslice.h.

Referenced by GetSourceType(), and SetSourceType().

◆ fStsDigis

std::vector<CbmStsDigi>* CbmSourceDigiTimeslice::fStsDigis = nullptr
private

Definition at line 95 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fTimeslice

CbmTimeSlice* CbmSourceDigiTimeslice::fTimeslice = nullptr
private

Time-slice header (old version)

Remarks
The CbmTimeSlice class is about to be deprecated, one should use the CbmTsEventHeader class instead.

Definition at line 110 of file CbmSourceDigiTimeslice.h.

Referenced by Init(), and ReadEvent().

◆ fTofDigis

std::vector<CbmTofDigi>* CbmSourceDigiTimeslice::fTofDigis = nullptr
private

Definition at line 98 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fTrdDigis

std::vector<CbmTrdDigi>* CbmSourceDigiTimeslice::fTrdDigis = nullptr
private

Definition at line 97 of file CbmSourceDigiTimeslice.h.

Referenced by Close(), Init(), and ReadEvent().

◆ fTsEventHeader

CbmTsEventHeader* CbmSourceDigiTimeslice::fTsEventHeader = nullptr
private

Time-slice event header

Definition at line 113 of file CbmSourceDigiTimeslice.h.

Referenced by Init(), and ReadEvent().


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