MaCh3  2.2.3
Reference Guide
Manager.h
Go to the documentation of this file.
1 #pragma once
2 
3 // MaCh3 Includes
5 #include "Manager/YamlHelper.h"
6 #include "Manager/Monitor.h"
8 
9 //KS: Joy of forward declaration https://gieseanw.wordpress.com/2018/02/25/the-joys-of-forward-declarations-results-from-the-real-world/
10 class TFile;
11 
16 class manager {
17 public:
20  explicit manager(std::string const &filename);
24  manager(const YAML::Node ConfigNode);
25 
27  virtual ~manager();
28 
31  void SaveSettings(TFile* const OutputFile);
32 
34  void Print();
35 
37  int GetMCStatLLH();
39  inline std::string GetFileName(){return FileName;}
41  inline YAML::Node const &raw(){return config;}
43  inline std::string GetName()const {return "Manager";};
44 
50  template <typename... Args>
51  void OverrideSettings(Args&&... args) {
52  OverrideConfig(config, std::forward<Args>(args)...);
53  }
54 
55 private:
57  void Initialise();
58 
60  YAML::Node config;
62  std::string FileName;
63 };
System and monitoring utilities for printing system information and status updates.
Utility functions for handling YAML nodes.
void OverrideConfig(YAML::Node node, std::string const &key, TValue val)
Overrides the configuration settings based on provided arguments.
Definition: YamlHelper.h:227
The manager class is responsible for managing configurations and settings.
Definition: Manager.h:16
void SaveSettings(TFile *const OutputFile)
Add manager useful information's to TFile, in most cases to Fitter.
Definition: Manager.cpp:49
std::string FileName
The name of the configuration file.
Definition: Manager.h:62
void Print()
Print currently used config.
Definition: Manager.cpp:90
int GetMCStatLLH()
Get likelihood type defined in the config.
Definition: Manager.cpp:98
void OverrideSettings(Args &&... args)
Overrides the configuration settings based on provided arguments.
Definition: Manager.h:51
manager(std::string const &filename)
Constructs a manager object with the specified file name.
Definition: Manager.cpp:9
YAML::Node config
The YAML node containing the configuration data.
Definition: Manager.h:60
YAML::Node const & raw()
Return config.
Definition: Manager.h:41
std::string GetFileName()
Return name of config.
Definition: Manager.h:39
void Initialise()
Common inialiser for both constructors.
Definition: Manager.cpp:27
virtual ~manager()
Destroys the manager object.
Definition: Manager.cpp:41
std::string GetName() const
Get class name.
Definition: Manager.h:43