CbmRoot
|
A reader for the CA parameters from the YAML configuration files. More...
#include <CaConfigReader.h>
Public Member Functions | |
ConfigReader (InitManager *pInitManager, int verbose=1) | |
Constructor. | |
~ConfigReader ()=default | |
Destructor. | |
void | Read () |
Reads configuration from files. | |
std::vector< Iteration > | ReadCAIterationVector () |
Reads CA track finder iterations from YAML node. | |
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. | |
bool | GetGeometryLock () const |
Gets geometry lock status. | |
void | SetGeometryLock (bool lock) |
Sets geometry lock status. | |
Private Member Functions | |
std::vector< std::set< int > > | ReadInactiveStationMap () |
Reads inactive tracking station map. | |
void | ReadMisalignmentTolerance () |
Reads the misalignment tolerance. | |
YAML::Node | GetNode (std::function< YAML::Node(YAML::Node)> fn) const |
Accesses a node either from user config or from main config. | |
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 | |
InitManager * | fpInitManager = nullptr |
Pointer to the L1InitManager instance. | |
int | fVerbose = 1 |
Verbosity level. | |
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. | |
bool | fbMainConfigInitialized = false |
Main configuration file is initialized (e.g. via parameters obj) | |
bool | fbGeometryLock = false |
Geometry initialization locked. | |
A reader for the CA parameters from the YAML configuration files.
TODO: Describe configuration procedure here... (main config, user config etc...)
ConfigReader::ConfigReader | ( | InitManager * | pInitManager, |
int | verbose = 1 ) |
Constructor.
pInitManager | Pointer to the L1InitManager instance |
Definition at line 32 of file CaConfigReader.cxx.
|
default |
Destructor.
|
inline |
Gets geometry lock status.
Definition at line 67 of file CaConfigReader.h.
References fbGeometryLock.
|
private |
Accesses a node either from user config or from main config.
fn | A function, which returns a YAML::Node reference object |
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 36 of file CaConfigReader.cxx.
References fMainConfigNode, fsMainConfigPath, fsUserConfigPath, and fUserConfigNode.
Referenced by Read(), ReadInactiveStationMap(), and ReadMisalignmentTolerance().
|
private |
Gets parameters content of the node.
node | YAML node |
Definition at line 59 of file CaConfigReader.cxx.
Referenced by ReadSingleCAIteration().
|
inline |
void ConfigReader::Read | ( | ) |
Reads configuration from files.
Definition at line 79 of file CaConfigReader.cxx.
References cbm::algo::ca::InitManager::ClearCAIterations(), cbm::algo::ca::InitManager::DevSetIgnoreHitSearchAreas(), cbm::algo::ca::InitManager::DevSetIsExtendTracksViaMc(), cbm::algo::ca::InitManager::DevSetIsMatchDoubletsViaMc(), cbm::algo::ca::InitManager::DevSetIsMatchTripletsViaMc(), cbm::algo::ca::InitManager::DevSetIsSuppressOverlapHitsViaMc(), cbm::algo::ca::InitManager::DevSetUseOfOriginalField(), fbGeometryLock, fpInitManager, fVerbose, GetNode(), cbm::algo::ca::InitManager::GetStationInfo(), cbm::algo::ca::InitManager::InitStationLayout(), ReadCAIterationVector(), ReadInactiveStationMap(), ReadMisalignmentTolerance(), cbm::algo::ca::InitManager::SetCAIterationsNumberCrosscheck(), cbm::algo::ca::InitManager::SetGhostSuppression(), cbm::algo::ca::InitManager::SetMaxDoubletsPerSinglet(), cbm::algo::ca::InitManager::SetMaxTripletPerDoublets(), and cbm::algo::ca::InitManager::SetRandomSeed().
std::vector< Iteration > ConfigReader::ReadCAIterationVector | ( | ) |
Reads CA track finder iterations from YAML node.
Definition at line 151 of file CaConfigReader.cxx.
References fMainConfigNode, fUserConfigNode, fVerbose, and ReadSingleCAIteration().
Referenced by Read(), and cbm::ca::tools::WindowFinder::ReadTrackingIterationsFromYAML().
|
private |
Reads inactive tracking station map.
Definition at line 249 of file CaConfigReader.cxx.
References fpInitManager, cbm::algo::ca::InitManager::GetDetectorName(), GetNode(), cbm::algo::ca::InitManager::GetNstationsGeometry(), and cbm::algo::ca::constants::size::MaxNdetectors.
Referenced by Read().
|
private |
Reads the misalignment tolerance.
Definition at line 346 of file CaConfigReader.cxx.
References fpInitManager, fsMainConfigPath, fsUserConfigPath, fUserConfigNode, cbm::algo::ca::InitManager::GetDetectorName(), GetNode(), cbm::algo::ca::constants::size::MaxNdetectors, cbm::algo::ca::InitManager::SetMisalignmentTolerance(), and v.
Referenced by Read().
|
private |
Reads iteration from config file.
node | YAML node containing an iteration |
defaultIter | Default iteration |
Definition at line 409 of file CaConfigReader.cxx.
References cbm::algo::ca::Iteration::GetDoubletChi2Cut(), cbm::algo::ca::Iteration::GetElectronFlag(), cbm::algo::ca::Iteration::GetExtendTracksFlag(), cbm::algo::ca::Iteration::GetFirstStationIndex(), cbm::algo::ca::Iteration::GetMaxDZ(), cbm::algo::ca::Iteration::GetMaxQp(), cbm::algo::ca::Iteration::GetMaxSlope(), cbm::algo::ca::Iteration::GetMaxSlopePV(), cbm::algo::ca::Iteration::GetMaxStationGap(), cbm::algo::ca::Iteration::GetMinNhits(), cbm::algo::ca::Iteration::GetMinNhitsStation0(), GetNodeKeys(), cbm::algo::ca::Iteration::GetPickGather(), cbm::algo::ca::Iteration::GetPrimaryFlag(), cbm::algo::ca::Iteration::GetTargetPosSigmaX(), cbm::algo::ca::Iteration::GetTargetPosSigmaY(), cbm::algo::ca::Iteration::GetTrackChi2Cut(), cbm::algo::ca::Iteration::GetTrackFromTripletsFlag(), cbm::algo::ca::Iteration::GetTripletChi2Cut(), cbm::algo::ca::Iteration::GetTripletFinalChi2Cut(), and cbm::algo::ca::Iteration::GetTripletLinkChi2().
Referenced by ReadCAIterationVector().
|
inline |
Sets geometry lock status.
Definition at line 70 of file CaConfigReader.h.
References fbGeometryLock.
void ConfigReader::SetMainConfigPath | ( | const std::string & | path | ) |
Sets main config file.
path | Path to the file |
Definition at line 448 of file CaConfigReader.cxx.
References fMainConfigNode, fsMainConfigPath, and fVerbose.
Referenced by cbm::ca::tools::WindowFinder::ReadTrackingIterationsFromYAML().
void ConfigReader::SetUserConfigPath | ( | const std::string & | path | ) |
Sets user config file.
path | Path to user config file |
Definition at line 466 of file CaConfigReader.cxx.
References fsUserConfigPath, fUserConfigNode, and fVerbose.
|
inline |
|
private |
Geometry initialization locked.
Definition at line 111 of file CaConfigReader.h.
Referenced by GetGeometryLock(), Read(), and SetGeometryLock().
|
private |
Main configuration file is initialized (e.g. via parameters obj)
Definition at line 110 of file CaConfigReader.h.
|
private |
Main configuration node.
Definition at line 107 of file CaConfigReader.h.
Referenced by GetNode(), ReadCAIterationVector(), and SetMainConfigPath().
|
private |
Pointer to the L1InitManager instance.
Definition at line 101 of file CaConfigReader.h.
Referenced by Read(), ReadInactiveStationMap(), and ReadMisalignmentTolerance().
|
private |
Path to the main config file (mandatory)
Definition at line 104 of file CaConfigReader.h.
Referenced by GetNode(), ReadMisalignmentTolerance(), and SetMainConfigPath().
|
private |
Path to the user config file (optional)
Definition at line 105 of file CaConfigReader.h.
Referenced by GetNode(), ReadMisalignmentTolerance(), and SetUserConfigPath().
|
private |
User configuration node.
Definition at line 108 of file CaConfigReader.h.
Referenced by GetNode(), ReadCAIterationVector(), ReadMisalignmentTolerance(), and SetUserConfigPath().
|
private |
Verbosity level.
Definition at line 102 of file CaConfigReader.h.
Referenced by GetVerbosity(), Read(), ReadCAIterationVector(), SetMainConfigPath(), SetUserConfigPath(), and SetVerbosity().