FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTCASource.h
Go to the documentation of this file.
1 
11 #ifndef EVENTDISPLAY_FAIRTCASOURCE_H_
12 #define EVENTDISPLAY_FAIRTCASOURCE_H_
13 
14 #include "FairDataSourceI.h"
15 #include "FairMCPoint.h"
16 #include "FairTimeStamp.h"
17 #include "TClonesArray.h"
18 
20 {
21  public:
22  FairTCASource();
23  FairTCASource(TString branchName)
24  : FairDataSourceI(branchName){};
25  virtual ~FairTCASource();
26 
27  virtual int GetNData() { return fCArray->GetEntries(); };
28  virtual TObject* GetData(int index) { return fCArray->At(index); }
29  virtual double GetTime(int index)
30  {
31  TObject* dataObj = fCArray->At(index);
32  double time = -1.0;
33  if (dataObj->InheritsFrom("FairTimeStamp")) {
34  time = static_cast<FairTimeStamp*>(dataObj)->GetTimeStamp();
35  } else if (dataObj->InheritsFrom("FairMCPoint")) {
36  time = static_cast<FairMCPoint*>(dataObj)->GetTime();
37  }
38  return time;
39  };
40  virtual void Reset(){};
41 
42  private:
43  ClassDef(FairTCASource, 1);
44 };
45 
46 #endif /* EVENTDISPLAY_FAIRTCASOURCE_H_ */
TClonesArray * fCArray
virtual double GetTime(int index)
Definition: FairTCASource.h:29
virtual ~FairTCASource()
Handles a TClonesArray as input object. No timebased operations are done and the TClonesArray is hand...
Definition: FairTCASource.h:19
FairTCASource(TString branchName)
Definition: FairTCASource.h:23
virtual TObject * GetData(int index)
Definition: FairTCASource.h:28
Abstract interface class to handle different input data for event and timebased data.
virtual int GetNData()
Definition: FairTCASource.h:27
virtual void Reset()
Definition: FairTCASource.h:40