10 #include "GaudiUtils/HistoStrings.h"
11 #include "GaudiUtils/Histo2String.h"
12 #include "GaudiUtils/HistoParsers.h"
13 #include "GaudiUtils/HistoXML.h"
56 (
const AIDA::IHistogram1D& histo ,
69 (
const AIDA::IHistogram2D& histo ,
80 ( TH1D& result ,
const std::string& input )
90 ( TH2D& result ,
const std::string& input )
100 ( AIDA::IHistogram1D& result ,
const std::string& input )
110 ( AIDA::IHistogram2D& result ,
const std::string& input )
116 template <
class TYPE>
117 std::string _toXml (
const TYPE&
object )
119 std::ostringstream
s ;
124 template <
class TYPE>
125 StatusCode _fromXml ( TYPE&
object ,
const std::string& input )
133 (
const TH1D& histo ) {
return _toXml ( histo ) ; }
135 (
const TH2D& histo ) {
return _toXml ( histo ) ; }
137 (
const TH3D& histo ) {
return _toXml ( histo ) ; }
139 (
const TProfile& histo ) {
return _toXml ( histo ) ; }
141 (
const TProfile2D& histo ) {
return _toXml ( histo ) ; }
144 (
const AIDA::IHistogram1D& histo ) {
return _toXml ( histo ) ; }
146 (
const AIDA::IHistogram2D& histo ) {
return _toXml ( histo ) ; }
148 (
const AIDA::IHistogram3D& histo ) {
return _toXml ( histo ) ; }
150 (
const AIDA::IProfile1D& histo ) {
return _toXml ( histo ) ; }
152 (
const AIDA::IProfile2D& histo ) {
return _toXml ( histo ) ; }
155 ( TH1D& result ,
const std::string& input )
156 {
return _fromXml ( result , input ) ; }
158 ( TH2D& result ,
const std::string& input )
159 {
return _fromXml ( result , input ) ; }
161 ( TH3D& result ,
const std::string& input )
162 {
return _fromXml ( result , input ) ; }
164 ( TProfile& result ,
const std::string& input )
165 {
return _fromXml ( result , input ) ; }
167 ( TProfile2D& result ,
const std::string& input )
168 {
return _fromXml ( result , input ) ; }
171 ( AIDA::IHistogram1D& result ,
const std::string& input )
172 {
return _fromXml ( result , input ) ; }
174 ( AIDA::IHistogram2D& result ,
const std::string& input )
175 {
return _fromXml ( result , input ) ; }
177 ( AIDA::IHistogram3D& result ,
const std::string& input )
178 {
return _fromXml ( result , input ) ; }
180 ( AIDA::IProfile1D& result ,
const std::string& input )
181 {
return _fromXml ( result , input ) ; }
183 ( AIDA::IProfile2D& result ,
const std::string& input )
184 {
return _fromXml ( result , input ) ; }
static std::string toXml(const TH1D &histo)
static StatusCode fromString(TH1D &result, const std::string &input)
parse the histogram from string
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
This class is used for returning status codes from appropriate routines.
static std::string toString(const TH1D &histo, const bool asXML=false)
convert the histogram into the string
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
static StatusCode fromXml(TH1D &result, const std::string &input)
GAUDI_API StatusCode fromXml(TH1D &result, const std::string &input)
parse the histogram from standard ROOT XML