|
CbmRoot
|
A reader for the CA parameters from the YAML configuration files. More...
#include <CaConfigReader.h>
Public Member Functions | |
| ConfigReader (int verbose=1) | |
| Constructor. | |
| ~ConfigReader ()=default | |
| Destructor. | |
| void | SetDetectorNames (const std::array< std::string, constants::size::MaxNdetectors > &input) |
| Sets detector names. | |
| void | SetMainConfigPath (const std::string &path) |
| Sets main config file. | |
| void | SetUserConfigPath (const std::string &path) |
| Sets user config file. | |
| void | SetVerbosity (int verbose) |
| Sets verbosity level. | |
| int | GetVerbosity () const |
| Gets verbosity level. | |
| Config | CreateConfig () const |
| Creates a config. | |
| std::vector< Iteration > | ReadCAIterationVector () const |
| Reads CA track finder iterations from YAML node. | |
| std::vector< std::pair< EDetectorID, int > > | ReadInactiveStationMap () const |
| Reads inactive tracking station map. | |
Private Member Functions | |
| YAML::Node | GetNode (std::function< YAML::Node(YAML::Node)> fn, bool optional=false) const |
| Accesses a node either from user config or from main config. | |
| Config::MisalignmentTolArray_t | ReadMisalignmentTolerances () const |
| Reads misalignment tolerances. | |
| Iteration | ReadSingleCAIteration (const YAML::Node &node, const Iteration &defaultIter) const |
| Reads iteration from config file. | |
| std::vector< std::string > | GetNodeKeys (const YAML::Node &node) const |
| Gets parameters content of the node. | |
Private Attributes | |
| std::unordered_map< std::string, EDetectorID > | fDetNameMap |
| std::string | fsMainConfigPath = "" |
| Path to the main config file (mandatory) | |
| std::string | fsUserConfigPath = "" |
| Path to the user config file (optional) | |
| YAML::Node | fMainConfigNode {YAML::NodeType::Undefined} |
| Main configuration node. | |
| YAML::Node | fUserConfigNode {YAML::NodeType::Undefined} |
| User configuration node. | |
| int | fVerbose = 1 |
| Verbosity level. | |
A reader for the CA parameters from the YAML configuration files.
TODO: Describe configuration procedure here... (main config, user config etc...)
Definition at line 37 of file CaConfigReader.h.
|
explicit |
Constructor.
Definition at line 30 of file CaConfigReader.cxx.
|
default |
Destructor.
| Config ConfigReader::CreateConfig | ( | ) | const |
Creates a config.
Definition at line 312 of file CaConfigReader.cxx.
|
private |
Accesses a node either from user config or from main config.
| fn | A function, which returns a YAML::Node reference object |
| optional | true: node is not mandatory |
| std::runtime_error,if | the path does not exist in the config |
This function is to be used, if the desired node should exist either in main or in user config. Firstly, the user config is checked, if it is provided. If the node is not found in user config, the main config is checked. If the node does not exist in the main config as well, an exception will be thrown.
Definition at line 35 of file CaConfigReader.cxx.
|
private |
Gets parameters content of the node.
| node | YAML node |
Definition at line 58 of file CaConfigReader.cxx.
|
inline |
Gets verbosity level.
Definition at line 60 of file CaConfigReader.h.
| std::vector< Iteration > ConfigReader::ReadCAIterationVector | ( | ) | const |
Reads CA track finder iterations from YAML node.
Definition at line 78 of file CaConfigReader.cxx.
| std::vector< std::pair< EDetectorID, int > > ConfigReader::ReadInactiveStationMap | ( | ) | const |
Reads inactive tracking station map.
Definition at line 164 of file CaConfigReader.cxx.
|
private |
Reads misalignment tolerances.
Definition at line 239 of file CaConfigReader.cxx.
|
private |
Reads iteration from config file.
| node | YAML node containing an iteration |
| defaultIter | Default iteration |
Definition at line 273 of file CaConfigReader.cxx.
| void ConfigReader::SetDetectorNames | ( | const std::array< std::string, constants::size::MaxNdetectors > & | input | ) |
Sets detector names.
Definition at line 322 of file CaConfigReader.cxx.
| void ConfigReader::SetMainConfigPath | ( | const std::string & | path | ) |
Sets main config file.
| path | Path to the file |
Definition at line 334 of file CaConfigReader.cxx.
| void ConfigReader::SetUserConfigPath | ( | const std::string & | path | ) |
Sets user config file.
| path | Path to user config file |
Definition at line 352 of file CaConfigReader.cxx.
|
inline |
Sets verbosity level.
Definition at line 57 of file CaConfigReader.h.
|
private |
Definition at line 100 of file CaConfigReader.h.
|
private |
Main configuration node.
Definition at line 105 of file CaConfigReader.h.
|
private |
Path to the main config file (mandatory)
Definition at line 102 of file CaConfigReader.h.
|
private |
Path to the user config file (optional)
Definition at line 103 of file CaConfigReader.h.
|
private |
User configuration node.
Definition at line 106 of file CaConfigReader.h.
|
private |
Verbosity level.
Definition at line 108 of file CaConfigReader.h.