MaCh3 2.2.1
Reference Guide
Loading...
Searching...
No Matches
styleManager.h
Go to the documentation of this file.
1#pragma once
2
3// MaCh3 Includes
7
8#pragma GCC diagnostic push
9#pragma GCC diagnostic ignored "-Wuseless-cast"
10#pragma GCC diagnostic ignored "-Wfloat-conversion"
11#pragma GCC diagnostic ignored "-Wfloat-conversion"
12#pragma GCC diagnostic ignored "-Wold-style-cast"
13#pragma GCC diagnostic ignored "-Wconversion"
14#pragma GCC diagnostic ignored "-Wformat-nonliteral"
15// ROOT Things
16#include "TColor.h"
17#include "TH1.h"
18#include "TStyle.h"
19#pragma GCC diagnostic pop
20
21namespace MaCh3Plotting {
23
26public:
29 StyleManager(std::string configName);
30
31 // NO COPYING!
32 StyleManager( const StyleManager& ) = delete;
33 StyleManager( StyleManager&& ) = default;
34
36 MACH3LOG_DEBUG("##### Deleting StyleManager Instance #####");
37 }
38
44 inline std::string prettifyParamName(const std::string &origName) const {
45 return prettifyName(origName, "parameters");
46 };
47
53 inline std::string prettifySampleName(const std::string &origName) const {
54 return prettifyName(origName, "samples");
55 };
56
57 // style setting options
61 void setPalette(int rootPlotStyle) const;
62
66 void setPalette(std::string configStyleName) const;
67
71 void setTH1Style(TH1 *hist, std::string styleName) const;
72
73private:
74 YAML::Node _styleConfig;
75
76 // helper to basically just read fancy names from config
77 std::string prettifyName(const std::string &origName, const std::string &nameType) const;
78
79};
80
81} // namespace MaCh3Plotting
KS: Based on this https://github.com/gabime/spdlog/blob/a2b4262090fd3f005c2315dcb5be2f0f1774a005/incl...
#define MACH3LOG_DEBUG
Definition: MaCh3Logger.h:22
Utility functions for handling YAML nodes.
EW: provides centralized styling utilities for plots, including name prettification and style applica...
Definition: styleManager.h:25
std::string prettifyParamName(const std::string &origName) const
Convert hideous and vulgar internal parameter name into a beautiful presentable name.
Definition: styleManager.h:44
void setTH1Style(TH1 *hist, std::string styleName) const
Set the style of a TH1 to one of the styles defined in the style config.
std::string prettifyName(const std::string &origName, const std::string &nameType) const
Definition: styleManager.cpp:8
void setPalette(int rootPlotStyle) const
Set the root colour palette to one of the default root pallettes as defined in (root docs)[https://ro...
std::string prettifySampleName(const std::string &origName) const
Convert hideous and vulgar internal sample name into a beautiful presentable name.
Definition: styleManager.h:53
StyleManager(const StyleManager &)=delete
StyleManager(StyleManager &&)=default