| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
Gaudi::Utils::Histos::Table Class Reference

Simple class for the customizeble printout of the histogram tables. More...

`#include <GaudiUtils/HistoTableFormat.h>`

Collaboration diagram for Gaudi::Utils::Histos::Table:
[legend]

## Public Member Functions
| Table (const int ID=0)
| constructor from enum More...
| Table (const std::string &format, const std::string &header="", const std::string &footer="")
| Constructor from the format, header and footer. More...
template<class HISTO , class STREAM , class TERMINATOR >
STREAM & | printList (HISTO first, HISTO last, STREAM &stream, TERMINATOR term) const
| print the simple sequence of histograms as table More...
template<class HISTO , class STREAM , class TERMINATOR >
STREAM & | printMap (HISTO first, HISTO last, const std::string &fmt, const std::string &hval, STREAM &stream, TERMINATOR term) const
| print as table the content of the accociative map (key->histogram) with the key, convertible to std::string More...
const std::string & | header () const
| the table header More...
const std::string & | footer () const
| the table footer More...
const std::string & | format () const
| the format More...
void | setHeader (std::string v)
| set new header More...
void | setFooter (std::string v)
| set new footer More...
void | setFormat (std::string v)
| set new format More...
std::string | toString (const AIDA::IHistogram1D *histo) const
| make the string representation according to the default format More...
std::string | toString (const AIDA::IProfile1D *histo) const
| make the string representation according to the default format More...
std::string | toString (const AIDA::IHistogram1D *histo, const std::string &ID, const std::string &fmt) const
| format a full row in table, including ID, label, path or any other "extra" identifier More...
std::string | toString (const AIDA::IProfile1D *histo, const std::string &ID, const std::string &fmt) const
| format a full row in table, including ID, label, path or any other "extra" identifier More...

## Public Attributes
std::string | m_header
| the table header More...
std::string | m_footer
| the table footer More...
std::string | m_format
| the defautl format More...

## Detailed Description

Simple class for the customizeble printout of the histogram tables.

Author
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2007-08-07

Definition at line 427 of file HistoTableFormat.h.

## Constructor & Destructor Documentation

## ◆ Table() [1/2]

Gaudi::Utils::Histos::Table::Table | ( | const int | ID = `0` | ) |

constructor from enum

Definition at line 372 of file HistoTableFormat.cpp.

373 : m_header( Gaudi::Utils::Histos::Formats::header( ID ) )
374 , m_footer()
375 , m_format( Gaudi::Utils::Histos::Formats::format( ID ) ) {}
Gaudi::Utils::Histos::Table::m_header
std::string m_header
the table header
Definition: HistoTableFormat.h:555
Gaudi::Utils::Histos::Formats::header
GAUDI_API std::string header(const int ID=Default)
get the recommended header by enum
Definition: HistoTableFormat.cpp:187
Gaudi::Utils::Histos::Formats::format
GAUDI_API std::string format(const int ID=Default)
get the format by enum
Definition: HistoTableFormat.cpp:154
Gaudi::Utils::Histos::Table::m_footer
std::string m_footer
the table footer
Definition: HistoTableFormat.h:557
Gaudi::Utils::Histos::Table::m_format
std::string m_format
the defautl format
Definition: HistoTableFormat.h:559

## ◆ Table() [2/2]

Gaudi::Utils::Histos::Table::Table | ( | const std::string & | format,
|  | const std::string & | header = `""`,
|  | const std::string & | footer = `""`
| ) |  |

Constructor from the format, header and footer.

Definition at line 377 of file HistoTableFormat.cpp.

378 : m_header( header ), m_footer( footer ), m_format( format ) {}
Gaudi::Utils::Histos::Table::m_header
std::string m_header
the table header
Definition: HistoTableFormat.h:555
Gaudi::Utils::Histos::Table::footer
const std::string & footer() const
the table footer
Definition: HistoTableFormat.h:478
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481
Gaudi::Utils::Histos::Table::header
const std::string & header() const
the table header
Definition: HistoTableFormat.h:475
Gaudi::Utils::Histos::Table::m_footer
std::string m_footer
the table footer
Definition: HistoTableFormat.h:557
Gaudi::Utils::Histos::Table::m_format
std::string m_format
the defautl format
Definition: HistoTableFormat.h:559

## Member Function Documentation

## ◆ footer()

const std::string& Gaudi::Utils::Histos::Table::footer | ( |  | ) | const
| inline

the table footer

Definition at line 478 of file HistoTableFormat.h.

478 { return m_footer; }
Gaudi::Utils::Histos::Table::m_footer
std::string m_footer
the table footer
Definition: HistoTableFormat.h:557

## ◆ format()

const std::string& Gaudi::Utils::Histos::Table::format | ( |  | ) | const
| inline

the format

Definition at line 481 of file HistoTableFormat.h.

481 { return m_format; }
Gaudi::Utils::Histos::Table::m_format
std::string m_format
the defautl format
Definition: HistoTableFormat.h:559

## ◆ header()

const std::string& Gaudi::Utils::Histos::Table::header | ( |  | ) | const
| inline

the table header

Definition at line 475 of file HistoTableFormat.h.

475 { return m_header; }
Gaudi::Utils::Histos::Table::m_header
std::string m_header
the table header
Definition: HistoTableFormat.h:555

## ◆ printList()

template<class HISTO , class STREAM , class TERMINATOR >

STREAM& Gaudi::Utils::Histos::Table::printList | ( | HISTO | first,
|  | HISTO | last,
|  | STREAM & | stream,
|  | TERMINATOR | term
| ) |  | const
| inline

print the simple sequence of histograms as table

Parameters

  first | begin-iterator for the sequence
  last | end-iterator for the sequence
  stream | the stream to be used for printout
  term | the terminmator for the stream

Definition at line 443 of file HistoTableFormat.h.

443 {
444 if ( !header().empty() ) { stream << header() << term; }
445 Gaudi::Utils::Histos::printList( first, last, format(), stream, term );
446 if ( !footer().empty() ) { stream << footer() << term; }
447 return stream;
448 }
Gaudi::Utils::Histos::Table::footer
const std::string & footer() const
the table footer
Definition: HistoTableFormat.h:478
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481
Gaudi::Utils::Histos::Table::header
const std::string & header() const
the table header
Definition: HistoTableFormat.h:475
Gaudi::Utils::Histos::printList
STREAM & printList(HISTO first, HISTO last, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple sequence (list-like) of histograms as table
Definition: HistoTableFormat.h:277

## ◆ printMap()

template<class HISTO , class STREAM , class TERMINATOR >

STREAM& Gaudi::Utils::Histos::Table::printMap | ( | HISTO | first,
|  | HISTO | last,
|  | const std::string & | fmt,
|  | const std::string & | hval,
|  | STREAM & | stream,
|  | TERMINATOR | term
| ) |  | const
| inline

print as table the content of the accociative map (key->histogram) with the key, convertible to std::string

The default format is used for histogram prinout

Parameters

  first | 'begin'-iterator for the mapping sequence
  last | 'end'-iterator for the mapping sequence
  fmt | 'short' format for the table printout
  hval | the name of the "key"-column
  stream | the stream for printout
  term | stream terminator

Definition at line 464 of file HistoTableFormat.h.

465 {
466 if ( !hval.empty() || !header().empty() ) {
467 stream << Gaudi::Utils::Histos::format( hval, header(), fmt ) << term;
468 }
469 return Gaudi::Utils::Histos::printMap( first, last, fmt, format(), stream, term );
470 }
Gaudi::Utils::Histos::printMap
STREAM & printMap(HISTO begin, HISTO end, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
Definition: HistoTableFormat.h:355
std::string::empty
T empty(T... args)
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481
Gaudi::Utils::Histos::Table::header
const std::string & header() const
the table header
Definition: HistoTableFormat.h:475

## ◆ setFooter()

void Gaudi::Utils::Histos::Table::setFooter | ( | std::string | v | ) |
| inline

set new footer

Definition at line 489 of file HistoTableFormat.h.

489 { m_footer = std::move( v ); }
Gaudi::Utils::Histos::Table::m_footer
std::string m_footer
the table footer
Definition: HistoTableFormat.h:557
std::move
T move(T... args)

## ◆ setFormat()

void Gaudi::Utils::Histos::Table::setFormat | ( | std::string | v | ) |
| inline

set new format

Definition at line 492 of file HistoTableFormat.h.

492 { m_format = std::move( v ); }
std::move
T move(T... args)
Gaudi::Utils::Histos::Table::m_format
std::string m_format
the defautl format
Definition: HistoTableFormat.h:559

## ◆ setHeader()

void Gaudi::Utils::Histos::Table::setHeader | ( | std::string | v | ) |
| inline

set new header

Definition at line 486 of file HistoTableFormat.h.

486 { m_header = std::move( v ); }
Gaudi::Utils::Histos::Table::m_header
std::string m_header
the table header
Definition: HistoTableFormat.h:555
std::move
T move(T... args)

## ◆ toString() [1/4]

std::string Gaudi::Utils::Histos::Table::toString | ( | const AIDA::IHistogram1D * | histo | ) | const

make the string representation according to the default format

Definition at line 382 of file HistoTableFormat.cpp.

382 {
383 return Gaudi::Utils::Histos::format( histo, format() );
384 }
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481

## ◆ toString() [2/4]

std::string Gaudi::Utils::Histos::Table::toString | ( | const AIDA::IProfile1D * | histo | ) | const

make the string representation according to the default format

Definition at line 399 of file HistoTableFormat.cpp.

399 {
400 return Gaudi::Utils::Histos::format( histo, format() );
401 }
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481

## ◆ toString() [3/4]

std::string Gaudi::Utils::Histos::Table::toString | ( | const AIDA::IHistogram1D * | histo,
|  | const std::string & | ID,
|  | const std::string & | fmt
| ) |  | const

format a full row in table, including ID, label, path or any other "extra" identifier

using namespace Gaudi::Utils::Histos ;
const Table& table = ... ;
const AIDA::IHistogram1D* histo = ... ;
// define short format
const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;
info () << table.toString ( "My Histo" , histo , fmt ) ;

Parameters

  histo | pointer to the histogram
  ID | historgam ID, title, label or other extra infomration
  fmt | "short" format used for the table

Returns
  formatted row

Definition at line 390 of file HistoTableFormat.cpp.

391 {
392 return Gaudi::Utils::Histos::format( histo, ID, fmt, format() );
393 }
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481

## ◆ toString() [4/4]

std::string Gaudi::Utils::Histos::Table::toString | ( | const AIDA::IProfile1D * | histo,
|  | const std::string & | ID,
|  | const std::string & | fmt
| ) |  | const

format a full row in table, including ID, label, path or any other "extra" identifier

using namespace Gaudi::Utils::Histos ;
const Table& table = ... ;
const AIDA::IProfile1D* histo = ... ;
// define short format
const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;
info () << table.toString ( "My Histo" , histo , fmt ) ;

Parameters

  histo | pointer to the histogram
  ID | historgam ID, title, label or other extra infomration
  fmt | "short" format used for the table

Returns
  formatted row

Definition at line 407 of file HistoTableFormat.cpp.

408 {
409 return Gaudi::Utils::Histos::format( histo, ID, fmt, format() );
410 }
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
Gaudi::Utils::Histos::Table::format
const std::string & format() const
the format
Definition: HistoTableFormat.h:481

## Member Data Documentation

## ◆ m_footer

std::string Gaudi::Utils::Histos::Table::m_footer

the table footer

Definition at line 557 of file HistoTableFormat.h.

## ◆ m_format

std::string Gaudi::Utils::Histos::Table::m_format

the defautl format

Definition at line 559 of file HistoTableFormat.h.

## ◆ m_header

std::string Gaudi::Utils::Histos::Table::m_header

the table header

Definition at line 555 of file HistoTableFormat.h.

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

- GaudiUtils/GaudiUtils/HistoTableFormat.h
- GaudiUtils/src/Lib/HistoTableFormat.cpp