mana root plugin: change logging to log.c

This commit is contained in:
Florian Lüke 2024-12-26 19:21:25 +01:00
parent ebd823ae4e
commit bfce5e76ab

View file

@ -22,7 +22,7 @@ struct Context
MANA_DEFINE_PLUGIN_INIT(init) MANA_DEFINE_PLUGIN_INIT(init)
{ {
log_set_level(LOG_DEBUG); log_set_level(LOG_INFO);
static Context g_ctx; static Context g_ctx;
log_debug("init: ctx=%p", &g_ctx); log_debug("init: ctx=%p", &g_ctx);
return &g_ctx; return &g_ctx;
@ -113,7 +113,6 @@ inline std::vector<std::vector<TH1 *>> make_raw_histos(TDirectory *baseDir,
auto bins = 1u << std::min(bits, 16u); auto bins = 1u << std::min(bits, 16u);
auto maxValue = std::pow(2.0, bits); auto maxValue = std::pow(2.0, bits);
ObjectPath path(jOutput["name"].get<std::string>()); ObjectPath path(jOutput["name"].get<std::string>());
spdlog::info("path={}, bins={}, maxValue={}", path.path, bins, maxValue);
baseDir->cd(); baseDir->cd();
root_mkpath_cd(path.components.begin(), path.components.end()); root_mkpath_cd(path.components.begin(), path.components.end());
@ -158,8 +157,8 @@ MANA_DEFINE_PLUGIN_BEGIN_RUN(begin_run)
ctx->outputFile = std::make_unique<TFile>("output.root", "RECREATE"); ctx->outputFile = std::make_unique<TFile>("output.root", "RECREATE");
ctx->hitCounts = make_hitcount_histos(ctx->outputFile.get(), jRun); ctx->hitCounts = make_hitcount_histos(ctx->outputFile.get(), jRun);
ctx->rawHistograms = make_raw_histos(ctx->outputFile.get(), jRun); ctx->rawHistograms = make_raw_histos(ctx->outputFile.get(), jRun);
spdlog::info("hitCount histograms: {}", histo_info(ctx->hitCounts)); log_info("hitCount histograms: %s", histo_info(ctx->hitCounts).c_str());
spdlog::info("raw histograms: {}", histo_info(ctx->rawHistograms)); log_info("raw histograms: %s", histo_info(ctx->rawHistograms).c_str());
} }
MANA_DEFINE_PLUGIN_END_RUN(end_run) MANA_DEFINE_PLUGIN_END_RUN(end_run)