KaliVeda
1.12/06
Heavy-Ion Analysis Toolkit
|
Utitlity base class for reading INDRA runlist files.
Use multiple inheritance with this class as one base class, then method "GoodRunLine" can be overridden to perform implementation-specific tasks.
Definition at line 17 of file KVINDRARunListReader.h.
Public Member Functions | |
KVINDRARunListReader () | |
virtual | ~ KVINDRARunListReader () |
void | CloseRLFile () |
KVRunListLine * | GetLineReader () const |
Int_t | GetRLLineNumber () const |
Int_t | GetRunListTrigger (const Char_t *field, const Char_t *fmt) |
virtual void | GoodRunLine () |
Bool_t | IsNewRunList () const |
Bool_t | OpenRLFile (const Char_t *) |
Bool_t | ReadRLLine () |
void | ReadRunList (const Char_t *name="") |
void | SetRLCommentChar (Char_t c) |
void | SetRLSeparatorChar (Char_t c) |
Private Attributes | |
Char_t | fComment |
character placed at beginning of comment lines More... | |
Int_t | fCurrentLine |
number of line in runlist file we are currently analysing More... | |
TString | fLine |
last line read from file More... | |
KVRunListLine * | fLineReader |
object used to analyse lines in file More... | |
Bool_t | fNewRunList |
flag set when reading new ("Version=10") runlist More... | |
TString | fRunsFile |
name of file to read More... | |
std::ifstream | fRunsStream |
input file stream More... | |
Char_t | fSeparator |
character used to separate fields on each line of file More... | |
Int_t | fTrigger |
last multiplicity trigger read from file More... | |
Int_t | fVersion |
version number of new runlist More... | |
#include <KVINDRARunListReader.h>
KVINDRARunListReader::KVINDRARunListReader | ( | ) |
Default ctor. We set default values for recognising comment lines ('#') and the separator character ('|')
Definition at line 20 of file KVINDRARunListReader.cpp.
|
virtual |
void KVINDRARunListReader::CloseRLFile | ( | ) |
Close current runlist file. Another file can be opened after this. If no file is open, do nothing.
Definition at line 85 of file KVINDRARunListReader.cpp.
|
inline |
Definition at line 59 of file KVINDRARunListReader.h.
|
inline |
Definition at line 66 of file KVINDRARunListReader.h.
Get trigger multiplicity for current line. Give field name which contains trigger information and format string 'fmt' containing e.g. "M>=%d" if trigger field info is written in form "M>=4" etc. etc. The last value read is kept (fTrigger), so that, if no trigger value is given for the current line, but one was given on a previous line, we assume that the previous value is valid until a new one is given. A value "-1" means no trigger has been set for any line in the file so far.
Definition at line 224 of file KVINDRARunListReader.cpp.
|
virtual |
This method should be overridden in derived class by the user. It is called every time that the fLineReader finds a line which is a "good run line" (see KVRunListLine::GoodRunLine()). The default behaviour is just to print the breakdown of the line in question on the screen.
Reimplemented in KVINDRADB4, KVINDRADB2, KVINDRADB1, and KVINDRADB.
Definition at line 205 of file KVINDRARunListReader.cpp.
|
inline |
Definition at line 34 of file KVINDRARunListReader.h.
Open file 'filename' for reading. Returns kTRUE if file can be opened (info message), kFALSE if not (error message) Reset fTrigger to -1 (in case we already read a different file)
Definition at line 57 of file KVINDRARunListReader.cpp.
Bool_t KVINDRARunListReader::ReadRLLine | ( | ) |
Read a line from current runlist file. If not a comment line (i.e. does not begin with 'fComment' character) then analyse it with fLineReader object. Returns kFALSE if no file is open or if file is not good for i/o Returns kFALSE if fLineReader has not been initialised Returns kFALSE if line cannot be read / end of file is reached
Definition at line 105 of file KVINDRARunListReader.cpp.
This method will open the runlist file 't' and read its entire contents, calling user-overridable method "GoodRunLine(KVRunListLine*)" every time a line defining a new run is read from the file. If 't' is not given, we assume that the name of the run list file was passed to the constructor, and so the file should already be open in this case. Before calling this method, you should call SetRunListLineType() to define the class used to read each line, and SetRLCommentChar()/SetRLSeparatorChar() if you want to override the default comment/separator characters.
Definition at line 156 of file KVINDRARunListReader.cpp.
Definition at line 46 of file KVINDRARunListReader.h.
Definition at line 50 of file KVINDRARunListReader.h.
|
private |
character placed at beginning of comment lines
Definition at line 25 of file KVINDRARunListReader.h.
|
private |
number of line in runlist file we are currently analysing
Definition at line 27 of file KVINDRARunListReader.h.
|
private |
last line read from file
Definition at line 24 of file KVINDRARunListReader.h.
|
private |
object used to analyse lines in file
Definition at line 23 of file KVINDRARunListReader.h.
|
private |
flag set when reading new ("Version=10") runlist
Definition at line 29 of file KVINDRARunListReader.h.
|
private |
name of file to read
Definition at line 21 of file KVINDRARunListReader.h.
|
private |
input file stream
Definition at line 22 of file KVINDRARunListReader.h.
|
private |
character used to separate fields on each line of file
Definition at line 26 of file KVINDRARunListReader.h.
|
private |
last multiplicity trigger read from file
Definition at line 28 of file KVINDRARunListReader.h.
|
private |
version number of new runlist
Definition at line 30 of file KVINDRARunListReader.h.