Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HistoStrings.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // ============================================================================
4 // STD & STL
5 // ============================================================================
6 #include <sstream>
7 // ============================================================================
8 // local
9 // ============================================================================
13 #include "GaudiUtils/HistoXML.h"
14 // ============================================================================
20 // ============================================================================
21 /* convert the histogram into the string
22  * @param histo (INPUT) the histogram to be streamed
23  * @param asXML (INPUT) use XML-format
24  * @return the string representation of the histogram
25  * @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
26  * @date 2009-09-26
27  */
28 // ============================================================================
30 ( const TH1D& histo ,
31  const bool asXML )
32 { return Gaudi::Utils::toString ( histo , asXML ) ; }
33 // ============================================================================
34 /* convert the histogram into the string
35  * @param histo (INPUT) the histogram to be streamed
36  * @param asXML (INPUT) use XML-format
37  * @return the string representation of the histogram
38  * @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
39  * @date 2009-09-26
40  */
41 // ============================================================================
43 ( const TH2D& histo ,
44  const bool asXML )
45 { return Gaudi::Utils::toString ( histo , asXML ) ; }
46 // ============================================================================
47 /* convert the histogram into the string
48  * @param histo (INPUT) the histogram to be streamed
49  * @param asXML (INPUT) use XML-format
50  * @return the string representation of the histogram
51  * @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
52  * @date 2009-09-26
53  */
54 // ============================================================================
56 ( const AIDA::IHistogram1D& histo ,
57  const bool asXML )
58 { return Gaudi::Utils::toString ( histo , asXML ) ; }
59 // ============================================================================
60 /* convert the histogram into the string
61  * @param histo (INPUT) the histogram to be streamed
62  * @param asXML (INPUT) use XML-format
63  * @return the string representation of the histogram
64  * @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
65  * @date 2009-09-26
66  */
67 // ============================================================================
69 ( const AIDA::IHistogram2D& histo ,
70  const bool asXML )
71 { return Gaudi::Utils::toString ( histo , asXML ) ; }
72 // ============================================================================
73 /* parse the histogram from string
74  * @param result (OUTPUT) the parsed histogram
75  * @param input (INPUT) the input string
76  * @return status code
77  */
78 // ============================================================================
79 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
80 ( TH1D& result , const std::string& input )
81 { return Gaudi::Parsers::parse ( result , input ) ; }
82 // ============================================================================
83 /* parse the histogram from string
84  * @param result (OUTPUT) the parsed histogram
85  * @param input (INPUT) the input string
86  * @return status code
87  */
88 // ============================================================================
89 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
90 ( TH2D& result , const std::string& input )
91 { return Gaudi::Parsers::parse ( result , input ) ; }
92 // ============================================================================
93 /* parse the histogram from string
94  * @param result (OUTPUT) the parsed histogram
95  * @param input (INPUT) the input XML string
96  * @return status code
97  */
98 // ============================================================================
99 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
100 ( AIDA::IHistogram1D& result , const std::string& input )
101 { return Gaudi::Parsers::parse ( result , input ) ; }
102 // ============================================================================
103 /* parse the histogram from string
104  * @param result (OUTPUT) the parsed histogram
105  * @param input (INPUT) the input XML string
106  * @return status code
107  */
108 // ============================================================================
109 StatusCode Gaudi::Utils::Histos::HistoStrings::fromString
110 ( AIDA::IHistogram2D& result , const std::string& input )
111 { return Gaudi::Parsers::parse ( result , input ) ; }
112 // ============================================================================
113 namespace
114 {
115  // ==========================================================================
116  template <class TYPE>
117  std::string _toXml ( const TYPE& object )
118  {
120  Gaudi::Utils::Histos::toXml ( object , s ) ;
121  return s.str() ;
122  }
123  // ==========================================================================
124  template <class TYPE>
125  StatusCode _fromXml ( TYPE& object , const std::string& input )
126  {
127  return Gaudi::Utils::Histos::fromXml ( object , input ) ;
128  }
129  // ==========================================================================
130 } // end of anonymous namespace
131 // ============================================================================
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 ) ; }
142 // ============================================================================
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 ) ; }
153 // ============================================================================
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 ) ; }
169 // ============================================================================
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 ) ; }
185 // ============================================================================
186 
187 
188 
189 
190 // ============================================================================
191 // The END
192 // ============================================================================

Generated at Wed Jan 30 2013 17:13:42 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004