15#include "TPaveStats.h"
19CbmQaIO::CbmQaIO(TString prefixName, std::shared_ptr<ObjList_t> pObjList) : fsPrefix(prefixName), fpvObjList(pObjList)
25 fpvObjList = std::make_shared<ObjList_t>();
39 pHist->GetYaxis()->SetLabelOffset(0.95);
44 stats->SetOptStat(111110);
45 stats->SetOptFit(100001);
54 pHist->SetOption(
"colz");
55 pHist->SetStats(
false);
71 pHist->GetYaxis()->SetLabelOffset(0.95);
72 pHist->SetOption(
"colz");
73 pHist->SetStats(
false);
86 constexpr double left = 0.18;
87 constexpr double bottom = 0.15;
88 constexpr double right = 0.10;
89 constexpr double top = 0.10;
90 pCanv->SetMargin(left, right, bottom, top);
101 catch (
const YAML::BadFile& exc) {
102 std::stringstream msg;
103 msg <<
"configuration file for QA \"" << path <<
"\" does not exist";
104 throw std::runtime_error(msg.str());
106 catch (
const YAML::ParserException& exc) {
107 std::stringstream msg;
108 msg <<
"configuration file for QA \"" << path <<
"\" is improperly formatted";
109 throw std::runtime_error(msg.str());
111 LOG(info) <<
fsPrefix <<
": configuration file is set to " << path;
119 for (
auto& [pObject, sPath] : (*
fpvObjList)) {
120 if (!pOutFile->GetDirectory(sPath)) {
121 pOutFile->mkdir(sPath);
140 fpvObjList->push_back(std::make_pair(
nullptr, sDirectory));
Definition of the CbmQaCanvas class.
Module for ROOT objects IO interface (header)
Useful utilities for CBM QA tasks.
virtual void SetTProfile2DProperties(TProfile2D *pHist) const
Applies properties on the profile 2D created with the MakeQaObject function.
virtual void SetCanvasProperties(TCanvas *pCanv) const
Applies properties on the canvas created with the MakeQaObject funciton.
void SetConfigName(const char *path)
Creates a ROOT object.
void WriteToFile(TFile *pOutFile) const
Writes objects into file.
YAML::Node fConfigNode
Configuration node.
void MakeQaDirectory(TString sName)
virtual void SetTH2Properties(TH2 *pHist) const
Applies properties on the histogram created with the MakeQaObject function.
virtual ~CbmQaIO()
Destructor.
TString fsPrefix
Unique prefix for all writeable root.
virtual void SetTH1Properties(TH1 *pHist) const
Applies properties on the histogram created with the MakeQaObject function.
std::shared_ptr< ObjList_t > fpvObjList
List of registered ROOT objects.
CbmQaIO(TString prefixName, std::shared_ptr< ObjList_t > pObjList=nullptr)
Constructor.
TString fsRootFolderName
Name of root folder.
TString fsConfigName
Name of configuration file.
TPaveStats * GetHistStats(TH1 *pHist)
Finds/Creates stats window for a histogram.