| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# Gaudi::Utils::Histos Namespace Reference

## Detailed Description

Collection of useful utilities for manipulations with AIDA hisgograms.

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-08-08

## Classes
class | Table
| Simple class for the customizeble printout of the histogram tables. More...
## Namespaces
namespace | Formats
| The 15 format fields are predefined now:.

## Functions
GAUDI_API void | fill (AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
| simple function to fill AIDA::IHistogram1D objects
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
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
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
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
GAUDI_API std::string | htitle (const AIDA::IBaseHistogram *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IHistogram *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IHistogram1D *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IHistogram2D *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IHistogram3D *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IProfile *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IProfile1D *histo, const std::string &title="")
| get the title
GAUDI_API std::string | htitle (const AIDA::IProfile2D *histo, const std::string &title="")
| get the title
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
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
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
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
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
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
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
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
GAUDI_API std::string | path (const AIDA::IBaseHistogram *aida)
| get the path in THS for AIDA histogram
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.
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
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
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
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.
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.
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

## Function Documentation

void Gaudi::Utils::Histos::fill | ( | AIDA::IProfile2D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const double | weight = `1.0` |
| ) |  |  |

simple function to fill AIDA::IProfile2D objects

See also:
  AIDA::IProfile2D

Parameters:

  | histo | pointer to the histogram
  | valueX | value to be added to the histogram
  | valueY | value to be added to the histogram
  | valueZ | value to be added to the histogram
  | weight | the "weight" assciated with this entry

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-10-02

Definition at line 115 of file Fill.cpp.

    00120 {
    00121   if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
    00122 }

void Gaudi::Utils::Histos::fill | ( | AIDA::IProfile1D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | weight = `1.0` |
| ) |  |  |

simple function to fill AIDA::IProfile1D objects

See also:
  AIDA::IProfile1D

Parameters:

  | histo | pointer to the histogram
  | valueX | value to be added to the histogram
  | valueY | value to be added to the histogram
  | weight | the "weight" assciated with this entry

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-10-02

Definition at line 95 of file Fill.cpp.

    00099 {
    00100   if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
    00101 }

void Gaudi::Utils::Histos::fill | ( | AIDA::IHistogram3D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const double | weight = `1.0` |
| ) |  |  |

simple function to fill AIDA::IHistogram3D objects

See also:
  AIDA::IHistogram3D

Parameters:

  | histo | pointer to the histogram
  | valueX | value to be added to the histogram
  | valueY | value to be added to the histogram
  | valueZ | value to be added to the histogram
  | weight | the "weight" assciated with this entry

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-10-02

Definition at line 75 of file Fill.cpp.

    00080 {
    00081   if ( 0 != histo ) { histo -> fill ( valueX , valueY , valueZ , weight ) ; }
    00082 }

void Gaudi::Utils::Histos::fill | ( | AIDA::IHistogram2D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | weight = `1.0` |
| ) |  |  |

simple function to fill AIDA::IHistogram2D objects

See also:
  AIDA::IHistogram2D

Parameters:

  | histo | pointer to the histogram
  | valueX | value to be added to the histogram
  | valueY | value to be added to the histogram
  | weight | the "weight" assciated with this entry

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-10-02

Definition at line 55 of file Fill.cpp.

    00059 {
    00060   if ( 0 != histo ) { histo -> fill ( valueX , valueY , weight ) ; }
    00061 }

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

simple function to fill AIDA::IHistogram1D objects

See also:
  AIDA::IHistogram1D

Parameters:

  | histo | pointer to the histogram
  | value | value to be added to the histogram
  | weight | the "weight" assciated with this entry

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-10-02

Definition at line 37 of file Fill.cpp.

    00040 {
    00041   if ( 0 != histo ) { histo->fill ( value , weight ) ; }
    00042 }

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 ibelyaev@physics.syr.edu

Date:
  2007-08-07

Definition at line 272 of file HistoTableFormat.cpp.

    00275 {
    00276   using namespace boost::io ;
    00277   boost::format _fmt ( fmt ) ;
    00278   // allow various number of arguments
    00279   _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
    00280   //
    00281   _fmt
    00282     % val1   // format ID
    00283     % val2 ; // format the histogram
    00284   //
    00285   return _fmt.str() ;
    00286 }

std::string Gaudi::Utils::Histos::format | ( | const AIDA::IHistogram1D * | histo,
|  | const std::string & | ID,
|  | const std::string & | fmt1,
|  | const std::string & | fmt2 |
| ) |  |  |

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

      using namespace Gaudi::Utils::Histos
      const AIDA::IHistogram1D* histo = ... ;

      // define short format
      const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;

      // define format for the histogram
      const std::string fmt2 = ... ;

      info () <<
            format   ( "My Histo" , histo , fmt1 , fmt2 )
              << endmsg ;

Parameters:

  | histo | pointer to the histogram
  | ID | historgam ID, title, label or other extra information
  | fmt1 | "short" format used for the table
  | fmt2 | format used for the histogram printout

Returns:
  formatted row

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-08-08

Definition at line 252 of file HistoTableFormat.cpp.

    00256 {
    00257   using namespace boost::io ;
    00258   boost::format _fmt ( fmt1 ) ;
    00259   // allow various number of arguments
    00260   _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
    00261   //
    00262   _fmt
    00263     % ID                         // format ID
    00264     % format ( histo , fmt2 )  ; // format the histogram
    00265   //
    00266   return _fmt.str() ;
    00267 }

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

Make the string representation of the historgam according to the specified format.

The method could be used to access/print various quantities

      using namespace Gaudi::Utils::Histos ;

      const AIDA::IHistogram1D* histo = ... ;

      // print title in a free format:
      std::cout << format   ( histo , "%2%" ) << std::endl ;

      // print the path in HTS in a free format:
      std::cout << format   ( histo , " path in HTS: %1% " ) << std::endl ;

      // print the formatted nEntries/Overflow/Underflow:
      std::cout <<
         format   ( histo , " #nEntries/Overflow/Underflow=%3%/%4%/%5%" )
                << std::endl ;

      // print the formatted Mean+-ErrorMean:
      std::cout <<
         format   ( histo , " Mean+-Error=(%8%+-%9%)" )
                << std::endl ;

      // print the skewness and kurtosis:
      std::cout <<
         format   ( histo , " Skewness/Kurtosis=%12%/%14% " )
                << std::endl ;

Parameters:

  | histo | reference to the histogram
  | fmt | the printout format

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-08-08

Definition at line 203 of file HistoTableFormat.cpp.

    00205 {
    00206   if ( 0 == histo ) { return "<NULL>" ; }
    00207   using namespace Gaudi::Utils ;
    00208   using namespace boost::io ;
    00209   boost::format _fmt ( fmt ) ;
    00210   // allow various number of arguments
    00211   _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
    00212
    00213   _fmt
    00214     % ( "\"" + path ( histo )    + "\"" )   //  1) histogram path
    00215     % ( "\"" + histo -> title () + "\"" )   //  2) title
    00216     % histo -> allEntries            ()     //  3) # entries
    00217     % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
    00218     % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  ) // 5) # overflow
    00219     % histo -> equivalentBinEntries  ()     //  6) equivalent entries
    00220     % histo -> sumBinHeights         ()     //  7) integral
    00221     % histo -> mean                  ()     //  8) mean value
    00222     % HistoStats:: meanErr    ( histo )     //  9) error in mean
    00223     % histo -> rms                   ()     // 10) rms
    00224     % HistoStats::rmsErr      ( histo )     // 11) error in rms
    00225     % HistoStats::skewness    ( histo )     // 12) skewness
    00226     % HistoStats::skewnessErr ( histo )     // 13) error in skewness
    00227     % HistoStats::kurtosis    ( histo )     // 14) kurtosis
    00228     % HistoStats::kurtosisErr ( histo )     // 15) error in kurtosis
    00229     //
    00230     % histo -> sumAllBinHeights      ()     // 16) full integral (in and out range)
    00231     % HistoStats::sumAllBinHeightErr ( histo ) // 17) error on 16
    00232     % HistoStats::sumBinHeightErr    ( histo ) // 18) error on  7
    00233     //
    00234     % ( 100 * HistoStats::underflowEntriesFrac     ( histo ) ) // 19) fraction of underflow entries
    00235     % ( 100 * HistoStats::underflowEntriesFracErr  ( histo ) ) // 20) error on 19
    00236     % ( 100 * HistoStats::overflowEntriesFrac      ( histo ) ) // 21) fraction of overflow entries
    00237     % ( 100 * HistoStats::overflowEntriesFracErr   ( histo ) ) // 22) error on 21
    00238     //
    00239     % HistoStats::underflowIntegralFrac    ( histo ) // 23) fraction of underflow integral
    00240     % HistoStats::underflowIntegralFracErr ( histo ) // 24) error on 23
    00241     % HistoStats::overflowIntegralFrac     ( histo ) // 25) fraction of overflow intergal
    00242     % HistoStats::overflowIntegralFracErr  ( histo ) ; // 26) error on 25
    00243   //
    00244   return _fmt.str() ;
    00245 }

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.Belyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 942 of file HistoDump.cpp.

    00946 {
    00947   std::ostringstream stream ;
    00948   histoDump ( histo , stream , width , height , errors );
    00949   return stream.str() ;
    00950 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 814 of file HistoDump.cpp.

    00819 {
    00820   const TProfile* profile = dynamic_cast<const TProfile*> ( histo ) ;
    00821   if ( 0 != profile )
    00822   { return histoDump ( profile , stream , width , height ) ; }
    00823   //
    00824   stream << std::endl ;
    00825   if ( 0 == histo     ) { return stream ; }  // RETURN
    00826   Histo hist ;
    00827   StatusCode sc = _getHisto ( histo , hist ) ;
    00828   if ( sc.isFailure() ) { return stream ; }  // RETURN
    00829   //
    00830   stream
    00831     << boost::format ( " Histo Name  : \"%s\"")
    00832     % histo -> GetName ()
    00833     << std::endl
    00834     << boost::format ( " Histo Title : \"%s\"")
    00835     % histo -> GetTitle ()
    00836     << std::endl
    00837     << std::endl ;
    00838   //
    00839   stream
    00840     << boost::format ( " Mean        : %11.5g +- %-10.4g ")
    00841     % histo -> GetMean      ()
    00842     % histo -> GetMeanError ()
    00843     << std::endl
    00844     << boost::format ( " Rms         : %11.5g +- %-10.4g ")
    00845     % histo -> GetRMS      ()
    00846     % histo -> GetRMSError ()
    00847     << std::endl
    00848     << boost::format ( " Skewness    : %11.5g            ")
    00849     % histo -> GetSkewness ()
    00850     << std::endl
    00851     << boost::format ( " Kurtosis    : %11.5g            ")
    00852     % histo -> GetKurtosis ()
    00853     << std::endl
    00854     << std::endl ;
    00855   //
    00856   stream
    00857     << boost::format ( " Entries     :\n | %=11s | %=11s | %=11s | %=11s | %=11s |")
    00858     % "All"
    00859     % "Underflow"
    00860     % "Overflow"
    00861     % "#Equivalent"
    00862     % "Integral"
    00863     << std::endl
    00864     << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
    00865     % histo -> GetEntries ()
    00866     % histo -> GetBinContent ( 0                       )
    00867     % histo -> GetBinContent ( histo->GetNbinsX() + 1  )
    00868     % histo -> GetEffectiveEntries  ()
    00869     % histo -> Integral             ()
    00870     << std::endl
    00871     << std::endl ;
    00872   //
    00873   return dumpText ( hist , width , height , errors , stream ) ;
    00874 }

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.Belyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 962 of file HistoDump.cpp.

    00965 {
    00966   std::ostringstream stream ;
    00967   histoDump ( histo , stream , width , height );
    00968   return stream.str() ;
    00969 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 887 of file HistoDump.cpp.

    00891 {
    00892   stream << std::endl ;
    00893   if ( 0 == histo     ) { return stream ; }  // RETURN
    00894   Histo hist ;
    00895   StatusCode sc = _getHisto ( histo , hist , true ) ;
    00896   if ( sc.isFailure() ) { return stream ; }  // RETURN
    00897   //
    00898   stream
    00899     << boost::format ( " Profile Name  : \"%s\"")
    00900     % histo -> GetName ()
    00901     << std::endl
    00902     << boost::format ( " Profile Title : \"%s\"")
    00903     % histo -> GetTitle ()
    00904     << std::endl
    00905     << std::endl ;
    00906   //
    00907   stream
    00908     << boost::format ( " Mean          : %11.5g ") % histo -> GetMean      ()
    00909     << std::endl
    00910     << boost::format ( " Rms           : %11.5g ") % histo -> GetRMS      ()
    00911     << std::endl
    00912     << std::endl ;
    00913   //
    00914   stream
    00915     << boost::format ( " Entries       :\n | %=11s | %=11s | %=11s | %=11s |")
    00916     % "All"
    00917     % "Underflow"
    00918     % "Overflow"
    00919     % "Integral"
    00920     << std::endl
    00921     << boost::format ( " | %=11.5g | %=11.5g | %=11.5g | %=11.5g |")
    00922     % histo -> GetEntries ()
    00923     % histo -> GetBinContent ( 0                       )
    00924     % histo -> GetBinContent ( histo->GetNbinsX() + 1  )
    00925     % histo -> Integral             ()
    00926     << std::endl
    00927     << std::endl ;
    00928   //
    00929   return dumpText ( hist , width , height , true , stream ) ;
    00930 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 793 of file HistoDump.cpp.

    00797 {
    00798   std::ostringstream stream ;
    00799   histoDump ( histo , stream , width , height , spread );
    00800   return stream.str() ;
    00801 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 718 of file HistoDump.cpp.

    00723 {
    00724   stream << std::endl ;
    00725   if ( 0 == histo     ) { return stream ; }  // RETURN
    00726   Histo hist ;
    00727   StatusCode sc = _getHisto ( histo , hist , spread ) ;
    00728   if ( sc.isFailure() ) { return stream ; }  // RETURN
    00729   //
    00730   stream
    00731     << boost::format ( " Histo TES   : \"%s\"") % path ( histo )
    00732     << std::endl
    00733     << boost::format ( " Histo Title : \"%s\"") % histo->title()
    00734     << std::endl
    00735     << std::endl ;
    00736   //
    00737   stream
    00738     << boost::format ( " Mean        : %11.5g ") % histo->mean()
    00739     << std::endl
    00740     << boost::format ( " Rms         : %11.5g ") % histo->rms ()
    00741     << std::endl
    00742     << std::endl ;
    00743   //
    00744   stream
    00745     << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s |")
    00746     % "All"
    00747     % "In Range"
    00748     % "Underflow"
    00749     % "Overflow"
    00750     // % "#Equivalent"
    00751     % "Integral"
    00752     % "Total"
    00753     << std::endl
    00754     << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g |")
    00755     % histo -> allEntries ()
    00756     % histo -> entries    ()
    00757     % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
    00758     % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )
    00759     // % histo -> equivalentBinEntries ()
    00760     % histo -> sumBinHeights        ()
    00761     % histo -> sumAllBinHeights     ()
    00762     << std::endl
    00763     << std::endl ;
    00764   //
    00765   const AIDA::IAnnotation& a = histo->annotation () ;
    00766   if ( 0 != a.size() )
    00767   {
    00768     stream << " Annotation" << std::endl ;
    00769     for ( int i = 0 ; i < a.size() ; ++i )
    00770     {
    00771       stream
    00772         << boost::format ( " | %-25.25s : %-45.45s | ")
    00773         % a.key   ( i )
    00774         % a.value ( i )
    00775         << std::endl ;
    00776     }
    00777     stream << std::endl ;
    00778   }
    00779   //
    00780   return dumpText ( hist , width , height , true , stream ) ;
    00781 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 696 of file HistoDump.cpp.

    00700 {
    00701   std::ostringstream stream ;
    00702   histoDump ( histo , stream , width , height , errors );
    00703   return stream.str() ;
    00704 }

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.BElyaev@nikhef.nl

Date:
  2009-09-19

Definition at line 607 of file HistoDump.cpp.

    00612 {
    00613   stream << std::endl ;
    00614   if ( 0 == histo     ) { return stream ; }  // RETURN
    00615   Histo hist ;
    00616   StatusCode sc = _getHisto ( histo , hist ) ;
    00617   if ( sc.isFailure() ) { return stream ; }  // RETURN
    00618   //
    00619   stream
    00620     << boost::format ( " Histo TES   : \"%s\"") % path ( histo )
    00621     << std::endl
    00622     << boost::format ( " Histo Title : \"%s\"") % histo->title()
    00623     << std::endl
    00624     << std::endl ;
    00625   //
    00626   stream
    00627     << boost::format ( " Mean        : %11.5g +- %-10.4g ")
    00628     % Gaudi::Utils::HistoStats::mean        ( histo )
    00629     % Gaudi::Utils::HistoStats::meanErr     ( histo )
    00630     << std::endl
    00631     << boost::format ( " Rms         : %11.5g +- %-10.4g ")
    00632     % Gaudi::Utils::HistoStats::rms         ( histo )
    00633     % Gaudi::Utils::HistoStats::rmsErr      ( histo )
    00634     << std::endl
    00635     << boost::format ( " Skewness    : %11.5g +- %-10.4g ")
    00636     % Gaudi::Utils::HistoStats::skewness    ( histo )
    00637     % Gaudi::Utils::HistoStats::skewnessErr ( histo )
    00638     << std::endl
    00639     << boost::format ( " Kurtosis    : %11.5g +- %-10.4g ")
    00640     % Gaudi::Utils::HistoStats::kurtosis    ( histo )
    00641     % Gaudi::Utils::HistoStats::kurtosisErr ( histo )
    00642     << std::endl
    00643     << std::endl ;
    00644   //
    00645   stream
    00646     << boost::format ( " Entries     :\n | %=9s | %=9s | %=9s | %9s | %=11s | %=11s | %=11s |")
    00647     % "All"
    00648     % "In Range"
    00649     % "Underflow"
    00650     % "Overflow"
    00651     % "#Equivalent"
    00652     % "Integral"
    00653     % "Total"
    00654     << std::endl
    00655     << boost::format ( " | %=9d | %=9d | %=9d | %=9d | %=11.5g | %=11.5g | %=11.5g |")
    00656     % histo -> allEntries ()
    00657     % histo -> entries    ()
    00658     % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
    00659     % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN  )
    00660     % histo -> equivalentBinEntries ()
    00661     % histo -> sumBinHeights        ()
    00662     % histo -> sumAllBinHeights     ()
    00663     << std::endl
    00664     << std::endl ;
    00665   //
    00666   const AIDA::IAnnotation& a = histo->annotation () ;
    00667   if ( 0 != a.size() )
    00668   {
    00669     stream << " Annotation" << std::endl ;
    00670     for ( int i = 0 ; i < a.size() ; ++i )
    00671     {
    00672       stream
    00673         << boost::format ( " | %-25.25s : %-45.45s | ")
    00674         % a.key   ( i )
    00675         % a.value ( i )
    00676         << std::endl ;
    00677     }
    00678     stream << std::endl ;
    00679   }
    00680   //
    00681   return dumpText ( hist , width , height , errors , stream ) ;
    00682 }

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.

    00190 { 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.

    00183 { 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.

    00176 { 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.

    00169 { 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.

    00162 { 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.

    00155 { 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.

    00148 { return htitle_ ( histo , title ) ; }

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.

    00141 { 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 ibelyaev@physics.syr.edu

Date:
  2007-08-08

Definition at line 185 of file HistoTableFormat.cpp.

    00186 {
    00187   if ( 0 == aida     ) { return "" ; }                          // RETURN
    00188   const DataObject* object   = dynamic_cast<const DataObject*>( aida ) ;
    00189   if ( 0 == object   ) { return "" ; }                          // RETURN
    00190   IRegistry*        registry = object->registry() ;
    00191   if ( 0 == registry ) { return "" ; }                          // RETURN
    00192   std::string _path = registry->identifier() ;
    00193   std::string::size_type n = _path.find("/stat/") ;
    00194   if ( 0 == n ) { return std::string(_path,6) ; }               // RETURN
    00195   return _path ;                                                // RETURN
    00196 }

template<class LIST, class STREAM, class TERMINATOR>

STREAM& Gaudi::Utils::Histos::printList | ( | const LIST & | histos,
|  | const std::string & | fmt,
|  | STREAM & | stream,
|  | TERMINATOR | term |
| ) |  |  | `[inline]`

print the simple container of histograms as table

      using namespace Gaudi::Utils::Histos ;

      SEQUENCE histos = ... ;

      // print a table with three columns:  path, title and #entries

      printList
        ( histos          ,
          " | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
          std::cout       ,
          '\n'            ) ;

Parameters:

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

Definition at line 269 of file HistoTableFormat.h.

    00273       {
    00274         return printList
    00275           ( histos.begin () , histos.end  () , fmt , stream , term ) ;
    00276       }

template<class HISTO, class STREAM, class TERMINATOR>

STREAM& Gaudi::Utils::Histos::printList | ( | HISTO | first,
|  | HISTO | last,
|  | const std::string & | fmt,
|  | STREAM & | stream,
|  | TERMINATOR | term |
| ) |  |  | `[inline]`

print the simple sequence (list-like) of histograms as table

      SEQUENCE histos = ... ;

      // print a table with three colums  path, title and #entries

      Gaudi::Utils::Histos::printList
        ( histos.begin () ,
          histos.end   () ,
          " | %1$|-40.40s | %2$-30.30s | %3$=7d | " ,
          std::cout       ,
          '\n'            ) ;

Parameters:

  | first | begin-iterator for the sequence
  | last | end-iterator for the sequence
  | stream | the stream to be used for printout
  | term | the terminmator for the stream
  | fmt | the format to be used

Definition at line 233 of file HistoTableFormat.h.

    00238       {
    00239         for ( ; first != last ; ++first )
    00240         { stream << format   ( *first , fmt ) << term ; }  // print table rows
    00241         return stream ;                                    // RETURN
    00242       }

template<class MAP, class STREAM, class TERMINATOR>

STREAM& Gaudi::Utils::Histos::printMap | ( | const MAP & | histos,
|  | const std::string & | fmt1,
|  | const std::string & | fmt2,
|  | STREAM & | stream,
|  | TERMINATOR | term |
| ) |  |  | `[inline]`

Print the "associative sequence" (e.g.

part of std:map) of histograms as table:

      using namespace Gaudi::Utils::Histos ;

      const std::map<std::string,AIDA::IHistogram1D*>& m = ... ;

      printMap
       ( m          ,
         "| %1$-10.10s | %2% " , // short format
         Gaudi::Utils::Histos::Formats::histoFormatOnly ,
         always()   ,
         endmsg     ) ;

Print only mean and rms:

      using namespace Gaudi::Utils::Histos ;

      const std::map<GaudiAlg::ID,AIDA::IHistogram1D*>& m = ... ;

      printMap
        ( m          ,
          "| %1$-10.10s | %2% "    , // short format
          " %8$10.5g+-%10$-10.5g|", // mean+-rms
          always()   ,
          endmsg     ) ;

Parameters:

  | begin | 'begin'-iterator for the mapping sequence
  | end | 'end'-iterator for the mapping sequence
  | fmt1 | 'short' format for the table printout
  | fmt3 | format for the printout of the histogram
  | stream | the stream for printout
  | term | stream terminator

Definition at line 385 of file HistoTableFormat.h.

    00390       {
    00391         return printMap
    00392           ( histos.begin () , histos.end() , fmt1 , fmt2 , stream , term ) ;
    00393       }

template<class HISTO, class STREAM, class TERMINATOR>

STREAM& Gaudi::Utils::Histos::printMap | ( | HISTO | begin,
|  | HISTO | end,
|  | const std::string & | fmt1,
|  | const std::string & | fmt2,
|  | STREAM & | stream,
|  | TERMINATOR | term |
| ) |  |  | `[inline]`

Print the "associative sequence" (e.g.

part of std:map) of histograms as table:

      using namespace Gaudi::Utils::Histos ;

      const std::map<std::string,AIDA::IHistogram1D*>& m = ... ;

      printMap
       ( m.begin () ,
         m.end   () ,
         "| %1$-10.10s | %2% " , // short format
         Gaudi::Utils::Histos::Formats::histoFormatOnly ,
         always()   ,
         endmsg     ) ;

Print only mean and rms:

      using namespace Gaudi::Utils::Histos ;

      const std::map<GaudiAlg::ID,AIDA::IHistogram1D*>& m = ... ;

      printMap
        ( m.begin () ,
          m.end   () ,
          "| %1$-10.10s | %2% "    , // short format
          " %8$10.5g+-%10$-10.5g|", // mean+-rms
          always()   ,
          endmsg     ) ;

Parameters:

  | begin | 'begin'-iterator for the mapping sequence
  | end | 'end'-iterator for the mapping sequence
  | fmt1 | 'short' format for the table printout
  | fmt3 | format for the printout of the histogram
  | stream | the stream for printout
  | term | stream terminator

Definition at line 324 of file HistoTableFormat.h.

    00330       {
    00331         for ( ; begin != end ; ++begin )
    00332         {
    00333           stream << format
    00334             ( begin -> second , // the histogram
    00335               begin -> first  , // the key
    00336               fmt1  ,  fmt2   ) << term ;
    00337         }
    00338         return stream ;
    00339       }

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

Definition at line 210 of file Fill.cpp.

    00210 { return histo ; }

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

Definition at line 206 of file Fill.cpp.

    00206 { return histo ; }

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

Definition at line 202 of file Fill.cpp.

    00202 { return histo ; }

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

Definition at line 198 of file Fill.cpp.

    00198 { return histo ; }

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

Definition at line 194 of file Fill.cpp.

    00194 { return histo ; }