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< 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::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

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

39 {
40  if ( histo ) { histo->fill ( value , weight ) ; }
41 }
GAUDI_API 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 54 of file Fill.cpp.

58 {
59  if ( histo ) { histo -> fill ( valueX , valueY , weight ) ; }
60 }
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
GAUDI_API 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 74 of file Fill.cpp.

79 {
80  if ( histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
81 }
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
GAUDI_API 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 94 of file Fill.cpp.

98 {
99  if ( histo ) { histo -> fill ( valueX , valueY , weight ) ; }
100 }
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
GAUDI_API 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 114 of file Fill.cpp.

119 {
120  if ( histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
121 }
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
GAUDI_API 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
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 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 }
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
Definition: HistoStats.cpp:432
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
Definition: HistoStats.cpp:410
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:326
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:254
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
Definition: HistoStats.cpp:358
list path
Definition: __init__.py:15
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:235
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
Definition: HistoStats.cpp:344
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:308
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
Definition: HistoStats.cpp:269
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:372
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
Definition: HistoStats.cpp:292
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:202
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:177
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:391
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:191
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:166
GAUDI_API 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 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 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GAUDI_API 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 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GAUDI_API 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 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GAUDI_API 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 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GAUDI_API 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 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GAUDI_API 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 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
GAUDI_API 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 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:229
tuple root
Definition: IOTest.py:42
GAUDI_API 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 698 of file HistoDump.cpp.

702 {
703  std::ostringstream stream ;
704  histoDump_ ( histo , stream , width , height , errors );
705  return stream.str() ;
706 }
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:609
GAUDI_API 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 795 of file HistoDump.cpp.

799 {
800  std::ostringstream stream ;
801  histoDump_ ( histo , stream , width , height , spread );
802  return stream.str() ;
803 }
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:609
GAUDI_API 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 964 of file HistoDump.cpp.

967 {
968  std::ostringstream stream ;
969  histoDump_ ( histo , stream , width , height );
970  return stream.str() ;
971 }
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:609
GAUDI_API 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 944 of file HistoDump.cpp.

948 {
949  std::ostringstream stream ;
950  histoDump_ ( histo , stream , width , height , errors );
951  return stream.str() ;
952 }
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:609
GAUDI_API 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 609 of file HistoDump.cpp.

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

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

893 {
894  stream << std::endl ;
895  if ( ! histo ) { return stream ; } // RETURN
896  Histo hist ;
897  StatusCode sc = _getHisto ( histo , hist , true ) ;
898  if ( sc.isFailure() ) { return stream ; } // RETURN
899  //
900  stream
901  << boost::format ( " Profile Name : \"%s\"")
902  % histo -> GetName ()
903  << std::endl
904  << boost::format ( " Profile Title : \"%s\"")
905  % histo -> GetTitle ()
906  << std::endl
907  << std::endl ;
908  //
909  stream
910  << boost::format ( " Mean : %11.5g ") % histo -> GetMean ()
911  << std::endl
912  << boost::format ( " Rms : %11.5g ") % histo -> GetRMS ()
913  << std::endl
914  << std::endl ;
915  //
916  stream
917  << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s |")
918  % "All"
919  % "Underflow"
920  % "Overflow"
921  % "Integral"
922  << std::endl
923  << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
924  % histo -> GetEntries ()
925  % histo -> GetBinContent ( 0 )
926  % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
927  % histo -> Integral ()
928  << std::endl
929  << std::endl ;
930  //
931  return dumpText ( hist , width , height , true , stream ) ;
932 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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
GAUDI_API 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 816 of file HistoDump.cpp.

821 {
822  const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
823  if ( profile )
824  { return histoDump_ ( profile , stream , width , height ) ; }
825  //
826  stream << std::endl ;
827  if ( !histo ) { return stream ; } // RETURN
828  Histo hist ;
829  StatusCode sc = _getHisto ( histo , hist ) ;
830  if ( sc.isFailure() ) { return stream ; } // RETURN
831  //
832  stream
833  << boost::format ( " Histo Name : \"%s\"")
834  % histo -> GetName ()
835  << std::endl
836  << boost::format ( " Histo Title : \"%s\"")
837  % histo -> GetTitle ()
838  << std::endl
839  << std::endl ;
840  //
841  stream
842  << boost::format ( " Mean : %11.5g +- %-10.4g ")
843  % histo -> GetMean ()
844  % histo -> GetMeanError ()
845  << std::endl
846  << boost::format ( " Rms : %11.5g +- %-10.4g ")
847  % histo -> GetRMS ()
848  % histo -> GetRMSError ()
849  << std::endl
850  << boost::format ( " Skewness : %11.5g ")
851  % histo -> GetSkewness ()
852  << std::endl
853  << boost::format ( " Kurtosis : %11.5g ")
854  % histo -> GetKurtosis ()
855  << std::endl
856  << std::endl ;
857  //
858  stream
859  << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
860  % "All"
861  % "Underflow"
862  % "Overflow"
863  % "#Equivalent"
864  % "Integral"
865  << std::endl
866  << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
867  % histo -> GetEntries ()
868  % histo -> GetBinContent ( 0 )
869  % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
870  % histo -> GetEffectiveEntries ()
871  % histo -> Integral ()
872  << std::endl
873  << std::endl ;
874  //
875  return dumpText ( hist , width , height , errors , stream ) ;
876 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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
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:609
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 ) ; }
GAUDI_API 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 }
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual const id_type & identifier() const =0
Full identifier (or key)
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
( histos.begin () ,
histos.end () ,
" | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
std::cout ,
'\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 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_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
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 | " ,
std::cout ,
'\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 267 of file HistoTableFormat.h.

271  {
272  return printList
273  ( histos.begin () , histos.end () , fmt , stream , term ) ;
274  }
STREAM & printList(const LIST &histos, const std::string &fmt, STREAM &stream, TERMINATOR term)
print the simple container of histograms as table
template<class HISTO , class STREAM , class TERMINATOR >
STREAM & 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 = ... ;
( 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 = ... ;
( 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 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  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
constexpr double second
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
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
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 = ... ;
( 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 = ... ;
( 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 383 of file HistoTableFormat.h.

388  {
389  return printMap
390  ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
391  }
STREAM & printMap(const MAP &histos, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
GAUDI_API 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 186 of file HistoLabels.cpp.

189  {
190  return setAxisLabels_<TH1D>( hist, xAxis, yAxis );
191  }
GAUDI_API 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 193 of file HistoLabels.cpp.

196  {
197  return setAxisLabels_<TProfile>( hist, xAxis, yAxis );
198  }
GAUDI_API 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 200 of file HistoLabels.cpp.

203  {
204  return setAxisLabels_<TH2D>( hist, xAxis, yAxis );
205  }
GAUDI_API 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 207 of file HistoLabels.cpp.

210  {
211  return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
212  }
GAUDI_API 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 106 of file HistoLabels.cpp.

108  {
109  return setBinLabels_(hist,labels);
110  }
GAUDI_API 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 94 of file HistoLabels.cpp.

96  {
97  return setBinLabels_<TH1D>(hist,labels);
98  }
GAUDI_API 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 112 of file HistoLabels.cpp.

114  {
115  return setBinLabels_(hist,labels);
116  }
GAUDI_API 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 100 of file HistoLabels.cpp.

102  {
103  return setBinLabels_<TProfile>(hist,labels);
104  }
GAUDI_API 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 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  }
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:31
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
list i
Definition: ana.py:128
GAUDI_API 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 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  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API 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 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  }
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:31
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
list i
Definition: ana.py:128
GAUDI_API 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 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  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IHistogram1D *  histo)

Definition at line 193 of file Fill.cpp.

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

Definition at line 197 of file Fill.cpp.

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

Definition at line 201 of file Fill.cpp.

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

Definition at line 205 of file Fill.cpp.

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

Definition at line 209 of file Fill.cpp.

209 { return histo ; }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
tuple root
Definition: IOTest.py:42
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
GAUDI_API 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 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:72
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
tuple root
Definition: IOTest.py:42