CbmRoot
|
TODO: SZh, 30.01.2023: Override THistPainter::PaintText() to add zeroes in tables. More...
#include <CbmQaTable.h>
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. | |
TODO: SZh, 30.01.2023: Override THistPainter::PaintText() to add zeroes in tables.
Definition at line 24 of file CbmQaTable.h.
|
inline |
Default constructor.
Definition at line 27 of file CbmQaTable.h.
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.
|
virtual |
Destructor.
Definition at line 52 of file CbmQaTable.cxx.
|
private |
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().
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().
|
inline |
Sets number of columns.
Definition at line 54 of file CbmQaTable.h.
References fNcols.
Referenced by cbm::qa::report::Table::Set().
|
inline |
Sets number of rows.
Definition at line 51 of file CbmQaTable.h.
References fNrows.
Referenced by cbm::qa::report::Table::Set().
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().
|
inline |
Sets width of column in log output
width | Width of column [number of symbols] |
Definition at line 74 of file CbmQaTable.h.
References fColWidth.
Referenced by cbm::ca::OutputQa::Check(), and TL1PerfEfficiencies::PrintEff().
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().
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().
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().
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().
std::string CbmQaTable::ToString | ( | int | prec, |
bool | useErr = false ) const |
Dumps table content into a string
prec | Precision of numbers |
useErr | If 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().
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.
|
friend |
Dumps table content into a stream.
Definition at line 164 of file CbmQaTable.cxx.
|
private |
Width of column in number of symbols.
Definition at line 92 of file CbmQaTable.h.
Referenced by SetColWidth(), and ToString().
|
private |
number of columns in a table
Definition at line 89 of file CbmQaTable.h.
Referenced by CbmQaTable(), GetNcols(), SetNamesOfCols(), and ToString().
|
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().
|
staticconstexprprivate |
|
staticconstexprprivate |
default size of entry in std::setw() for columns
Definition at line 98 of file CbmQaTable.h.
|
staticconstexprprivate |
|
staticconstexprprivate |
size of entry in std::setw() for row titles
Definition at line 99 of file CbmQaTable.h.
|
staticconstexprprivate |
precision of output parameters
Definition at line 100 of file CbmQaTable.h.