10 YAML::Node prettyNames =
_styleConfig[
"PrettyNames"][nameType];
11 auto prettyName = GetFromManager<std::string>(prettyNames[origName], origName, __FILE__, __LINE__);
18 gStyle->SetPalette(rootPlotStyle);
28 styleDef = palettes[configStyleName];
31 auto paletteDef = GetFromManager<std::vector<std::vector<double>>>(
33 std::vector<std::vector<double>>{
35 {0.0 , 0.33 , 0.66 , 1.0},
36 {0.0 , 0.0 , 0.0 , 0.0},
37 {0.0 , 0.0 , 1.0 , 0.0},
38 {0.0 , 1.0 , 0.0 , 0.0}
39 }, __FILE__, __LINE__);
40 const Int_t NCont = Int_t(paletteDef[0][0]);
42 std::vector<double> stopVec = paletteDef[1];
43 std::vector<double> redsVec = paletteDef[2];
44 std::vector<double> greensVec = paletteDef[3];
45 std::vector<double> bluesVec = paletteDef[4];
48 const size_t NRGBs = stopVec.size();
49 if (redsVec.size() != NRGBs || greensVec.size() != NRGBs ||
50 bluesVec.size() != NRGBs)
52 MACH3LOG_ERROR(
"invalid colour palette defined in style config file: {}");
53 MACH3LOG_ERROR(
"RGB arrays don't all have the same size, please fix that");
57 TColor::CreateGradientColorTable(
int(NRGBs), stopVec.data(), redsVec.data(), greensVec.data(), bluesVec.data(), NCont);
58 gStyle->SetNumberContours(NCont);
66 styleDef = TH1Styles[styleName];
69 hist->SetMarkerColor(GetFromManager<Color_t>(styleDef[
"MarkerColor"], kRed, __FILE__, __LINE__));
70 hist->SetMarkerStyle(GetFromManager<Color_t>(styleDef[
"MarkerStyle"], 7, __FILE__, __LINE__));
71 hist->SetFillColor(GetFromManager<Color_t>(styleDef[
"FillColor"], kRed, __FILE__, __LINE__));
72 hist->SetFillStyle(GetFromManager<Color_t>(styleDef[
"FillStyle"], 3003, __FILE__, __LINE__));
73 hist->SetLineColor(GetFromManager<Color_t>(styleDef[
"LineColor"], kRed, __FILE__, __LINE__));
74 hist->SetLineStyle(GetFromManager<Color_t>(styleDef[
"LineStyle"], 1, __FILE__, __LINE__));
78 constexpr
const double DefaultScalingFactor = 10;
79 if(!
_styleConfig[
"BinWidthScaleFactor"])
return DefaultScalingFactor;
81 return GetFromManager<double>(
_styleConfig[
"BinWidthScaleFactor"][Name], DefaultScalingFactor, __FILE__, __LINE__);
#define M3OpenConfig(filename)
Macro to simplify calling LoadYaml with file and line info.
double getBinWidthScale(const std::string &Name) const
Get bin-width scaling factor for a given kinematic variable.
StyleManager(const std::string &configName)
Constructor.
void setTH1Style(TH1 *hist, const 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
void setPalette(const int rootPlotStyle) const
Set the root colour palette to one of the default root pallettes as defined in (root docs)[https://ro...
Main namespace for MaCh3 software.