Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HistoStrings.h
Go to the documentation of this file.
1 #ifndef GAUDIUTILS_HISTOSTRINGS_H
2 #define GAUDIUTILS_HISTOSTRINGS_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <iosfwd>
9 #include <string>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/StatusCode.h"
14 // ============================================================================
15 // forward declarations
16 // ============================================================================
17 // Forward declarations
18 // ============================================================================
19 // AIDA
20 // ============================================================================
21 namespace AIDA {
22  class IHistogram1D;
23  class IHistogram2D;
24  class IHistogram3D;
25  class IProfile1D;
26  class IProfile2D;
27 } // namespace AIDA
28 // ============================================================================
29 // ROOT
30 // ============================================================================
31 class TH1D; // ROOT
32 class TH2D; // ROOT
33 class TH3D; // ROOT
34 class TProfile; // ROOT
35 class TProfile2D; // ROOT
36 // ============================================================================
37 namespace Gaudi {
38  // ==========================================================================
39  namespace Utils {
40  // ========================================================================
41  namespace Histos {
42  // ======================================================================
49  // ====================================================================
50  public:
51  // ====================================================================
59  static std::string toString( const TH1D& histo, const bool asXML = false );
60  // ====================================================================
68  static std::string toString( const TH2D& histo, const bool asXML = false );
69  // ====================================================================
77  static std::string toString( const AIDA::IHistogram1D& histo, const bool asXML = false );
78  // ====================================================================
86  static std::string toString( const AIDA::IHistogram2D& histo, const bool asXML = false );
87  // ====================================================================
93  static StatusCode fromString( TH1D& result, const std::string& input );
94  // ====================================================================
100  static StatusCode fromString( AIDA::IHistogram1D& result, const std::string& input );
101  // ====================================================================
107  static StatusCode fromString( TH2D& result, const std::string& input );
108  // ====================================================================
114  static StatusCode fromString( AIDA::IHistogram2D& result, const std::string& input );
115  // ====================================================================
116  static std::string toXml( const TH1D& histo );
117  static std::string toXml( const TH2D& histo );
118  static std::string toXml( const TH3D& histo );
119  static std::string toXml( const TProfile& histo );
120  static std::string toXml( const TProfile2D& histo );
121  // ====================================================================
122  static std::string toXml( const AIDA::IHistogram1D& histo );
123  static std::string toXml( const AIDA::IHistogram2D& histo );
124  static std::string toXml( const AIDA::IHistogram3D& histo );
125  static std::string toXml( const AIDA::IProfile1D& histo );
126  static std::string toXml( const AIDA::IProfile2D& histo );
127  // ====================================================================
128  static StatusCode fromXml( TH1D& result, const std::string& input );
129  static StatusCode fromXml( TH2D& result, const std::string& input );
130  static StatusCode fromXml( TH3D& result, const std::string& input );
131  static StatusCode fromXml( TProfile& result, const std::string& input );
132  static StatusCode fromXml( TProfile2D& result, const std::string& input );
133  // ====================================================================
134  static StatusCode fromXml( AIDA::IHistogram1D& result, const std::string& input );
135  static StatusCode fromXml( AIDA::IHistogram2D& result, const std::string& input );
136  static StatusCode fromXml( AIDA::IHistogram3D& result, const std::string& input );
137  static StatusCode fromXml( AIDA::IProfile1D& result, const std::string& input );
138  static StatusCode fromXml( AIDA::IProfile2D& result, const std::string& input );
139  // ====================================================================
140  };
141  // ======================================================================
142  } // namespace Histos
143  // ========================================================================
144  } // namespace Utils
145  // ==========================================================================
146 } // end of namespace Gaudi
147 // ============================================================================
148 // The END
149 // ============================================================================
150 #endif // GAUDIUTILS_HISTOSTRINGS_H
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML
Definition: HistoXML.cpp:187
GaudiKernel.
Definition: Fill.h:10
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:64
Helper class to produce "good" dictionaries.
Definition: HistoStrings.h:48
#define GAUDI_API
Definition: Kernel.h:71
Helper functions to set/get the application return code.
Definition: __init__.py:1
std::string toString(const Type &)