| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Namespaces | Classes | Typedefs | Functions
Gaudi::Utils::Histos Namespace Reference

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

## Namespaces
| Formats
| The 15 format fields are predefined now:

## Classes
class | HistoStrings
| Helper class to produce "good" dictionaries. More...
class | Table
| Simple class for the customizeble printout of the histogram tables. More...

## Typedefs
typedef std::vector< std::string > | Labels
| Typedef for a list of labels. More...
typedef std::pair< unsigned, std::string > | BinLabel
| Typedef for a bin number and its associated label. More...
typedef std::vector< BinLabel > | BinLabels
| Typedef for a list of bin numbers and their associated label. More...

## Functions
GAUDI_API void | fill (AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
| simple function to fill AIDA::IHistogram1D objects More...
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 More...
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 More...
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 More...
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 More...
GAUDI_API std::string | htitle (const AIDA::IBaseHistogram *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IHistogram *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IHistogram1D *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IHistogram2D *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IHistogram3D *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IProfile *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IProfile1D *histo, const std::string &title="")
| get the title More...
GAUDI_API std::string | htitle (const AIDA::IProfile2D *histo, const std::string &title="")
| get the title More...
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::ostream & | 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 More...
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 More...
GAUDI_API std::ostream & | 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 More...
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 More...
GAUDI_API std::ostream & | 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 More...
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 More...
GAUDI_API std::ostream & | 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 More...
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 More...
GAUDI_API bool | setBinLabels (AIDA::IHistogram1D *hist, const Labels &labels)
| Set the Bin labels for a given 1D histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IHistogram1D *hist, const BinLabels &labels)
| Set the Bin labels for a given 1D histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IProfile1D *hist, const Labels &labels)
| Set the Bin labels for a given 1D profile histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IProfile1D *hist, const BinLabels &labels)
| Set the Bin labels for a given 1D profile histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IHistogram2D *hist, const Labels &xlabels, const Labels &ylabels)
| Set the Bin labels for a given 2D histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IHistogram2D *hist, const BinLabels &xlabels, const BinLabels &ylabels)
| Set the Bin labels for a given 2D histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IProfile2D *hist, const Labels &xlabels, const Labels &ylabels)
| Set the Bin labels for a given 2D profile histogram. More...
GAUDI_API bool | setBinLabels (AIDA::IProfile2D *hist, const BinLabels &xlabels, const BinLabels &ylabels)
| Set the Bin labels for a given 2D profile histogram. More...
GAUDI_API bool | setAxisLabels (AIDA::IHistogram1D *hist, const std::string &xAxis, const std::string &yAxis)
| Set the axis labels for the given 1D histogram. More...
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. More...
GAUDI_API bool | setAxisLabels (AIDA::IHistogram2D *hist, const std::string &xAxis, const std::string &yAxis)
| Set the axis labels for the given 2D histogram. More...
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. More...
GAUDI_API std::string | path (const AIDA::IBaseHistogram *aida)
| get the path in THS for AIDA histogram More...
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. More...
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 More...
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 More...
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 More...
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. More...
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. More...
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 More...
GAUDI_API std::ostream & | toXml (const TH1D &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TH2D &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TH3D &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TProfile &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TProfile2D &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const AIDA::IHistogram1D &histo, std::ostream &stream)
| stream the AIDA histogram into the output stream as XML More...
GAUDI_API std::ostream & | toXml (const AIDA::IHistogram2D &histo, std::ostream &stream)
| stream the AIDA histogram into the output stream as XML More...
GAUDI_API std::ostream & | toXml (const AIDA::IHistogram3D &histo, std::ostream &stream)
| stream the AIDA histogram into the output stream as XML More...
GAUDI_API std::ostream & | toXml (const AIDA::IProfile1D &histo, std::ostream &stream)
| stream the AIDA histogram into the output stream as XML More...
GAUDI_API std::ostream & | toXml (const TH1F &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TH2F &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const TH3F &histo, std::ostream &stream)
| stream the ROOT histogram into output stream as XML More...
GAUDI_API std::ostream & | toXml (const AIDA::IProfile2D &histo, std::ostream &stream)
| stream the AIDA histogram into the output stream as XML More...
GAUDI_API StatusCode | fromXml (TH1D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH2D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH3D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TProfile &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TProfile2D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH1F &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH2F &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH3F &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH1D *&result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH2D *&result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TH3D *&result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TProfile *&result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (TProfile2D *&result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (AIDA::IHistogram1D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (AIDA::IHistogram2D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (AIDA::IHistogram3D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (AIDA::IProfile1D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...
GAUDI_API StatusCode | fromXml (AIDA::IProfile2D &result, const std::string &input)
| parse the histogram from standard ROOT XML More...

## 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 29 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 31 of file HistoLabels.h.

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

Typedef for a list of labels.

Definition at line 27 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

  histo | pointer to the histogram
  value | value to be added to the histogram
  weight | the "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 36 of file Fill.cpp.

39 {
40 if ( histo ) { histo->fill ( value , weight ) ; }
41 }

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

  histo | pointer to the histogram
  valueX | value to be added to the histogram
  valueY | value to be added to the histogram
  weight | the "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 54 of file Fill.cpp.

58 {
59 if ( histo ) { histo -> fill ( valueX , valueY , weight ) ; }
60 }
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:36

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

  histo | pointer to the histogram
  valueX | value to be added to the histogram
  valueY | value to be added to the histogram
  valueZ | value to be added to the histogram
  weight | the "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 74 of file Fill.cpp.

79 {
80 if ( histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
81 }
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:36

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

  histo | pointer to the histogram
  valueX | value to be added to the histogram
  valueY | value to be added to the histogram
  weight | the "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 94 of file Fill.cpp.

98 {
99 if ( histo ) { histo -> fill ( valueX , valueY , weight ) ; }
100 }
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:36

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

  histo | pointer to the histogram
  valueX | value to be added to the histogram
  valueY | value to be added to the histogram
  valueZ | value to be added to the histogram
  weight | the "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 114 of file Fill.cpp.

119 {
120 if ( histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
121 }
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:36

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:
std::cout <<
format ( histo , " #nEntries/Overflow/Underflow=%3%/%4%/%5%" )
<< std::endl ;
// print the formatted Mean+-ErrorMean:
std::cout <<
format ( histo , " Mean+-Error=(%8%+-%9%)" )
<< std::endl ;
// print the skewness and kurtosis:
std::cout <<
format ( histo , " Skewness/Kurtosis=%12%/%14% " )
<< std::endl ;

Parameters

  histo | reference to the histogram
  fmt | the 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 209 of file HistoTableFormat.cpp.

211 {
212 if ( 0 == histo ) { return "<NULL>" ; }
213 using namespace Gaudi::Utils ;
214 using namespace boost::io ;
215 boost::format _fmt ( fmt ) ;
216 // allow various number of arguments
217 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
218
219 _fmt
220 % ( "\"" + path ( histo ) + "\"" ) // 1) histogram path
221 % ( "\"" + histo -> title () + "\"" ) // 2) title
222 % histo -> allEntries () // 3) # entries
223 % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
224 % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
225 % histo -> equivalentBinEntries () // 6) equivalent entries
226 % histo -> sumBinHeights () // 7) integral
227 % histo -> mean () // 8) mean value
228 % HistoStats:: meanErr ( histo ) // 9) error in mean
229 % histo -> rms () // 10) rms
230 % HistoStats::rmsErr ( histo ) // 11) error in rms
231 % HistoStats::skewness ( histo ) // 12) skewness
232 % HistoStats::skewnessErr ( histo ) // 13) error in skewness
233 % HistoStats::kurtosis ( histo ) // 14) kurtosis
234 % HistoStats::kurtosisErr ( histo ) // 15) error in kurtosis
235 //
236 % histo -> sumAllBinHeights () // 16) full integral (in and out range)
237 % HistoStats::sumAllBinHeightErr ( histo ) // 17) error on 16
238 % HistoStats::sumBinHeightErr ( histo ) // 18) error on 7
239 //
240 % ( 100 * HistoStats::underflowEntriesFrac ( histo ) ) // 19) fraction of underflow entries
241 % ( 100 * HistoStats::underflowEntriesFracErr ( histo ) ) // 20) error on 19
242 % ( 100 * HistoStats::overflowEntriesFrac ( histo ) ) // 21) fraction of overflow entries
243 % ( 100 * HistoStats::overflowEntriesFracErr ( histo ) ) // 22) error on 21
244 //
245 % HistoStats::underflowIntegralFrac ( histo ) // 23) fraction of underflow integral
246 % HistoStats::underflowIntegralFracErr ( histo ) // 24) error on 23
247 % HistoStats::overflowIntegralFrac ( histo ) // 25) fraction of overflow intergal
248 % HistoStats::overflowIntegralFracErr ( histo ) ; // 26) error on 25
249 //
250 return _fmt.str() ;
251 }
Gaudi::Utils::HistoStats::underflowIntegralFracErr
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
Definition: HistoStats.cpp:411
Gaudi::Utils::HistoStats::overflowIntegralFracErr
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
Definition: HistoStats.cpp:388
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
Gaudi::Utils::HistoStats::underflowEntriesFrac
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:307
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
Gaudi::Utils::HistoStats::rmsErr
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:241
Gaudi::Utils::HistoStats::underflowIntegralFrac
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
Definition: HistoStats.cpp:336
Gaudi::Utils::HistoStats::meanErr
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:223
Gaudi::Utils::HistoStats::overflowIntegralFrac
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
Definition: HistoStats.cpp:322
GaudiPython.HistoUtils.mean
mean
Definition: HistoUtils.py:737
Gaudi::Utils::HistoStats::overflowEntriesFrac
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:292
Gaudi::Utils::HistoStats::sumBinHeightErr
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
Definition: HistoStats.cpp:255
Gaudi::Utils::HistoStats::overflowEntriesFracErr
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:350
Gaudi::Utils::HistoStats::sumAllBinHeightErr
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
Definition: HistoStats.cpp:276
Gaudi::Utils::HistoStats::kurtosisErr
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:192
Gaudi::Utils::HistoStats::skewnessErr
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:169
Gaudi::Utils
Definition: Fill.h:24
Gaudi::Utils::HistoStats::underflowEntriesFracErr
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:369
Gaudi::Utils::HistoStats::kurtosis
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:181
Gaudi::Utils::HistoStats::skewness
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:158
GaudiPython.HistoUtils.rms
rms
Definition: HistoUtils.py:739

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

  histo | pointer to the histogram
  ID | historgam ID, title, label or other extra information
  fmt1 | "short" format used for the table
  fmt2 | format 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 258 of file HistoTableFormat.cpp.

262 {
263 using namespace boost::io ;
264 boost::format _fmt ( fmt1 ) ;
265 // allow various number of arguments
266 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
267 //
268 _fmt
269 % ID // format ID
270 % format ( histo , fmt2 ) ; // format the histogram
271 //
272 return _fmt.str() ;
273 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119

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

281 {
282 using namespace boost::io ;
283 boost::format _fmt ( fmt ) ;
284 // allow various number of arguments
285 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
286 //
287 _fmt
288 % val1 // format ID
289 % val2 ; // format the histogram
290 //
291 return _fmt.str() ;
292 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119

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 229 of file HistoXML.cpp.

230 {
231 //
232 result.Reset() ; // RESET old histogram
233 //
234
235 auto histo = _Xml<TH1D>( input ) ;
236 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
237 //
238 histo->Copy ( result ) ;
239 //
240 return StatusCode::SUCCESS ;
241 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 250 of file HistoXML.cpp.

251 {
252 //
253 result.Reset() ; // RESET old histogram
254 //
255 auto histo = _Xml<TH2D>( input ) ;
256 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
257 //
258 histo->Copy ( result ) ;
259 //
260 return StatusCode::SUCCESS ;
261 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 270 of file HistoXML.cpp.

271 {
272 //
273 result.Reset() ; // RESET old histogram
274 //
275 auto histo = _Xml<TH3D>( input ) ;
276 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
277 //
278 histo->Copy ( result ) ;
279 //
280 return StatusCode::SUCCESS ;
281 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 350 of file HistoXML.cpp.

351 {
352 //
353 result.Reset() ; // RESET old histogram
354 //
355 auto histo = _Xml<TProfile>( input ) ;
356 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
357 //
358 histo->Copy ( result ) ;
359 //
360 return StatusCode::SUCCESS ;
361 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 370 of file HistoXML.cpp.

371 {
372 //
373 result.Reset() ; // RESET old histogram
374 //
375 auto histo = _Xml<TProfile2D>( input ) ;
376 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
377 //
378 histo->Copy ( result ) ;
379 //
380 return StatusCode::SUCCESS ;
381 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 290 of file HistoXML.cpp.

291 {
292 //
293 result.Reset() ; // RESET old histogram
294 //
295 auto histo = _Xml<TH1F>( input ) ;
296 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
297 //
298 histo->Copy ( result ) ;
299 //
300 return StatusCode::SUCCESS ;
301 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 310 of file HistoXML.cpp.

311 {
312 //
313 result.Reset() ; // RESET old histogram
314 //
315 auto histo = _Xml<TH2F>( input ) ;
316 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
317 //
318 histo->Copy ( result ) ;
319 //
320 return StatusCode::SUCCESS ;
321 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 330 of file HistoXML.cpp.

331 {
332 //
333 result.Reset() ; // RESET old histogram
334 //
335 auto histo =_Xml<TH3F>( input ) ;
336 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
337 //
338 histo->Copy ( result ) ;
339 //
340 return StatusCode::SUCCESS ;
341 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29

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 392 of file HistoXML.cpp.

393 {
394 if ( result ) { return fromXml ( *result , input ) ; }
395 //
396 auto histo = _Xml<TH1D>( input ) ;
397 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
398 //
399 result = histo.release() ; // ASSIGN
400 //
401 return StatusCode::SUCCESS ;
402 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
StatusCode::FAILURE
Definition: StatusCode.h:29

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 411 of file HistoXML.cpp.

412 {
413 if ( result ) { return fromXml ( *result , input ) ; }
414 //
415 auto histo = _Xml<TH2D>( input ) ;
416 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
417 //
418 result = histo.release() ; // ASSIGN
419 //
420 return StatusCode::SUCCESS ;
421 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
StatusCode::FAILURE
Definition: StatusCode.h:29

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 430 of file HistoXML.cpp.

431 {
432 if ( result ) { return fromXml ( *result , input ) ; }
433 //
434 auto histo = _Xml<TH3D>( input ) ;
435 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
436 //
437 result = histo.release() ; // ASSIGN
438 //
439 return StatusCode::SUCCESS ;
440 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
StatusCode::FAILURE
Definition: StatusCode.h:29

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 450 of file HistoXML.cpp.

451 {
452 if ( result ) { return fromXml ( *result , input ) ; }
453 //
454 auto histo = _Xml<TProfile>( input ) ;
455 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
456 //
457 result = histo.release() ; // ASSIGN
458 //
459 return StatusCode::SUCCESS ;
460 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
StatusCode::FAILURE
Definition: StatusCode.h:29

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 469 of file HistoXML.cpp.

470 {
471 if ( result ) { return fromXml ( *result , input ) ; }
472 //
473 auto histo = _Xml<TProfile2D>( input ) ;
474 if ( !histo ) { return StatusCode::FAILURE ; } // RETURN
475 //
476 result = histo.release() ; // ASSIGN
477 //
478 return StatusCode::SUCCESS ;
479 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
StatusCode::FAILURE
Definition: StatusCode.h:29

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 488 of file HistoXML.cpp.

489 {
490 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
491 return root ? fromXml ( *root , input ) : StatusCode::FAILURE ; // RETURN
492 }
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 501 of file HistoXML.cpp.

502 {
503 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
504 return root ? fromXml ( *root , input ) : StatusCode::FAILURE; // RETURN
505 }
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 514 of file HistoXML.cpp.

515 {
516 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
517 return root ? fromXml ( *root , input ) : StatusCode::FAILURE; // RETURN
518 }
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 527 of file HistoXML.cpp.

528 {
529 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
530 return root ? fromXml ( *root , input ) : StatusCode::FAILURE; // RETURN
531 }
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 540 of file HistoXML.cpp.

541 {
542 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
543 return root ? fromXml ( *root , input ) : StatusCode::FAILURE; // RETURN
544 }
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GaudiPython.Bindings.FAILURE
FAILURE
Definition: Bindings.py:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 699 of file HistoDump.cpp.

703 {
704 std::ostringstream stream ;
705 histoDump_ ( histo , stream , width , height , errors );
706 return stream.str() ;
707 }
Gaudi::Utils::Histos::histoDump_
GAUDI_API std::ostream & 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
Definition: HistoDump.cpp:610
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

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 796 of file HistoDump.cpp.

800 {
801 std::ostringstream stream ;
802 histoDump_ ( histo , stream , width , height , spread );
803 return stream.str() ;
804 }
Gaudi::Utils::Histos::histoDump_
GAUDI_API std::ostream & 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
Definition: HistoDump.cpp:610
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

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 965 of file HistoDump.cpp.

968 {
969 std::ostringstream stream ;
970 histoDump_ ( histo , stream , width , height );
971 return stream.str() ;
972 }
Gaudi::Utils::Histos::histoDump_
GAUDI_API std::ostream & 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
Definition: HistoDump.cpp:610
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

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 945 of file HistoDump.cpp.

949 {
950 std::ostringstream stream ;
951 histoDump_ ( histo , stream , width , height , errors );
952 return stream.str() ;
953 }
Gaudi::Utils::Histos::histoDump_
GAUDI_API std::ostream & 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
Definition: HistoDump.cpp:610
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

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 610 of file HistoDump.cpp.

615 {
616 stream << std::endl ;
617 if ( !histo ) { return stream ; } // RETURN
618 Histo hist ;
619 StatusCode sc = _getHisto ( histo , hist ) ;
620 if ( sc.isFailure() ) { return stream ; } // RETURN
621 //
622 stream
623 << boost::format ( " Histo TES : \"%s\"") % path ( histo )
624 << std::endl
625 << boost::format ( " Histo Title : \"%s\"") % histo->title()
626 << std::endl
627 << std::endl ;
628 //
629 stream
630 << boost::format ( " Mean : %11.5g +- %-10.4g ")
631 % Gaudi::Utils::HistoStats::mean ( histo )
632 % Gaudi::Utils::HistoStats::meanErr ( histo )
633 << std::endl
634 << boost::format ( " Rms : %11.5g +- %-10.4g ")
635 % Gaudi::Utils::HistoStats::rms ( histo )
636 % Gaudi::Utils::HistoStats::rmsErr ( histo )
637 << std::endl
638 << boost::format ( " Skewness : %11.5g +- %-10.4g ")
639 % Gaudi::Utils::HistoStats::skewness ( histo )
640 % Gaudi::Utils::HistoStats::skewnessErr ( histo )
641 << std::endl
642 << boost::format ( " Kurtosis : %11.5g +- %-10.4g ")
643 % Gaudi::Utils::HistoStats::kurtosis ( histo )
644 % Gaudi::Utils::HistoStats::kurtosisErr ( histo )
645 << std::endl
646 << std::endl ;
647 //
648 stream
649 << boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
650 % "All"
651 % "In Range"
652 % "Underflow"
653 % "Overflow"
654 % "#Equivalent"
655 % "Integral"
656 % "Total"
657 << std::endl
658 << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
659 % histo -> allEntries ()
660 % histo -> entries ()
661 % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
662 % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
663 % histo -> equivalentBinEntries ()
664 % histo -> sumBinHeights ()
665 % histo -> sumAllBinHeights ()
666 << std::endl
667 << std::endl ;
668 //
669 const AIDA::IAnnotation& a = histo->annotation () ;
670 if ( 0 != a.size() )
671 {
672 stream << " Annotation" << std::endl ;
673 for ( int i = 0 ; i < a.size() ; ++i )
674 {
675 stream
676 << boost::format ( " | %-25.25s : %-45.45s | ")
677 % a.key ( i )
678 % a.value ( i )
679 << std::endl ;
680 }
681 stream << std::endl ;
682 }
683 //
684 return dumpText ( hist , width , height , errors , stream ) ;
685 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
Gaudi::Utils::HistoStats::rmsErr
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:241
std::endl
T endl(T...args)
Gaudi::Utils::HistoStats::meanErr
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:223
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
Gaudi::Utils::HistoStats::rms
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
Definition: HistoStats.cpp:233
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::HistoStats::kurtosisErr
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:192
Gaudi::Utils::HistoStats::mean
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
Definition: HistoStats.cpp:215
Gaudi::Utils::HistoStats::skewnessErr
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:169
Gaudi::Utils::HistoStats::kurtosis
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:181
Gaudi::Utils::HistoStats::skewness
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:158

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 721 of file HistoDump.cpp.

726 {
727 stream << std::endl ;
728 if ( !histo ) { return stream ; } // RETURN
729 Histo hist ;
730 StatusCode sc = _getHisto ( histo , hist , spread ) ;
731 if ( sc.isFailure() ) { return stream ; } // RETURN
732 //
733 stream
734 << boost::format ( " Histo TES : \"%s\"") % path ( histo )
735 << std::endl
736 << boost::format ( " Histo Title : \"%s\"") % histo->title()
737 << std::endl
738 << std::endl ;
739 //
740 stream
741 << boost::format ( " Mean : %11.5g ") % histo->mean()
742 << std::endl
743 << boost::format ( " Rms : %11.5g ") % histo->rms ()
744 << std::endl
745 << std::endl ;
746 //
747 stream
748 << boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |")
749 % "All"
750 % "In Range"
751 % "Underflow"
752 % "Overflow"
753 // % "#Equivalent"
754 % "Integral"
755 % "Total"
756 << std::endl
757 << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |")
758 % histo -> allEntries ()
759 % histo -> entries ()
760 % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
761 % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
762 // % histo -> equivalentBinEntries ()
763 % histo -> sumBinHeights ()
764 % histo -> sumAllBinHeights ()
765 << std::endl
766 << std::endl ;
767 //
768 const AIDA::IAnnotation& a = histo->annotation () ;
769 if ( 0 != a.size() )
770 {
771 stream << " Annotation" << std::endl ;
772 for ( int i = 0 ; i < a.size() ; ++i )
773 {
774 stream
775 << boost::format ( " | %-25.25s : %-45.45s | ")
776 % a.key ( i )
777 % a.value ( i )
778 << std::endl ;
779 }
780 stream << std::endl ;
781 }
782 //
783 return dumpText ( hist , width , height , true , stream ) ;
784 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
std::endl
T endl(T...args)
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26

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 890 of file HistoDump.cpp.

894 {
895 stream << std::endl ;
896 if ( ! histo ) { return stream ; } // RETURN
897 Histo hist ;
898 StatusCode sc = _getHisto ( histo , hist , true ) ;
899 if ( sc.isFailure() ) { return stream ; } // RETURN
900 //
901 stream
902 << boost::format ( " Profile Name : \"%s\"")
903 % histo -> GetName ()
904 << std::endl
905 << boost::format ( " Profile Title : \"%s\"")
906 % histo -> GetTitle ()
907 << std::endl
908 << std::endl ;
909 //
910 stream
911 << boost::format ( " Mean : %11.5g ") % histo -> GetMean ()
912 << std::endl
913 << boost::format ( " Rms : %11.5g ") % histo -> GetRMS ()
914 << std::endl
915 << std::endl ;
916 //
917 stream
918 << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s |")
919 % "All"
920 % "Underflow"
921 % "Overflow"
922 % "Integral"
923 << std::endl
924 << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
925 % histo -> GetEntries ()
926 % histo -> GetBinContent ( 0 )
927 % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
928 % histo -> Integral ()
929 << std::endl
930 << std::endl ;
931 //
932 return dumpText ( hist , width , height , true , stream ) ;
933 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
std::endl
T endl(T...args)
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiMath::Integral
GAUDI_API double Integral(const Genfun::AbsFunction &function, const double a, const double b, const GaudiMath::Integration::Type type=GaudiMath::Integration::Adaptive, const GaudiMath::Integration::KronrodRule rule=GaudiMath::Integration::Default, const double epsabs=1.e-10, const double epsrel=1.e-7, const size_t size=1000)
Definition: Integral.cpp:27

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 817 of file HistoDump.cpp.

822 {
823 const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
824 if ( profile )
825 { return histoDump_ ( profile , stream , width , height ) ; }
826 //
827 stream << std::endl ;
828 if ( !histo ) { return stream ; } // RETURN
829 Histo hist ;
830 StatusCode sc = _getHisto ( histo , hist ) ;
831 if ( sc.isFailure() ) { return stream ; } // RETURN
832 //
833 stream
834 << boost::format ( " Histo Name : \"%s\"")
835 % histo -> GetName ()
836 << std::endl
837 << boost::format ( " Histo Title : \"%s\"")
838 % histo -> GetTitle ()
839 << std::endl
840 << std::endl ;
841 //
842 stream
843 << boost::format ( " Mean : %11.5g +- %-10.4g ")
844 % histo -> GetMean ()
845 % histo -> GetMeanError ()
846 << std::endl
847 << boost::format ( " Rms : %11.5g +- %-10.4g ")
848 % histo -> GetRMS ()
849 % histo -> GetRMSError ()
850 << std::endl
851 << boost::format ( " Skewness : %11.5g ")
852 % histo -> GetSkewness ()
853 << std::endl
854 << boost::format ( " Kurtosis : %11.5g ")
855 % histo -> GetKurtosis ()
856 << std::endl
857 << std::endl ;
858 //
859 stream
860 << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
861 % "All"
862 % "Underflow"
863 % "Overflow"
864 % "#Equivalent"
865 % "Integral"
866 << std::endl
867 << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
868 % histo -> GetEntries ()
869 % histo -> GetBinContent ( 0 )
870 % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
871 % histo -> GetEffectiveEntries ()
872 % histo -> Integral ()
873 << std::endl
874 << std::endl ;
875 //
876 return dumpText ( hist , width , height , errors , stream ) ;
877 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
Gaudi::Utils::Histos::histoDump_
GAUDI_API std::ostream & 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
Definition: HistoDump.cpp:610
std::endl
T endl(T...args)
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiMath::Integral
GAUDI_API double Integral(const Genfun::AbsFunction &function, const double a, const double b, const GaudiMath::Integration::Type type=GaudiMath::Integration::Adaptive, const GaudiMath::Integration::KronrodRule rule=GaudiMath::Integration::Default, const double epsabs=1.e-10, const double epsrel=1.e-7, const size_t size=1000)
Definition: Integral.cpp:27

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IBaseHistogram * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 138 of file Fill.cpp.

140 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IHistogram * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 145 of file Fill.cpp.

147 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IHistogram1D * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 152 of file Fill.cpp.

154 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IHistogram2D * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 159 of file Fill.cpp.

161 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IHistogram3D * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 166 of file Fill.cpp.

168 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IProfile * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 173 of file Fill.cpp.

175 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IProfile1D * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 180 of file Fill.cpp.

182 { return htitle_ ( histo , title ) ; }

std::string Gaudi::Utils::Histos::htitle | ( | const AIDA::IProfile2D * | histo,
|  | const std::string & | title = `""`
| ) |  |

get the title

Definition at line 187 of file Fill.cpp.

189 { 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 191 of file HistoTableFormat.cpp.

192 {
193 if ( 0 == aida ) { return "" ; } // RETURN
194 const DataObject* object = dynamic_cast<const DataObject*>( aida ) ;
195 if ( 0 == object ) { return "" ; } // RETURN
196 IRegistry* registry = object->registry() ;
197 if ( 0 == registry ) { return "" ; } // RETURN
198 std::string _path = registry->identifier() ;
199 std::string::size_type n = _path.find("/stat/") ;
200 if ( 0 == n ) { return std::string(_path,6) ; } // RETURN
201 return _path ; // RETURN
202 }
std::string
STL class.
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:217
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:63
std::string::find
T find(T...args)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
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
Gaudi::Utils::Histos::printList
( histos.begin () ,
histos.end () ,
" | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
std::cout ,
'\n' ) ;

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
  fmt | the format to be used

Definition at line 231 of file HistoTableFormat.h.

236 {
237 for ( ; first != last ; ++first )
238 { stream << format ( *first , fmt ) << term ; } // print table rows
239 return stream ; // RETURN
240 }
Gaudi::Utils::Histos::format
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
Definition: HistoTableFormat.cpp:278
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
printList
( histos ,
" | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
std::cout ,
'\n' ) ;

Parameters

  histos | the sequence of histograms
  stream | the stream to be used for printout
  term | the terminmator for the stream
  fmt | the format to be used

Definition at line 267 of file HistoTableFormat.h.

271 {
272 return printList
273 ( histos.begin () , histos.end () , fmt , stream , term ) ;
274 }
compareRootHistos.histos
list histos
Definition: compareRootHistos.py:13
Gaudi::Utils::Histos::printList
STREAM & printList(const LIST &histos, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple container of histograms as table
Definition: HistoTableFormat.h:267
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 ;
const std::map<std::string,AIDA::IHistogram1D*>& m = ... ;
printMap
( 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 ;
const std::map<GaudiAlg::ID,AIDA::IHistogram1D*>& m = ... ;
printMap
( 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
  fmt3 | format for the printout of the histogram
  stream | the stream for printout
  term | stream terminator

Definition at line 322 of file HistoTableFormat.h.

328 {
329 for ( ; begin != end ; ++begin )
330 {
331 stream << format
332 ( begin -> second , // the histogram
333 begin -> first , // the key
334 fmt1 , fmt2 ) << term ;
335 }
336 return stream ;
337 }
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:48
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:122
Gaudi::Utils::Histos::format
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
Definition: HistoTableFormat.cpp:278
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:50
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 ;
const std::map<std::string,AIDA::IHistogram1D*>& m = ... ;
printMap
( m ,
"| %1$-10.10s | %2% " , // short format
Gaudi::Utils::Histos::Formats::histoFormatOnly ,
always() ,
endmsg ) ;

Print only mean and rms:

using namespace Gaudi::Utils::Histos ;
const std::map<GaudiAlg::ID,AIDA::IHistogram1D*>& m = ... ;
printMap
( 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
  fmt3 | format for the printout of the histogram
  stream | the stream for printout
  term | stream terminator

Definition at line 383 of file HistoTableFormat.h.

388 {
389 return printMap
390 ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
391 }
Gaudi::Utils::Histos::printMap
STREAM & printMap(const MAP &histos, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
Definition: HistoTableFormat.h:383
compareRootHistos.histos
list histos
Definition: compareRootHistos.py:13

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

  hist | Pointer to the histogram
  xAxis | Label for the x axis
  yAxis | Label for the y axis

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 186 of file HistoLabels.cpp.

189 {
190 return setAxisLabels_<TH1D>( hist, xAxis, yAxis );
191 }

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

  hist | Pointer to the histogram
  xAxis | Label for the x axis
  yAxis | Label for the y axis

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 193 of file HistoLabels.cpp.

196 {
197 return setAxisLabels_<TProfile>( hist, xAxis, yAxis );
198 }

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

  hist | Pointer to the histogram
  xAxis | Label for the x axis
  yAxis | Label for the y axis

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 200 of file HistoLabels.cpp.

203 {
204 return setAxisLabels_<TH2D>( hist, xAxis, yAxis );
205 }

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

  hist | Pointer to the histogram
  xAxis | Label for the x axis
  yAxis | Label for the y axis

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 207 of file HistoLabels.cpp.

210 {
211 return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
212 }

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

  hist | Pointer to the histogram
  labels | The list of labels

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 106 of file HistoLabels.cpp.

108 {
109 return setBinLabels_(hist,labels);
110 }

bool Gaudi::Utils::Histos::setBinLabels | ( | AIDA::IHistogram1D * | hist,
|  | const BinLabels & | labels
| ) |  |

Set the Bin labels for a given 1D histogram.

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

Parameters

  hist | Pointer to the histogram
  labels | The list of labels

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 94 of file HistoLabels.cpp.

96 {
97 return setBinLabels_<TH1D>(hist,labels);
98 }

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

  hist | Pointer to the histogram
  labels | The list of labels

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 112 of file HistoLabels.cpp.

114 {
115 return setBinLabels_(hist,labels);
116 }

bool Gaudi::Utils::Histos::setBinLabels | ( | AIDA::IProfile1D * | hist,
|  | const BinLabels & | labels
| ) |  |

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

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

Parameters

  hist | Pointer to the histogram
  labels | The list of bin numbers and the associated label

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 100 of file HistoLabels.cpp.

102 {
103 return setBinLabels_<TProfile>(hist,labels);
104 }

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

  hist | Pointer to the histogram
  xlabels | The list of x labels
  ylabels | The list of y labels

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 118 of file HistoLabels.cpp.

121 {
122 if (!hist) return false;
123 TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
124 if (!h2d) return false;
125 BinLabels lx;
126 lx.reserve(xlabels.size());
127 for ( unsigned int i = 0; i < xlabels.size(); ++i )
128 {
129 lx.emplace_back( i , xlabels[i] );
130 }
131 BinLabels ly;
132 ly.reserve(ylabels.size());
133 for ( unsigned int i = 0; i < ylabels.size(); ++i )
134 {
135 ly.emplace_back( i , ylabels[i] );
136 }
137 return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
138 setBinLabels_( h2d->GetYaxis(), ly ) );
139 }
Gaudi::Utils::Histos::BinLabels
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:31
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72

bool Gaudi::Utils::Histos::setBinLabels | ( | AIDA::IHistogram2D * | hist,
|  | const BinLabels & | xlabels,
|  | const BinLabels & | ylabels
| ) |  |

Set the Bin labels for a given 2D histogram.

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

Parameters

  hist | Pointer to the histogram
  xlabels | The list of x bin numbers and the associated label
  ylabels | The list of y bin numbers and the associated label

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 141 of file HistoLabels.cpp.

144 {
145 TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
146 return ( h2d &&
147 setBinLabels_( h2d->GetXaxis(), xlabels ) &&
148 setBinLabels_( h2d->GetYaxis(), ylabels ) );
149 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72

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

  hist | Pointer to the histogram
  xlabels | The list of x labels
  ylabels | The list of y labels

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 151 of file HistoLabels.cpp.

154 {
155 if (!hist) return false;
156 TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
157 if (!h2d) return false;
158 BinLabels lx;
159 lx.reserve(xlabels.size());
160 for ( unsigned int i = 0; i < xlabels.size(); ++i )
161 {
162 lx.emplace_back( i , xlabels[i] );
163 }
164 BinLabels ly;
165 ly.reserve(ylabels.size());
166 for ( unsigned int i = 0; i < ylabels.size(); ++i )
167 {
168 ly.emplace_back( i , ylabels[i] );
169 }
170 return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
171 setBinLabels_( h2d->GetYaxis(), ly ) );
172 }
Gaudi::Utils::Histos::BinLabels
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:31
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72

bool Gaudi::Utils::Histos::setBinLabels | ( | AIDA::IProfile2D * | hist,
|  | const BinLabels & | xlabels,
|  | const BinLabels & | ylabels
| ) |  |

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

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

Parameters

  hist | Pointer to the histogram
  xlabels | The list of x bin numbers and the associated label
  ylabels | The list of y bin numbers and the associated label

Returns
  Boolean indicating if the labels were successfully applied or not

Return values

  TRUE | Labels were applied OK
  FALSE | Labels were NOT applied

Definition at line 174 of file HistoLabels.cpp.

177 {
178 TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
179 return ( h2d &&
180 setBinLabels_( h2d->GetXaxis(), xlabels ) &&
181 setBinLabels_( h2d->GetYaxis(), ylabels ) );
182 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72

AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase | ( | AIDA::IHistogram1D * | histo | ) |

Definition at line 193 of file Fill.cpp.

193 { return histo ; }

AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase | ( | AIDA::IHistogram2D * | histo | ) |

Definition at line 197 of file Fill.cpp.

197 { return histo ; }

AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase | ( | AIDA::IHistogram3D * | histo | ) |

Definition at line 201 of file Fill.cpp.

201 { return histo ; }

AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase | ( | AIDA::IProfile1D * | histo | ) |

Definition at line 205 of file Fill.cpp.

205 { return histo ; }

AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase | ( | AIDA::IProfile2D * | histo | ) |

Definition at line 209 of file Fill.cpp.

209 { 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 67 of file HistoXML.cpp.

69 {
70 return stream << TBufferXML::ConvertToXML( &histo ) ;
71 }

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 79 of file HistoXML.cpp.

81 {
82 return stream << TBufferXML::ConvertToXML( &histo ) ;
83 }

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 91 of file HistoXML.cpp.

93 {
94 return stream << TBufferXML::ConvertToXML( &histo ) ;
95 }

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 139 of file HistoXML.cpp.

141 {
142 return stream << TBufferXML::ConvertToXML( &histo ) ;
143 }

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 151 of file HistoXML.cpp.

153 {
154 return stream << TBufferXML::ConvertToXML ( &histo ) ;
155 }

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 163 of file HistoXML.cpp.

165 {
166 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &histo ) ;
167 return root ? toXml( *root , stream ) : stream;
168 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 176 of file HistoXML.cpp.

178 {
179 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &histo ) ;
180 return root ? toXml( *root , stream ) : stream;
181 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 189 of file HistoXML.cpp.

191 {
192 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &histo ) ;
193 return root ? toXml( *root , stream ) : stream;
194 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 202 of file HistoXML.cpp.

204 {
205 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &histo ) ;
206 return root ? toXml( *root , stream ) : stream;
207 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14

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 103 of file HistoXML.cpp.

105 {
106 return stream << TBufferXML::ConvertToXML( &histo ) ;
107 }

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 115 of file HistoXML.cpp.

117 {
118 return stream << TBufferXML::ConvertToXML( &histo ) ;
119 }

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 127 of file HistoXML.cpp.

129 {
130 return stream << TBufferXML::ConvertToXML( &histo ) ;
131 }

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 215 of file HistoXML.cpp.

217 {
218 auto root = Gaudi::Utils::Aida2ROOT::aida2root ( &histo ) ;
219 return root ? toXml( *root , stream ) : stream;
220 }
Gaudi::Utils::Aida2ROOT::aida2root
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:14