From e1e0cad5396b6ab38d6f1bef7d0639bfb716ec26 Mon Sep 17 00:00:00 2001 From: "se.gorbunov" <se.gorbunov@gsi.de> Date: Mon, 14 Nov 2022 15:05:40 +0000 Subject: [PATCH] L1: store performance tables in a separate file --- reco/L1/CbmL1.cxx | 27 +++++++++++++++++++-------- reco/L1/CbmL1.h | 1 + reco/L1/CbmL1Performance.cxx | 4 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index a9eee4d8ef..96179436bb 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -191,6 +191,7 @@ InitStatus CbmL1::Init() fHistoDir->mkdir("Input"); fHistoDir->mkdir("Fit"); + fTableDir = gROOT->mkdir("L1Tables"); // turn on reconstruction in sub-detectors @@ -1208,14 +1209,24 @@ void CbmL1::Finish() boost::filesystem::path p = (FairRunAna::Instance()->GetUserOutputFileName()).Data(); std::string dir = p.parent_path().string(); if (dir.empty()) dir = "."; - std::string histoOutName = dir + "/L1_histo_" + p.filename().string(); - LOG(info) << "\033[31;1mHistograms will be saved to: \033[0m" << histoOutName; - - TFile* outfile = new TFile(histoOutName.c_str(), "RECREATE"); - outfile->cd(); - writedir2current(fHistoDir); - outfile->Close(); - outfile->Delete(); + { + std::string histoOutName = dir + "/L1_histo_" + p.filename().string(); + LOG(info) << "\033[31;1mL1 performance histograms will be saved to: \033[0m" << histoOutName; + TFile* outfile = new TFile(histoOutName.c_str(), "RECREATE"); + outfile->cd(); + writedir2current(fHistoDir); + outfile->Close(); + outfile->Delete(); + } + { + std::string tablesOutName = dir + "/L1_perftable_" + p.filename().string(); + LOG(info) << "\033[31;1mL1 performance tables will be saved to: \033[0m" << tablesOutName; + TFile* outfile = new TFile(tablesOutName.c_str(), "RECREATE"); + outfile->cd(); + writedir2current(fTableDir); + outfile->Close(); + outfile->Delete(); + } gFile = currentFile; gDirectory = curr; diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h index 676a65878c..1bccc2849e 100644 --- a/reco/L1/CbmL1.h +++ b/reco/L1/CbmL1.h @@ -628,6 +628,7 @@ private: // TODO: move to a separate class (S.Zharko) TFile* fPerfFile {nullptr}; TDirectory* fHistoDir {nullptr}; + TDirectory* fTableDir {nullptr}; static const int fNTimeHistos = 22; TH1F* fTimeHisto[fNTimeHistos] {nullptr}; diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx index 7fe6e9bf0d..ce678187ac 100644 --- a/reco/L1/CbmL1Performance.cxx +++ b/reco/L1/CbmL1Performance.cxx @@ -286,8 +286,8 @@ void CbmL1::EfficienciesPerformance() TL1PerfEfficiencies ntra; // efficiencies for current event - ntra.fOutDir = fHistoDir; // Setup a pointer for output directory - L1_NTRA.fOutDir = fHistoDir; // Save average efficiencies + ntra.fOutDir = fTableDir; // Setup a pointer for output directory + L1_NTRA.fOutDir = fTableDir; // Save average efficiencies for (vector<CbmL1Track>::iterator rtraIt = fvRecoTracks.begin(); rtraIt != fvRecoTracks.end(); ++rtraIt) { ntra.ghosts += rtraIt->IsGhost(); -- GitLab