Gaudi Framework, version v23r2

Home   Generated: Thu Jun 28 2012

HistoStrings.cpp

Go to the documentation of this file.
00001 // ============================================================================
00002 // Include files
00003 // ============================================================================
00004 // STD & STL
00005 // ============================================================================
00006 #include <sstream>
00007 // ============================================================================
00008 // local
00009 // ============================================================================
00010 #include "GaudiUtils/HistoStrings.h"
00011 #include "GaudiUtils/Histo2String.h"
00012 #include "GaudiUtils/HistoParsers.h"
00013 #include "GaudiUtils/HistoXML.h"
00014 // ============================================================================
00020 // ============================================================================
00021 /*  convert the histogram into the string
00022  *  @param histo  (INPUT)  the histogram to be streamed
00023  *  @param asXML  (INPUT)  use XML-format
00024  *  @return the string representation of the histogram
00025  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
00026  *  @date 2009-09-26
00027  */
00028 // ============================================================================
00029 std::string Gaudi::Utils::Histos::HistoStrings::toString
00030 ( const TH1D&               histo ,
00031   const bool                asXML )
00032 { return Gaudi::Utils::toString ( histo , asXML ) ; }
00033 // ============================================================================
00034 /*  convert the histogram into the string
00035  *  @param histo  (INPUT)  the histogram to be streamed
00036  *  @param asXML  (INPUT)  use XML-format
00037  *  @return the string representation of the histogram
00038  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
00039  *  @date 2009-09-26
00040  */
00041 // ============================================================================
00042 std::string Gaudi::Utils::Histos::HistoStrings::toString
00043 ( const TH2D&               histo ,
00044   const bool                asXML )
00045 { return Gaudi::Utils::toString ( histo , asXML ) ; }
00046 // ============================================================================
00047 /*  convert the histogram into the string
00048  *  @param histo  (INPUT)  the histogram to be streamed
00049  *  @param asXML  (INPUT)  use XML-format
00050  *  @return the string representation of the histogram
00051  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
00052  *  @date 2009-09-26
00053  */
00054 // ============================================================================
00055 std::string Gaudi::Utils::Histos::HistoStrings::toString
00056 ( const AIDA::IHistogram1D& histo ,
00057   const bool                asXML )
00058 { return Gaudi::Utils::toString ( histo , asXML ) ; }
00059 // ============================================================================
00060 /*  convert the histogram into the string
00061  *  @param histo  (INPUT)  the histogram to be streamed
00062  *  @param asXML  (INPUT)  use XML-format
00063  *  @return the string representation of the histogram
00064  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
00065  *  @date 2009-09-26
00066  */
00067 // ============================================================================
00068 std::string Gaudi::Utils::Histos::HistoStrings::toString
00069 ( const AIDA::IHistogram2D& histo ,
00070   const bool                asXML )
00071 { return Gaudi::Utils::toString ( histo , asXML ) ; }
00072 // ============================================================================
00073 /*  parse the histogram from string
00074  *  @param result (OUTPUT)  the parsed histogram
00075  *  @param input  (INPUT)   the input string
00076  *  @return status code
00077  */
00078 // ============================================================================
00079 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
00080 ( TH1D& result , const std::string& input )
00081 { return Gaudi::Parsers::parse ( result , input ) ; }
00082 // ============================================================================
00083 /*  parse the histogram from string
00084  *  @param result (OUTPUT)  the parsed histogram
00085  *  @param input  (INPUT)   the input string
00086  *  @return status code
00087  */
00088 // ============================================================================
00089 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
00090 ( TH2D& result , const std::string& input )
00091 { return Gaudi::Parsers::parse ( result , input ) ; }
00092 // ============================================================================
00093 /*  parse the histogram from string
00094  *  @param result (OUTPUT)  the parsed histogram
00095  *  @param input  (INPUT)   the input XML string
00096  *  @return status code
00097  */
00098 // ============================================================================
00099 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
00100 ( AIDA::IHistogram1D& result , const std::string& input )
00101 { return Gaudi::Parsers::parse ( result , input ) ; }
00102 // ============================================================================
00103 /*  parse the histogram from string
00104  *  @param result (OUTPUT)  the parsed histogram
00105  *  @param input  (INPUT)   the input XML string
00106  *  @return status code
00107  */
00108 // ============================================================================
00109 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
00110 ( AIDA::IHistogram2D& result , const std::string& input )
00111 { return Gaudi::Parsers::parse ( result , input ) ; }
00112 // ============================================================================
00113 namespace
00114 {
00115   // ==========================================================================
00116   template <class TYPE>
00117   std::string _toXml ( const TYPE& object )
00118   {
00119     std::ostringstream s ;
00120     Gaudi::Utils::Histos::toXml ( object , s ) ;
00121     return s.str() ;
00122   }
00123   // ==========================================================================
00124   template <class TYPE>
00125   StatusCode _fromXml ( TYPE& object , const std::string& input )
00126   {
00127     return Gaudi::Utils::Histos::fromXml ( object , input ) ;
00128   }
00129   // ==========================================================================
00130 } //                                                end of anonymous namespace
00131 // ============================================================================
00132 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00133 ( const TH1D&               histo ) { return _toXml ( histo ) ; }
00134 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00135 ( const TH2D&               histo ) { return _toXml ( histo ) ; }
00136 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00137 ( const TH3D&               histo ) { return _toXml ( histo ) ; }
00138 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00139 ( const TProfile&           histo ) { return _toXml ( histo ) ; }
00140 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00141 ( const TProfile2D&         histo ) { return _toXml ( histo ) ; }
00142 // ============================================================================
00143 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00144 ( const AIDA::IHistogram1D& histo ) { return _toXml ( histo ) ; }
00145 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00146 ( const AIDA::IHistogram2D& histo ) { return _toXml ( histo ) ; }
00147 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00148 ( const AIDA::IHistogram3D& histo ) { return _toXml ( histo ) ; }
00149 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00150 ( const AIDA::IProfile1D&   histo ) { return _toXml ( histo ) ; }
00151 std::string Gaudi::Utils::Histos::HistoStrings::toXml
00152 ( const AIDA::IProfile2D&   histo ) { return _toXml ( histo ) ; }
00153 // ============================================================================
00154 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00155 ( TH1D&               result , const std::string& input )
00156 { return _fromXml ( result , input ) ; }
00157 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00158 ( TH2D&               result , const std::string& input )
00159 { return _fromXml ( result , input ) ; }
00160 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00161 ( TH3D&               result , const std::string& input )
00162 { return _fromXml ( result , input ) ; }
00163 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00164 ( TProfile&           result , const std::string& input )
00165 { return _fromXml ( result , input ) ; }
00166 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00167 ( TProfile2D&         result , const std::string& input )
00168 { return _fromXml ( result , input ) ; }
00169 // ============================================================================
00170 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00171 ( AIDA::IHistogram1D& result , const std::string& input )
00172 { return _fromXml ( result , input ) ; }
00173 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00174 ( AIDA::IHistogram2D& result , const std::string& input )
00175 { return _fromXml ( result , input ) ; }
00176 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00177 ( AIDA::IHistogram3D& result , const std::string& input )
00178 { return _fromXml ( result , input ) ; }
00179 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00180 ( AIDA::IProfile1D&   result , const std::string& input )
00181 { return _fromXml ( result , input ) ; }
00182 StatusCode Gaudi::Utils::Histos::HistoStrings::fromXml
00183 ( AIDA::IProfile2D&   result , const std::string& input )
00184 { return _fromXml ( result , input ) ; }
00185 // ============================================================================
00186 
00187 
00188 
00189 
00190 // ============================================================================
00191 // The END
00192 // ============================================================================
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Thu Jun 28 2012 23:27:29 for Gaudi Framework, version v23r2 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004