1 #include <boost/filesystem.hpp>
8 #include "travex/config.h"
17 TFile(prgOpts.GetOutFileName().c_str(), option, ftitle, compress),
21 Info(
"RootFile",
"Created ROOT file: %s", GetName());
23 std::string macroPath = std::string(gROOT->GetMacroPath()) +
":" + gTravexMacrosPath;
24 gROOT->SetMacroPath(macroPath.c_str());
25 gROOT->Macro(
"style_hists.C");
35 for (
const std::pair<std::string, HistContainer*>& subDir :
fDirs)
37 std::string dirName = subDir.first;
41 Error(
"FillDerivedHists",
"No container/directory found for key %s. Skipping...", dirName.c_str());
63 gROOT->Macro(
"style_hists.C");
65 namespace fs = boost::filesystem;
67 if (fs::create_directories(prefix))
68 Info(
"SaveAllAs",
"Created directory: %s", prefix.c_str());
70 Warning(
"SaveAllAs",
"Perhaps directory already exists: %s", prefix.c_str());
72 for (
const std::pair<std::string, HistContainer*>& subDir :
fDirs)
74 std::string dirName = subDir.first;
78 Error(
"SaveAllAs",
"No container/directory found for key %s. Skipping...", dirName.c_str());
82 std::string path = prefix +
"/" + dirName;
84 if (gSystem->mkdir(path.c_str()) < 0)
85 Warning(
"SaveAllAs",
"Perhaps directory already exists: %s", path.c_str());
87 Info(
"SaveAllAs",
"Created directory: %s", path.c_str());
virtual void FillDerivedHists()
A user implementation of this method can be called when additional histograms need to be built from t...
RootFile(ProgramOptions &prgOpts, Option_t *option="", const char *ftitle="", Int_t compress=1)
bool SaveGraphics() const
Processes and controls user options provided in the command line.
std::string GetOutPrefix() const
A light container to hold and manipulate user histograms.
void SaveAllAs(std::string prefix="./")
HistContainers fDirs
A string-to-HistContainer map for convenient access to enclosed directories.
void FillDerivedHists()
For each histogram container calls the method of the same name in order to produce new histograms fro...
ProgramOptions & fPrgOptions
Command line arguments and options requested by the user.
void SaveAllAs(std::string prefix="./", std::string img_format="png")
Saves all histograms from the container as png images in the prefix directory.
virtual void Close(Option_t *option="")