FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairDataSourceI.h
Go to the documentation of this file.
1 
11 #ifndef EVENTDISPLAY_FAIRDATASOURCEI_H_
12 #define EVENTDISPLAY_FAIRDATASOURCEI_H_
13 
14 #include "FairTask.h"
15 
16 #include <TClonesArray.h>
17 #include <TObject.h>
18 #include <TString.h>
19 #include <fairlogger/Logger.h>
20 
21 class FairDataSourceI : public TObject
22 {
23  public:
25  FairDataSourceI(TString branchName)
26  : fBranchName(branchName){};
27  virtual ~FairDataSourceI();
28 
32  virtual InitStatus Init();
38  virtual void RetrieveData(double time)
39  {
40  LOG(debug) << "Retrieving Data for " << fBranchName << " for time " << time << " ns - nData = " << GetNData();
41  }
42  virtual int GetNData() = 0;
43  virtual TObject* GetData(int index) = 0;
44  virtual double GetTime(int index) { return -1.0; };
45  virtual TString GetBranchName() const { return fBranchName; };
46  virtual void Reset() = 0; //< Resets the data containers
47 
48  protected:
49  TClonesArray* fCArray = nullptr;
50  TString fBranchName;
51 
53 };
54 
55 #endif /* EVENTDISPLAY_FAIRDATASOURCEI_H_ */
ClassDef(FairDataSourceI, 1)
virtual InitStatus Init()
InitStatus
Definition: FairTask.h:33
virtual ~FairDataSourceI()
TClonesArray * fCArray
virtual void RetrieveData(double time)
virtual double GetTime(int index)
virtual TObject * GetData(int index)=0
Abstract interface class to handle different input data for event and timebased data.
virtual void Reset()=0
virtual int GetNData()=0
FairDataSourceI(TString branchName)
virtual TString GetBranchName() const