GET library
GETRunFile.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETRunFile.hh
3  *
4  * Include file for the GETRunFile class.
5  */
6 //======================================================================
7 
8 #ifndef GET_RUN_FILE_HH
9 #define GET_RUN_FILE_HH
10 
11 //----------------------------------------------------------------------
12 // includes from GET library
13 #include "GETCommon.hh"
14 
15 // includes from ROOT
16 #include <TSystem.h>
17 #include <TROOT.h>
18 
19 
20 //======================================================================
21 /*! \class GETRunFile
22  *
23  * This is the base class for runs data files.
24  * It manages a single file, while derived classes may handle more
25  * complicated groups of files.
26  *
27  * The run files are only open in read mode.
28  */
30 {
31  //------------------------------------------------------------
32  /*! \object_doc */
34  //------------------------------------------------------------
35 
36  protected:
37 
38  // data file
39  FILE * run_file_ptr; ///< Pointer to experimental data file
40  string run_file_name; ///< Name of the experimental data file
41 
42  u_int file_event_count; ///< Number of events in the file
43 
44  public:
45  //----------------------------------------------------------
46  /** @name Constructors, affectation, destructor */
47  //@{
48  GETRunFile ( const string & fname = "", bool open = true );
49  virtual ~GETRunFile ( );
50  //@}
51 
52  //----------------------------------------------------------
53  /** @name File operations */
54  //@{
55  virtual int Open ( const string & fname );
56 
57  virtual int Open ( ); // inline
58  virtual int Close ( );
59  virtual bool IsOpen ( ) const; // inline
60  virtual int OpenNext ( ); // inline
61 
62  virtual bool AtEnd ( ) const; // inline
63  //@}
64 
65  //----------------------------------------------------------
66  /** @name File information */
67  //@{
68  int GetFileLun ( ) const; // inline
69 
70  virtual int SetFileName ( const string & fname );
71 
72  const string & GetFileName ( ) const; // inline
73  string & GetFileName ( ); // inline
74 
75  FILE * GetFilePtr ( ); // inline
76 
77  virtual void EventCountIncr ( ); // inline
78  int GetFileEventCount ( ) const; // inline
79  //@}
80 
81 
82  //----------------------------------------------------------
83  /** @name ROOT related functions */
84  //@{
85  public:
86 
87  /*! for use within ROOT.*/
89  //@}
90 };
91 
92 
93 //----------------------------------------------------------------------
94 // Inline functions
95 #include "icc/GETRunFile.icc"
96 
97 
98 //======================================================================
99 #endif
GETRunFile(const string &fname="", bool open=true)
Definition: GETRunFile.cpp:18
int GetFileLun() const
Definition: GETRunFile.icc:34
u_int file_event_count
Number of events in the file.
Definition: GETRunFile.hh:42
string run_file_name
Name of the experimental data file.
Definition: GETRunFile.hh:40
virtual bool AtEnd() const
Definition: GETRunFile.icc:26
virtual int Close()
Definition: GETRunFile.cpp:89
GObject(GETRunFile)
Definition: GETRunFile.hh:29
virtual bool IsOpen() const
Definition: GETRunFile.icc:38
const string & GetFileName() const
Definition: GETRunFile.icc:44
FILE * run_file_ptr
Pointer to experimental data file.
Definition: GETRunFile.hh:39
virtual void EventCountIncr()
Definition: GETRunFile.icc:58
FILE * GetFilePtr()
Definition: GETRunFile.icc:52
virtual int OpenNext()
Definition: GETRunFile.icc:20
virtual ~GETRunFile()
Definition: GETRunFile.cpp:32
virtual int SetFileName(const string &fname)
Definition: GETRunFile.cpp:118
virtual int Open()
Definition: GETRunFile.icc:11
int GetFileEventCount() const
Definition: GETRunFile.icc:62
ClassDef(GETRunFile, 0)