HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoDccReader.h
Go to the documentation of this file.
1 #ifndef HARPODCCREADER_H
2 #define HARPODCCREADER_H
3 // //
5 // HarpoDccReader //
6 // //
7 // DCC raw file Reader Class //
8 // //
10 #include "TString.h"
11 #include "TFile.h"
12 //#include "TTree.h"
13 
14 #include "HarpoDetReader.h"
15 
16 #include "HarpoDccEvent.h"
17 #include "HarpoDccHeader.h"
18 #include "HarpoDccAnalyse.h"
19 #include "HarpoConfig.h"
20 
22 
23 public:
24 
27 
28  virtual ~HarpoDccReader();
29 
30  void SetDccFile(TString *name);
31  void SetRootFile(TString *name);
33 
34  Bool_t NextEvent(); // Read next event from raw file
35  void SkipEvent(); // Skipping not "intersting" event
36  void PushBack(); // Reread current event on follwing NextEvent
37 
38  HarpoDccEvent *GetEvent(); // Pointer to Current event
39  HarpoDccHeader *GetDetHeader(); // Run Header
40 
41  Bool_t Init(); // Open raw file and check header
42  Bool_t isDone() { return fDone; }
43  Bool_t isError() { return fError; }
44 
45  Long_t Loop(); // Process all events as defined in config
46  Long_t Loop(Long_t maxevents);
47 
48  /* Bool_t Find(Long_t eventNo); //! Find raw event by event number */
49 
50  /* void SetRunNo(Long_t nRun) { fRunNo = nRun; } */
51  /* Long_t GetRunNo() { return fRunNo; } */
52 
53  void SetPlane(Long_t plane) { fPlane = plane; }
54  Int_t GetPlane() { return fPlane; }
55  /* Long_t GetReadEvts() { return fNevts; } //! Number of readed events */
56  /* ULong_t GetTimeStamp() { return fTimeStamp; } // TS from prev event */
57  /* ULong_t GetPrevTimeStamp() { return fPrevTimeStamp; } // TS from prev event */
58 
59  void Save();
60 
61 private:
62 
63  void AddPedestals();
64  /* Long_t fRunNo; // Run Number */
65  Long_t fPlane; // Plane Number ( X == 0, Y == 1)
66  Bool_t fDone; // Finished reading
67  Bool_t fError; // Read error of event format error
68 
69  //Bool_t fSaveTree;
70  //TTree* fTree;
71  /* TString *fInFile; // Dcc File name */
72  FILE *fIn; // Dcc File discriptor
73  Long_t fNevts; // Readed events
74 
75  /* TString *fNewFileName; //ROOT file Name */
76  TFile *fNewFile; //ROOT file handler
77  Long_t fNewNb; //Number of bytes written onto new file
78 
79  /* Long_t fMaxEvents; //max Number of event to read */
80 
81 
82  HarpoDccEvent *fEvent; // Current Event
83  HarpoDccEvent *fSaveEvent; // Pushed event pointer
84  Bool_t isEventSaved;
85 
86  HarpoDccAnalyse *fDccAnalyse; // User Analisysis Function
87 
88  EventHeader_t lHeader; // local buffer
89  UShort_t lData[EVENT_BUFFER_SIZE]; // local buffer
90 
91 
92 
93  ClassDef(HarpoDccReader,1)
94 };
95 #endif
void SetRootFile(TString *name)
A class which read HARPO dcc file from one DCC and creant Dcc Events and Dcc Headers for DCC Events o...
UShort_t lData[EVENT_BUFFER_SIZE]
Long_t Loop()
Read errors.
#define EVENT_BUFFER_SIZE
Definition: HarpoDccEvent.h:20
A class hold HARPO run iformation.
void PushBack()
Skeeping not "intersting" event.
Bool_t Init()
Init method : Open in/out files and check run header signature.
HarpoDccEvent * fSaveEvent
HarpoDccHeader * GetDetHeader()
EventHeader_t lHeader
Bool_t isError()
EOF reached.
A virtual base class for all HARPO detectors readers.
void SetPlane(Long_t plane)
void SetAnalyseFunction(HarpoDccAnalyse *func)
virtual ~HarpoDccReader()
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Harpo Event Header.
Definition: HarpoDetEvent.h:26
HarpoDccEvent * GetEvent()
HarpoDccEvent * fEvent
Int_t GetPlane()
Define plane X or Y.
void SetDccFile(TString *name)
HarpoDccAnalyse * fDccAnalyse
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50
void SkipEvent()
Read next event from raw file.
A class store HARPO EVENT : header and row data. Its provide also the methods for access to this data...
Definition: HarpoDccEvent.h:22