All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 30 of file HistoLabels.h.

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

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

Definition at line 32 of file HistoLabels.h.

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

Typedef for a list of labels.

Definition at line 28 of file HistoLabels.h.

Function Documentation

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

simple function to fill AIDA::IHistogram1D objects

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

Definition at line 37 of file Fill.cpp.

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

simple function to fill AIDA::IHistogram2D objects

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

Definition at line 55 of file Fill.cpp.

59 {
60  if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
61 }
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:37
void Gaudi::Utils::Histos::fill ( AIDA::IHistogram3D *  histo,
const double  valueX,
const double  valueY,
const double  valueZ,
const double  weight = 1.0 
)

simple function to fill AIDA::IHistogram3D objects

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

Definition at line 75 of file Fill.cpp.

80 {
81  if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
82 }
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:37
void Gaudi::Utils::Histos::fill ( AIDA::IProfile1D *  histo,
const double  valueX,
const double  valueY,
const double  weight = 1.0 
)

simple function to fill AIDA::IProfile1D objects

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

Definition at line 95 of file Fill.cpp.

99 {
100  if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
101 }
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:37
void Gaudi::Utils::Histos::fill ( AIDA::IProfile2D *  histo,
const double  valueX,
const double  valueY,
const double  valueZ,
const double  weight = 1.0 
)

simple function to fill AIDA::IProfile2D objects

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

Definition at line 115 of file Fill.cpp.

120 {
121  if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
122 }
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:37
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 203 of file HistoTableFormat.cpp.

205 {
206  if ( 0 == histo ) { return "<NULL>" ; }
207  using namespace Gaudi::Utils ;
208  using namespace boost::io ;
209  boost::format _fmt ( fmt ) ;
210  // allow various number of arguments
211  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
212 
213  _fmt
214  % ( "\"" + path ( histo ) + "\"" ) // 1) histogram path
215  % ( "\"" + histo -> title () + "\"" ) // 2) title
216  % histo -> allEntries () // 3) # entries
217  % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
218  % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
219  % histo -> equivalentBinEntries () // 6) equivalent entries
220  % histo -> sumBinHeights () // 7) integral
221  % histo -> mean () // 8) mean value
222  % HistoStats:: meanErr ( histo ) // 9) error in mean
223  % histo -> rms () // 10) rms
224  % HistoStats::rmsErr ( histo ) // 11) error in rms
225  % HistoStats::skewness ( histo ) // 12) skewness
226  % HistoStats::skewnessErr ( histo ) // 13) error in skewness
227  % HistoStats::kurtosis ( histo ) // 14) kurtosis
228  % HistoStats::kurtosisErr ( histo ) // 15) error in kurtosis
229  //
230  % histo -> sumAllBinHeights () // 16) full integral (in and out range)
231  % HistoStats::sumAllBinHeightErr ( histo ) // 17) error on 16
232  % HistoStats::sumBinHeightErr ( histo ) // 18) error on 7
233  //
234  % ( 100 * HistoStats::underflowEntriesFrac ( histo ) ) // 19) fraction of underflow entries
235  % ( 100 * HistoStats::underflowEntriesFracErr ( histo ) ) // 20) error on 19
236  % ( 100 * HistoStats::overflowEntriesFrac ( histo ) ) // 21) fraction of overflow entries
237  % ( 100 * HistoStats::overflowEntriesFracErr ( histo ) ) // 22) error on 21
238  //
239  % HistoStats::underflowIntegralFrac ( histo ) // 23) fraction of underflow integral
240  % HistoStats::underflowIntegralFracErr ( histo ) // 24) error on 23
241  % HistoStats::overflowIntegralFrac ( histo ) // 25) fraction of overflow intergal
242  % HistoStats::overflowIntegralFracErr ( histo ) ; // 26) error on 25
243  //
244  return _fmt.str() ;
245 }
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
Definition: HistoStats.cpp:433
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
Definition: HistoStats.cpp:411
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:327
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:255
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
Definition: HistoStats.cpp:359
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:236
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
Definition: HistoStats.cpp:345
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:309
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
Definition: HistoStats.cpp:270
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
Definition: HistoStats.cpp:373
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
Definition: HistoStats.cpp:293
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:203
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:178
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
Definition: HistoStats.cpp:392
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:192
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:167
std::string Gaudi::Utils::Histos::format ( const AIDA::IHistogram1D *  histo,
const std::string &  ID,
const std::string &  fmt1,
const std::string &  fmt2 
)

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

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

Definition at line 252 of file HistoTableFormat.cpp.

256 {
257  using namespace boost::io ;
258  boost::format _fmt ( fmt1 ) ;
259  // allow various number of arguments
260  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
261  //
262  _fmt
263  % ID // format ID
264  % format ( histo , fmt2 ) ; // format the histogram
265  //
266  return _fmt.str() ;
267 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
std::string Gaudi::Utils::Histos::format ( const std::string &  val1,
const std::string &  val2,
const std::string &  fmt 
)

helper method to merge the headers for short format table

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

Definition at line 272 of file HistoTableFormat.cpp.

275 {
276  using namespace boost::io ;
277  boost::format _fmt ( fmt ) ;
278  // allow various number of arguments
279  _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
280  //
281  _fmt
282  % val1 // format ID
283  % val2 ; // format the histogram
284  //
285  return _fmt.str() ;
286 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
StatusCode Gaudi::Utils::Histos::fromXml ( TH1D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 297 of file HistoXML.cpp.

298 {
299  //
300  result.Reset() ; // RESET old histogram
301  //
302  _Xml<TH1D> _xml ;
303  std::auto_ptr<TH1D> histo = _xml ( input ) ;
304  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
305  //
306  result.Reset() ;
307  histo->Copy ( result ) ;
308  //
309  return StatusCode::SUCCESS ;
310 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH2D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 319 of file HistoXML.cpp.

320 {
321  //
322  result.Reset() ; // RESET old histogram
323  //
324  _Xml<TH2D> _xml ;
325  std::auto_ptr<TH2D> histo = _xml ( input ) ;
326  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
327  //
328  result.Reset() ;
329  histo->Copy ( result ) ;
330  //
331  return StatusCode::SUCCESS ;
332 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH3D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 341 of file HistoXML.cpp.

342 {
343  //
344  result.Reset() ; // RESET old histogram
345  //
346  _Xml<TH3D> _xml ;
347  std::auto_ptr<TH3D> histo = _xml ( input ) ;
348  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
349  //
350  result.Reset() ;
351  histo->Copy ( result ) ;
352  //
353  return StatusCode::SUCCESS ;
354 }
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 429 of file HistoXML.cpp.

430 {
431  //
432  result.Reset() ; // RESET old histogram
433  //
434  _Xml<TProfile> _xml ;
435  std::auto_ptr<TProfile> histo = _xml ( input ) ;
436  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
437  //
438  result.Reset() ;
439  histo->Copy ( result ) ;
440  //
441  return StatusCode::SUCCESS ;
442 }
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile2D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 451 of file HistoXML.cpp.

452 {
453  //
454  result.Reset() ; // RESET old histogram
455  //
456  _Xml<TProfile2D> _xml ;
457  std::auto_ptr<TProfile2D> histo = _xml ( input ) ;
458  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
459  //
460  result.Reset() ;
461  histo->Copy ( result ) ;
462  //
463  return StatusCode::SUCCESS ;
464 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH1F &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 363 of file HistoXML.cpp.

364 {
365  //
366  result.Reset() ; // RESET old histogram
367  //
368  _Xml<TH1F> _xml ;
369  std::auto_ptr<TH1F> histo = _xml ( input ) ;
370  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
371  //
372  result.Reset() ;
373  histo->Copy ( result ) ;
374  //
375  return StatusCode::SUCCESS ;
376 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH2F &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 385 of file HistoXML.cpp.

386 {
387  //
388  result.Reset() ; // RESET old histogram
389  //
390  _Xml<TH2F> _xml ;
391  std::auto_ptr<TH2F> histo = _xml ( input ) ;
392  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
393  //
394  result.Reset() ;
395  histo->Copy ( result ) ;
396  //
397  return StatusCode::SUCCESS ;
398 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH3F &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 407 of file HistoXML.cpp.

408 {
409  //
410  result.Reset() ; // RESET old histogram
411  //
412  _Xml<TH3F> _xml ;
413  std::auto_ptr<TH3F> histo = _xml ( input ) ;
414  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
415  //
416  result.Reset() ;
417  histo->Copy ( result ) ;
418  //
419  return StatusCode::SUCCESS ;
420 }
StatusCode Gaudi::Utils::Histos::fromXml ( TH1D *&  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 475 of file HistoXML.cpp.

476 {
477  if ( 0 != result ) { return fromXml ( *result , input ) ; }
478  //
479  _Xml<TH1D> _xml ;
480  std::auto_ptr<TH1D> histo = _xml ( input ) ;
481  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
482  //
483  result = histo.release() ; // ASSIGN
484  //
485  return StatusCode::SUCCESS ;
486 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
StatusCode Gaudi::Utils::Histos::fromXml ( TH2D *&  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 495 of file HistoXML.cpp.

496 {
497  if ( 0 != result ) { return fromXml ( *result , input ) ; }
498  //
499  _Xml<TH2D> _xml ;
500  std::auto_ptr<TH2D> histo = _xml ( input ) ;
501  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
502  //
503  result = histo.release() ; // ASSIGN
504  //
505  return StatusCode::SUCCESS ;
506 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
StatusCode Gaudi::Utils::Histos::fromXml ( TH3D *&  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 515 of file HistoXML.cpp.

516 {
517  if ( 0 != result ) { return fromXml ( *result , input ) ; }
518  //
519  _Xml<TH3D> _xml ;
520  std::auto_ptr<TH3D> histo = _xml ( input ) ;
521  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
522  //
523  result = histo.release() ; // ASSIGN
524  //
525  return StatusCode::SUCCESS ;
526 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile *&  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 536 of file HistoXML.cpp.

537 {
538  if ( 0 != result ) { return fromXml ( *result , input ) ; }
539  //
540  _Xml<TProfile> _xml ;
541  std::auto_ptr<TProfile> histo = _xml ( input ) ;
542  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
543  //
544  result = histo.release() ; // ASSIGN
545  //
546  return StatusCode::SUCCESS ;
547 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
StatusCode Gaudi::Utils::Histos::fromXml ( TProfile2D *&  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 556 of file HistoXML.cpp.

557 {
558  if ( 0 != result ) { return fromXml ( *result , input ) ; }
559  //
560  _Xml<TProfile2D> _xml ;
561  std::auto_ptr<TProfile2D> histo = _xml ( input ) ;
562  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; } // RETURN
563  //
564  result = histo.release() ; // ASSIGN
565  //
566  return StatusCode::SUCCESS ;
567 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram1D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 576 of file HistoXML.cpp.

577 {
578  TH1D* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
579  if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
580  //
581  return fromXml ( *root , input ) ; // RETURN
582 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
tuple root
Definition: IOTest.py:42
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram2D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 591 of file HistoXML.cpp.

592 {
593  TH2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
594  if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
595  //
596  return fromXml ( *root , input ) ; // RETURN
597 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
tuple root
Definition: IOTest.py:42
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IHistogram3D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 606 of file HistoXML.cpp.

607 {
608  TH3D* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
609  if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
610  //
611  return fromXml ( *root , input ) ; // RETURN
612 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
tuple root
Definition: IOTest.py:42
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IProfile1D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 621 of file HistoXML.cpp.

622 {
623  TProfile* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
624  if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
625  //
626  return fromXml ( *root , input ) ; // RETURN
627 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
tuple root
Definition: IOTest.py:42
StatusCode Gaudi::Utils::Histos::fromXml ( AIDA::IProfile2D &  result,
const std::string &  input 
)

parse the histogram from standard ROOT XML

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

Definition at line 636 of file HistoXML.cpp.

637 {
638  TProfile2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( &result ) ;
639  if ( 0 == root ) { return StatusCode::FAILURE ; } // RETURN
640  //
641  return fromXml ( *root , input ) ; // RETURN
642 }
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:297
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
tuple root
Definition: IOTest.py:42
std::string Gaudi::Utils::Histos::histoDump ( const AIDA::IHistogram1D *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

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

Definition at line 710 of file HistoDump.cpp.

714 {
715  std::ostringstream stream ;
716  histoDump_ ( histo , stream , width , height , errors );
717  return stream.str() ;
718 }
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:621
std::string Gaudi::Utils::Histos::histoDump ( const AIDA::IProfile1D *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  spread = true 
)

dump the text representation of the 1D-profile

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

Definition at line 807 of file HistoDump.cpp.

811 {
812  std::ostringstream stream ;
813  histoDump_ ( histo , stream , width , height , spread );
814  return stream.str() ;
815 }
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:621
std::string Gaudi::Utils::Histos::histoDump ( const TProfile *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50 
)

dump the text representation of the histogram

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

Definition at line 976 of file HistoDump.cpp.

979 {
980  std::ostringstream stream ;
981  histoDump_ ( histo , stream , width , height );
982  return stream.str() ;
983 }
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:621
std::string Gaudi::Utils::Histos::histoDump ( const TH1 *  histo,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

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

Definition at line 956 of file HistoDump.cpp.

960 {
961  std::ostringstream stream ;
962  histoDump_ ( histo , stream , width , height , errors );
963  return stream.str() ;
964 }
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:621
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const AIDA::IHistogram1D *  histo,
std::ostream &  stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

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

Definition at line 621 of file HistoDump.cpp.

626 {
627  stream << std::endl ;
628  if ( 0 == histo ) { return stream ; } // RETURN
629  Histo hist ;
630  StatusCode sc = _getHisto ( histo , hist ) ;
631  if ( sc.isFailure() ) { return stream ; } // RETURN
632  //
633  stream
634  << boost::format ( " Histo TES : \"%s\"") % path ( histo )
635  << std::endl
636  << boost::format ( " Histo Title : \"%s\"") % histo->title()
637  << std::endl
638  << std::endl ;
639  //
640  stream
641  << boost::format ( " Mean : %11.5g +- %-10.4g ")
644  << std::endl
645  << boost::format ( " Rms : %11.5g +- %-10.4g ")
648  << std::endl
649  << boost::format ( " Skewness : %11.5g +- %-10.4g ")
652  << std::endl
653  << boost::format ( " Kurtosis : %11.5g +- %-10.4g ")
656  << std::endl
657  << std::endl ;
658  //
659  stream
660  << boost::format ( " Entries :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
661  % "All"
662  % "In Range"
663  % "Underflow"
664  % "Overflow"
665  % "#Equivalent"
666  % "Integral"
667  % "Total"
668  << std::endl
669  << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
670  % histo -> allEntries ()
671  % histo -> entries ()
672  % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
673  % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
674  % histo -> equivalentBinEntries ()
675  % histo -> sumBinHeights ()
676  % histo -> sumAllBinHeights ()
677  << std::endl
678  << std::endl ;
679  //
680  const AIDA::IAnnotation& a = histo->annotation () ;
681  if ( 0 != a.size() )
682  {
683  stream << " Annotation" << std::endl ;
684  for ( int i = 0 ; i < a.size() ; ++i )
685  {
686  stream
687  << boost::format ( " | %-25.25s : %-45.45s | ")
688  % a.key ( i )
689  % a.value ( i )
690  << std::endl ;
691  }
692  stream << std::endl ;
693  }
694  //
695  return dumpText ( hist , width , height , errors , stream ) ;
696 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Definition: HistoStats.cpp:255
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Definition: HistoStats.cpp:236
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
Definition: HistoStats.cpp:246
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
Definition: HistoStats.cpp:203
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
Definition: HistoStats.cpp:227
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
Definition: HistoStats.cpp:178
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
Definition: HistoStats.cpp:192
list i
Definition: ana.py:128
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Definition: HistoStats.cpp:167
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const AIDA::IProfile1D *  histo,
std::ostream &  stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  spread = true 
)

dump the text representation of 1D-profile

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

Definition at line 732 of file HistoDump.cpp.

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

dump the text representation of the Profile

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

Definition at line 901 of file HistoDump.cpp.

905 {
906  stream << std::endl ;
907  if ( 0 == histo ) { return stream ; } // RETURN
908  Histo hist ;
909  StatusCode sc = _getHisto ( histo , hist , true ) ;
910  if ( sc.isFailure() ) { return stream ; } // RETURN
911  //
912  stream
913  << boost::format ( " Profile Name : \"%s\"")
914  % histo -> GetName ()
915  << std::endl
916  << boost::format ( " Profile Title : \"%s\"")
917  % histo -> GetTitle ()
918  << std::endl
919  << std::endl ;
920  //
921  stream
922  << boost::format ( " Mean : %11.5g ") % histo -> GetMean ()
923  << std::endl
924  << boost::format ( " Rms : %11.5g ") % histo -> GetRMS ()
925  << std::endl
926  << std::endl ;
927  //
928  stream
929  << boost::format ( " Entries :\n | %=11s | %=11s | %=11s | %=11s |")
930  % "All"
931  % "Underflow"
932  % "Overflow"
933  % "Integral"
934  << std::endl
935  << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
936  % histo -> GetEntries ()
937  % histo -> GetBinContent ( 0 )
938  % histo -> GetBinContent ( histo->GetNbinsX() + 1 )
939  % histo -> Integral ()
940  << std::endl
941  << std::endl ;
942  //
943  return dumpText ( hist , width , height , true , stream ) ;
944 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
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:28
std::ostream & Gaudi::Utils::Histos::histoDump_ ( const TH1 *  histo,
std::ostream &  stream,
const std::size_t  width = 80,
const std::size_t  height = 50,
const bool  errors = false 
)

dump the text representation of the histogram

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

Definition at line 828 of file HistoDump.cpp.

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

get the title

Definition at line 139 of file Fill.cpp.

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

get the title

Definition at line 146 of file Fill.cpp.

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

get the title

Definition at line 153 of file Fill.cpp.

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

get the title

Definition at line 160 of file Fill.cpp.

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

get the title

Definition at line 167 of file Fill.cpp.

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

get the title

Definition at line 174 of file Fill.cpp.

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

get the title

Definition at line 181 of file Fill.cpp.

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

get the title

Definition at line 188 of file Fill.cpp.

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

get the path in THS for AIDA histogram

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

Definition at line 185 of file HistoTableFormat.cpp.

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

238  {
239  for ( ; first != last ; ++first )
240  { stream << format ( *first , fmt ) << term ; } // print table rows
241  return stream ; // RETURN
242  }
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 269 of file HistoTableFormat.h.

273  {
274  return printList
275  ( histos.begin () , histos.end () , fmt , stream , term ) ;
276  }
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 324 of file HistoTableFormat.h.

330  {
331  for ( ; begin != end ; ++begin )
332  {
333  stream << format
334  ( begin -> second , // the histogram
335  begin -> first , // the key
336  fmt1 , fmt2 ) << term ;
337  }
338  return stream ;
339  }
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
tuple end
Definition: IOTest.py:101
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 385 of file HistoTableFormat.h.

390  {
391  return printMap
392  ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
393  }
STREAM & printMap(const MAP &histos, const std::string &fmt1, const std::string &fmt2, STREAM &stream, TERMINATOR term)
Print the "associative sequence" (e.g.
bool Gaudi::Utils::Histos::setAxisLabels ( AIDA::IHistogram1D *  hist,
const std::string &  xAxis,
const std::string &  yAxis 
)

Set the axis labels for the given 1D histogram.

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

Definition at line 191 of file HistoLabels.cpp.

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

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

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

Definition at line 198 of file HistoLabels.cpp.

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

Set the axis labels for the given 2D histogram.

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

Definition at line 205 of file HistoLabels.cpp.

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

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

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

Definition at line 212 of file HistoLabels.cpp.

215  {
216  return setAxisLabels_<TProfile2D>( hist, xAxis, yAxis );
217  }
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 111 of file HistoLabels.cpp.

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

101  {
102  return setBinLabels_<TH1D>(hist,labels);
103  }
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 117 of file HistoLabels.cpp.

119  {
120  return setBinLabels_(hist,labels);
121  }
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 105 of file HistoLabels.cpp.

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

126  {
127  if (!hist) return false;
128  TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
129  if (!h2d) return false;
130  BinLabels lx;
131  lx.reserve(xlabels.size());
132  for ( unsigned int i = 0; i < xlabels.size(); ++i )
133  {
134  lx.push_back( Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
135  }
136  BinLabels ly;
137  ly.reserve(ylabels.size());
138  for ( unsigned int i = 0; i < ylabels.size(); ++i )
139  {
140  ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
141  }
142  return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
143  setBinLabels_( h2d->GetYaxis(), ly ) );
144  }
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:32
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
std::pair< unsigned, std::string > BinLabel
Typedef for a bin number and its associated label.
Definition: HistoLabels.h:30
list i
Definition: ana.py:128
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 146 of file HistoLabels.cpp.

149  {
150  TH2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
151  return ( h2d &&
152  setBinLabels_( h2d->GetXaxis(), xlabels ) &&
153  setBinLabels_( h2d->GetYaxis(), ylabels ) );
154  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
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 156 of file HistoLabels.cpp.

159  {
160  if (!hist) return false;
161  TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
162  if (!h2d) return false;
163  BinLabels lx;
164  lx.reserve(xlabels.size());
165  for ( unsigned int i = 0; i < xlabels.size(); ++i )
166  {
167  lx.push_back(Gaudi::Utils::Histos::BinLabel( i , xlabels[i] ) );
168  }
169  BinLabels ly;
170  ly.reserve(ylabels.size());
171  for ( unsigned int i = 0; i < ylabels.size(); ++i )
172  {
173  ly.push_back(Gaudi::Utils::Histos::BinLabel( i , ylabels[i] ) );
174  }
175  return ( setBinLabels_( h2d->GetXaxis(), lx ) &&
176  setBinLabels_( h2d->GetYaxis(), ly ) );
177  }
std::vector< BinLabel > BinLabels
Typedef for a list of bin numbers and their associated label.
Definition: HistoLabels.h:32
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
std::pair< unsigned, std::string > BinLabel
Typedef for a bin number and its associated label.
Definition: HistoLabels.h:30
list i
Definition: ana.py:128
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 179 of file HistoLabels.cpp.

182  {
183  TProfile2D * h2d = Gaudi::Utils::Aida2ROOT::aida2root( hist );
184  return ( h2d &&
185  setBinLabels_( h2d->GetXaxis(), xlabels ) &&
186  setBinLabels_( h2d->GetYaxis(), ylabels ) );
187  }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
AIDA::IBaseHistogram * Gaudi::Utils::Histos::toBase ( AIDA::IHistogram1D *  histo)

Definition at line 194 of file Fill.cpp.

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

Definition at line 198 of file Fill.cpp.

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

Definition at line 202 of file Fill.cpp.

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

Definition at line 206 of file Fill.cpp.

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

Definition at line 210 of file Fill.cpp.

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

stream the ROOT histogram into output stream as XML

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

Definition at line 70 of file HistoXML.cpp.

72 {
73  //
74  const TObject* obj = &histo ;
75  //
76  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
77  //
78  return stream << s ;
79 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TH2D &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 87 of file HistoXML.cpp.

89 {
90  //
91  const TObject* obj = &histo ;
92  //
93  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
94  //
95  return stream << s ;
96 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TH3D &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 104 of file HistoXML.cpp.

106 {
107  //
108  const TObject* obj = &histo ;
109  //
110  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
111  //
112  return stream << s ;
113 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TProfile &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 172 of file HistoXML.cpp.

174 {
175  //
176  const TObject* obj = &histo ;
177  //
178  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
179  //
180  return stream << s ;
181 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TProfile2D &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 189 of file HistoXML.cpp.

191 {
192  //
193  const TObject* obj = &histo ;
194  //
195  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
196  //
197  return stream << s ;
198 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram1D &  histo,
std::ostream &  stream 
)

stream the AIDA histogram into the output stream as XML

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

Definition at line 206 of file HistoXML.cpp.

208 {
209  //
210  AIDA::IHistogram1D* aida = const_cast<AIDA::IHistogram1D*> ( &histo ) ;
211  //
212  const TH1D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
213  if ( 0 == root ) { return stream ; } // RETURN
214  //
215  return toXml ( *root , stream ) ;
216 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:70
tuple root
Definition: IOTest.py:42
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram2D &  histo,
std::ostream &  stream 
)

stream the AIDA histogram into the output stream as XML

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

Definition at line 224 of file HistoXML.cpp.

226 {
227  //
228  AIDA::IHistogram2D* aida = const_cast<AIDA::IHistogram2D*> ( &histo ) ;
229  //
230  const TH2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
231  if ( 0 == root ) { return stream ; } // RETURN
232  //
233  return toXml ( *root , stream ) ;
234 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:70
tuple root
Definition: IOTest.py:42
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IHistogram3D &  histo,
std::ostream &  stream 
)

stream the AIDA histogram into the output stream as XML

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

Definition at line 242 of file HistoXML.cpp.

244 {
245  //
246  AIDA::IHistogram3D* aida = const_cast<AIDA::IHistogram3D*> ( &histo ) ;
247  //
248  const TH3D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
249  if ( 0 == root ) { return stream ; } // RETURN
250  //
251  return toXml ( *root , stream ) ;
252 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:70
tuple root
Definition: IOTest.py:42
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IProfile1D &  histo,
std::ostream &  stream 
)

stream the AIDA histogram into the output stream as XML

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

Definition at line 260 of file HistoXML.cpp.

262 {
263  //
264  AIDA::IProfile1D* aida = const_cast<AIDA::IProfile1D*> ( &histo ) ;
265  //
266  const TProfile* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
267  if ( 0 == root ) { return stream ; } // RETURN
268  //
269  return toXml ( *root , stream ) ;
270 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:70
tuple root
Definition: IOTest.py:42
std::ostream & Gaudi::Utils::Histos::toXml ( const TH1F &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 121 of file HistoXML.cpp.

123 {
124  //
125  const TObject* obj = &histo ;
126  //
127  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
128  //
129  return stream << s ;
130 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TH2F &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 138 of file HistoXML.cpp.

140 {
141  //
142  const TObject* obj = &histo ;
143  //
144  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
145  //
146  return stream << s ;
147 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const TH3F &  histo,
std::ostream &  stream 
)

stream the ROOT histogram into output stream as XML

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

Definition at line 155 of file HistoXML.cpp.

157 {
158  //
159  const TObject* obj = &histo ;
160  //
161  TString s = TBufferXML::ConvertToXML ( const_cast<TObject*> ( obj ) ) ;
162  //
163  return stream << s ;
164 }
string s
Definition: gaudirun.py:210
std::ostream & Gaudi::Utils::Histos::toXml ( const AIDA::IProfile2D &  histo,
std::ostream &  stream 
)

stream the AIDA histogram into the output stream as XML

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

Definition at line 278 of file HistoXML.cpp.

280 {
281  //
282  AIDA::IProfile2D* aida = const_cast<AIDA::IProfile2D*> ( &histo ) ;
283  //
284  const TProfile2D* root = Gaudi::Utils::Aida2ROOT::aida2root ( aida ) ;
285  if ( 0 == root ) { return stream ; } // RETURN
286  //
287  return toXml ( *root , stream ) ;
288 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:55
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:70
tuple root
Definition: IOTest.py:42