KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Private Attributes | List of all members
KVINDRARunListReader Class Reference

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 ()
 
KVRunListLineGetLineReader () 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...
 
KVRunListLinefLineReader
 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>

Inheritance diagram for KVINDRARunListReader:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVINDRARunListReader()

KVINDRARunListReader::KVINDRARunListReader ( )

Default ctor. We set default values for recognising comment lines ('#') and the separator character ('|')

Definition at line 20 of file KVINDRARunListReader.cpp.

◆ ~ KVINDRARunListReader()

virtual KVINDRARunListReader::~ KVINDRARunListReader ( )
virtual

Member Function Documentation

◆ CloseRLFile()

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.

◆ GetLineReader()

KVRunListLine* KVINDRARunListReader::GetLineReader ( ) const
inline

Definition at line 59 of file KVINDRARunListReader.h.

◆ GetRLLineNumber()

Int_t KVINDRARunListReader::GetRLLineNumber ( ) const
inline

Definition at line 66 of file KVINDRARunListReader.h.

◆ GetRunListTrigger()

Int_t KVINDRARunListReader::GetRunListTrigger ( const Char_t field,
const Char_t fmt 
)

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.

◆ GoodRunLine()

void KVINDRARunListReader::GoodRunLine ( )
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.

◆ IsNewRunList()

Bool_t KVINDRARunListReader::IsNewRunList ( ) const
inline

Definition at line 34 of file KVINDRARunListReader.h.

◆ OpenRLFile()

Bool_t KVINDRARunListReader::OpenRLFile ( const Char_t filename)

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.

◆ ReadRLLine()

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.

◆ ReadRunList()

void KVINDRARunListReader::ReadRunList ( const Char_t t = "")

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.

◆ SetRLCommentChar()

void KVINDRARunListReader::SetRLCommentChar ( Char_t  c)
inline

Definition at line 46 of file KVINDRARunListReader.h.

◆ SetRLSeparatorChar()

void KVINDRARunListReader::SetRLSeparatorChar ( Char_t  c)
inline

Definition at line 50 of file KVINDRARunListReader.h.

Member Data Documentation

◆ fComment

Char_t KVINDRARunListReader::fComment
private

character placed at beginning of comment lines

Definition at line 25 of file KVINDRARunListReader.h.

◆ fCurrentLine

Int_t KVINDRARunListReader::fCurrentLine
private

number of line in runlist file we are currently analysing

Definition at line 27 of file KVINDRARunListReader.h.

◆ fLine

TString KVINDRARunListReader::fLine
private

last line read from file

Definition at line 24 of file KVINDRARunListReader.h.

◆ fLineReader

KVRunListLine* KVINDRARunListReader::fLineReader
private

object used to analyse lines in file

Definition at line 23 of file KVINDRARunListReader.h.

◆ fNewRunList

Bool_t KVINDRARunListReader::fNewRunList
private

flag set when reading new ("Version=10") runlist

Definition at line 29 of file KVINDRARunListReader.h.

◆ fRunsFile

TString KVINDRARunListReader::fRunsFile
private

name of file to read

Definition at line 21 of file KVINDRARunListReader.h.

◆ fRunsStream

std::ifstream KVINDRARunListReader::fRunsStream
private

input file stream

Definition at line 22 of file KVINDRARunListReader.h.

◆ fSeparator

Char_t KVINDRARunListReader::fSeparator
private

character used to separate fields on each line of file

Definition at line 26 of file KVINDRARunListReader.h.

◆ fTrigger

Int_t KVINDRARunListReader::fTrigger
private

last multiplicity trigger read from file

Definition at line 28 of file KVINDRARunListReader.h.

◆ fVersion

Int_t KVINDRARunListReader::fVersion
private

version number of new runlist

Definition at line 30 of file KVINDRARunListReader.h.


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