CbmRoot
Loading...
Searching...
No Matches
CbmSourceTs.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: Volker Friese[committer] */
4
5#ifndef CBMSOURCETS_H
6#define CBMSOURCETS_H 1
7
8
9#include <TimesliceSource.hpp>
10
11#include <FairSource.h>
12
13#include <cstdint>
14#include <memory>
15#include <string>
16
17
26class CbmSourceTs : public FairSource {
27
28 public:
34 CbmSourceTs(const char* fileName = "");
35
41 CbmSourceTs(std::vector<std::string> fileNames);
42
43
45 virtual ~CbmSourceTs(){};
46
47
49 CbmSourceTs(const CbmSourceTs&) = delete;
50
51
54
55
60 size_t AddInputFile(const char* fileName);
61
62
64 virtual void Close();
65
66
72 size_t GetNumTs() const { return fNumCalls - 1; }
73
74
76 virtual Source_Type GetSourceType() { return kFILE; }
77
78
80 //std::shared_ptr<fles::Timeslice> GetTimeslice() { return fFlesTs; }
81 fles::Timeslice* GetTimeslice() { return fFlesTs.get(); }
82
83
85 virtual Bool_t Init();
86
87
89 virtual Bool_t InitUnpackers() { return kTRUE; }
90
91
93 virtual Int_t ReadEvent(UInt_t = 0);
94
95
97 virtual Bool_t ReInitUnpackers() { return kTRUE; }
98
99
101 virtual void Reset() {}
102
103
105 virtual void SetParUnpackers() {}
106
107
109 virtual Bool_t SpecifyRunId() { return kTRUE; }
110
111
112 private: // member variables
114 std::vector<std::string> fFileNames = {};
115
117 fles::TimesliceSource* fFlesSource = nullptr;
118
120 std::unique_ptr<fles::Timeslice> fFlesTs = nullptr;
121
123 size_t fNumCalls = 0;
124
125
126 ClassDef(CbmSourceTs, 1)
127};
128
129
130#endif
Source class for reading from archived time slice data.
Definition CbmSourceTs.h:26
virtual ~CbmSourceTs()
Destructor.
Definition CbmSourceTs.h:45
CbmSourceTs & operator=(const CbmSourceTs &)=delete
Assignment operator - not implemented.
virtual void SetParUnpackers()
Demanded by base class.
virtual Bool_t Init()
Initialisation.
virtual Bool_t ReInitUnpackers()
Demanded by base class.
Definition CbmSourceTs.h:97
virtual void Close()
Demanded by base class.
size_t fNumCalls
fles::Timeslice * GetTimeslice()
Pointer to current FLES timeslice.
Definition CbmSourceTs.h:81
CbmSourceTs(const char *fileName="")
Constructor.
size_t AddInputFile(const char *fileName)
Add an input file.
std::unique_ptr< fles::Timeslice > fFlesTs
virtual void Reset()
Demanded by base class.
virtual Source_Type GetSourceType()
Demanded by base class.
Definition CbmSourceTs.h:76
fles::TimesliceSource * fFlesSource
std::vector< std::string > fFileNames
virtual Int_t ReadEvent(UInt_t=0)
Read one time slice from file.
virtual Bool_t InitUnpackers()
Demanded by base class.
Definition CbmSourceTs.h:89
CbmSourceTs(const CbmSourceTs &)=delete
Copy constructor - not implemented.
CbmSourceTs(std::vector< std::string > fileNames)
Constructor.
size_t GetNumTs() const
Number of processed timeslices.
Definition CbmSourceTs.h:72
virtual Bool_t SpecifyRunId()
Demanded by base class.