102 const char* name = prof.
GetName().c_str();
103 const char* titl = prof.
GetTitle().c_str();
112 bool add = TH1::AddDirectoryStatus();
113 TH1::AddDirectory(
false);
115 TH1::AddDirectory(add);
116 pRes->SetFromQaHistogram<
Prof2D>(prof);
125 auto archive = std::make_unique<cbm::algo::qa::DataInputArchive>(inFilename);
126 LOG(info) <<
"ConvertOutput: reading from input archive " << inFilename;
127 auto desc = archive->descriptor();
128 LOG(info) <<
" - Time created: " << desc.time_created();
129 LOG(info) <<
" - Host name : " << desc.hostname();
130 LOG(info) <<
" - User name : " << desc.username();
132 auto data = archive->get();
134 LOG(error) <<
"ConvertOutput: failed to read qa::Data from archive";
138 if (outFilename.empty()) {
139 auto inPath = boost::filesystem::path(inFilename);
140 outFilename = (inPath.parent_path() / (inPath.stem().string() +
".root")).string();
142 LOG(info) <<
"ConvertOutput: storing converted histograms in " << outFilename;
144 TFile fileOut(outFilename.c_str(),
"RECREATE");
147 auto ProcessHistograms = [&fileOut](
const auto& container) {
148 for (
const auto& histogram : container) {
149 std::string dirName =
"";
150 std::string histName = histogram.GetName();
151 LOG(info) <<
" - processing histogram " << histName;
154 auto slashPos = histogram.GetName().rfind(
'/');
155 if (slashPos != std::string::npos) {
156 dirName = histName.substr(0, slashPos);
157 histName = histName.substr(slashPos + 1, std::string::npos);
160 auto* pDir = fileOut.GetDirectory(dirName.c_str());
162 pDir = fileOut.mkdir(dirName.c_str());
166 pRootHist->SetName(histName.c_str());
167 pRootHist->SetDirectory(pDir);
171 ProcessHistograms(data->H1());
172 ProcessHistograms(data->H2());
173 ProcessHistograms(data->P1());
174 ProcessHistograms(data->P2());