Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Functions
Gaudi::Utils::Histos Namespace Reference

Collection of useful utilities for manipulations with AIDA hisgograms. More...

Namespaces

namespace  Formats
 The 15 format fields are predefined now:
 

Classes

class  HistoStrings
 Helepr class to produce "good" Reflex dictionries. More...
 
class  Table
 Simple class for the customizeble printout of the histogram tables. More...
 

Typedefs

typedef std::vector< std::stringLabels
 Typedef for a list of labels.
 
typedef std::pair< unsigned,
std::string
BinLabel
 Typedef for a bin number and its associated label.
 
typedef std::vector< BinLabelBinLabels
 Typedef for a list of bin numbers and their associated label.
 

Functions

GAUDI_API void fill (AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
 simple function to fill AIDA::IHistogram1D objects
 
GAUDI_API void fill (AIDA::IHistogram2D *histo, const double valueX, const double valueY, const double weight=1.0)
 simple function to fill AIDA::IHistogram2D objects
 
GAUDI_API void fill (AIDA::IHistogram3D *histo, const double valueX, const double valueY, const double valueZ, const double weight=1.0)
 simple function to fill AIDA::IHistogram3D objects
 
GAUDI_API void fill (AIDA::IProfile1D *histo, const double valueX, const double valueY, const double weight=1.0)
 simple function to fill AIDA::IProfile1D objects
 
GAUDI_API void fill (AIDA::IProfile2D *histo, const double valueX, const double valueY, const double valueZ, const double weight=1.0)
 simple function to fill AIDA::IProfile2D objects
 
GAUDI_API std::string htitle (const AIDA::IBaseHistogram *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IHistogram *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IHistogram1D *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IHistogram2D *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IHistogram3D *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IProfile *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IProfile1D *histo, const std::string &title="")
 get the title
 
GAUDI_API std::string htitle (const AIDA::IProfile2D *histo, const std::string &title="")
 get the title
 
GAUDI_API AIDA::IBaseHistogram * toBase (AIDA::IHistogram1D *histo)
 
GAUDI_API AIDA::IBaseHistogram * toBase (AIDA::IHistogram2D *histo)
 
GAUDI_API AIDA::IBaseHistogram * toBase (AIDA::IHistogram3D *histo)
 
GAUDI_API AIDA::IBaseHistogram * toBase (AIDA::IProfile1D *histo)
 
GAUDI_API AIDA::IBaseHistogram * toBase (AIDA::IProfile2D *histo)
 
GAUDI_API std::ostreamhistoDump_ (const AIDA::IHistogram1D *histo, std::ostream &stream, const std::size_t width=80, const std::size_t height=50, const bool errors=false)
 dump the text representation of the histogram
 
GAUDI_API std::string histoDump (const AIDA::IHistogram1D *histo, const std::size_t width=80, const std::size_t height=50, const bool errors=false)
 dump the text representation of the histogram
 
GAUDI_API std::ostreamhistoDump_ (const AIDA::IProfile1D *histo, std::ostream &stream, const std::size_t width=80, const std::size_t height=50, const bool spread=true)
 dump the text representation of 1D-profile
 
GAUDI_API std::string histoDump (const AIDA::IProfile1D *histo, const std::size_t width=80, const std::size_t height=50, const bool spread=true)
 dump the text representation of the 1D-profile
 
GAUDI_API std::ostreamhistoDump_ (const TProfile *histo, std::ostream &stream, const std::size_t width=80, const std::size_t height=50)
 dump the text representation of the Profile
 
GAUDI_API std::string histoDump (const TProfile *histo, const std::size_t width=80, const std::size_t height=50)
 dump the text representation of the histogram
 
GAUDI_API std::ostreamhistoDump_ (const TH1 *histo, std::ostream &stream, const std::size_t width=80, const std::size_t height=50, const bool errors=false)
 dump the text representation of the histogram
 
GAUDI_API std::string histoDump (const TH1 *histo, const std::size_t width=80, const std::size_t height=50, const bool errors=false)
 dump the text representation of the histogram
 
GAUDI_API bool setBinLabels (AIDA::IHistogram1D *hist, const Labels &labels)
 Set the Bin labels for a given 1D histogram.
 
GAUDI_API bool setBinLabels (AIDA::IProfile1D *hist, const Labels &labels)
 Set the Bin labels for a given 1D profile histogram.
 
GAUDI_API bool setBinLabels (AIDA::IHistogram2D *hist, const Labels &xlabels, const Labels &ylabels)
 Set the Bin labels for a given 2D histogram.
 
GAUDI_API bool setBinLabels (AIDA::IProfile2D *hist, const Labels &xlabels, const Labels &ylabels)
 Set the Bin labels for a given 2D profile histogram.
 
GAUDI_API bool setAxisLabels (AIDA::IHistogram1D *hist, const std::string &xAxis, const std::string &yAxis)
 Set the axis labels for the given 1D histogram.
 
GAUDI_API bool setAxisLabels (AIDA::IProfile1D *hist, const std::string &xAxis, const std::string &yAxis)
 Set the axis labels for the given 1D profile histogram.
 
GAUDI_API bool setAxisLabels (AIDA::IHistogram2D *hist, const std::string &xAxis, const std::string &yAxis)
 Set the axis labels for the given 2D histogram.
 
GAUDI_API bool setAxisLabels (AIDA::IProfile2D *hist, const std::string &xAxis, const std::string &yAxis)
 Set the axis labels for the given 2D profile histogram.
 
GAUDI_API std::string path (const AIDA::IBaseHistogram *aida)
 get the path in THS for AIDA histogram
 
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.
 
GAUDI_API std::string format (const AIDA::IHistogram1D *histo, const std::string &ID, const std::string &fmt1, const std::string &fmt2)
 format a full row in table, including ID, label, path or any other "extra" identifier in string form
 
template<class HISTO , class STREAM , class TERMINATOR >
STREAM & printList (HISTO first, HISTO last, const std::string &fmt, STREAM &stream, TERMINATOR term)
 print the simple sequence (list-like) of histograms as table
 
template<class LIST , class STREAM , class TERMINATOR >
STREAM & printList (const LIST &histos, const std::string &fmt, STREAM &stream, TERMINATOR term)
 print the simple container of histograms as table
 
template<class HISTO , class STREAM , class TERMINATOR >
STREAM & printMap (HISTO begin, HISTO end, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
 Print the "associative sequence" (e.g.
 
template<class MAP , class STREAM , class TERMINATOR >
STREAM & printMap (const MAP &histos, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
 Print the "associative sequence" (e.g.
 
GAUDI_API std::string format (const std::string &val1, const std::string &val2, const std::string &fmt)
 helper method to merge the headers for short format table
 
GAUDI_API std::ostreamtoXml (const TH1D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TH2D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TH3D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TProfile &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TProfile2D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram1D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram2D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram3D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML
 
GAUDI_API std::ostreamtoXml (const AIDA::IProfile1D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML
 
GAUDI_API std::ostreamtoXml (const TH1F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TH2F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const TH3F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML
 
GAUDI_API std::ostreamtoXml (const AIDA::IProfile2D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML
 
GAUDI_API StatusCode fromXml (TH1D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH2D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH3D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TProfile &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TProfile2D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH1F &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH2F &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH3F &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH1D *&result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH2D *&result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TH3D *&result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TProfile *&result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (TProfile2D *&result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (AIDA::IHistogram1D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (AIDA::IHistogram2D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (AIDA::IHistogram3D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (AIDA::IProfile1D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 
GAUDI_API StatusCode fromXml (AIDA::IProfile2D &result, const std::string &input)
 parse the histogram from standard ROOT XML
 

Detailed Description

Collection of useful utilities for manipulations with AIDA hisgograms.

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-08-08

Typedef Documentation

typedef std::pair<unsigned,std::string> Gaudi::Utils::Histos::BinLabel

Typedef for a bin number and its associated label.

Definition at line 30 of file HistoLabels.h.

typedef std::vector<BinLabel> Gaudi::Utils::Histos::BinLabels

Typedef for a list of bin numbers and their associated label.

Definition at line 32 of file HistoLabels.h.

typedef std::vector<std::string> Gaudi::Utils::Histos::Labels

Typedef for a list of labels.

Definition at line 28 of file HistoLabels.h.

Function Documentation

void Gaudi::Utils::Histos::fill ( AIDA::IHistogram1D histo,
const double  value,
const double  weight = 1.0 
)

simple function to fill AIDA::IHistogram1D objects

See Also
AIDA::IHistogram1D
Parameters
histopointer to the histogram
valuevalue to be added to the histogram
weightthe "weight" assciated with this entry
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-10-02

Definition at line 37 of file Fill.cpp.

{
if ( 0 != histo ) { histo->fill ( value , weight ) ; }
}
void Gaudi::Utils::Histos::fill ( AIDA::IHistogram2D *  histo,
const double  valueX,
const double  valueY,
const double  weight = 1.0 
)

simple function to fill AIDA::IHistogram2D objects

See Also
AIDA::IHistogram2D
Parameters
histopointer to the histogram
valueXvalue to be added to the histogram
valueYvalue to be added to the histogram
weightthe "weight" assciated with this entry
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-10-02

Definition at line 55 of file Fill.cpp.

{
if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
}
void Gaudi::Utils::Histos::fill ( AIDA::IHistogram3D histo,
const double  valueX,
const double  valueY,
const double  valueZ,
const double  weight = 1.0 
)

simple function to fill AIDA::IHistogram3D objects

See Also
AIDA::IHistogram3D
Parameters
histopointer to the histogram
valueXvalue to be added to the histogram
valueYvalue to be added to the histogram
valueZvalue to be added to the histogram
weightthe "weight" assciated with this entry
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-10-02

Definition at line 75 of file Fill.cpp.

{
if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
}
void Gaudi::Utils::Histos::fill ( AIDA::IProfile1D histo,
const double  valueX,
const double  valueY,
const double  weight = 1.0 
)

simple function to fill AIDA::IProfile1D objects

See Also
AIDA::IProfile1D
Parameters
histopointer to the histogram
valueXvalue to be added to the histogram
valueYvalue to be added to the histogram
weightthe "weight" assciated with this entry
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-10-02

Definition at line 95 of file Fill.cpp.

{
if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
}
void Gaudi::Utils::Histos::fill ( AIDA::IProfile2D histo,
const double  valueX,
const double  valueY,
const double  valueZ,
const double  weight = 1.0 
)

simple function to fill AIDA::IProfile2D objects

See Also
AIDA::IProfile2D
Parameters
histopointer to the histogram
valueXvalue to be added to the histogram
valueYvalue to be added to the histogram
valueZvalue to be added to the histogram
weightthe "weight" assciated with this entry
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-10-02

Definition at line 115 of file Fill.cpp.

{
if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
}
std::string Gaudi::Utils::Histos::format ( const AIDA::IHistogram1D histo,
const std::string fmt 
)

Make the string representation of the historgam according to the specified format.

The method could be used to access/print various quantities

using namespace Gaudi::Utils::Histos ;
const AIDA::IHistogram1D* histo = ... ;
// print title in a free format:
std::cout << format ( histo , "%2%" ) << std::endl ;
// print the path in HTS in a free format:
std::cout << format ( histo , " path in HTS: %1% " ) << std::endl ;
// print the formatted nEntries/Overflow/Underflow:
format ( histo , " #nEntries/Overflow/Underflow=%3%/%4%/%5%" )
<< std::endl ;
// print the formatted Mean+-ErrorMean:
format ( histo , " Mean+-Error=(%8%+-%9%)" )
<< std::endl ;
// print the skewness and kurtosis:
format ( histo , " Skewness/Kurtosis=%12%/%14% " )
<< std::endl ;
Parameters
historeference to the histogram
fmtthe printout format
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-08-08

Definition at line 203 of file HistoTableFormat.cpp.

{
if ( 0 == histo ) { return "<NULL>" ; }
using namespace Gaudi::Utils ;
using namespace boost::io ;
boost::format _fmt ( fmt ) ;
// allow various number of arguments
_fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
_fmt
% ( "\"" + path ( histo ) + "\"" ) // 1) histogram path
% ( "\"" + histo -> title () + "\"" ) // 2) title
% histo -> allEntries () // 3) # entries
% histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
% histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
% histo -> equivalentBinEntries () // 6) equivalent entries
% histo -> sumBinHeights () // 7) integral
% histo -> mean () // 8) mean value
% HistoStats:: meanErr ( histo ) // 9) error in mean
% histo -> rms () // 10) rms
% HistoStats::rmsErr ( histo ) // 11) error in rms
% HistoStats::skewness ( histo ) // 12) skewness
% HistoStats::skewnessErr ( histo ) // 13) error in skewness
% HistoStats::kurtosis ( histo ) // 14) kurtosis
% HistoStats::kurtosisErr ( histo ) // 15) error in kurtosis
//
% histo -> sumAllBinHeights () // 16) full integral (in and out range)
% HistoStats::sumAllBinHeightErr ( histo ) // 17) error on 16
% HistoStats::sumBinHeightErr ( histo ) // 18) error on 7
//
% ( 100 * HistoStats::underflowEntriesFrac ( histo ) ) // 19) fraction of underflow entries
% ( 100 * HistoStats::underflowEntriesFracErr ( histo ) ) // 20) error on 19
% ( 100 * HistoStats::overflowEntriesFrac ( histo ) ) // 21) fraction of overflow entries
% ( 100 * HistoStats::overflowEntriesFracErr ( histo ) ) // 22) error on 21
//
% HistoStats::underflowIntegralFrac ( histo ) // 23) fraction of underflow integral
% HistoStats::underflowIntegralFracErr ( histo ) // 24) error on 23
% HistoStats::overflowIntegralFrac ( histo ) // 25) fraction of overflow intergal
% HistoStats::overflowIntegralFracErr ( histo ) ; // 26) error on 25
//
return _fmt.str() ;
}
std::string Gaudi::Utils::Histos::format ( const AIDA::IHistogram1D histo,
const std::string ID,
const std::string fmt1,
const std::string fmt2 
)

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

using namespace Gaudi::Utils::Histos
const AIDA::IHistogram1D* histo = ... ;
// define short format
const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;
// define format for the histogram
const std::string fmt2 = ... ;
info () <<
format ( "My Histo" , histo , fmt1 , fmt2 )
<< endmsg ;
Parameters
histopointer to the histogram
IDhistorgam ID, title, label or other extra information
fmt1"short" format used for the table
fmt2format used for the histogram printout
Returns
formatted row
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-08-08

Definition at line 252 of file HistoTableFormat.cpp.

{
using namespace boost::io ;
boost::format _fmt ( fmt1 ) ;
// allow various number of arguments
_fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
//
_fmt
% ID // format ID
% format ( histo , fmt2 ) ; // format the histogram
//
return _fmt.str() ;
}
std::string Gaudi::Utils::Histos::format ( const std::string val1,
const std::string val2,
const std::string fmt 
)

helper method to merge the headers for short format table

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 272 of file HistoTableFormat.cpp.

{
using namespace boost::io ;
boost::format _fmt ( fmt ) ;
// allow various number of arguments
_fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
//
_fmt
% val1 // format ID
% val2 ; // format the histogram
//
return _fmt.str() ;
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH1D &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 297 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH1D> _xml ;
std::auto_ptr<TH1D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH2D &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 319 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH2D> _xml ;
std::auto_ptr<TH2D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH3D &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 341 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH3D> _xml ;
std::auto_ptr<TH3D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 429 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TProfile> _xml ;
std::auto_ptr<TProfile> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile2D &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 451 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TProfile2D> _xml ;
std::auto_ptr<TProfile2D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH1F &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 363 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH1F> _xml ;
std::auto_ptr<TH1F> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH2F &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 385 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH2F> _xml ;
std::auto_ptr<TH2F> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH3F &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 407 of file HistoXML.cpp.

{
//
result.Reset() ; // RESET old histogram
//
_Xml<TH3F> _xml ;
std::auto_ptr<TH3F> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result.Reset() ;
histo->Copy ( result ) ;
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH1D *&  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 475 of file HistoXML.cpp.

{
if ( 0 != result ) { return fromXml ( *result , input ) ; }
//
_Xml<TH1D> _xml ;
std::auto_ptr<TH1D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result = histo.release() ; // ASSIGN
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH2D *&  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 495 of file HistoXML.cpp.

{
if ( 0 != result ) { return fromXml ( *result , input ) ; }
//
_Xml<TH2D> _xml ;
std::auto_ptr<TH2D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result = histo.release() ; // ASSIGN
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TH3D *&  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 515 of file HistoXML.cpp.

{
if ( 0 != result ) { return fromXml ( *result , input ) ; }
//
_Xml<TH3D> _xml ;
std::auto_ptr<TH3D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result = histo.release() ; // ASSIGN
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile *&  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 536 of file HistoXML.cpp.

{
if ( 0 != result ) { return fromXml ( *result , input ) ; }
//
_Xml<TProfile> _xml ;
std::auto_ptr<TProfile> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result = histo.release() ; // ASSIGN
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile2D *&  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 556 of file HistoXML.cpp.

{
if ( 0 != result ) { return fromXml ( *result , input ) ; }
//
_Xml<TProfile2D> _xml ;
std::auto_ptr<TProfile2D> histo = _xml ( input ) ;
if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
//
result = histo.release() ; // ASSIGN
//
}
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram1D result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 576 of file HistoXML.cpp.

{
if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
//
return fromXml ( *root , input ) ; // RETURN
}
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram2D &  result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 591 of file HistoXML.cpp.

{
if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
//
return fromXml ( *root , input ) ; // RETURN
}
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram3D result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 606 of file HistoXML.cpp.

{
if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
//
return fromXml ( *root , input ) ; // RETURN
}
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IProfile1D result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 621 of file HistoXML.cpp.

{
TProfile* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
//
return fromXml ( *root , input ) ; // RETURN
}
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IProfile2D result,
const std::string input 
)

parse the histogram from standard ROOT XML

See Also
TBufferXML
TBufferXML::ConvertFromXML
Parameters
result(OUTPUT) the parsed histogram
input(INPUT) the input XML string
Returns
status code

Definition at line 636 of file HistoXML.cpp.

{
TProfile2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
//
return fromXml ( *root , input ) ; // RETURN
}
std::string Gaudi::Utils::Histos::histoDump ( const AIDA::IHistogram1D histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

Parameters
histo(INPUT) the histogram
width(INPUT) the maximal column width
height(INPUT) the proposed column height
erorrs(INPUT) print/plot errors
Returns
string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 710 of file HistoDump.cpp.

{
histoDump_ ( histo , stream , width , height , errors );
return stream.str() ;
}
std::string Gaudi::Utils::Histos::histoDump ( const AIDA::IProfile1D histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  spread = true 
)

dump the text representation of the 1D-profile

Parameters
histo(INPUT) the histogram
width(INPUT) the maximal column width
height(INPUT) the proposed column height
spread(INPUT) print/plto spread vs rms
Returns
string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 807 of file HistoDump.cpp.

{
histoDump_ ( histo , stream , width , height , spread );
return stream.str() ;
}
std::string Gaudi::Utils::Histos::histoDump ( const TProfile *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50 
)

dump the text representation of the histogram

Parameters
histo(INPUT) the histogram
width(INPUT) the maximal column width
height(INPUT) the propsoed coulmn height
erorrs(INPUT) print/plot errors
Returns
string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 976 of file HistoDump.cpp.

{
histoDump_ ( histo , stream , width , height );
return stream.str() ;
}
std::string Gaudi::Utils::Histos::histoDump ( const TH1 *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

Parameters
histo(INPUT) the histogram
width(INPUT) the maximal column width
height(INPUT) the propsoed coulmn height
erorrs(INPUT) print/plot errors
Returns
string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 956 of file HistoDump.cpp.

{
histoDump_ ( histo , stream , width , height , errors );
return stream.str() ;
}
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const AIDA::IHistogram1D histo,
std::ostream stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

Parameters
histo(INPUT) the histogram
stream(OUTUT) the stream
width(INPUT) the maximal column width
height(INPUT) the proposed column height
errors(INPUT) print/plot errors
Returns
the stream
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 621 of file HistoDump.cpp.

{
stream << std::endl ;
if ( 0 == histo ) { return stream ; } // RETURN
Histo hist ;
StatusCode sc = _getHisto ( histo , hist ) ;
if ( sc.isFailure() ) { return stream ; } // RETURN
//
stream
<< boost::format ( " Histo TES : \"%s\"") % path ( histo )
<< std::endl
<< boost::format ( " Histo Title : \"%s\"") % histo->title()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Mean : %11.5g +- %-10.4g ")
<< std::endl
<< boost::format ( " Rms : %11.5g +- %-10.4g ")
<< std::endl
<< boost::format ( " Skewness : %11.5g +- %-10.4g ")
<< std::endl
<< boost::format ( " Kurtosis : %11.5g +- %-10.4g ")
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
% "All"
% "In Range"
% "Underflow"
% "Overflow"
% "#Equivalent"
% "Integral"
% "Total"
<< std::endl
<< boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
% histo -> allEntries ()
% histo -> entries ()
% histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
% histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
% histo -> equivalentBinEntries ()
% histo -> sumBinHeights ()
% histo -> sumAllBinHeights ()
<< std::endl
<< std::endl ;
//
const AIDA::IAnnotation& a = histo->annotation () ;
if ( 0 != a.size() )
{
stream << " Annotation" << std::endl ;
for ( int i = 0 ; i < a.size() ; ++i )
{
stream
<< boost::format ( " | %-25.25s : %-45.45s | ")
% a.key ( i )
% a.value ( i )
<< std::endl ;
}
stream << std::endl ;
}
//
return dumpText ( hist , width , height , errors , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const AIDA::IProfile1D histo,
std::ostream stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  spread = true 
)

dump the text representation of 1D-profile

Parameters
histo(INPUT) the 1D-profile
stream(OUTUT) the stream
width(INPUT) the maximal column width
height(INPUT) the proposed column height
spread(INPUT) print/plot spread/rms ?
Returns
the stream
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 732 of file HistoDump.cpp.

{
stream << std::endl ;
if ( 0 == histo ) { return stream ; } // RETURN
Histo hist ;
StatusCode sc = _getHisto ( histo , hist , spread ) ;
if ( sc.isFailure() ) { return stream ; } // RETURN
//
stream
<< boost::format ( " Histo TES : \"%s\"") % path ( histo )
<< std::endl
<< boost::format ( " Histo Title : \"%s\"") % histo->title()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Mean : %11.5g ") % histo->mean()
<< std::endl
<< boost::format ( " Rms : %11.5g ") % histo->rms ()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |")
% "All"
% "In Range"
% "Underflow"
% "Overflow"
// % "#Equivalent"
% "Integral"
% "Total"
<< std::endl
<< boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |")
% histo -> allEntries ()
% histo -> entries ()
% histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
% histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
// % histo -> equivalentBinEntries ()
% histo -> sumBinHeights ()
% histo -> sumAllBinHeights ()
<< std::endl
<< std::endl ;
//
const AIDA::IAnnotation& a = histo->annotation () ;
if ( 0 != a.size() )
{
stream << " Annotation" << std::endl ;
for ( int i = 0 ; i < a.size() ; ++i )
{
stream
<< boost::format ( " | %-25.25s : %-45.45s | ")
% a.key ( i )
% a.value ( i )
<< std::endl ;
}
stream << std::endl ;
}
//
return dumpText ( hist , width , height , true , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const TProfile *  histo,
std::ostream stream,
const std::size_t  width = 80,
const std::size_t  height = 50 
)

dump the text representation of the Profile

Parameters
histo(INPUT) the histogram
stream(OUTUT) the stream
width(INPUT) the maximal column width
height(INPUT) the proposed coulmn height
spread(INPUT) print/plot rms versus erorr
Returns
the stream
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 901 of file HistoDump.cpp.

{
stream << std::endl ;
if ( 0 == histo ) { return stream ; } // RETURN
Histo hist ;
StatusCode sc = _getHisto ( histo , hist , true ) ;
if ( sc.isFailure() ) { return stream ; } // RETURN
//
stream
<< boost::format ( " Profile Name : \"%s\"")
% histo -> GetName ()
<< std::endl
<< boost::format ( " Profile Title : \"%s\"")
% histo -> GetTitle ()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Mean : %11.5g ") % histo -> GetMean ()
<< std::endl
<< boost::format ( " Rms : %11.5g ") % histo -> GetRMS ()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s |")
% "All"
% "Underflow"
% "Overflow"
% "Integral"
<< std::endl
<< boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
% histo -> GetEntries ()
% histo -> GetBinContent ( 0 )
% histo -> GetBinContent ( histo->GetNbinsX() + 1 )
% histo -> Integral ()
<< std::endl
<< std::endl ;
//
return dumpText ( hist , width , height , true , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const TH1 *  histo,
std::ostream stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

Parameters
histo(INPUT) the histogram
stream(OUTUT) the stream
width(INPUT) the maximal column width
height(INPUT) the proposed coulmn height
errors(INPUT) print/plot errors
Returns
the stream
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-19

Definition at line 828 of file HistoDump.cpp.

{
const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
if ( 0 != profile )
{ return histoDump_ ( profile , stream , width , height ) ; }
//
stream << std::endl ;
if ( 0 == histo ) { return stream ; } // RETURN
Histo hist ;
StatusCode sc = _getHisto ( histo , hist ) ;
if ( sc.isFailure() ) { return stream ; } // RETURN
//
stream
<< boost::format ( " Histo Name : \"%s\"")
% histo -> GetName ()
<< std::endl
<< boost::format ( " Histo Title : \"%s\"")
% histo -> GetTitle ()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Mean : %11.5g +- %-10.4g ")
% histo -> GetMean ()
% histo -> GetMeanError ()
<< std::endl
<< boost::format ( " Rms : %11.5g +- %-10.4g ")
% histo -> GetRMS ()
% histo -> GetRMSError ()
<< std::endl
<< boost::format ( " Skewness : %11.5g ")
% histo -> GetSkewness ()
<< std::endl
<< boost::format ( " Kurtosis : %11.5g ")
% histo -> GetKurtosis ()
<< std::endl
<< std::endl ;
//
stream
<< boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
% "All"
% "Underflow"
% "Overflow"
% "#Equivalent"
% "Integral"
<< std::endl
<< boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
% histo -> GetEntries ()
% histo -> GetBinContent ( 0 )
% histo -> GetBinContent ( histo->GetNbinsX() + 1 )
% histo -> GetEffectiveEntries ()
% histo -> Integral ()
<< std::endl
<< std::endl ;
//
return dumpText ( hist , width , height , errors , stream ) ;
}
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IBaseHistogram *  histo,
const std::string title = "" 
)

get the title

Definition at line 139 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IHistogram *  histo,
const std::string title = "" 
)

get the title

Definition at line 146 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IHistogram1D histo,
const std::string title = "" 
)

get the title

Definition at line 153 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IHistogram2D *  histo,
const std::string title = "" 
)

get the title

Definition at line 160 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IHistogram3D histo,
const std::string title = "" 
)

get the title

Definition at line 167 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IProfile *  histo,
const std::string title = "" 
)

get the title

Definition at line 174 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IProfile1D histo,
const std::string title = "" 
)

get the title

Definition at line 181 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::htitle ( const AIDA::IProfile2D histo,
const std::string title = "" 
)

get the title

Definition at line 188 of file Fill.cpp.

{ return htitle_ ( histo , title ) ; }
std::string Gaudi::Utils::Histos::path ( const AIDA::IBaseHistogram *  aida)

get the path in THS for AIDA histogram

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-08-08

Definition at line 185 of file HistoTableFormat.cpp.

{
if ( 0 == aida ) { return "" ; } // RETURN
const DataObject* object = dynamic_cast<const DataObject*>( aida ) ;
if ( 0 == object ) { return "" ; } // RETURN
IRegistry* registry = object->registry() ;
if ( 0 == registry ) { return "" ; } // RETURN
std::string _path = registry->identifier() ;
std::string::size_type n = _path.find("/stat/") ;
if ( 0 == n ) { return std::string(_path,6) ; } // RETURN
return _path ; // RETURN
}
template<class HISTO , class STREAM , class TERMINATOR >
STREAM& Gaudi::Utils::Histos::printList ( HISTO  first,
HISTO  last,
const std::string fmt,
STREAM &  stream,
TERMINATOR  term 
)
inline

print the simple sequence (list-like) of histograms as table

SEQUENCE histos = ... ;
// print a table with three colums path, title and #entries
( histos.begin () ,
histos.end () ,
" | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
'\n' ) ;
Parameters
firstbegin-iterator for the sequence
lastend-iterator for the sequence
streamthe stream to be used for printout
termthe terminmator for the stream
fmtthe format to be used

Definition at line 233 of file HistoTableFormat.h.

{
for ( ; first != last ; ++first )
{ stream << format ( *first , fmt ) << term ; } // print table rows
return stream ; // RETURN
}
template<class LIST , class STREAM , class TERMINATOR >
STREAM& Gaudi::Utils::Histos::printList ( const LIST &  histos,
const std::string fmt,
STREAM &  stream,
TERMINATOR  term 
)
inline

print the simple container of histograms as table

using namespace Gaudi::Utils::Histos ;
SEQUENCE histos = ... ;
// print a table with three columns: path, title and #entries
( histos ,
" | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
'\n' ) ;
Parameters
histosthe sequence of histograms
streamthe stream to be used for printout
termthe terminmator for the stream
fmtthe format to be used

Definition at line 269 of file HistoTableFormat.h.

{
return printList
( histos.begin () , histos.end () , fmt , stream , term ) ;
}
template<class HISTO , class STREAM , class TERMINATOR >
STREAM& Gaudi::Utils::Histos::printMap ( HISTO  begin,
HISTO  end,
const std::string fmt1,
const std::string fmt2,
STREAM &  stream,
TERMINATOR  term 
)
inline

Print the "associative sequence" (e.g.

part of std:map) of histograms as table:

using namespace Gaudi::Utils::Histos ;
( m.begin () ,
m.end () ,
"| %1$-10.10s | %2% " , // short format
Gaudi::Utils::Histos::Formats::histoFormatOnly ,
always() ,
endmsg ) ;

Print only mean and rms:

using namespace Gaudi::Utils::Histos ;
( m.begin () ,
m.end () ,
"| %1$-10.10s | %2% " , // short format
" %8$10.5g+-%10$-10.5g|", // mean+-rms
always() ,
endmsg ) ;
Parameters
begin'begin'-iterator for the mapping sequence
end'end'-iterator for the mapping sequence
fmt1'short' format for the table printout
fmt3format for the printout of the histogram
streamthe stream for printout
termstream terminator

Definition at line 324 of file HistoTableFormat.h.

{
for ( ; begin != end ; ++begin )
{
stream << format
( begin -> second , // the histogram
begin -> first , // the key
fmt1 , fmt2 ) << term ;
}
return stream ;
}
template<class MAP , class STREAM , class TERMINATOR >
STREAM& Gaudi::Utils::Histos::printMap ( const MAP &  histos,
const std::string fmt1,
const std::string fmt2,
STREAM &  stream,
TERMINATOR  term 
)
inline

Print the "associative sequence" (e.g.

part of std:map) of histograms as table:

using namespace Gaudi::Utils::Histos ;
( m ,
"| %1$-10.10s | %2% " , // short format
Gaudi::Utils::Histos::Formats::histoFormatOnly ,
always() ,
endmsg ) ;

Print only mean and rms:

using namespace Gaudi::Utils::Histos ;
( m ,
"| %1$-10.10s | %2% " , // short format
" %8$10.5g+-%10$-10.5g|", // mean+-rms
always() ,
endmsg ) ;
Parameters
begin'begin'-iterator for the mapping sequence
end'end'-iterator for the mapping sequence
fmt1'short' format for the table printout
fmt3format for the printout of the histogram
streamthe stream for printout
termstream terminator

Definition at line 385 of file HistoTableFormat.h.

{
return printMap
( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
}
bool Gaudi::Utils::Histos::setAxisLabels ( AIDA::IHistogram1D hist,
const std::string xAxis,
const std::string yAxis 
)

Set the axis labels for the given 1D histogram.

Parameters
histPointer to the histogram
xAxisLabel for the x axis
yAxisLabel for the y axis
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 191 of file HistoLabels.cpp.

{
return setAxisLabels_<TH1D>( hist, xAxis, yAxis );
}
bool Gaudi::Utils::Histos::setAxisLabels ( AIDA::IProfile1D hist,
const std::string xAxis,
const std::string yAxis 
)

Set the axis labels for the given 1D profile histogram.

Parameters
histPointer to the histogram
xAxisLabel for the x axis
yAxisLabel for the y axis
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 198 of file HistoLabels.cpp.

{
return setAxisLabels_<TProfile>( hist, xAxis, yAxis );
}
bool Gaudi::Utils::Histos::setAxisLabels ( AIDA::IHistogram2D *  hist,
const std::string xAxis,
const std::string yAxis 
)

Set the axis labels for the given 2D histogram.

Parameters
histPointer to the histogram
xAxisLabel for the x axis
yAxisLabel for the y axis
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 205 of file HistoLabels.cpp.

{
return setAxisLabels_<TH2D>( hist, xAxis, yAxis );
}
bool Gaudi::Utils::Histos::setAxisLabels ( AIDA::IProfile2D hist,
const std::string xAxis,
const std::string yAxis 
)

Set the axis labels for the given 2D profile histogram.

Parameters
histPointer to the histogram
xAxisLabel for the x axis
yAxisLabel for the y axis
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 212 of file HistoLabels.cpp.

{
return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
}
bool Gaudi::Utils::Histos::setBinLabels ( AIDA::IHistogram1D hist,
const Labels &  labels 
)

Set the Bin labels for a given 1D histogram.

The labels will be applied in the order they appear in the list, starting at the first bin. If the list of labels is too short, the later bins will be missing a label. If the list is too long, only the first N will be used, where N is the number of bins in the histogram

Parameters
histPointer to the histogram
labelsThe list of labels
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Each entry in 'labels' gives the bin number and its associated label

Parameters
histPointer to the histogram
labelsThe list of labels
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 99 of file HistoLabels.cpp.

{
return setBinLabels_<TH1D>(hist,labels);
}
bool Gaudi::Utils::Histos::setBinLabels ( AIDA::IProfile1D hist,
const Labels &  labels 
)

Set the Bin labels for a given 1D profile histogram.

The labels will be applied in the order they appear in the list, starting at the first bin. If the list of labels is too short, the later bins will be missing a label. If the list is too long, only the first N will be used, where N is the number of bins in the histogram

Parameters
histPointer to the histogram
labelsThe list of labels
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Each entry in 'labels' gives the bin number and its associated label

Parameters
histPointer to the histogram
labelsThe list of bin numbers and the associated label
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 105 of file HistoLabels.cpp.

{
return setBinLabels_<TProfile>(hist,labels);
}
bool Gaudi::Utils::Histos::setBinLabels ( AIDA::IHistogram2D *  hist,
const Labels &  xlabels,
const Labels &  ylabels 
)

Set the Bin labels for a given 2D histogram.

The labels will be applied in the order they appear in the lists, starting at the first bin. If the list of labels is too short, the later bins will be missing a label. If the list is too long, only the first N will be used, where N is the number of bins in the histogram

Parameters
histPointer to the histogram
xlabelsThe list of x labels
ylabelsThe list of y labels
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Each entry in 'labels' lists gives the bin number and its associated label

Parameters
histPointer to the histogram
xlabelsThe list of x bin numbers and the associated label
ylabelsThe list of y bin numbers and the associated label
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 123 of file HistoLabels.cpp.

{
if (!hist) return false;
TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
if (!h2d) return false;
lx.reserve(xlabels.size());
for ( unsigned int i = 0; i < xlabels.size(); ++i )
{
lx.push_back( Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
}
ly.reserve(ylabels.size());
for ( unsigned int i = 0; i < ylabels.size(); ++i )
{
ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
}
return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
setBinLabels_( h2d->GetYaxis(), ly ) );
}
bool Gaudi::Utils::Histos::setBinLabels ( AIDA::IProfile2D hist,
const Labels &  xlabels,
const Labels &  ylabels 
)

Set the Bin labels for a given 2D profile histogram.

The labels will be applied in the order they appear in the lists, starting at the first bin. If the list of labels is too short, the later bins will be missing a label. If the list is too long, only the first N will be used, where N is the number of bins in the histogram

Parameters
histPointer to the histogram
xlabelsThe list of x labels
ylabelsThe list of y labels
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Each entry in 'labels' lists gives the bin number and its associated label

Parameters
histPointer to the histogram
xlabelsThe list of x bin numbers and the associated label
ylabelsThe list of y bin numbers and the associated label
Returns
Boolean indicating if the labels were successfully applied or not
Return values
TRUELabels were applied OK
FALSELabels were NOT applied

Definition at line 156 of file HistoLabels.cpp.

{
if (!hist) return false;
TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
if (!h2d) return false;
lx.reserve(xlabels.size());
for ( unsigned int i = 0; i < xlabels.size(); ++i )
{
lx.push_back(Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
}
ly.reserve(ylabels.size());
for ( unsigned int i = 0; i < ylabels.size(); ++i )
{
ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
}
return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
setBinLabels_( h2d->GetYaxis(), ly ) );
}
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IHistogram1D histo)

Definition at line 194 of file Fill.cpp.

{ return histo ; }
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IHistogram2D *  histo)

Definition at line 198 of file Fill.cpp.

{ return histo ; }
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IHistogram3D histo)

Definition at line 202 of file Fill.cpp.

{ return histo ; }
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IProfile1D histo)

Definition at line 206 of file Fill.cpp.

{ return histo ; }
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IProfile2D histo)

Definition at line 210 of file Fill.cpp.

{ return histo ; }
std::ostream & Gaudi::Utils::Histos::toXml ( const TH1D &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 70 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TH2D &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 87 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TH3D &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 104 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TProfile &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 172 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TProfile2D &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 189 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram1D histo,
std::ostream stream 
)

stream the AIDA histogram into the output stream as XML

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 206 of file HistoXML.cpp.

{
//
AIDA::IHistogram1D* aida = const_cast<AIDA::IHistogram1D*> ( &histo ) ;
//
const TH1D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
if ( 0 == root ) { return stream ; } // RETURN
//
return toXml ( *root , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram2D &  histo,
std::ostream stream 
)

stream the AIDA histogram into the output stream as XML

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 224 of file HistoXML.cpp.

{
//
AIDA::IHistogram2D* aida = const_cast<AIDA::IHistogram2D*> ( &histo ) ;
//
const TH2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
if ( 0 == root ) { return stream ; } // RETURN
//
return toXml ( *root , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram3D histo,
std::ostream stream 
)

stream the AIDA histogram into the output stream as XML

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 242 of file HistoXML.cpp.

{
//
AIDA::IHistogram3D* aida = const_cast<AIDA::IHistogram3D*> ( &histo ) ;
//
const TH3D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
if ( 0 == root ) { return stream ; } // RETURN
//
return toXml ( *root , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IProfile1D histo,
std::ostream stream 
)

stream the AIDA histogram into the output stream as XML

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 260 of file HistoXML.cpp.

{
//
AIDA::IProfile1D* aida = const_cast<AIDA::IProfile1D*> ( &histo ) ;
//
const TProfile* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
if ( 0 == root ) { return stream ; } // RETURN
//
return toXml ( *root , stream ) ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TH1F &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 121 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TH2F &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 138 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const TH3F &  histo,
std::ostream stream 
)

stream the ROOT histogram into output stream as XML

See Also
TBufferXML
TBufferXML::ConvertToXML
Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 155 of file HistoXML.cpp.

{
//
const TObject* obj = &histo ;
//
TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
//
return stream << s ;
}
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IProfile2D histo,
std::ostream stream 
)

stream the AIDA histogram into the output stream as XML

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream

Definition at line 278 of file HistoXML.cpp.

{
//
AIDA::IProfile2D* aida = const_cast<AIDA::IProfile2D*> ( &histo ) ;
//
const TProfile2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
if ( 0 == root ) { return stream ; } // RETURN
//
return toXml ( *root , stream ) ;
}

Generated at Wed Dec 4 2013 14:33:22 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004