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

204 {
205  if ( 0 == histo ) { return "<NULL>" ; }
206  using namespace Gaudi::Utils ;
207  using namespace boost::io ;
208  boost::format _fmt ( fmt ) ;
209  // allow various number of arguments
210  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
211 
212  _fmt
213  % ( "\"" + path ( histo ) + "\"" ) // 1) histogram path
214  % ( "\"" + histo -> title () + "\"" ) // 2) title
215  % histo -> allEntries () // 3) # entries
216  % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
217  % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
218  % histo -> equivalentBinEntries () // 6) equivalent entries
219  % histo -> sumBinHeights () // 7) integral
220  % histo -> mean () // 8) mean value
221  % HistoStats:: meanErr ( histo ) // 9) error in mean
222  % histo -> rms () // 10) rms
223  % HistoStats::rmsErr ( histo ) // 11) error in rms
224  % HistoStats::skewness ( histo ) // 12) skewness
225  % HistoStats::skewnessErr ( histo ) // 13) error in skewness
226  % HistoStats::kurtosis ( histo ) // 14) kurtosis
227  % HistoStats::kurtosisErr ( histo ) // 15) error in kurtosis
228  //
229  % histo -> sumAllBinHeights () // 16) full integral (in and out range)
230  % HistoStats::sumAllBinHeightErr ( histo ) // 17) error on 16
231  % HistoStats::sumBinHeightErr ( histo ) // 18) error on 7
232  //
233  % ( 100 * HistoStats::underflowEntriesFrac ( histo ) ) // 19) fraction of underflow entries
234  % ( 100 * HistoStats::underflowEntriesFracErr ( histo ) ) // 20) error on 19
235  % ( 100 * HistoStats::overflowEntriesFrac ( histo ) ) // 21) fraction of overflow entries
236  % ( 100 * HistoStats::overflowEntriesFracErr ( histo ) ) // 22) error on 21
237  //
238  % HistoStats::underflowIntegralFrac ( histo ) // 23) fraction of underflow integral
239  % HistoStats::underflowIntegralFracErr ( histo ) // 24) error on 23
240  % HistoStats::overflowIntegralFrac ( histo ) // 25) fraction of overflow intergal
241  % HistoStats::overflowIntegralFracErr ( histo ) ; // 26) error on 25
242  //
243  return _fmt.str() ;
244 }
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
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
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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 251 of file HistoTableFormat.cpp.

255 {
256  using namespace boost::io ;
257  boost::format _fmt ( fmt1 ) ;
258  // allow various number of arguments
259  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
260  //
261  _fmt
262  % ID // format ID
263  % format ( histo , fmt2 ) ; // format the histogram
264  //
265  return _fmt.str() ;
266 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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 271 of file HistoTableFormat.cpp.

274 {
275  using namespace boost::io ;
276  boost::format _fmt ( fmt ) ;
277  // allow various number of arguments
278  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
279  //
280  _fmt
281  % val1 // format ID
282  % val2 ; // format the histogram
283  //
284  return _fmt.str() ;
285 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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:65
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:65
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:65
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:65
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:65
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 708 of file HistoDump.cpp.

712 {
713  std::ostringstream stream ;
714  histoDump_ ( histo , stream , width , height , errors );
715  return stream.str() ;
716 }
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:619
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 805 of file HistoDump.cpp.

809 {
810  std::ostringstream stream ;
811  histoDump_ ( histo , stream , width , height , spread );
812  return stream.str() ;
813 }
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:619
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 974 of file HistoDump.cpp.

977 {
978  std::ostringstream stream ;
979  histoDump_ ( histo , stream , width , height );
980  return stream.str() ;
981 }
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:619
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 954 of file HistoDump.cpp.

958 {
959  std::ostringstream stream ;
960  histoDump_ ( histo , stream , width , height , errors );
961  return stream.str() ;
962 }
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:619
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 619 of file HistoDump.cpp.

624 {
625  stream << std::endl ;
626  if ( !histo ) { return stream ; } // RETURN
627  Histo hist ;
628  StatusCode sc = _getHisto ( histo , hist ) ;
629  if ( sc.isFailure() ) { return stream ; } // RETURN
630  //
631  stream
632  << boost::format ( " Histo TES : \"%s\"") % path ( histo )
633  << std::endl
634  << boost::format ( " Histo Title : \"%s\"") % histo->title()
635  << std::endl
636  << std::endl ;
637  //
638  stream
639  << boost::format ( " Mean : %11.5g +- %-10.4g ")
642  << std::endl
643  << boost::format ( " Rms : %11.5g +- %-10.4g ")
646  << std::endl
647  << boost::format ( " Skewness : %11.5g +- %-10.4g ")
650  << std::endl
651  << boost::format ( " Kurtosis : %11.5g +- %-10.4g ")
654  << std::endl
655  << std::endl ;
656  //
657  stream
658  << boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
659  % "All"
660  % "In Range"
661  % "Underflow"
662  % "Overflow"
663  % "#Equivalent"
664  % "Integral"
665  % "Total"
666  << std::endl
667  << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
668  % histo -> allEntries ()
669  % histo -> entries ()
670  % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
671  % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
672  % histo -> equivalentBinEntries ()
673  % histo -> sumBinHeights ()
674  % histo -> sumAllBinHeights ()
675  << std::endl
676  << std::endl ;
677  //
678  const AIDA::IAnnotation& a = histo->annotation () ;
679  if ( 0 != a.size() )
680  {
681  stream << " Annotation" << std::endl ;
682  for ( int i = 0 ; i < a.size() ; ++i )
683  {
684  stream
685  << boost::format ( " | %-25.25s : %-45.45s | ")
686  % a.key ( i )
687  % a.value ( i )
688  << std::endl ;
689  }
690  stream << std::endl ;
691  }
692  //
693  return dumpText ( hist , width , height , errors , stream ) ;
694 }
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
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
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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 730 of file HistoDump.cpp.

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

903 {
904  stream << std::endl ;
905  if ( ! histo ) { return stream ; } // RETURN
906  Histo hist ;
907  StatusCode sc = _getHisto ( histo , hist , true ) ;
908  if ( sc.isFailure() ) { return stream ; } // RETURN
909  //
910  stream
911  << boost::format ( " Profile Name : \"%s\"")
912  % histo -> GetName ()
913  << std::endl
914  << boost::format ( " Profile Title : \"%s\"")
915  % histo -> GetTitle ()
916  << std::endl
917  << std::endl ;
918  //
919  stream
920  << boost::format ( " Mean : %11.5g ") % histo -> GetMean ()
921  << std::endl
922  << boost::format ( " Rms : %11.5g ") % histo -> GetRMS ()
923  << std::endl
924  << std::endl ;
925  //
926  stream
927  << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s |")
928  % "All"
929  % "Underflow"
930  % "Overflow"
931  % "Integral"
932  << std::endl
933  << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
934  % histo -> GetEntries ()
935  % histo -> GetBinContent ( 0 )
936  % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
937  % histo -> Integral ()
938  << std::endl
939  << std::endl ;
940  //
941  return dumpText ( hist , width , height , true , stream ) ;
942 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
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::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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 826 of file HistoDump.cpp.

831 {
832  const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
833  if ( profile )
834  { return histoDump_ ( profile , stream , width , height ) ; }
835  //
836  stream << std::endl ;
837  if ( !histo ) { return stream ; } // RETURN
838  Histo hist ;
839  StatusCode sc = _getHisto ( histo , hist ) ;
840  if ( sc.isFailure() ) { return stream ; } // RETURN
841  //
842  stream
843  << boost::format ( " Histo Name : \"%s\"")
844  % histo -> GetName ()
845  << std::endl
846  << boost::format ( " Histo Title : \"%s\"")
847  % histo -> GetTitle ()
848  << std::endl
849  << std::endl ;
850  //
851  stream
852  << boost::format ( " Mean : %11.5g +- %-10.4g ")
853  % histo -> GetMean ()
854  % histo -> GetMeanError ()
855  << std::endl
856  << boost::format ( " Rms : %11.5g +- %-10.4g ")
857  % histo -> GetRMS ()
858  % histo -> GetRMSError ()
859  << std::endl
860  << boost::format ( " Skewness : %11.5g ")
861  % histo -> GetSkewness ()
862  << std::endl
863  << boost::format ( " Kurtosis : %11.5g ")
864  % histo -> GetKurtosis ()
865  << std::endl
866  << std::endl ;
867  //
868  stream
869  << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
870  % "All"
871  % "Underflow"
872  % "Overflow"
873  % "#Equivalent"
874  % "Integral"
875  << std::endl
876  << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
877  % histo -> GetEntries ()
878  % histo -> GetBinContent ( 0 )
879  % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
880  % histo -> GetEffectiveEntries ()
881  % histo -> Integral ()
882  << std::endl
883  << std::endl ;
884  //
885  return dumpText ( hist , width , height , errors , stream ) ;
886 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
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:619
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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 184 of file HistoTableFormat.cpp.

185 {
186  if ( 0 == aida ) { return "" ; } // RETURN
187  const DataObject* object = dynamic_cast<const DataObject*>( aida ) ;
188  if ( 0 == object ) { return "" ; } // RETURN
189  IRegistry* registry = object->registry() ;
190  if ( 0 == registry ) { return "" ; } // RETURN
191  std::string _path = registry->identifier() ;
192  std::string::size_type n = _path.find("/stat/") ;
193  if ( 0 == n ) { return std::string(_path,6) ; } // RETURN
194  return _path ; // RETURN
195 }
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:65
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:65
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:65
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:65
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:65
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:65
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:65
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:65
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:65
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