3 #ifndef GAUDIUTILS_HISTOTABLEFORMAT_H
4 #define GAUDIUTILS_HISTOTABLEFORMAT_H 1
15 class IBaseHistogram ;
130 GAUDI_API std::string
path (
const AIDA::IBaseHistogram* aida ) ;
171 (
const AIDA::IHistogram1D* histo ,
172 const std::string& fmt ) ;
203 (
const AIDA::IHistogram1D* histo ,
204 const std::string& ID ,
205 const std::string& fmt1 ,
206 const std::string& fmt2 ) ;
231 template <
class HISTO,
class STREAM,
class TERMINATOR>
235 const std::string& fmt ,
239 for ( ; first != last ; ++first )
240 { stream <<
format ( *first , fmt ) << term ; }
267 template <
class LIST,
class STREAM,
class TERMINATOR>
270 const std::string& fmt ,
275 ( histos.begin () , histos.end () , fmt , stream , term ) ;
322 template <
class HISTO,
class STREAM,
class TERMINATOR>
326 const std::string& fmt1 ,
327 const std::string& fmt2 ,
331 for ( ; begin !=
end ; ++begin )
336 fmt1 , fmt2 ) << term ;
383 template <
class MAP,
class STREAM,
class TERMINATOR>
385 (
const MAP& histos ,
386 const std::string& fmt1 ,
387 const std::string& fmt2 ,
392 ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
400 (
const std::string& val1 ,
401 const std::string& val2 ,
402 const std::string& fmt ) ;
415 Table (
const int ID = 0 ) ;
418 (
const std::string&
format ,
419 const std::string&
header =
"" ,
420 const std::string& footer =
"" ) ;
429 template <
class HISTO,
class STREAM,
class TERMINATOR>
434 TERMINATOR term )
const
436 if ( !
header().empty() ) { stream <<
header () << term ; }
438 if ( !footer().empty() ) { stream << footer () << term ; }
455 template <
class HISTO,
class STREAM,
class TERMINATOR>
459 const std::string& fmt ,
460 const std::string& hval ,
462 TERMINATOR term )
const
464 if ( !hval.empty() || !
header().empty() )
467 ( first , last , fmt ,
format() , stream , term ) ;
473 const std::string&
header ()
const {
return m_header ; }
476 const std::string&
footer ()
const {
return m_footer ; }
479 const std::string&
format ()
const {
return m_format ; }
484 void setHeader (
const std::string& v ) { m_header = v ; }
487 void setFooter (
const std::string& v ) { m_footer = v ; }
490 void setFormat (
const std::string& v ) { m_format = v ; }
495 std::string
toString (
const AIDA::IHistogram1D* histo )
const ;
523 (
const AIDA::IHistogram1D* histo ,
524 const std::string& ID ,
525 const std::string& fmt )
const ;
542 #endif // GAUDIUTILS_HISTOTABLEFORMAT_H
STREAM & printMap(HISTO begin, HISTO end, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
void setFooter(const std::string &v)
set new footer
void setFormat(const std::string &v)
set new format
std::string m_header
the table header
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
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.
const std::string & header() const
the table header
void setHeader(const std::string &v)
set new header
const std::string & format() const
the format
Simple class for the customizeble printout of the histogram tables.
std::string m_footer
the table footer
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
STREAM & printList(HISTO first, HISTO last, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple sequence (list-like) of histograms as table
This is a number of static methods for bootstrapping the Gaudi framework.
std::string m_format
the defautl format
const std::string & footer() const
the table footer