Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Acclaim::AnalysisSettings Class Reference

Public Member Functions

 AnalysisSettings (const char *fName=NULL)
 
void apply (TObject *obj) const
 
void write (TFile *f) const
 
void print () const
 
Bool_t getSetting (const char *settingName, Bool_t &settingVal) const
 
Bool_t getSetting (const char *settingName, Int_t &settingVal) const
 
Bool_t getSetting (const char *settingName, Double_t &settingVal) const
 

Protected Member Functions

Bool_t stringIsKeyValuePair (const TString &commentStrippedLine, TString &key, TString &value) const
 
Bool_t stringIsSection (const TString &commentStrippedLine, TString &secName) const
 
Bool_t stringIsAlphaNumeric (const TString &commentStrippedLine) const
 
void handleKeyValue (VariableMap_t *variableMap, const TString &key, const TString &value)
 
VariableMap_t * handleSection (const TString &section)
 
Bool_t getSetting (const char *settingName, TString &settingVal) const
 
void parseSettingsFile ()
 
Bool_t tryFile (const char *fName)
 
void findFile ()
 

Protected Attributes

TString fileName
 
TString parsedFileCopy
 
SectionMap_t sectionMap
 

Detailed Description

Definition at line 71 of file AnalysisSettings.h.

Collaboration diagram for Acclaim::AnalysisSettings:
Collaboration graph
[legend]

Member Function Documentation

Bool_t Acclaim::AnalysisSettings::getSetting ( const char *  settingName,
Bool_t &  settingVal 
) const

Read a setting from the conf file, and put the result into a boolian The input is not modified if no matching setting is found.

Parameters
settingNameis the class and variable name to find
settingValis the boolian value to update
Returns
true if a match was found, otherwise false

Definition at line 441 of file AnalysisSettings.cxx.

Bool_t Acclaim::AnalysisSettings::getSetting ( const char *  settingName,
Int_t &  settingVal 
) const

Read a setting from the conf file, and put the result into a integer The input is not modified if no matching setting is found.

Parameters
settingNameis the class and variable name to find
settingValis the integer value to update
Returns
true if a match was found, otherwise false

Definition at line 460 of file AnalysisSettings.cxx.

Bool_t Acclaim::AnalysisSettings::getSetting ( const char *  settingName,
Double_t &  settingVal 
) const

Read a setting from the conf file, and put the result into a double The input is not modified if no matching setting is found.

Parameters
settingNameis the class and variable name to find
settingValis the double value to update
Returns
true if a match was found, otherwise false

Definition at line 478 of file AnalysisSettings.cxx.

Bool_t Acclaim::AnalysisSettings::getSetting ( const char *  settingName,
TString &  settingVal 
) const
protected

Workhorse function to parse the config file contents instead of using ROOT reflection. This function is called by the public wrappers with specified types. Instead of using ROOT's reflection, we try and match the strings ourselves. Since I am doing this by hand, I've allowed multiple formats to work:

Acclaim::class::member Acclaim::class->member Acclaim::class.member

Should give some informative errors in cases of malformed input.

Parameters
settingNameis the name of the variable
settingValthe value in the config file as a string
Returns
true on finding a match, otherwise false.

Definition at line 372 of file AnalysisSettings.cxx.


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