CbmRoot
Loading...
Searching...
No Matches
cbm::algo::ca::ConfigReader Class Reference

A reader for the CA parameters from the YAML configuration files. More...

#include <CaConfigReader.h>

Collaboration diagram for cbm::algo::ca::ConfigReader:
[legend]

Public Member Functions

 ConfigReader (InitManager *pInitManager, int verbose=1)
 Constructor.
 
 ~ConfigReader ()=default
 Destructor.
 
void Read ()
 Reads configuration from files.
 
std::vector< IterationReadCAIterationVector ()
 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

InitManagerfpInitManager = 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.
 

Detailed Description

A reader for the CA parameters from the YAML configuration files.

TODO: Describe configuration procedure here... (main config, user config etc...)

Constructor & Destructor Documentation

◆ ConfigReader()

ConfigReader::ConfigReader ( InitManager * pInitManager,
int verbose = 1 )

Constructor.

Parameters
pInitManagerPointer to the L1InitManager instance

Definition at line 32 of file CaConfigReader.cxx.

◆ ~ConfigReader()

cbm::algo::ca::ConfigReader::~ConfigReader ( )
default

Destructor.

Member Function Documentation

◆ GetGeometryLock()

bool cbm::algo::ca::ConfigReader::GetGeometryLock ( ) const
inline

Gets geometry lock status.

Definition at line 67 of file CaConfigReader.h.

References fbGeometryLock.

◆ GetNode()

YAML::Node ConfigReader::GetNode ( std::function< YAML::Node(YAML::Node)> fn) const
private

Accesses a node either from user config or from main config.

Parameters
fnA function, which returns a YAML::Node reference object
Note
If the node is not found in both configs
Exceptions
std::runtime_error,ifthe 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().

◆ GetNodeKeys()

std::vector< std::string > ConfigReader::GetNodeKeys ( const YAML::Node & node) const
private

Gets parameters content of the node.

Parameters
nodeYAML node
Returns
Vector of key names

Definition at line 59 of file CaConfigReader.cxx.

Referenced by ReadSingleCAIteration().

◆ GetVerbosity()

int cbm::algo::ca::ConfigReader::GetVerbosity ( ) const
inline

Gets verbosity level.

Definition at line 64 of file CaConfigReader.h.

References fVerbose.

◆ Read()

◆ ReadCAIterationVector()

std::vector< Iteration > ConfigReader::ReadCAIterationVector ( )

Reads CA track finder iterations from YAML node.

Returns
A vector of iterations

Definition at line 151 of file CaConfigReader.cxx.

References fMainConfigNode, fUserConfigNode, fVerbose, and ReadSingleCAIteration().

Referenced by Read(), and cbm::ca::tools::WindowFinder::ReadTrackingIterationsFromYAML().

◆ ReadInactiveStationMap()

std::vector< std::set< int > > ConfigReader::ReadInactiveStationMap ( )
private

Reads inactive tracking station map.

Returns
A vector of sets of disabled station local indexes vs. the the detector index

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().

◆ ReadMisalignmentTolerance()

void ConfigReader::ReadMisalignmentTolerance ( )
private

◆ ReadSingleCAIteration()

◆ SetGeometryLock()

void cbm::algo::ca::ConfigReader::SetGeometryLock ( bool lock)
inline

Sets geometry lock status.

Definition at line 70 of file CaConfigReader.h.

References fbGeometryLock.

◆ SetMainConfigPath()

void ConfigReader::SetMainConfigPath ( const std::string & path)

Sets main config file.

Parameters
pathPath to the file

Definition at line 448 of file CaConfigReader.cxx.

References fMainConfigNode, fsMainConfigPath, and fVerbose.

Referenced by cbm::ca::tools::WindowFinder::ReadTrackingIterationsFromYAML().

◆ SetUserConfigPath()

void ConfigReader::SetUserConfigPath ( const std::string & path)

Sets user config file.

Parameters
pathPath to user config file

Definition at line 466 of file CaConfigReader.cxx.

References fsUserConfigPath, fUserConfigNode, and fVerbose.

◆ SetVerbosity()

void cbm::algo::ca::ConfigReader::SetVerbosity ( int verbose)
inline

Sets verbosity level.

Definition at line 61 of file CaConfigReader.h.

References fVerbose.

Member Data Documentation

◆ fbGeometryLock

bool cbm::algo::ca::ConfigReader::fbGeometryLock = false
private

Geometry initialization locked.

Definition at line 111 of file CaConfigReader.h.

Referenced by GetGeometryLock(), Read(), and SetGeometryLock().

◆ fbMainConfigInitialized

bool cbm::algo::ca::ConfigReader::fbMainConfigInitialized = false
private

Main configuration file is initialized (e.g. via parameters obj)

Definition at line 110 of file CaConfigReader.h.

◆ fMainConfigNode

YAML::Node cbm::algo::ca::ConfigReader::fMainConfigNode {YAML::NodeType::Undefined}
private

Main configuration node.

Definition at line 107 of file CaConfigReader.h.

Referenced by GetNode(), ReadCAIterationVector(), and SetMainConfigPath().

◆ fpInitManager

InitManager* cbm::algo::ca::ConfigReader::fpInitManager = nullptr
private

Pointer to the L1InitManager instance.

Definition at line 101 of file CaConfigReader.h.

Referenced by Read(), ReadInactiveStationMap(), and ReadMisalignmentTolerance().

◆ fsMainConfigPath

std::string cbm::algo::ca::ConfigReader::fsMainConfigPath = ""
private

Path to the main config file (mandatory)

Definition at line 104 of file CaConfigReader.h.

Referenced by GetNode(), ReadMisalignmentTolerance(), and SetMainConfigPath().

◆ fsUserConfigPath

std::string cbm::algo::ca::ConfigReader::fsUserConfigPath = ""
private

Path to the user config file (optional)

Definition at line 105 of file CaConfigReader.h.

Referenced by GetNode(), ReadMisalignmentTolerance(), and SetUserConfigPath().

◆ fUserConfigNode

YAML::Node cbm::algo::ca::ConfigReader::fUserConfigNode {YAML::NodeType::Undefined}
private

User configuration node.

Definition at line 108 of file CaConfigReader.h.

Referenced by GetNode(), ReadCAIterationVector(), ReadMisalignmentTolerance(), and SetUserConfigPath().

◆ fVerbose

int cbm::algo::ca::ConfigReader::fVerbose = 1
private

Verbosity level.

Definition at line 102 of file CaConfigReader.h.

Referenced by GetVerbosity(), Read(), ReadCAIterationVector(), SetMainConfigPath(), SetUserConfigPath(), and SetVerbosity().


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