StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrgDatReader.h
1 // $Id: StTrgDatReader.h,v 1.6 2010/01/25 17:41:53 akio Exp $
2 //
3 // $Log: StTrgDatReader.h,v $
4 // Revision 1.6 2010/01/25 17:41:53 akio
5 // Remove RecordSize, and RecordUnixTime to return 2019686401 (Sat Dec 31 19:00:01 2033)
6 //
7 // Revision 1.5 2010/01/15 21:26:51 fine
8 // RT #1816. Eliminate the side effect from RT 1803 fix
9 //
10 // Revision 1.4 2010/01/07 17:37:58 fine
11 // introduce closeFileSignal to process several DAT files at once. RT # 1794
12 //
13 // Revision 1.3 2010/01/06 20:42:26 fine
14 // Fix type EventNumber shoould be RunNumber . Thanks Akio
15 //
16 // Revision 1.2 2010/01/06 20:09:39 fine
17 // RT #1794. Add EventNumber method to the StStreamFile interface RT # 1794
18 //
19 // Revision 1.1 2009/10/13 15:53:31 fine
20 // Akio\'s DAT file format reader
21 //
22 //
23 
24 /***************************************************************************
25  * Author: akio ogawea
26  * Description: Trigger Data file (run*.*.dat) reader
27  **************************************************************************/
28 
29 #ifndef __StTrgDatReader_h__
30 #define __StTrgDatReader_h__
31 
32 #include "StStreamFile.h"
33 
34 class StTrgDatReader : public StStreamFile {
35 
36 public:
37  explicit StTrgDatReader();
38  explicit StTrgDatReader(const char *fileName, ios_base::openmode mode = ios_base::in);
39 
40  virtual ~StTrgDatReader();
41 
42 public: // implementation of StStreamFile abstract interface
43 
44  fstream &Read();
45  char *Record();
46  int Length() const;
47  int Version() const;
48  int RunNumber() const;
49  int RecordUnixTime() const;
50 
51 protected :
52  char *Buffer(streamsize n);
53  virtual bool closeFileSignal();
54 
55 private:
56 
57  int mLength;
58  int mVersion;
59  int mRunNumber;
60  char *mData;
61  streamsize mAllocated;
62  static const int mLheader; // the length of the header
63 };
64 #endif