GET library
|
#include <GETRunSerie.hh>
Public Member Functions | |
Constructors, affectation, destructor | |
GETRunSerie (const string &pattern="", const string &serie="", bool open=true) | |
virtual | ~GETRunSerie () |
File operations | |
virtual int | Open () |
virtual int | Close () |
virtual bool | IsOpen () const |
virtual int | OpenNext () |
virtual bool | AtEnd () const |
virtual int | SetNextRunList (bool skip=true) |
virtual int | SetRunList (int rnum) |
File information | |
virtual int | SetRunPattern (const string &pattern) |
virtual int | SetRunSerie (const string &serie) |
const string & | GetRunPattern () const |
string & | GetRunPattern () |
string | GetRunSerie () const |
u_int | GetRunCount () const |
int | GetCurrentRun () const |
void | InitCurrentRun () |
virtual void | EventCountIncr () |
int | GetSerieEventCount () const |
ROOT related functions | |
ClassDef (GETRunSerie, 0) | |
Public Member Functions inherited from GETRunList | |
GETRunList (const string &pattern="", bool open=true) | |
virtual | ~GETRunList () |
virtual int | SetFilePattern (const string &pattern) |
const string & | GetFilePattern () const |
string & | GetFilePattern () |
const GStringList & | GetFileList () const |
GStringList & | GetFileList () |
u_int | GetFileCount () const |
int | GetListEventCount () const |
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_run_num |
Current run number (-1 if none) | |
GString | run_pattern |
Pattern for file name (containing "%*r" information) | |
GIntervalList | run_serie |
List of effective run files. | |
u_int | serie_event_count |
Number of events in the runs serie. | |
Protected Attributes inherited from GETRunList | |
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 (GETRunSerie) | |
This class defines a serie of runs data files, identified by a list of run numbers and a file pattern.
The file pattern must contain a "%R" indicating where the run number is specified in the file name, or "%<n>R" if the run number is padded with 0.
GETRunSerie::GETRunSerie | ( | const string & | pattern = "" , |
const string & | serie = "" , |
||
bool | open = true |
||
) |
Constructor.
pattern | pattern for the run file list selection, with "%*r" for run number indication |
serie | string defining the list of run numbers |
open | whether the first file should be opened when created |
References current_run_num, Open(), run_pattern, serie_event_count, SetRunPattern(), and SetRunSerie().
|
virtual |
Destructor.
|
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 GETRunList.
References GETRunList::AtEnd(), current_run_num, and run_serie.
GETRunSerie::ClassDef | ( | GETRunSerie | , |
0 | |||
) |
for use within ROOT.
|
virtual |
Close the current run file, if open. The function returns 0 if no error occured
Reimplemented from GETRunList.
References GETRunList::Close(), GetRunSerie(), InitCurrentRun(), GETRunList::IsOpen(), and IsOpen().
|
inlinevirtual |
Increment the event counter.
Reimplemented from GETRunList.
References GETRunList::EventCountIncr(), and serie_event_count.
|
inline |
Return the current run number.
References current_run_num.
|
inline |
Return the number of runs in the current serie.
References run_serie.
Referenced by Open(), SetNextRunList(), and SetRunSerie().
|
inline |
Return the pattern for the files selection.
References run_pattern.
|
inline |
Return the pattern for the files selection.
References run_pattern.
|
inline |
|
inline |
Return the event counter since the run serie was started.
References serie_event_count.
|
private |
Macro from GCpp library that defines the following functions:
|
inline |
Initialize the current run number.
References current_run_num, and run_serie.
Referenced by Close(), Open(), and SetRunSerie().
|
inlinevirtual |
Return true if the file is currently opened.
Reimplemented from GETRunList.
References current_run_num, GETRunList::IsOpen(), and run_serie.
Referenced by Close(), Open(), OpenNext(), SetRunPattern(), and SetRunSerie().
|
virtual |
Open the file list, starting at first file.
Reimplemented from GETRunList.
References GetRunCount(), GetRunSerie(), InitCurrentRun(), IsOpen(), GETRunList::Open(), serie_event_count, and SetNextRunList().
Referenced by GETRunSerie().
|
virtual |
Open the next effective file. First try in the current file serie, and if at end, try next run number.
It returns -1 when there no next file, or a positive value in case of error.
Reimplemented from GETRunList.
References GETRunList::AtEnd(), GETRunList::Close(), GETRunList::IsOpen(), IsOpen(), GETRunList::Open(), GETRunList::OpenNext(), and SetNextRunList().
|
virtual |
Prepare the list of run files for the next run number. If argument skip is true, if no file is found in the list, try the next run number, until a file is found.
skip | skip run number with no files |
References current_run_num, GetRunCount(), run_serie, and SetRunList().
Referenced by Open(), and OpenNext().
|
virtual |
Prepare the list of run files for a given run number. If argument skip is true, if no file is found in the list, try the next run number, until a file is found.
The funtion returns 0 if no error occured, a positive value in case of error, and -1 if there is no file matching.
rnum | run number for which the list of files should be built |
References GETRunList::GetFileCount(), run_pattern, and GETRunList::SetFilePattern().
Referenced by SetNextRunList().
|
virtual |
Defines the pattern used to identify the run files. The pattern must contain at least one occurence of the run number indication "%R" or "%<n>R".
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.
pattern | pattern for the file list selection |
References IsOpen(), and run_pattern.
Referenced by GETRunSerie().
|
virtual |
Defines the serie of run numbers.
If successful, it initializes the current run number.
The function returns 0 if no error occured. If a file is already opened, an error is returned.
serie | string defining the list of run numbers |
References GetRunCount(), InitCurrentRun(), IsOpen(), and run_serie.
Referenced by GETRunSerie().