CbmRoot
Loading...
Searching...
No Matches
CbmSourceTsArchive.h
Go to the documentation of this file.
1/* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Jan de Cuveland, Volker Friese[committer], Pierre-Alain Loizeau */
4
5#ifndef CBMSOURCETSARCHIVE_H
6#define CBMSOURCETSARCHIVE_H 1
7
8#include "CbmRecoUnpack.h"
9
10#include <TimesliceSource.hpp>
11
12#include <FairSource.h>
13
14#include <cstdint>
15#include <string>
16
17
26class CbmSourceTsArchive : public FairSource {
27
28 public:
34 CbmSourceTsArchive(const char* fileName = "");
35
41 CbmSourceTsArchive(std::vector<std::string> fileNames);
42
43
46 {
47 if (fTsSource) delete fTsSource;
48 }
49
50
53
56
62 void SetDebugPrintout(bool value = true) { fDoDebugPrints = value; }
63
64
69 size_t AddInputFile(const char* fileName);
70
71
73 virtual void Close();
74
75
79 virtual Source_Type GetSourceType() { return fSourceType; }
80
87
88
90 virtual Bool_t Init();
91
92
94 virtual Bool_t InitUnpackers() { return kTRUE; }
95
96
98 Int_t ReadEvent(UInt_t = 0);
99
100
102 virtual Bool_t ReInitUnpackers() { return kTRUE; }
103
104
106 virtual void Reset() { fUnpack.Reset(); }
107
109 virtual void SetParUnpackers() {}
110
112 void SetSourceType(Source_Type type) { fSourceType = type; }
113
115 Bool_t SpecifyRunId() { return kTRUE; }
116
117 private:
119 bool fDoDebugPrints = false;
120
122 std::vector<std::string> fFileNames = {};
123
125 Source_Type fSourceType = Source_Type::kONLINE;
126
128 fles::TimesliceSource* fTsSource = nullptr;
129
131 ULong64_t fTsCounter = 0;
132
135
136
137 ClassDef(CbmSourceTsArchive, 1)
138};
139
140
141#endif
Main steering class for unpacking in cbmroot.
void Reset()
Clear the output vectors as preparation of the next timeslice. Called via FairSource::Reset()
Source class for reading from archived time slice data.
virtual Bool_t InitUnpackers()
Initialise unpackers (forced by base class)
Bool_t SpecifyRunId()
Provide dummy implementation of this virtual function as not relevant in our case.
virtual ~CbmSourceTsArchive()
Destructor.
bool fDoDebugPrints
Flag if extended debug output is to be printed or not.
void SetSourceType(Source_Type type)
Set the Source Type.
size_t AddInputFile(const char *fileName)
Add an input file.
fles::TimesliceSource * fTsSource
CbmSourceTsArchive(const CbmSourceTsArchive &)=delete
Copy constructor - not implemented.
Int_t ReadEvent(UInt_t=0)
Read one time slice from file.
virtual void SetParUnpackers()
Set unpacker parameters (forced by base class)
CbmSourceTsArchive & operator=(const CbmSourceTsArchive &)=delete
Assignment operator - not implemented.
Source_Type fSourceType
type of source that is currently used
std::vector< std::string > fFileNames
CbmRecoUnpack * GetRecoUnpack()
Get the Reco Unpack Access the CbmRecoUnpack class to add unpacker configs.
virtual Source_Type GetSourceType()
Source type.
virtual Bool_t ReInitUnpackers()
Re-Initialise unpackers (forced by base class)
CbmSourceTsArchive(const char *fileName="")
Constructor.
virtual void Close()
Close source after end of run.
virtual void Reset()
Reset clear the output vectors as preparation for the next timeslice. Forwarded to CbmRecoUnpack.
void SetDebugPrintout(bool value=true)
Set the Debug Printout Flag.
virtual Bool_t Init()
Initialisation.