CbmRoot
Loading...
Searching...
No Matches
QaReportGenerator Class Reference

Generates a comparison QA report (input + output) for CA tracking. More...

#include <QaReportGenerator.h>

Public Types

enum class  EngineType { kHtml , kBeamer , kLatex }
 Supported output engines. More...
 

Public Member Functions

 QaReportGenerator (const std::string &qaFile, const std::string &setup, const std::string &outDir, EngineType engine=EngineType::kLatex, const std::string &figExt="png", bool ignoreSame=false)
 
void Generate ()
 Run the complete report generation pipeline.
 

Private Member Functions

void GetResults (TDirectory *dir, const std::string &currentPath, const std::string &taskName)
 
void Process (const std::string &yamlFile)
 Process the YAML results file.
 

Static Private Member Functions

static std::string EscapeLatex (const std::string &text)
 
static std::vector< std::string > GetCanvasPaths (TDirectory *dir, const std::string &prefix="")
 
static std::string CmpInferenceToString (cbm::qa::checker::ECmpInference inf)
 

Private Attributes

std::unique_ptr< TFile > fFile
 input ROOT file
 
std::unique_ptr< cbm::qa::report::BuilderfReport
 report builder
 
std::string fSetup
 setup tag
 
std::string fOutDir
 output directory
 
EngineType fEngine
 chosen engine
 
std::vector< std::string > fObjlist
 list of objects in the file
 
std::vector< std::string > fVersionLabel
 version labels for comparison
 
std::unordered_map< std::string, std::vector< cbm::qa::checker::Result > > fResults
 results map
 
bool fIgnoreSame = false
 ignore "Same" results in comparison tables
 

Detailed Description

Generates a comparison QA report (input + output) for CA tracking.

Encapsulates the full report pipeline and lets the caller choose the output engine (HTML, LaTeX, Beamer).

Definition at line 29 of file QaReportGenerator.h.

Member Enumeration Documentation

◆ EngineType

enum class QaReportGenerator::EngineType
strong

Supported output engines.

Enumerator
kHtml 
kBeamer 
kLatex 

Definition at line 32 of file QaReportGenerator.h.

Constructor & Destructor Documentation

◆ QaReportGenerator()

QaReportGenerator::QaReportGenerator ( const std::string & qaFile,
const std::string & setup,
const std::string & outDir,
EngineType engine = EngineType::kLatex,
const std::string & figExt = "png",
bool ignoreSame = false )

Construct the generator.

Parameters
qaFilePath to the ROOT QA file.
setupSetup tag (e.g. "s100c").
outDirOutput directory for figures + script.
engineOutput engine (default: LaTeX).
figExtImage extension for saved canvases (png/svg/pdf).

Definition at line 32 of file QaReportGenerator.cxx.

References fEngine, fFile, fIgnoreSame, fOutDir, fReport, and fSetup.

Member Function Documentation

◆ CmpInferenceToString()

std::string QaReportGenerator::CmpInferenceToString ( cbm::qa::checker::ECmpInference inf)
staticprivate

Definition at line 279 of file QaReportGenerator.cxx.

Referenced by Process().

◆ EscapeLatex()

std::string QaReportGenerator::EscapeLatex ( const std::string & text)
staticprivate
Parameters
textText to escape.
Returns
Escaped text suitable for LaTeX.

Definition at line 212 of file QaReportGenerator.cxx.

References pos.

◆ Generate()

void QaReportGenerator::Generate ( )

Run the complete report generation pipeline.

Definition at line 52 of file QaReportGenerator.cxx.

References fEngine, fFile, fReport, kBeamer, kHtml, kLatex, and Process().

Referenced by main().

◆ GetCanvasPaths()

std::vector< std::string > QaReportGenerator::GetCanvasPaths ( TDirectory * dir,
const std::string & prefix = "" )
staticprivate

Definition at line 178 of file QaReportGenerator.cxx.

References GetCanvasPaths().

Referenced by GetCanvasPaths(), and Process().

◆ GetResults()

void QaReportGenerator::GetResults ( TDirectory * dir,
const std::string & currentPath,
const std::string & taskName )
private

Definition at line 229 of file QaReportGenerator.cxx.

References fObjlist, fResults, fVersionLabel, GetResults(), and pos.

Referenced by GetResults(), and Process().

◆ Process()

void QaReportGenerator::Process ( const std::string & yamlFile)
private

Process the YAML results file.

Definition at line 79 of file QaReportGenerator.cxx.

References CmpInferenceToString(), fObjlist, fReport, fResults, fVersionLabel, GetCanvasPaths(), and GetResults().

Referenced by Generate().

Member Data Documentation

◆ fEngine

EngineType QaReportGenerator::fEngine
private

chosen engine

Definition at line 83 of file QaReportGenerator.h.

Referenced by Generate(), and QaReportGenerator().

◆ fFile

std::unique_ptr<TFile> QaReportGenerator::fFile
private

input ROOT file

Definition at line 79 of file QaReportGenerator.h.

Referenced by Generate(), and QaReportGenerator().

◆ fIgnoreSame

bool QaReportGenerator::fIgnoreSame = false
private

ignore "Same" results in comparison tables

Definition at line 89 of file QaReportGenerator.h.

Referenced by QaReportGenerator().

◆ fObjlist

std::vector<std::string> QaReportGenerator::fObjlist
private

list of objects in the file

Definition at line 84 of file QaReportGenerator.h.

Referenced by GetResults(), and Process().

◆ fOutDir

std::string QaReportGenerator::fOutDir
private

output directory

Definition at line 82 of file QaReportGenerator.h.

Referenced by QaReportGenerator().

◆ fReport

std::unique_ptr<cbm::qa::report::Builder> QaReportGenerator::fReport
private

report builder

Definition at line 80 of file QaReportGenerator.h.

Referenced by Generate(), Process(), and QaReportGenerator().

◆ fResults

std::unordered_map<std::string, std::vector<cbm::qa::checker::Result> > QaReportGenerator::fResults
private

results map

Definition at line 88 of file QaReportGenerator.h.

Referenced by GetResults(), and Process().

◆ fSetup

std::string QaReportGenerator::fSetup
private

setup tag

Definition at line 81 of file QaReportGenerator.h.

Referenced by QaReportGenerator().

◆ fVersionLabel

std::vector<std::string> QaReportGenerator::fVersionLabel
private

version labels for comparison

Definition at line 85 of file QaReportGenerator.h.

Referenced by GetResults(), and Process().


The documentation for this class was generated from the following files: