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

TODO: SZh, 30.01.2023: Override THistPainter::PaintText() to add zeroes in tables. More...

#include <CbmQaTable.h>

Inheritance diagram for CbmQaTable:
[legend]
Collaboration diagram for CbmQaTable:
[legend]

Public Member Functions

 CbmQaTable ()
 Default constructor.
 
 CbmQaTable (const char *name, const char *title, Int_t nRows, Int_t nCols)
 Constructor from number of rows and columns.
 
virtual ~CbmQaTable ()
 Destructor.
 
std::string ToString (int prec, bool useErr=false) const
 
void ToTextFile (const std::string &fileName, std::ios_base::openmode mode=std::ios_base::out) const
 
Double_t GetCell (Int_t iRow, Int_t iCol) const
 Gets cell content. Please mind, that the signature and result of this function is different to TH2D::GetBinContent.
 
Double_t GetCellError (Int_t iRow, Int_t iCol) const
 Gets cell error. Please mind, that the signature and result of this function is different to TH2D::GetBinError.
 
Int_t GetNrows () const
 Sets number of rows.
 
Int_t GetNcols () const
 Sets number of columns.
 
void SetCell (Int_t iRow, Int_t iCol, Double_t content, Double_t error=0.)
 
void SetNamesOfCols (const std::vector< std::string > &names)
 Sets the names of table columns.
 
void SetNamesOfRows (const std::vector< std::string > &names)
 Sets the names of table rows.
 
void SetRowName (Int_t iRow, const char *name)
 Set name of a row.
 
void SetTextSize (Float_t size=0.03)
 Sets size of the text.
 
void SetColWidth (Int_t width)
 

Private Member Functions

 ClassDef (CbmQaTable, 1)
 

Private Attributes

Int_t fNcols {0}
 number of columns in a table
 
Int_t fNrows {0}
 number of rows in a table
 
Int_t fColWidth {12}
 Width of column in number of symbols.
 

Static Private Attributes

static constexpr Float_t kDefaultTextSize {0.03}
 default size of text
 
static constexpr Style_t kDefaultFontStyle {62}
 default text style
 
static constexpr Int_t kDefaultSetwPar {20}
 default size of entry in std::setw() for columns
 
static constexpr Int_t kRowTitlesSetwPar {30}
 size of entry in std::setw() for row titles
 
static constexpr Int_t kValuesPrecision {3}
 precision of output parameters
 

Friends

std::ostream & operator<< (std::ostream &out, const CbmQaTable &aTable)
 Dumps table content into a stream.
 

Detailed Description

TODO: SZh, 30.01.2023: Override THistPainter::PaintText() to add zeroes in tables.

Definition at line 24 of file CbmQaTable.h.

Constructor & Destructor Documentation

◆ CbmQaTable() [1/2]

CbmQaTable::CbmQaTable ( )
inline

Default constructor.

Definition at line 27 of file CbmQaTable.h.

◆ CbmQaTable() [2/2]

CbmQaTable::CbmQaTable ( const char * name,
const char * title,
Int_t nRows,
Int_t nCols )

Constructor from number of rows and columns.

Definition at line 26 of file CbmQaTable.cxx.

References fNcols, fNrows, and kDefaultFontStyle.

◆ ~CbmQaTable()

CbmQaTable::~CbmQaTable ( )
virtual

Destructor.

Definition at line 52 of file CbmQaTable.cxx.

Member Function Documentation

◆ ClassDef()

CbmQaTable::ClassDef ( CbmQaTable ,
1  )
private

◆ GetCell()

Double_t CbmQaTable::GetCell ( Int_t iRow,
Int_t iCol ) const

Gets cell content. Please mind, that the signature and result of this function is different to TH2D::GetBinContent.

Definition at line 56 of file CbmQaTable.cxx.

References fNrows.

Referenced by cbm::qa::report::Table::Set(), and ToString().

◆ GetCellError()

Double_t CbmQaTable::GetCellError ( Int_t iRow,
Int_t iCol ) const

Gets cell error. Please mind, that the signature and result of this function is different to TH2D::GetBinError.

Definition at line 60 of file CbmQaTable.cxx.

References fNrows.

Referenced by ToString().

◆ GetNcols()

Int_t CbmQaTable::GetNcols ( ) const
inline

Sets number of columns.

Definition at line 54 of file CbmQaTable.h.

References fNcols.

Referenced by cbm::qa::report::Table::Set().

◆ GetNrows()

Int_t CbmQaTable::GetNrows ( ) const
inline

Sets number of rows.

Definition at line 51 of file CbmQaTable.h.

References fNrows.

Referenced by cbm::qa::report::Table::Set().

◆ SetCell()

void CbmQaTable::SetCell ( Int_t iRow,
Int_t iCol,
Double_t content,
Double_t error = 0. )

Sets cell content and error. Please mind, that the signature and result of this function is different to TH2D::SetBinContent and TH2D::SetBinError

Definition at line 64 of file CbmQaTable.cxx.

References fNrows.

Referenced by cbm::ca::OutputQa::Check(), and TL1PerfEfficiencies::PrintEff().

◆ SetColWidth()

void CbmQaTable::SetColWidth ( Int_t width)
inline

Sets width of column in log output

Parameters
widthWidth of column [number of symbols]

Definition at line 74 of file CbmQaTable.h.

References fColWidth.

Referenced by cbm::ca::OutputQa::Check(), and TL1PerfEfficiencies::PrintEff().

◆ SetNamesOfCols()

void CbmQaTable::SetNamesOfCols ( const std::vector< std::string > & names)

Sets the names of table columns.

Definition at line 72 of file CbmQaTable.cxx.

References fNcols.

Referenced by cbm::ca::OutputQa::Check(), and TL1PerfEfficiencies::PrintEff().

◆ SetNamesOfRows()

void CbmQaTable::SetNamesOfRows ( const std::vector< std::string > & names)

Sets the names of table rows.

Definition at line 83 of file CbmQaTable.cxx.

References fNrows.

Referenced by TL1PerfEfficiencies::PrintEff().

◆ SetRowName()

void CbmQaTable::SetRowName ( Int_t iRow,
const char * name )

Set name of a row.

Definition at line 94 of file CbmQaTable.cxx.

References fNrows.

Referenced by cbm::ca::OutputQa::Check().

◆ SetTextSize()

void CbmQaTable::SetTextSize ( Float_t size = 0.03)

Sets size of the text.

Definition at line 154 of file CbmQaTable.cxx.

References kDefaultTextSize, and size().

◆ ToString()

std::string CbmQaTable::ToString ( int prec,
bool useErr = false ) const

Dumps table content into a string

Parameters
precPrecision of numbers
useErrIf true, the errors will be drawed together with the central values

Definition at line 98 of file CbmQaTable.cxx.

References fColWidth, fNcols, fNrows, GetCell(), and GetCellError().

Referenced by cbm::ca::OutputQa::Check().

◆ ToTextFile()

void CbmQaTable::ToTextFile ( const std::string & fileName,
std::ios_base::openmode mode = std::ios_base::out ) const

Dumps table content into a text file. File open mode is also controllable, for example, use mode = std::ios_base::app to append the table into an existing file

Definition at line 145 of file CbmQaTable.cxx.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const CbmQaTable & aTable )
friend

Dumps table content into a stream.

Definition at line 164 of file CbmQaTable.cxx.

Member Data Documentation

◆ fColWidth

Int_t CbmQaTable::fColWidth {12}
private

Width of column in number of symbols.

Definition at line 92 of file CbmQaTable.h.

Referenced by SetColWidth(), and ToString().

◆ fNcols

Int_t CbmQaTable::fNcols {0}
private

number of columns in a table

Definition at line 89 of file CbmQaTable.h.

Referenced by CbmQaTable(), GetNcols(), SetNamesOfCols(), and ToString().

◆ fNrows

Int_t CbmQaTable::fNrows {0}
private

number of rows in a table

Definition at line 90 of file CbmQaTable.h.

Referenced by CbmQaTable(), GetCell(), GetCellError(), GetNrows(), SetCell(), SetNamesOfRows(), SetRowName(), and ToString().

◆ kDefaultFontStyle

Style_t CbmQaTable::kDefaultFontStyle {62}
staticconstexprprivate

default text style

Definition at line 96 of file CbmQaTable.h.

Referenced by CbmQaTable().

◆ kDefaultSetwPar

Int_t CbmQaTable::kDefaultSetwPar {20}
staticconstexprprivate

default size of entry in std::setw() for columns

Definition at line 98 of file CbmQaTable.h.

◆ kDefaultTextSize

Float_t CbmQaTable::kDefaultTextSize {0.03}
staticconstexprprivate

default size of text

Definition at line 95 of file CbmQaTable.h.

Referenced by SetTextSize().

◆ kRowTitlesSetwPar

Int_t CbmQaTable::kRowTitlesSetwPar {30}
staticconstexprprivate

size of entry in std::setw() for row titles

Definition at line 99 of file CbmQaTable.h.

◆ kValuesPrecision

Int_t CbmQaTable::kValuesPrecision {3}
staticconstexprprivate

precision of output parameters

Definition at line 100 of file CbmQaTable.h.


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