KaliVeda
Toolkit for HIC analysis
|
Base class for reading runlists for experiments ,.
Base class for reading runlists for experiments, either 'real' runlists with all info (KVLineCSV) or the minimalist files used for old data and based on the DST runlists kept at CC-IN2P3 (KVLineDST).
For backwards compatibility, this uses KVString whenever possible.
Definition at line 26 of file KVRunListLine.h.
#include <KVRunListLine.h>
Public Member Functions | |
KVRunListLine () | |
virtual | ~KVRunListLine () |
Int_t | BreakLineIntoFields (const char) |
void | Clear () |
Bool_t | FieldContains (const Char_t *, const Char_t *) const |
Returns true if "field" exists, has been filled, and contains "string" as part or all of its value. | |
Bool_t | FieldsSet () const |
virtual const Char_t * | GetField (const Char_t *) const |
TObjString * | GetFieldString (const Char_t *) const |
Float_t | GetFloatField (const Char_t *) |
Int_t | GetIntField (const Char_t *) |
virtual Int_t | GetTrigger (const Char_t *field_name="Trigger", const Char_t *fmt="M>=%d") |
virtual Bool_t | GoodRunLine () |
Returns kTRUE if and only if current line contains integer values for ALL the fields defined by SetRunKeys. | |
Bool_t | HasField (const Char_t *) const |
INLINES_______________________________________________________________________________. | |
Bool_t | HasFieldValue (const Char_t *) const |
virtual Bool_t | IsFieldHeader () |
Returns kTRUE if and only if current line contains ALL of the keywords defined by SetFieldKeys() | |
Bool_t | IsFloat (const Char_t *name) |
virtual void | Print () const |
void | PrintFieldValue (const Char_t *name) const |
template<typename T , typename... Args> | |
void | SetFieldKeys (T key0, Args... keys) |
virtual void | SetFields () |
void | SetLine (const Char_t *) |
void | SetLine (TString &) |
template<typename T , typename... Args> | |
void | SetRunKeys (T key0, Args... keys) |
Private Member Functions | |
Int_t | GetFieldIndex (const Char_t *) const |
void | SetFieldKeys () |
void | SetRunKeys () |
Private Attributes | |
bool | calling_field_keys |
bool | calling_run_keys |
KVList | fFieldKeys |
key words used to recognise field headings | |
TObjArray * | fFields |
array of all fields after break down of fLine | |
Bool_t | fFieldsSet |
flag set once fields have been set | |
KVNameValueList | fIndexList |
list of integer indexes corresponding to field names | |
TString | fLine |
line to analyse | |
Int_t | fMaxNFields |
maximum allowed number of fields i.e. size of TObjArray fFields | |
KVList | fRunKeys |
fields that must be present (have a value) for a line to be considered a "good run line" | |
KVRunListLine::KVRunListLine | ( | ) |
Default ctor Initial size of TObjArray (fMaxNFields) is 5. This will be increased if necessary in BreakLineIntoFields().
Definition at line 20 of file KVRunListLine.cpp.
|
virtual |
Definition at line 37 of file KVRunListLine.cpp.
Int_t KVRunListLine::BreakLineIntoFields | ( | const char | _delim | ) |
Break down "line" into fields separated by the delimiter "_delim". Fields are stored in TObjArray of TObjString s (including empty fields i.e. 2 consecutive delimiters in "line" with nothing between are translated as a field whose content is "". TString::Tokenize() simply skips over such cases, so we can't use it with our field idxing system). Remove leading/trailing white space from each field. Return the total number of fields found (including empty fields).
Definition at line 55 of file KVRunListLine.cpp.
|
inline |
Returns true if "field" exists, has been filled, and contains "string" as part or all of its value.
Definition at line 300 of file KVRunListLine.cpp.
|
inline |
Definition at line 62 of file KVRunListLine.h.
returns a string containing the field in the line corresponding to column title "fname". returns 0 if field not found
Definition at line 177 of file KVRunListLine.cpp.
PROTECTED method. Returns index of field with name 'fname' This index can be used to retrieve the field-value from fFields Returns -1 if : field indices not set yet (no call to SetFields) or if : field is unknown
Definition at line 146 of file KVRunListLine.h.
TObjString * KVRunListLine::GetFieldString | ( | const Char_t * | fname | ) | const |
returns a TObjString containing the field in the line corresponding to column title "fname". Check that field indices are set and field is known otherwise return 0
Definition at line 158 of file KVRunListLine.cpp.
returns the floating-point translation of the field in the line corresponding to column title "fname". We check that the field is a floating point number (IsFloat=kTRUE) If not, 0 is returned.
Definition at line 219 of file KVRunListLine.cpp.
Returns the integer translation of the field in the line corresponding to column title "fname". We check the field is present in current line and that all characters in the field are numbers (KVString::IsDigit). If not, 0 is returned.
Definition at line 196 of file KVRunListLine.cpp.
|
virtual |
Returns value of "Trigger" field, assuming it is written with format "fmt" i.e. if fmt = "M>=%d" (default) we expect "M>=1", "M>=4" etc. The actual field name for the trigger is given as first argument (default value = "Trigger") If trigger field is not present, we return -1 (but no error) If format is not respected, an error message is printed and -1 is returned.
Definition at line 322 of file KVRunListLine.cpp.
|
virtual |
Returns kTRUE if and only if current line contains integer values for ALL the fields defined by SetRunKeys.
Definition at line 377 of file KVRunListLine.cpp.
INLINES_______________________________________________________________________________.
we check that the field in question is set, i.e. does the current definition of possible fields include field "fname" ?
Definition at line 122 of file KVRunListLine.h.
we check that the field in question exists and has been filled in this line if the field index is greater than the actual number of fields in the line, we assume the field was not filled (HasFieldValue=kFALSE) fields which are present but empty or filled with whitespace are not considered to have a field value
Definition at line 132 of file KVRunListLine.h.
|
virtual |
Returns kTRUE if and only if current line contains ALL of the keywords defined by SetFieldKeys()
Definition at line 352 of file KVRunListLine.cpp.
Returns kTRUE if field "name" contains a floating point number Examples are: 64320 6.4320 6.43e20 6.43E20 6.43e-20 6.43E-20
Definition at line 274 of file KVRunListLine.cpp.
|
virtual |
Print information on this reader object. If fields have been set, we show which fields have been found. Break down of current line is shown.
Definition at line 242 of file KVRunListLine.cpp.
for a given field "name", print out current value of field as: Field name : current value if the field is absent from current line (HasFieldValue=kFALSE) we print Field name : [absent]
Definition at line 184 of file KVRunListLine.h.
|
inlineprivate |
Definition at line 40 of file KVRunListLine.h.
|
inline |
Set keywords used to identify lines in the file which define the column headings, i.e. the field names. Give the list of keywords (at least one).
Each and every keyword given as argument here (at least one word must be given) must appear in a line for it to be considered a column heading. Lines identified as such (by IsFieldHeader()) are used to set indices for each column (SetFields()).
at beginning of call, clear out list of keywords
Definition at line 82 of file KVRunListLine.h.
|
virtual |
set field idxes based on field header line in file identified by IsFieldHeader(). this method is called automatically by BreakLineIntoFields(). we check that at least one index has been defined at the end previous definitions are forgotten clear index list
Definition at line 117 of file KVRunListLine.cpp.
|
inlineprivate |
Definition at line 44 of file KVRunListLine.h.
|
inline |
Set list of fields which must have values for a line to be considered a "good" run line Give the list of field names (at least one).
at beginning of call, clear out list of keywords
Definition at line 99 of file KVRunListLine.h.
|
private |
Definition at line 38 of file KVRunListLine.h.
|
private |
Definition at line 39 of file KVRunListLine.h.
|
private |
key words used to recognise field headings
Definition at line 33 of file KVRunListLine.h.
|
private |
array of all fields after break down of fLine
Definition at line 32 of file KVRunListLine.h.
|
private |
flag set once fields have been set
Definition at line 31 of file KVRunListLine.h.
|
private |
list of integer indexes corresponding to field names
Definition at line 50 of file KVRunListLine.h.
|
private |
line to analyse
Definition at line 30 of file KVRunListLine.h.
|
private |
maximum allowed number of fields i.e. size of TObjArray fFields
Definition at line 29 of file KVRunListLine.h.
|
private |
fields that must be present (have a value) for a line to be considered a "good run line"
Definition at line 34 of file KVRunListLine.h.