FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTimebasedSource.h
Go to the documentation of this file.
1 
10 #ifndef EVENTDISPLAY_FAIRTIMEBASEDSOURCE_H_
11 #define EVENTDISPLAY_FAIRTIMEBASEDSOURCE_H_
12 
13 #include "FairDataSourceI.h"
14 #include "FairTSBufferFunctional.h" // IWYU pragma: keep needed for cint
15 #include "FairTimeStamp.h"
16 
18 {
19  public:
21  FairTimebasedSource(TString branchName, Double_t windowMinus, Double_t windowPlus)
22  : FairDataSourceI(branchName)
23  , fTimeWindowMinus(windowMinus)
24  , fTimeWindowPlus(windowPlus){};
25  virtual ~FairTimebasedSource();
26 
27  virtual void RetrieveData(double time);
28  virtual int GetNData() { return fCArray->GetEntries(); };
29  virtual TObject* GetData(int index) { return fCArray->At(index); }
30  virtual double GetTime(int index) { return static_cast<FairTimeStamp*>(fCArray->At(index))->GetTimeStamp(); }
31  virtual void Reset(){};
32 
33  private:
34  BinaryFunctor* fStartFunctor{new StopTime()};
35  BinaryFunctor* fStopFunctor{new StopTime()};
36  Double_t fTimeWindowPlus{-1.0};
37  Double_t fTimeWindowMinus{-1.0};
38 
39  ClassDef(FairTimebasedSource, 1);
40 };
41 
42 #endif /* EVENTDISPLAY_FAIRTCASOURCE_H_ */
FairTimebasedSource(TString branchName, Double_t windowMinus, Double_t windowPlus)
virtual TObject * GetData(int index)
TClonesArray * fCArray
virtual double GetTime(int index)
Handles timebased data via the GetData method. A time window has to be given in which the data is rec...
virtual void RetrieveData(double time)
Abstract interface class to handle different input data for event and timebased data.
Base class for all functors which are used in the FairTSBufferFunctional.