25 #include <AIDA/IHistogram1D.h>
26 #include <AIDA/IHistogram2D.h>
27 #include <AIDA/IHistogram3D.h>
47 template <
class HISTO>
58 const TAxis* axis = histo.GetXaxis();
59 const unsigned int nBins = axis->GetNbins();
62 if ( axis->IsVariableBinSize() ) {
63 const TArrayD* xbins = axis->GetXbins();
64 const unsigned int xsize = xbins->GetSize();
66 for (
unsigned int iBin = 0; iBin < xsize; ++iBin ) { edges.
push_back( xbins->At( iBin ) ); }
79 for (
unsigned int iBin = 0; iBin <= nBins + 1; ++iBin ) {
80 bins.
emplace_back( histo.GetBinContent( iBin ), histo.GetBinError( iBin ) );
90 template <
class HISTO>
101 const TAxis* xaxis = histo.GetXaxis();
102 const int xBins = xaxis->GetNbins();
105 if ( xaxis->IsVariableBinSize() ) {
106 const TArrayD* xbins = xaxis->GetXbins();
107 const unsigned int xsize = xbins->GetSize();
109 for (
unsigned int iBin = 0; iBin < xsize; ++iBin ) { edges.
push_back( xbins->At( iBin ) ); }
122 const TAxis* yaxis = histo.GetYaxis();
123 const int yBins = yaxis->GetNbins();
126 if ( yaxis->IsVariableBinSize() ) {
127 const TArrayD* ybins = yaxis->GetXbins();
128 const unsigned int ysize = ybins->GetSize();
130 for (
unsigned int iBin = 0; iBin < ysize; ++iBin ) { edges.
push_back( ybins->At( iBin ) ); }
145 for (
int jBin = yBins + 1; jBin >= 0; --jBin ) {
147 for (
int iBin = 0; iBin <= xBins + 1; ++iBin ) {
152 if ( xBins + 1 != iBin || 0 != jBin ) {
stream <<
" , "; }
162 template <
class HISTO>
173 const TAxis* xaxis = histo.GetXaxis();
174 const int xBins = xaxis->GetNbins();
177 if ( xaxis->IsVariableBinSize() ) {
178 const TArrayD* xbins = xaxis->GetXbins();
179 const unsigned int xsize = xbins->GetSize();
181 for (
unsigned int iBin = 0; iBin < xsize; ++iBin ) { edges.
push_back( xbins->At( iBin ) ); }
194 const TAxis* yaxis = histo.GetYaxis();
195 const int yBins = yaxis->GetNbins();
198 if ( yaxis->IsVariableBinSize() ) {
199 const TArrayD* ybins = yaxis->GetXbins();
200 const unsigned int ysize = ybins->GetSize();
202 for (
unsigned int iBin = 0; iBin < ysize; ++iBin ) { edges.
push_back( ybins->At( iBin ) ); }
215 const TAxis* zaxis = histo.GetZaxis();
216 const int zBins = zaxis->GetNbins();
219 if ( zaxis->IsVariableBinSize() ) {
220 const TArrayD* zbins = zaxis->GetXbins();
221 const unsigned int zsize = zbins->GetSize();
223 for (
unsigned int iBin = 0; iBin < zsize; ++iBin ) { edges.
push_back( zbins->At( iBin ) ); }
238 for (
int kBin = 0; kBin <= zBins + 1; ++kBin ) {
239 for (
int jBin = yBins + 1; jBin >= 0; --jBin ) {
241 for (
int iBin = 0; iBin <= xBins + 1; ++iBin ) {
244 std::make_pair( histo.GetBinContent( iBin, jBin, kBin ), histo.GetBinError( iBin, jBin, kBin ) ),
247 if ( !( ( ( xBins + 1 ) == iBin ) && ( 0 == jBin ) && ( ( zBins + 1 ) == kBin ) ) ) {
stream <<
" , "; }
267 return _toStream_1D_( histo,
stream, asXML );
277 return _toStream_1D_( histo,
stream, asXML );
287 return _toStream_2D_( histo,
stream, asXML );
297 return _toStream_2D_( histo,
stream, asXML );
307 return _toStream_3D_( histo,
stream, asXML );
317 return _toStream_3D_( histo,
stream, asXML );