The Gaudi Framework  v33r0 (d5ea422b)
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::stringLabels
 Typedef for a list of labels. More...
 
typedef std::pair< unsigned, std::stringBinLabel
 Typedef for a bin number and its associated label. More...
 
typedef std::vector< BinLabelBinLabels
 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::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 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::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 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::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 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::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 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 histogram according to the specified format. More...
 
GAUDI_API std::string format (const AIDA::IProfile1D *histo, const std::string &fmt)
 Make the string representation of the profile histogram 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...
 
GAUDI_API std::string format (const AIDA::IProfile1D *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::ostreamtoXml (const TH1D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TH2D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TH3D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TProfile &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TProfile2D &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram1D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram2D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const AIDA::IHistogram3D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const AIDA::IProfile1D &histo, std::ostream &stream)
 stream the AIDA histogram into the output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TH1F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TH2F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (const TH3F &histo, std::ostream &stream)
 stream the ROOT histogram into output stream as XML More...
 
GAUDI_API std::ostreamtoXml (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

◆ BinLabel

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

Typedef for a bin number and its associated label.

Definition at line 35 of file HistoLabels.h.

◆ BinLabels

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

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

Definition at line 37 of file HistoLabels.h.

◆ Labels

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

Typedef for a list of labels.

Definition at line 33 of file HistoLabels.h.

Function Documentation

◆ fill() [1/5]

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 45 of file Fill.cpp.

45  {
46  if ( histo ) { histo->fill( value, weight ); }
47 }

◆ fill() [2/5]

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 59 of file Fill.cpp.

60  {
61  if ( histo ) { histo->fill( valueX, valueY, weight ); }
62 }

◆ fill() [3/5]

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.

76  {
77  if ( histo ) { histo->fill( valueX, valueY, valueZ, weight ); }
78 }

◆ fill() [4/5]

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 90 of file Fill.cpp.

91  {
92  if ( histo ) { histo->fill( valueX, valueY, weight ); }
93 }

◆ fill() [5/5]

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 106 of file Fill.cpp.

107  {
108  if ( histo ) { histo->fill( valueX, valueY, valueZ, weight ); }
109 }

◆ format() [1/5]

std::string Gaudi::Utils::Histos::format ( const AIDA::IHistogram1D *  histo,
const std::string fmt 
)

Make the string representation of the histogram 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 244 of file HistoTableFormat.cpp.

244  {
245  if ( !histo ) { return "<NULL>"; }
246  using namespace Gaudi::Utils;
247  using namespace boost::io;
248  boost::format _fmt( fmt );
249  // allow various number of arguments
250  _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
251 
252  _fmt % ( "\"" + path( histo ) + "\"" ) // 1) histogram path
253  % ( "\"" + _title( histo ) + "\"" ) // 2) title
254  % histo->allEntries() // 3) # entries
255  % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
256  % histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
257  % HistoStats::nEff( histo ) // 6) equivalent entries
258  % histo->sumBinHeights() // 7) integral
259  % HistoStats::mean( histo ) // 8) mean value
260  % HistoStats::meanErr( histo ) // 9) error in mean
261  % HistoStats::rms( histo ) // 10) rms
262  % HistoStats::rmsErr( histo ) // 11) error in rms
263  % HistoStats::skewness( histo ) // 12) skewness
264  % HistoStats::skewnessErr( histo ) // 13) error in skewness
265  % HistoStats::kurtosis( histo ) // 14) kurtosis
266  % HistoStats::kurtosisErr( histo ) // 15) error in kurtosis
267  //
268  % histo->sumAllBinHeights() // 16) full integral (in and out range)
269  % HistoStats::sumAllBinHeightErr( histo ) // 17) error on 16
270  % HistoStats::sumBinHeightErr( histo ) // 18) error on 7
271  //
272  % ( 100 * HistoStats::underflowEntriesFrac( histo ) ) // 19) fraction of underflow entries
273  % ( 100 * HistoStats::underflowEntriesFracErr( histo ) ) // 20) error on 19
274  % ( 100 * HistoStats::overflowEntriesFrac( histo ) ) // 21) fraction of overflow entries
275  % ( 100 * HistoStats::overflowEntriesFracErr( histo ) ) // 22) error on 21
276  //
277  % HistoStats::underflowIntegralFrac( histo ) // 23) fraction of underflow integral
278  % HistoStats::underflowIntegralFracErr( histo ) // 24) error on 23
279  % HistoStats::overflowIntegralFrac( histo ) // 25) fraction of overflow intergal
280  % HistoStats::overflowIntegralFracErr( histo ) // 26) error on 25
281  ;
282 
283  return _fmt.str();
284 }
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
Definition: HistoStats.cpp:775
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
Definition: HistoStats.cpp:763
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:703
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:661
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
Definition: HistoStats.cpp:727
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:645
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
Definition: HistoStats.cpp:715
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
Definition: HistoStats.cpp:653
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:691
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
Definition: HistoStats.cpp:669
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:739
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
Definition: HistoStats.cpp:679
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:621
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
Definition: HistoStats.cpp:637
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:605
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:751
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:613
static double nEff(const AIDA::IHistogram1D *histo)
get the effective entries (just for completeness)
Definition: HistoStats.cpp:629
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:597

◆ format() [2/5]

std::string Gaudi::Utils::Histos::format ( const AIDA::IProfile1D *  histo,
const std::string fmt 
)

Make the string representation of the profile histogram according to the specified format.

The method could be used to access/print various quantities

using namespace Gaudi::Utils::Histos ;
const AIDA::IProfile1D* 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 ;
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 290 of file HistoTableFormat.cpp.

290  {
291  if ( !histo ) { return "<NULL>"; }
292  using namespace Gaudi::Utils;
293  using namespace boost::io;
294  boost::format _fmt( fmt );
295  // allow various number of arguments
296  _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
297 
298  _fmt % ( "\"" + path( histo ) + "\"" ) // 1) histogram path
299  % ( "\"" + _title( histo ) + "\"" ) // 2) title
300  % histo->allEntries() // 3) # entries
301  % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
302  % histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
303  % HistoStats::nEff( histo ) // 6) equivalent entries
304  % histo->sumBinHeights() // 7) integral
305  % HistoStats::mean( histo ) // 8) mean value
306  % HistoStats::meanErr( histo ) // 9) error in mean
307  % HistoStats::rms( histo ) // 10) rms
308  % HistoStats::rmsErr( histo ) // 11) error in rms
309  % HistoStats::skewness( histo ) // 12) skewness
310  % HistoStats::skewnessErr( histo ) // 13) error in skewness
311  % HistoStats::kurtosis( histo ) // 14) kurtosis
312  % HistoStats::kurtosisErr( histo ) // 15) error in kurtosis
313  //
314  % histo->sumAllBinHeights() // 16) full integral (in and out range)
315  % HistoStats::sumAllBinHeightErr( histo ) // 17) error on 16
316  % HistoStats::sumBinHeightErr( histo ) // 18) error on 7
317  //
318  % ( 100 * HistoStats::underflowEntriesFrac( histo ) ) // 19) fraction of underflow entries
319  % ( 100 * HistoStats::underflowEntriesFracErr( histo ) ) // 20) error on 19
320  % ( 100 * HistoStats::overflowEntriesFrac( histo ) ) // 21) fraction of overflow entries
321  % ( 100 * HistoStats::overflowEntriesFracErr( histo ) ) // 22) error on 21
322  //
323  % HistoStats::underflowIntegralFrac( histo ) // 23) fraction of underflow integral
324  % HistoStats::underflowIntegralFracErr( histo ) // 24) error on 23
325  % HistoStats::overflowIntegralFrac( histo ) // 25) fraction of overflow intergal
326  % HistoStats::overflowIntegralFracErr( histo ) // 26) error on 25
327  ;
328 
329  return _fmt.str();
330 }
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
Definition: HistoStats.cpp:775
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
Definition: HistoStats.cpp:763
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:703
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:661
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
Definition: HistoStats.cpp:727
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:645
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
Definition: HistoStats.cpp:715
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
Definition: HistoStats.cpp:653
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:691
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
Definition: HistoStats.cpp:669
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:739
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
Definition: HistoStats.cpp:679
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:621
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
Definition: HistoStats.cpp:637
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:605
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:751
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:613
static double nEff(const AIDA::IHistogram1D *histo)
get the effective entries (just for completeness)
Definition: HistoStats.cpp:629
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:597

◆ format() [3/5]

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

337  {
338  using namespace boost::io;
339  boost::format _fmt( fmt1 );
340  // allow various number of arguments
341  _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
342  //
343  _fmt % ID // format ID
344  % format( histo, fmt2 ); // format the histogram
345  //
346  return _fmt.str();
347 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119

◆ format() [4/5]

std::string Gaudi::Utils::Histos::format ( const AIDA::IProfile1D *  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::IProfile1D* 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 353 of file HistoTableFormat.cpp.

354  {
355  using namespace boost::io;
356  boost::format _fmt( fmt1 );
357  // allow various number of arguments
358  _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
359  //
360  _fmt % ID // format ID
361  % format( histo, fmt2 ); // format the histogram
362  //
363  return _fmt.str();
364 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119

◆ format() [5/5]

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

368  {
369  using namespace boost::io;
370  boost::format _fmt( fmt );
371  // allow various number of arguments
372  _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
373  //
374  _fmt % val1 // format ID
375  % val2; // format the histogram
376  //
377  return _fmt.str();
378 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119

◆ fromXml() [1/18]

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

197  {
198  //
199  result.Reset(); // RESET old histogram
200  //
201 
202  auto histo = _Xml<TH1D>( input );
203  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
204  //
205  histo->Copy( result );
206  //
207  return StatusCode::SUCCESS;
208 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [2/18]

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

216  {
217  //
218  result.Reset(); // RESET old histogram
219  //
220  auto histo = _Xml<TH2D>( input );
221  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
222  //
223  histo->Copy( result );
224  //
225  return StatusCode::SUCCESS;
226 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [3/18]

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

234  {
235  //
236  result.Reset(); // RESET old histogram
237  //
238  auto histo = _Xml<TH3D>( input );
239  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
240  //
241  histo->Copy( result );
242  //
243  return StatusCode::SUCCESS;
244 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [4/18]

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

306  {
307  //
308  result.Reset(); // RESET old histogram
309  //
310  auto histo = _Xml<TProfile>( input );
311  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
312  //
313  histo->Copy( result );
314  //
315  return StatusCode::SUCCESS;
316 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [5/18]

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

324  {
325  //
326  result.Reset(); // RESET old histogram
327  //
328  auto histo = _Xml<TProfile2D>( input );
329  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
330  //
331  histo->Copy( result );
332  //
333  return StatusCode::SUCCESS;
334 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [6/18]

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

252  {
253  //
254  result.Reset(); // RESET old histogram
255  //
256  auto histo = _Xml<TH1F>( input );
257  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
258  //
259  histo->Copy( result );
260  //
261  return StatusCode::SUCCESS;
262 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [7/18]

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

270  {
271  //
272  result.Reset(); // RESET old histogram
273  //
274  auto histo = _Xml<TH2F>( input );
275  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
276  //
277  histo->Copy( result );
278  //
279  return StatusCode::SUCCESS;
280 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [8/18]

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

288  {
289  //
290  result.Reset(); // RESET old histogram
291  //
292  auto histo = _Xml<TH3F>( input );
293  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
294  //
295  histo->Copy( result );
296  //
297  return StatusCode::SUCCESS;
298 }
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [9/18]

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

343  {
344  if ( result ) { return fromXml( *result, input ); }
345  //
346  auto histo = _Xml<TH1D>( input );
347  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
348  //
349  result = histo.release(); // ASSIGN
350  //
351  return StatusCode::SUCCESS;
352 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [10/18]

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

360  {
361  if ( result ) { return fromXml( *result, input ); }
362  //
363  auto histo = _Xml<TH2D>( input );
364  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
365  //
366  result = histo.release(); // ASSIGN
367  //
368  return StatusCode::SUCCESS;
369 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [11/18]

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

377  {
378  if ( result ) { return fromXml( *result, input ); }
379  //
380  auto histo = _Xml<TH3D>( input );
381  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
382  //
383  result = histo.release(); // ASSIGN
384  //
385  return StatusCode::SUCCESS;
386 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [12/18]

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

395  {
396  if ( result ) { return fromXml( *result, input ); }
397  //
398  auto histo = _Xml<TProfile>( input );
399  if ( !histo ) { return StatusCode::FAILURE; } // RETURN
400  //
401  result = histo.release(); // ASSIGN
402  //
403  return StatusCode::SUCCESS;
404 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
constexpr static const auto SUCCESS
Definition: StatusCode.h:96
constexpr static const auto FAILURE
Definition: StatusCode.h:97

◆ fromXml() [13/18]

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

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

◆ fromXml() [14/18]

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

429  {
430  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
431  return root ? fromXml( *root, input ) : StatusCode::FAILURE; // RETURN
432 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ fromXml() [15/18]

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

440  {
441  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
442  return root ? fromXml( *root, input ) : StatusCode::FAILURE; // RETURN
443 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ fromXml() [16/18]

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

451  {
452  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
453  return root ? fromXml( *root, input ) : StatusCode::FAILURE; // RETURN
454 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ fromXml() [17/18]

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

462  {
463  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
464  return root ? fromXml( *root, input ) : StatusCode::FAILURE; // RETURN
465 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ fromXml() [18/18]

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

473  {
474  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &result );
475  return root ? fromXml( *root, input ) : StatusCode::FAILURE; // RETURN
476 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:197
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ histoDump() [1/4]

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

654  {
655  std::ostringstream stream;
656  histoDump_( histo, stream, width, height, errors );
657  return stream.str();
658 }
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:594
T str(T... args)

◆ histoDump() [2/4]

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

723  {
724  std::ostringstream stream;
725  histoDump_( histo, stream, width, height, spread );
726  return stream.str();
727 }
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:594
T str(T... args)

◆ histoDump() [3/4]

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

835  {
836  std::ostringstream stream;
837  histoDump_( histo, stream, width, height );
838  return stream.str();
839 }
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:594
T str(T... args)

◆ histoDump() [4/4]

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

819  {
820  std::ostringstream stream;
821  histoDump_( histo, stream, width, height, errors );
822  return stream.str();
823 }
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:594
T str(T... args)

◆ histoDump_() [1/4]

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

595  {
596  stream << std::endl;
597  if ( !histo ) { return stream; } // RETURN
598  Histo hist;
599  StatusCode sc = _getHisto( histo, hist );
600  if ( sc.isFailure() ) { return stream; } // RETURN
601  //
602  stream << boost::format( " Histo TES : \"%s\"" ) % path( histo ) << std::endl
603  << boost::format( " Histo Title : \"%s\"" ) % histo->title() << std::endl
604  << std::endl;
605  //
606  stream << boost::format( " Mean : %11.5g +- %-10.4g " ) % Gaudi::Utils::HistoStats::mean( histo ) %
608  << std::endl
609  << boost::format( " Rms : %11.5g +- %-10.4g " ) % Gaudi::Utils::HistoStats::rms( histo ) %
611  << std::endl
612  << boost::format( " Skewness : %11.5g +- %-10.4g " ) % Gaudi::Utils::HistoStats::skewness( histo ) %
614  << std::endl
615  << boost::format( " Kurtosis : %11.5g +- %-10.4g " ) % Gaudi::Utils::HistoStats::kurtosis( histo ) %
617  << std::endl
618  << std::endl;
619  //
620  stream << boost::format( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |" ) % "All" %
621  "In Range" % "Underflow" % "Overflow" % "#Equivalent" % "Integral" % "Total"
622  << std::endl
623  << boost::format( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |" ) % histo->allEntries() %
624  histo->entries() % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) %
625  histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ) % histo->equivalentBinEntries() %
626  histo->sumBinHeights() % histo->sumAllBinHeights()
627  << std::endl
628  << std::endl;
629  //
630  const AIDA::IAnnotation& a = histo->annotation();
631  if ( 0 != a.size() ) {
632  stream << " Annotation" << std::endl;
633  for ( int i = 0; i < a.size(); ++i ) {
634  stream << boost::format( " | %-25.25s : %-45.45s | " ) % a.key( i ) % a.value( i ) << std::endl;
635  }
636  stream << std::endl;
637  }
638  //
639  return dumpText( hist, width, height, errors, stream );
640 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:661
T endl(T... args)
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:645
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
Definition: HistoStats.cpp:653
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:621
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
Definition: HistoStats.cpp:637
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:605
bool isFailure() const
Definition: StatusCode.h:141
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:613
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:597

◆ histoDump_() [2/4]

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

672  {
673  stream << std::endl;
674  if ( !histo ) { return stream; } // RETURN
675  Histo hist;
676  StatusCode sc = _getHisto( histo, hist, spread );
677  if ( sc.isFailure() ) { return stream; } // RETURN
678  //
679  stream << boost::format( " Histo TES : \"%s\"" ) % path( histo ) << std::endl
680  << boost::format( " Histo Title : \"%s\"" ) % histo->title() << std::endl
681  << std::endl;
682  //
683  stream << boost::format( " Mean : %11.5g " ) % histo->mean() << std::endl
684  << boost::format( " Rms : %11.5g " ) % histo->rms() << std::endl
685  << std::endl;
686  //
687  stream << boost::format( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |" ) % "All" % "In Range" %
688  "Underflow" %
689  "Overflow"
690  // % "#Equivalent"
691  % "Integral" % "Total"
692  << std::endl
693  << boost::format( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |" ) % histo->allEntries() %
694  histo->entries() % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) %
695  histo->binEntries( AIDA::IAxis::OVERFLOW_BIN )
696  // % histo -> equivalentBinEntries ()
697  % histo->sumBinHeights() % histo->sumAllBinHeights()
698  << std::endl
699  << std::endl;
700  //
701  const AIDA::IAnnotation& a = histo->annotation();
702  if ( 0 != a.size() ) {
703  stream << " Annotation" << std::endl;
704  for ( int i = 0; i < a.size(); ++i ) {
705  stream << boost::format( " | %-25.25s : %-45.45s | " ) % a.key( i ) % a.value( i ) << std::endl;
706  }
707  stream << std::endl;
708  }
709  //
710  return dumpText( hist, width, height, true, stream );
711 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
T endl(T... args)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isFailure() const
Definition: StatusCode.h:141

◆ histoDump_() [3/4]

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

783  {
784  stream << std::endl;
785  if ( !histo ) { return stream; } // RETURN
786  Histo hist;
787  StatusCode sc = _getHisto( histo, hist, true );
788  if ( sc.isFailure() ) { return stream; } // RETURN
789  //
790  stream << boost::format( " Profile Name : \"%s\"" ) % histo->GetName() << std::endl
791  << boost::format( " Profile Title : \"%s\"" ) % histo->GetTitle() << std::endl
792  << std::endl;
793  //
794  stream << boost::format( " Mean : %11.5g " ) % histo->GetMean() << std::endl
795  << boost::format( " Rms : %11.5g " ) % histo->GetRMS() << std::endl
796  << std::endl;
797  //
798  stream << boost::format( " Entries :\n | %=11s | %=11s | %=11s | %=11s |" ) % "All" % "Underflow" % "Overflow" %
799  "Integral"
800  << std::endl
801  << boost::format( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |" ) % histo->GetEntries() %
802  histo->GetBinContent( 0 ) % histo->GetBinContent( histo->GetNbinsX() + 1 ) % histo->Integral()
803  << std::endl
804  << std::endl;
805  //
806  return dumpText( hist, width, height, true, stream );
807 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
T endl(T... args)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isFailure() const
Definition: StatusCode.h:141

◆ histoDump_() [4/4]

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

740  {
741  const TProfile* profile = dynamic_cast<const TProfile*>( histo );
742  if ( profile ) { return histoDump_( profile, stream, width, height ); }
743  //
744  stream << std::endl;
745  if ( !histo ) { return stream; } // RETURN
746  Histo hist;
747  StatusCode sc = _getHisto( histo, hist );
748  if ( sc.isFailure() ) { return stream; } // RETURN
749  //
750  stream << boost::format( " Histo Name : \"%s\"" ) % histo->GetName() << std::endl
751  << boost::format( " Histo Title : \"%s\"" ) % histo->GetTitle() << std::endl
752  << std::endl;
753  //
754  stream << boost::format( " Mean : %11.5g +- %-10.4g " ) % histo->GetMean() % histo->GetMeanError() << std::endl
755  << boost::format( " Rms : %11.5g +- %-10.4g " ) % histo->GetRMS() % histo->GetRMSError() << std::endl
756  << boost::format( " Skewness : %11.5g " ) % histo->GetSkewness() << std::endl
757  << boost::format( " Kurtosis : %11.5g " ) % histo->GetKurtosis() << std::endl
758  << std::endl;
759  //
760  stream << boost::format( " Entries :\n | %=11s | %=11s | %=11s | %=11s | %=11s |" ) % "All" % "Underflow" %
761  "Overflow" % "#Equivalent" % "Integral"
762  << std::endl
763  << boost::format( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |" ) % histo->GetEntries() %
764  histo->GetBinContent( 0 ) % histo->GetBinContent( histo->GetNbinsX() + 1 ) %
765  histo->GetEffectiveEntries() % histo->Integral()
766  << std::endl
767  << std::endl;
768  //
769  return dumpText( hist, width, height, errors, stream );
770 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
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:594
T endl(T... args)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isFailure() const
Definition: StatusCode.h:141

◆ htitle() [1/8]

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

get the title

Definition at line 119 of file Fill.cpp.

119  {
120  return htitle_( histo, title );
121 }

◆ htitle() [2/8]

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

get the title

Definition at line 125 of file Fill.cpp.

125  {
126  return htitle_( histo, title );
127 }

◆ htitle() [3/8]

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

get the title

Definition at line 131 of file Fill.cpp.

131  {
132  return htitle_( histo, title );
133 }

◆ htitle() [4/8]

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

get the title

Definition at line 137 of file Fill.cpp.

137  {
138  return htitle_( histo, title );
139 }

◆ htitle() [5/8]

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

get the title

Definition at line 143 of file Fill.cpp.

143  {
144  return htitle_( histo, title );
145 }

◆ htitle() [6/8]

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

get the title

Definition at line 149 of file Fill.cpp.

149  {
150  return htitle_( histo, title );
151 }

◆ htitle() [7/8]

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

get the title

Definition at line 155 of file Fill.cpp.

155  {
156  return htitle_( histo, title );
157 }

◆ htitle() [8/8]

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

get the title

Definition at line 161 of file Fill.cpp.

161  {
162  return htitle_( histo, title );
163 }

◆ path()

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

229  {
230  if ( !aida ) { return ""; } // RETURN
231  const auto object = dynamic_cast<const DataObject*>( aida );
232  if ( !object ) { return ""; } // RETURN
233  const auto registry = object->registry();
234  if ( !registry ) { return ""; } // RETURN
235  const auto _path = registry->identifier();
236  const auto n = _path.find( "/stat/" );
237  return ( 0 == n ? std::string( _path, 6 ) : _path ); // RETURN
238 }
STL class.

◆ printList() [1/2]

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 287 of file HistoTableFormat.h.

287  {
288  for ( ; first != last; ++first ) { stream << format( *first, fmt ) << term; } // print table rows
289  return stream; // RETURN
290  }
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

◆ printList() [2/2]

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 316 of file HistoTableFormat.h.

316  {
317  return printList( histos.begin(), histos.end(), fmt, stream, term );
318  }
STREAM & printList(const LIST &histos, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple container of histograms as table

◆ printMap() [1/2]

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 365 of file HistoTableFormat.h.

366  {
367  for ( ; begin != end; ++begin ) {
368  stream << format( begin->second, // the histogram
369  begin->first, // the key
370  fmt1, fmt2 )
371  << term;
372  }
373  return stream;
374  }
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
def end
Definition: IOTest.py:123
AttribStringParser::Iterator begin(const AttribStringParser &parser)

◆ printMap() [2/2]

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 419 of file HistoTableFormat.h.

420  {
421  return printMap( histos.begin(), histos.end(), fmt1, fmt2, stream, term );
422  }
STREAM & printMap(const MAP &histos, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.

◆ setAxisLabels() [1/4]

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

139  {
140  return setAxisLabels_<TH1D>( hist, xAxis, yAxis );
141  }

◆ setAxisLabels() [2/4]

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 143 of file HistoLabels.cpp.

143  {
144  return setAxisLabels_<TProfile>( hist, xAxis, yAxis );
145  }

◆ setAxisLabels() [3/4]

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 147 of file HistoLabels.cpp.

147  {
148  return setAxisLabels_<TH2D>( hist, xAxis, yAxis );
149  }

◆ setAxisLabels() [4/4]

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

151  {
152  return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
153  }

◆ setBinLabels() [1/8]

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

Definition at line 97 of file HistoLabels.cpp.

97 { return setBinLabels_( hist, labels ); }

◆ setBinLabels() [2/8]

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
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 89 of file HistoLabels.cpp.

89  {
90  return setBinLabels_<TH1D>( hist, labels );
91  }

◆ setBinLabels() [3/8]

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

Definition at line 99 of file HistoLabels.cpp.

99 { return setBinLabels_( hist, labels ); }

◆ setBinLabels() [4/8]

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
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 93 of file HistoLabels.cpp.

93  {
94  return setBinLabels_<TProfile>( hist, labels );
95  }

◆ setBinLabels() [5/8]

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

Definition at line 101 of file HistoLabels.cpp.

101  {
102  if ( !hist ) return false;
103  TH2D* h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
104  if ( !h2d ) return false;
105  BinLabels lx;
106  lx.reserve( xlabels.size() );
107  for ( unsigned int i = 0; i < xlabels.size(); ++i ) { lx.emplace_back( i, xlabels[i] ); }
108  BinLabels ly;
109  ly.reserve( ylabels.size() );
110  for ( unsigned int i = 0; i < ylabels.size(); ++i ) { ly.emplace_back( i, ylabels[i] ); }
111  return ( setBinLabels_( h2d->GetXaxis(), lx ) && setBinLabels_( h2d->GetYaxis(), ly ) );
112  }
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:37
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ setBinLabels() [6/8]

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
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 114 of file HistoLabels.cpp.

114  {
115  TH2D* h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
116  return ( h2d && setBinLabels_( h2d->GetXaxis(), xlabels ) && setBinLabels_( h2d->GetYaxis(), ylabels ) );
117  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ setBinLabels() [7/8]

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

Definition at line 119 of file HistoLabels.cpp.

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

◆ setBinLabels() [8/8]

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
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 132 of file HistoLabels.cpp.

132  {
133  TProfile2D* h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
134  return ( h2d && setBinLabels_( h2d->GetXaxis(), xlabels ) && setBinLabels_( h2d->GetYaxis(), ylabels ) );
135  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80

◆ toBase() [1/5]

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

Definition at line 165 of file Fill.cpp.

165 { return histo; }

◆ toBase() [2/5]

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

Definition at line 167 of file Fill.cpp.

167 { return histo; }

◆ toBase() [3/5]

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

Definition at line 169 of file Fill.cpp.

169 { return histo; }

◆ toBase() [4/5]

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

Definition at line 171 of file Fill.cpp.

171 { return histo; }

◆ toBase() [5/5]

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

Definition at line 173 of file Fill.cpp.

173 { return histo; }

◆ toXml() [1/13]

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

74  {
75  return stream << TBufferXML::ConvertToXML( &histo );
76 }

◆ toXml() [2/13]

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

83  {
84  return stream << TBufferXML::ConvertToXML( &histo );
85 }

◆ toXml() [3/13]

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

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

◆ toXml() [4/13]

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

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

◆ toXml() [5/13]

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

137  {
138  return stream << TBufferXML::ConvertToXML( &histo );
139 }

◆ toXml() [6/13]

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

146  {
147  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
148  return root ? toXml( *root, stream ) : stream;
149 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:74

◆ toXml() [7/13]

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

156  {
157  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
158  return root ? toXml( *root, stream ) : stream;
159 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:74

◆ toXml() [8/13]

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

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

◆ toXml() [9/13]

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

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

◆ toXml() [10/13]

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

101  {
102  return stream << TBufferXML::ConvertToXML( &histo );
103 }

◆ toXml() [11/13]

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

110  {
111  return stream << TBufferXML::ConvertToXML( &histo );
112 }

◆ toXml() [12/13]

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

119  {
120  return stream << TBufferXML::ConvertToXML( &histo );
121 }

◆ toXml() [13/13]

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

186  {
187  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
188  return root ? toXml( *root, stream ) : stream;
189 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:74