The Gaudi Framework  v30r3 (a5ef0a68)
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 {
23  class IHistogram1D;
24  class IHistogram2D;
25  class IHistogram3D;
26  class IProfile1D;
27  class IProfile2D;
28 }
29 // ============================================================================
30 // ROOT
31 // ============================================================================
32 class TH1D; // ROOT
33 class TH2D; // ROOT
34 class TH3D; // ROOT
35 class TProfile; // ROOT
36 class TProfile2D; // ROOT
37 // ============================================================================
38 namespace Gaudi
39 {
40  // ==========================================================================
41  namespace Utils
42  {
43  // ========================================================================
44  namespace Histos
45  {
46  // ======================================================================
53  {
54  // ====================================================================
55  public:
56  // ====================================================================
64  static std::string toString( const TH1D& histo, const bool asXML = false );
65  // ====================================================================
73  static std::string toString( const TH2D& histo, const bool asXML = false );
74  // ====================================================================
82  static std::string toString( const AIDA::IHistogram1D& histo, const bool asXML = false );
83  // ====================================================================
91  static std::string toString( const AIDA::IHistogram2D& histo, const bool asXML = false );
92  // ====================================================================
98  static StatusCode fromString( TH1D& result, const std::string& input );
99  // ====================================================================
105  static StatusCode fromString( AIDA::IHistogram1D& result, const std::string& input );
106  // ====================================================================
112  static StatusCode fromString( TH2D& result, const std::string& input );
113  // ====================================================================
119  static StatusCode fromString( AIDA::IHistogram2D& result, const std::string& input );
120  // ====================================================================
121  static std::string toXml( const TH1D& histo );
122  static std::string toXml( const TH2D& histo );
123  static std::string toXml( const TH3D& histo );
124  static std::string toXml( const TProfile& histo );
125  static std::string toXml( const TProfile2D& histo );
126  // ====================================================================
127  static std::string toXml( const AIDA::IHistogram1D& histo );
128  static std::string toXml( const AIDA::IHistogram2D& histo );
129  static std::string toXml( const AIDA::IHistogram3D& histo );
130  static std::string toXml( const AIDA::IProfile1D& histo );
131  static std::string toXml( const AIDA::IProfile2D& histo );
132  // ====================================================================
133  static StatusCode fromXml( TH1D& result, const std::string& input );
134  static StatusCode fromXml( TH2D& result, const std::string& input );
135  static StatusCode fromXml( TH3D& result, const std::string& input );
136  static StatusCode fromXml( TProfile& result, const std::string& input );
137  static StatusCode fromXml( TProfile2D& result, const std::string& input );
138  // ====================================================================
139  static StatusCode fromXml( AIDA::IHistogram1D& result, const std::string& input );
140  static StatusCode fromXml( AIDA::IHistogram2D& result, const std::string& input );
141  static StatusCode fromXml( AIDA::IHistogram3D& result, const std::string& input );
142  static StatusCode fromXml( AIDA::IProfile1D& result, const std::string& input );
143  static StatusCode fromXml( AIDA::IProfile2D& result, const std::string& input );
144  // ====================================================================
145  };
146  // ======================================================================
147  } // end of namespace Gaudi::Utils::Histos
148  // ========================================================================
149  } // end of namespace Gaudi::Utils
150  // ==========================================================================
151 } // end of namespace Gaudi
152 // ============================================================================
153 // The END
154 // ============================================================================
155 #endif // GAUDIUTILS_HISTOSTRINGS_H
156 // ============================================================================
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:202
GaudiKernel.
Definition: Fill.h:10
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:66
Helper class to produce "good" dictionaries.
Definition: HistoStrings.h:52
#define GAUDI_API
Definition: Kernel.h:104
Helper functions to set/get the application return code.
Definition: __init__.py:1
std::string toString(const Type &)