HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoReaderBase.h
Go to the documentation of this file.
1 #ifndef HARPOREADERBASE_H
2 #define HARPOREADERBASE_H
3 // //
5 // HarpoReaderBase //
6 // //
7 // Harpo Reader Class //
8 // //
10 
11 #include "TObject.h"
12 #include "TFile.h"
13 #include "HarpoConfig.h"
14 #include "HarpoDetSet.h"
15 
16 #include "HarpoRunHeader.h"
17 #include "HarpoEvent.h"
18 #include "HarpoEventHeader.h"
19 
20 #include "HarpoDetReader.h"
21 #include "HarpoAnalyse.h"
22 //#include <vector>
23 
24 enum hReadMode { // Event read mode
25  hNoCMPTime, // Read without timeshump comparision
26  hFirstTime, // return only plane which smaller time stamp
27  hSyncTime // skip plane event with smaller timeshatp, return only
28  // event with both timestamp syncronized
29 };
30 
32 
33 public:
34 
37 
38  virtual ~HarpoReaderBase();
39 
40  virtual void SetDetFile(TString *name,Int_t plane) = 0;
41  virtual void SetRootFile(TString *name)= 0;
42 
43  virtual void SetAnalyseFunction(HarpoAnalyse *func, Int_t i = 0);
44  virtual void AddAnalyseFunction(HarpoAnalyse *func);
45 
46  virtual Bool_t NextEvent() =0; // Read next event from raw file
47  virtual Bool_t isTimeSynchro() = 0; // Both planes has the same time stamp
48 
49  virtual void SkipEvent() =0; // Skeep Event
50 
51  virtual HarpoEvent *GetEvent() = 0 ; // Pointer to Current event
52  virtual HarpoRunHeader *GetRunHeader()=0 ; // Run Header
53 
54  virtual Bool_t Init(hReadMode mode=hSyncTime)=0; // Open raw file and check header
55 
56  virtual Bool_t isDone() { return fDone; }
57  virtual Bool_t isError() { return fError; }
58 
59  virtual Long_t LoopAll(); // Process all events as defined in config
60  virtual Long_t Loop(Long_t maxevents)=0;
61 
62  virtual Long_t Find(Long_t eventNo)=0;
63 
64  virtual void SetRunNo(Long_t nRun) { fRunNo = nRun; }
65  virtual Long_t GetRunNo() { return fRunNo; }
66  virtual Long_t GetReadEvts() { return fNevts; }
67 
68 
69 protected:
70 
71  Long_t fRunNo; // Run Number
72  Long_t fNevts; // Readed events
73  Long_t fFirstEvent; // First event to read
74  Long_t fMaxEvents; // Max number of events to read
75  Bool_t fDone; // Finished reading
76  Bool_t fError; // Read error of event format error
77 
78  Int_t fNanalyses;
79 
80  HarpoDetReader **fDetReader; // Raw Files reader
81 
82  HarpoEvent *fEvent; // Current Event
83  HarpoEventHeader *fEventHeader; // Current Event Header
84  HarpoRunHeader *fRunHeader; // Run Header
85 
86  // HarpoAnalyse *fAnalyse;
88  // std::vector<HarpoAnalyse *> fAnalyse;
89  // std::vector<HarpoAnalyse *> fAnalyse(10,(HarpoAnalyse *)0);
90 
92 
93 
94  ClassDef(HarpoReaderBase,1)
95 };
96 
97 
98 #endif
HarpoRunHeader * fRunHeader
virtual void AddAnalyseFunction(HarpoAnalyse *func)
virtual ~HarpoReaderBase()
Long_t fRunNo
Number of readed events.
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Definition: HarpoAnalyse.h:47
virtual HarpoEvent * GetEvent()=0
virtual Long_t LoopAll()
Read errors.
A class hold HARPO run iformation.
virtual Bool_t isTimeSynchro()=0
HarpoAnalyse * fAnalyse[30]
A generic class for HARPO datectors The class is ....
Definition: HarpoDetSet.h:21
FullEvent Header not scecific to the detectors The class is ....
virtual Bool_t isError()
EOF reached.
virtual Long_t Find(Long_t eventNo)=0
virtual Long_t GetRunNo()
virtual void SetRootFile(TString *name)=0
A virtual base class for all HARPO detectors readers.
A base class for all top level HARPO readers.
virtual Long_t Loop(Long_t maxevents)=0
virtual Bool_t Init(hReadMode mode=hSyncTime)=0
virtual HarpoRunHeader * GetRunHeader()=0
virtual Long_t GetReadEvts()
virtual void SetAnalyseFunction(HarpoAnalyse *func, Int_t i=0)
virtual Bool_t NextEvent()=0
virtual void SkipEvent()=0
virtual void SetRunNo(Long_t nRun)
Find raw event by event number.
virtual Bool_t isDone()
A class store HARPO row event data and header. Provide access metods to the row event data...
Definition: HarpoEvent.h:29
HarpoEvent * fEvent
hReadMode
virtual void SetDetFile(TString *name, Int_t plane)=0
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50
HarpoDetReader ** fDetReader
HarpoDetSet * fDetSet
HarpoEventHeader * fEventHeader