GET library
GETRunList Class Reference

#include <GETRunList.hh>

Inheritance diagram for GETRunList:
GETRunFile GETRunSerie

Public Member Functions

Constructors, affectation, destructor
 GETRunList (const string &pattern="", bool open=true)
 
virtual ~GETRunList ()
 
File operations
virtual int Open ()
 
virtual int Close ()
 
virtual bool IsOpen () const
 
virtual int OpenNext ()
 
virtual bool AtEnd () const
 
File information
virtual int SetFilePattern (const string &pattern)
 
const string & GetFilePattern () const
 
string & GetFilePattern ()
 
const GStringList & GetFileList () const
 
GStringList & GetFileList ()
 
u_int GetFileCount () const
 
virtual void EventCountIncr ()
 
int GetListEventCount () const
 
ROOT related functions
 ClassDef (GETRunList, 0)
 
- Public Member Functions inherited from GETRunFile
 GETRunFile (const string &fname="", bool open=true)
 
virtual ~GETRunFile ()
 
virtual int Open (const string &fname)
 
int GetFileLun () const
 
virtual int SetFileName (const string &fname)
 
const string & GetFileName () const
 
string & GetFileName ()
 
FILE * GetFilePtr ()
 
int GetFileEventCount () const
 
 ClassDef (GETRunFile, 0)
 

Protected Attributes

int current_file_num
 Number of currently opened file (-1 if none)
 
u_int list_event_count
 Number of events in the file list.
 
GStringList run_file_list
 List of effective run files.
 
string run_file_pattern
 Pattern for file name selection.
 
- Protected Attributes inherited from GETRunFile
u_int file_event_count
 Number of events in the file.
 
string run_file_name
 Name of the experimental data file.
 
FILE * run_file_ptr
 Pointer to experimental data file.
 

Private Member Functions

 GObject (GETRunList)
 

Detailed Description

This class defines a list of runs data files, instead of a single file.

Constructor & Destructor Documentation

GETRunList::GETRunList ( const string &  pattern = "",
bool  open = true 
)

Constructor.

Parameters
patternpattern for the file list selection
openwhether the first file should be opened when created

References current_file_num, list_event_count, Open(), run_file_pattern, and SetFilePattern().

GETRunList::~GETRunList ( )
virtual

Destructor.

Member Function Documentation

bool GETRunList::AtEnd ( ) const
inlinevirtual

Return true if at end of the last file in the list. The function also returns true if no file is opened.

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References GETRunFile::AtEnd(), current_file_num, and GetFileCount().

Referenced by GETRunSerie::AtEnd(), and GETRunSerie::OpenNext().

GETRunList::ClassDef ( GETRunList  ,
 
)

for use within ROOT.

int GETRunList::Close ( )
virtual

Close the current run file, if open. The function returns 0 if no error occured

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References GETRunFile::Close(), current_file_num, IsOpen(), and GETRunFile::IsOpen().

Referenced by GETRunSerie::Close(), and GETRunSerie::OpenNext().

void GETRunList::EventCountIncr ( )
inlinevirtual

Increment the event counter.

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References GETRunFile::EventCountIncr(), and list_event_count.

Referenced by GETRunSerie::EventCountIncr().

u_int GETRunList::GetFileCount ( ) const
inline

Return the number of files in the current list of files.

References run_file_list.

Referenced by AtEnd(), Open(), OpenNext(), and GETRunSerie::SetRunList().

const GStringList & GETRunList::GetFileList ( ) const
inline

Return the list of file names.

References run_file_list.

GStringList & GETRunList::GetFileList ( )
inline

Return the list of file names.

References run_file_list.

const string & GETRunList::GetFilePattern ( ) const
inline

Return the pattern for the files selection.

References run_file_pattern.

string & GETRunList::GetFilePattern ( )
inline

Return the pattern for the files selection.

References run_file_pattern.

int GETRunList::GetListEventCount ( ) const
inline

Return the event counter since last file list started.

References list_event_count.

GETRunList::GObject ( GETRunList  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
bool GETRunList::IsOpen ( ) const
inlinevirtual

Return true if the file is currently opened.

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References current_file_num, and GETRunFile::IsOpen().

Referenced by Close(), GETRunSerie::Close(), GETRunSerie::IsOpen(), Open(), OpenNext(), GETRunSerie::OpenNext(), and SetFilePattern().

int GETRunList::Open ( )
virtual

Open the file list, starting at first file.

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References current_file_num, GetFileCount(), IsOpen(), list_event_count, GETRunFile::Open(), run_file_list, and GETRunFile::run_file_name.

Referenced by GETRunList(), GETRunSerie::Open(), and GETRunSerie::OpenNext().

int GETRunList::OpenNext ( )
virtual

Open the next effective file. It returns -1 when there no next file, or a positive value in case of error.

Reimplemented from GETRunFile.

Reimplemented in GETRunSerie.

References GETRunFile::Close(), current_file_num, GetFileCount(), IsOpen(), GETRunFile::Open(), and run_file_list.

Referenced by GETRunSerie::OpenNext().

int GETRunList::SetFilePattern ( const string &  pattern)
virtual

Defines the list of file names according to the pattern argument. If successful, it initializes the current selected file. The function returns 0 if no error occured. If the file is already opened, an error is returned.

Parameters
patternpattern for the file list selection

References current_file_num, IsOpen(), run_file_list, GETRunFile::run_file_name, and run_file_pattern.

Referenced by GETRunList(), and GETRunSerie::SetRunList().


The documentation for this class was generated from the following files: