7 #include "boost/regex.hpp"
32 string name = histPtr->GetName();
35 cerr <<
"TH1Store::add() Error: '" <<
name <<
"' already exists. Aborting." << endl;
39 cout <<
"THStore::add() : Adding " <<
name << endl;
42 histPtr->SetDirectory(
nullptr);
52 cerr <<
"TH1Store::hist() Error: '" <<
name <<
"' does not exists. Aborting." << endl;
59 TFile *filePtr = TFile::Open(
filename.c_str(),
"RECREATE");
61 cerr <<
"TH1Store::write() Error: Can not open '" <<
filename <<
"' for output. Aborting." << endl;
64 write(filePtr, argsVec, inputFilesVec);
81 iter->second->Write();
86 if (!argsVec.empty()) {
87 dir->WriteObject(&argsVec,
"argsVec");
89 if (!inputFilesVec.empty()) {
90 dir->WriteObject(&inputFilesVec,
"inputFiles");
92 cout <<
"TH1Store::write(): Successfully written to '" << filePtr->GetName() <<
"'." << endl;
97 TDirectory *dirPtr = filePtr->GetDirectory(
dirName.c_str());
104 const boost::regex subdirRE(
"(.+?)/([^/]+)");
106 TDirectory *parentDir =
nullptr;
115 dirPtr = parentDir->mkdir(useName.c_str());