StRoot
1
|
Public Member Functions | |
std::string | dump () const |
dump config to a basic string representation - mostly for debugging More... | |
bool | exists (std::string path) const |
returns whether or not a path exist Either node or attribute - used to determine if default value is used More... | |
template<typename T > | |
T | convert (std::string s) const |
Generic conversion of type T from string override this for special conversions. More... | |
template<typename T > | |
std::string | convertTo (T v) const |
Generic conversion of type T to a string. More... | |
template<typename T > | |
T | get (std::string path, T dv) const |
template function for getting any type that can be converted from string via stringstream More... | |
template<typename T > | |
void | set (std::string path, T v) |
Writes a value of type T to the map Uses convertTo<T> to convert type T to a string rep. More... | |
template<typename T > | |
std::vector< T > | getVector (std::string path, std::vector< T > dv) const |
Get a Vector object from config. More... | |
std::vector< std::string > | childrenOf (std::string path) const |
list the paths of children nodes for a given node More... | |
FwdTrackerConfig () | |
Constructor is noop, use load(...) | |
FwdTrackerConfig (std::string filename) | |
Construct a new Fwd Tracker Config object and load a file. More... | |
void | load (std::string filename, bool asString=false) |
Main setup routine Loads the given XML file (or string) and maps it. More... | |
template<> | |
void | set (std::string path, std::string v) |
write a value to path More... | |
template<> | |
void | set (std::string path, bool bv) |
write a value to path More... | |
template<> | |
std::string | get (std::string path, std::string dv) const |
Get a value from the path. More... | |
template<> | |
std::string | convert (std::string str) const |
conversion to string is a noop More... | |
template<> | |
bool | convert (std::string str) const |
specialization for bool adds recognition of strings "true" and "false" (lower case) More... | |
template<> | |
TString | convert (std::string str) const |
get as ROOT TString More... | |
Static Public Member Functions | |
static void | canonize (std::string &path) |
Returns a path in its cannonical form. More... | |
Protected Member Functions | |
size_t | pathCount (const std::string path) |
get lowest non-existing path index assumes bare path and adds [i] until DNE starts at 1 since 0 is checked on existance More... | |
void | mapFile (TXMLEngine &xml, XMLNodePointer_t node, Int_t level, std::string path="") |
Reads an xml document and writes it into map. More... | |
Protected Attributes | |
bool | mErrorParsing = false |
std::map< std::string, std::string > | mNodes |
Definition at line 17 of file FwdTrackerConfig.h.
|
inline |
Construct a new Fwd Tracker Config object and load a file.
filename |
Definition at line 295 of file FwdTrackerConfig.h.
References load().
|
inlinestatic |
Returns a path in its cannonical form.
path | Path to cannoize, returned in place by reference |
Definition at line 103 of file FwdTrackerConfig.h.
Referenced by childrenOf(), exists(), get(), getVector(), and set().
|
inline |
list the paths of children nodes for a given node
path | path to search for children |
Definition at line 257 of file FwdTrackerConfig.h.
References canonize().
Referenced by StFwdTrackMaker::Init().
std::string FwdTrackerConfig::convert | ( | std::string | str | ) | const |
conversion to string is a noop
string | specialization |
str | input |
Definition at line 72 of file FwdTrackerConfig.cxx.
bool FwdTrackerConfig::convert | ( | std::string | str | ) | const |
specialization for bool adds recognition of strings "true" and "false" (lower case)
bool | specialization, fallback to int check |
str | input string |
Definition at line 85 of file FwdTrackerConfig.cxx.
TString FwdTrackerConfig::convert | ( | std::string | str | ) | const |
get as ROOT TString
TString | specialization |
str | input value |
Definition at line 104 of file FwdTrackerConfig.cxx.
|
inline |
Generic conversion of type T from string override this for special conversions.
T | : Type to convert to and return |
s | : input string to use for conversion |
Definition at line 156 of file FwdTrackerConfig.h.
|
inline |
Generic conversion of type T to a string.
T | : type to convert |
v | : value of type T |
Definition at line 173 of file FwdTrackerConfig.h.
|
inline |
dump config to a basic string representation - mostly for debugging
Definition at line 122 of file FwdTrackerConfig.h.
|
inline |
returns whether or not a path exist Either node or attribute - used to determine if default value is used
path | - the path to check |
Definition at line 140 of file FwdTrackerConfig.h.
References canonize().
Referenced by get(), and getVector().
std::string FwdTrackerConfig::get | ( | std::string | path, |
std::string | dv | ||
) | const |
Get a value from the path.
Specialization | for string to avoid extra conversions |
path | path to lookup |
dv | default value if path DNE |
Definition at line 55 of file FwdTrackerConfig.cxx.
References canonize(), and exists().
|
inline |
template function for getting any type that can be converted from string via stringstream
T | type to return |
path | path to lookup |
dv | default value to return if the node DNE |
Definition at line 190 of file FwdTrackerConfig.h.
References canonize(), and exists().
Referenced by StFwdTrackMaker::Finish(), StFwdTrackMaker::Init(), and StFwdTrackMaker::Make().
|
inline |
Get a Vector object from config.
T | type of value for the vector object |
path | path to lookup |
dv | default value, can use initializer list |
Definition at line 224 of file FwdTrackerConfig.h.
References canonize(), and exists().
|
inline |
Main setup routine Loads the given XML file (or string) and maps it.
filename | filename (or xml string) to load. If file the content is loaded as an xml doc |
asString | false: filename is loaded and contents treated as xml doc, true: treat the string filename directly as an xml doc |
Definition at line 305 of file FwdTrackerConfig.h.
References mapFile().
Referenced by FwdTrackerConfig().
|
inlineprotected |
Reads an xml document and writes it into map.
xml | xml document to map |
node | starting node - allows recursive mapping |
level | the integer index of the level of current parsing |
path | the path for the current node |
Definition at line 54 of file FwdTrackerConfig.h.
References pathCount().
Referenced by load().
|
inlineprotected |
get lowest non-existing path index assumes bare path and adds [i] until DNE starts at 1 since 0 is checked on existance
path | base path to check |
Definition at line 36 of file FwdTrackerConfig.h.
Referenced by mapFile().
void FwdTrackerConfig::set | ( | std::string | path, |
std::string | v | ||
) |
write a value to path
template | specialization for std::string |
path | path to write, if it DNE it is created |
v | value (of type string) to write |
Definition at line 20 of file FwdTrackerConfig.cxx.
References canonize().
void FwdTrackerConfig::set | ( | std::string | path, |
bool | bv | ||
) |
write a value to path
template | specialization for bool |
path | path to write, if it DNE it is created |
bv | boolean to write |
Definition at line 35 of file FwdTrackerConfig.cxx.
References canonize().
|
inline |
Writes a value of type T to the map Uses convertTo<T> to convert type T to a string rep.
T | type of value to write |
path | path to write to |
v | value of type T |
Definition at line 209 of file FwdTrackerConfig.h.
References canonize().
Referenced by StFwdTrackMaker::setConstB(), StFwdTrackMaker::setFitDebugLvl(), StFwdTrackMaker::setFitMaxIterations(), StFwdTrackMaker::setFitMinIterations(), StFwdTrackMaker::setFittingMaterialEffects(), StFwdTrackMaker::setFstRasterPhi(), StFwdTrackMaker::setFstRasterR(), StFwdTrackMaker::setFttHitSource(), StFwdTrackMaker::setIncludePrimaryVertexInFit(), StFwdTrackMaker::setMaxFailedHitsInFit(), StFwdTrackMaker::setOutputFilename(), StFwdTrackMaker::setPrimaryVertexSigmaXY(), StFwdTrackMaker::setPrimaryVertexSigmaZ(), StFwdTrackMaker::setSeedFindingConnectorDistance(), StFwdTrackMaker::setSeedFindingMinHitsOnTrack(), StFwdTrackMaker::setSeedFindingNumInterations(), StFwdTrackMaker::setSeedFindingNumPhiSlices(), StFwdTrackMaker::setSeedFindingUseHitRemover(), StFwdTrackMaker::setSeedFindingUseSubsetNN(), StFwdTrackMaker::setSeedFindingWithFst(), StFwdTrackMaker::setSeedFindingWithFtt(), StFwdTrackMaker::setSmearMcPrimaryVertex(), StFwdTrackMaker::setTrackFittingOff(), StFwdTrackMaker::setTrackRefit(), StFwdTrackMaker::setUseFstRasteredGeantHits(), StFwdTrackMaker::setUseMcSeedForFit(), StFwdTrackMaker::setUseTruthSeedFinding(), and StFwdTrackMaker::setZeroB().