1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: OADBConverter.hh 768 2004-06-16 13:35:19Z thea $ |
---|
3 | // A.Thea, J.Watts created Mar, 22 2004 |
---|
4 | |
---|
5 | #ifndef __OADBCONVERTER_HH_ |
---|
6 | #define __OADBCONVERTER_HH_ |
---|
7 | |
---|
8 | #include "TObject.h" |
---|
9 | #include "OADBTree.hh" |
---|
10 | #include <Riostream.h> |
---|
11 | #include <string> |
---|
12 | |
---|
13 | class OADBHeader; |
---|
14 | class OADBPhotons; |
---|
15 | |
---|
16 | |
---|
17 | enum OAEKeyType { kBegin, kEnd, kHeader, kPhotons, kWavelength, kAngle }; |
---|
18 | |
---|
19 | class OADBConverter : public TObject { |
---|
20 | private: |
---|
21 | // enum OAEKeyType { kBegin, kEnd, kHeader, kPhotons, kWavelength, kAngle }; |
---|
22 | public: |
---|
23 | // ctor |
---|
24 | OADBConverter( OADBTree* ); |
---|
25 | |
---|
26 | // dtor |
---|
27 | virtual ~OADBConverter(); |
---|
28 | |
---|
29 | // convert oatree into a binary ESAF-readable file |
---|
30 | void SaveBinary( const char* ); |
---|
31 | |
---|
32 | // checks binary |
---|
33 | void CheckBinary( const char* ); |
---|
34 | |
---|
35 | static string KeyWord( OAEKeyType ); |
---|
36 | |
---|
37 | private: |
---|
38 | // helper functions |
---|
39 | // writing |
---|
40 | void WriteHeader(); |
---|
41 | void WritePhotons(); |
---|
42 | void InsertBegin( OAEKeyType ); |
---|
43 | void InsertEnd( OAEKeyType ); |
---|
44 | //reading |
---|
45 | void Read(); |
---|
46 | |
---|
47 | |
---|
48 | OADBTree *fTree; |
---|
49 | |
---|
50 | OADBHeader *fHeader; |
---|
51 | OADBPhotons *fPhotons; |
---|
52 | |
---|
53 | fstream *fBinFile; |
---|
54 | // length of the keywords |
---|
55 | size_t fKeyLength; |
---|
56 | |
---|
57 | ClassDef(OADBConverter,1) |
---|
58 | }; |
---|
59 | |
---|
60 | #endif /* __OADBCONVERTER_HH_ */ |
---|
61 | |
---|