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 <string>
9 #include <iosfwd>
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
65  ( const TH1D& histo ,
66  const bool asXML = false ) ;
67  // ====================================================================
75  static std::string toString
76  ( const TH2D& histo ,
77  const bool asXML = false ) ;
78  // ====================================================================
86  static std::string toString
87  ( const AIDA::IHistogram1D& histo ,
88  const bool asXML = false ) ;
89  // ====================================================================
97  static std::string toString
98  ( const AIDA::IHistogram2D& histo ,
99  const bool asXML = false ) ;
100  // ====================================================================
106  static StatusCode fromString
107  ( TH1D& result , const std::string& input ) ;
108  // ====================================================================
114  static StatusCode fromString
115  ( AIDA::IHistogram1D& result , const std::string& input ) ;
116  // ====================================================================
122  static StatusCode fromString
123  ( TH2D& result , const std::string& input ) ;
124  // ====================================================================
130  static StatusCode fromString
131  ( AIDA::IHistogram2D& result , const std::string& input ) ;
132  // ====================================================================
133  static std::string toXml ( const TH1D& histo ) ;
134  static std::string toXml ( const TH2D& histo ) ;
135  static std::string toXml ( const TH3D& histo ) ;
136  static std::string toXml ( const TProfile& histo ) ;
137  static std::string toXml ( const TProfile2D& histo ) ;
138  // ====================================================================
139  static std::string toXml ( const AIDA::IHistogram1D& histo ) ;
140  static std::string toXml ( const AIDA::IHistogram2D& histo ) ;
141  static std::string toXml ( const AIDA::IHistogram3D& histo ) ;
142  static std::string toXml ( const AIDA::IProfile1D& histo ) ;
143  static std::string toXml ( const AIDA::IProfile2D& histo ) ;
144  // ====================================================================
145  static StatusCode fromXml
146  ( TH1D& result , const std::string& input ) ;
147  static StatusCode fromXml
148  ( TH2D& result , const std::string& input ) ;
149  static StatusCode fromXml
150  ( TH3D& result , const std::string& input ) ;
151  static StatusCode fromXml
152  ( TProfile& result , const std::string& input ) ;
153  static StatusCode fromXml
154  ( TProfile2D& result , const std::string& input ) ;
155  // ====================================================================
156  static StatusCode fromXml
157  ( AIDA::IHistogram1D& result , const std::string& input ) ;
158  static StatusCode fromXml
159  ( AIDA::IHistogram2D& result , const std::string& input ) ;
160  static StatusCode fromXml
161  ( AIDA::IHistogram3D& result , const std::string& input ) ;
162  static StatusCode fromXml
163  ( AIDA::IProfile1D& result , const std::string& input ) ;
164  static StatusCode fromXml
165  ( AIDA::IProfile2D& result , const std::string& input ) ;
166  // ====================================================================
167  };
168  // ======================================================================
169  } // end of namespace Gaudi::Utils::Histos
170  // ========================================================================
171  } // end of namespace Gaudi::Utils
172  // ==========================================================================
173 } // end of namespace Gaudi
174 // ============================================================================
175 // The END
176 // ============================================================================
177 #endif // GAUDIUTILS_HISTOSTRINGS_H
178 // ============================================================================
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:229
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:367
GaudiKernel.
Definition: Fill.h:8
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition: HistoXML.cpp:67
Helper class to produce "good" dictionaries.
Definition: HistoStrings.h:52
#define GAUDI_API
Definition: Kernel.h:107
Helper functions to set/get the application return code.
Definition: __init__.py:1