1 #ifndef GAUDIUTILS_HISTOTABLEFORMAT_H
2 #define GAUDIUTILS_HISTOTABLEFORMAT_H 1
6 #include "GaudiKernel/Kernel.h"
13 class IBaseHistogram ;
128 GAUDI_API std::string
path (
const AIDA::IBaseHistogram* aida ) ;
169 (
const AIDA::IHistogram1D* histo ,
170 const std::string& fmt ) ;
201 (
const AIDA::IHistogram1D* histo ,
202 const std::string& ID ,
203 const std::string& fmt1 ,
204 const std::string& fmt2 ) ;
229 template <
class HISTO,
class STREAM,
class TERMINATOR>
233 const std::string& fmt ,
237 for ( ; first != last ; ++first )
238 { stream <<
format ( *first , fmt ) << term ; }
265 template <
class LIST,
class STREAM,
class TERMINATOR>
268 const std::string& fmt ,
273 ( histos.begin () , histos.end () , fmt , stream , term ) ;
320 template <
class HISTO,
class STREAM,
class TERMINATOR>
324 const std::string& fmt1 ,
325 const std::string& fmt2 ,
334 fmt1 , fmt2 ) << term ;
381 template <
class MAP,
class STREAM,
class TERMINATOR>
383 (
const MAP& histos ,
384 const std::string& fmt1 ,
385 const std::string& fmt2 ,
390 ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
398 (
const std::string& val1 ,
399 const std::string& val2 ,
400 const std::string& fmt ) ;
413 Table (
const int ID = 0 ) ;
416 (
const std::string&
format ,
417 const std::string&
header =
"" ,
418 const std::string& footer =
"" ) ;
427 template <
class HISTO,
class STREAM,
class TERMINATOR>
432 TERMINATOR term )
const
434 if ( !
header().empty() ) { stream <<
header () << term ; }
436 if ( !footer().empty() ) { stream << footer () << term ; }
453 template <
class HISTO,
class STREAM,
class TERMINATOR>
457 const std::string& fmt ,
458 const std::string& hval ,
460 TERMINATOR term )
const
462 if ( !hval.empty() || !
header().empty() )
465 ( first , last , fmt ,
format() , stream , term ) ;
471 const std::string&
header ()
const {
return m_header ; }
474 const std::string&
footer ()
const {
return m_footer ; }
477 const std::string&
format ()
const {
return m_format ; }
482 void setHeader ( std::string v ) { m_header = std::move(v) ; }
485 void setFooter ( std::string v ) { m_footer = std::move(v) ; }
488 void setFormat ( std::string v ) { m_format = std::move(v) ; }
493 std::string
toString (
const AIDA::IHistogram1D* histo )
const ;
521 (
const AIDA::IHistogram1D* histo ,
522 const std::string& ID ,
523 const std::string& fmt )
const ;
540 #endif // GAUDIUTILS_HISTOTABLEFORMAT_H
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
STREAM & printMap(HISTO begin, HISTO end, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
std::string m_header
the table header
STREAM & printList(HISTO first, HISTO last, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple sequence (list-like) of histograms as table
auto begin(reverse_wrapper< T > &w)
void setHeader(std::string v)
set new header
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
void setFormat(std::string v)
set new format
const std::string & header() const
the table header
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the historgam according to the specified format.
auto end(reverse_wrapper< T > &w)
const std::string & format() const
the format
Simple class for the customizeble printout of the histogram tables.
std::string m_footer
the table footer
void setFooter(std::string v)
set new footer
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Helper functions to set/get the application return code.
std::string m_format
the defautl format
const std::string & footer() const
the table footer