MaCh3  2.4.2
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) const;
32 
34  void Print() const;
35 
37  int GetMCStatLLH() const;
39  inline std::string GetFileName() const {return FileName;}
41  inline YAML::Node const &raw() const {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 };
Defines the custom exception class used throughout MaCh3.
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:249
The manager class is responsible for managing configurations and settings.
Definition: Manager.h:16
void Initialise()
Common inialiser for both constructors.
Definition: Manager.cpp:27
int GetMCStatLLH() const
Get likelihood type defined in the config.
Definition: Manager.cpp:98
virtual ~Manager()
Destroys the manager object.
Definition: Manager.cpp:41
YAML::Node config
The YAML node containing the configuration data.
Definition: Manager.h:60
YAML::Node const & raw() const
Return config.
Definition: Manager.h:41
Manager(std::string const &filename)
Constructs a manager object with the specified file name.
Definition: Manager.cpp:9
void SaveSettings(TFile *const OutputFile) const
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
std::string GetName() const
Get class name.
Definition: Manager.h:43
std::string GetFileName() const
Return name of config.
Definition: Manager.h:39
void OverrideSettings(Args &&... args)
Overrides the configuration settings based on provided arguments.
Definition: Manager.h:51
void Print() const
Print currently used config.
Definition: Manager.cpp:90