Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
14 # pragma warning( disable : 2259 )
18 #include "AIDA/IHistogram1D.h"
19 #include "AIDA/IHistogram2D.h"
20 #include "AIDA/IHistogram3D.h"
21 #include "AIDA/IProfile1D.h"
22 #include "AIDA/IProfile2D.h"
29 #include "TProfile2D.h"
30 #include <fmt/format.h>
57 {
"SimpleHistos/Gaussian mean=0, sigma=1",
"SimpleHistos/101",
"SimpleHistos/102",
"SimpleHistos/1111",
58 "SimpleHistos/test1",
"SimpleHistos/subdir2/bino",
"SimpleHistos/subdir1/bino",
"SimpleHistos/poisson" },
59 "list of 1D-histograms" };
63 {
"SimpleHistos/Gaussian V Flat",
"SimpleHistos/Exponential V Flat",
64 "SimpleHistos/binVpois",
"SimpleHistos/expoVpois" },
65 "list of 2D-histograms" };
68 this,
"Histos3D", {
"SimpleHistos/3D plot AutoID",
"SimpleHistos/3d" },
"list of 3D-histograms" };
71 this,
"Profs1D", {
"SimpleHistos/Expo V Gauss 1DProf" },
"list of 1D-profiles" };
74 this,
"Profs2D", {
"SimpleHistos/321",
"SimpleHistos/2dprof" },
"list of 2D-profiles" };
86 always() <<
"Get the native ROOT representation of histograms!" <<
endmsg;
89 for (
auto&
path : m_1Ds ) {
91 AIDA::IHistogram1D* aida = 0;
93 if ( sc.
isFailure() || 0 == aida ) {
return Error(
"Unable to retrieve 1D-histogram '" + (
path ) +
"'" ); }
96 if ( 0 ==
root ) {
return Error(
"Unable to convert to ROOT the 1D-histogram '" + (
path ) +
"'" ); }
98 info() <<
"The native ROOT printout for 1D-histogram '" << (
path ) <<
"':" <<
endmsg;
101 info() <<
" | Compare | AIDA/HistoStats | ROOT/TH1 | Delta | " <<
endmsg;
102 auto print = [](
double aida,
double root, std::string_view
name ) {
103 return fmt::format(
" | {:<14.14s} | {:>15.8g} | {:< 15.8g} | {:^ 15.8g} | ",
name, aida,
root,
120 for (
auto&
path : m_2Ds ) {
122 AIDA::IHistogram2D* aida = 0;
124 if ( sc.
isFailure() || 0 == aida ) {
return Error(
"Unable to retrieve 2D-histogram '" + (
path ) +
"'" ); }
127 if ( 0 ==
root ) {
return Error(
"Unable to convert to ROOT the 2D-histogram '" + (
path ) +
"'" ); }
129 info() <<
"The native ROOT printout for 2D-histogram '" << (
path ) <<
"':" <<
endmsg;
135 for (
auto&
path : m_3Ds ) {
137 AIDA::IHistogram3D* aida = 0;
139 if ( sc.
isFailure() || 0 == aida ) {
return Error(
"Unable to retrieve 3D-histogram '" + (
path ) +
"'" ); }
142 if ( 0 ==
root ) {
return Error(
"Unable to convert to ROOT the 3D-histogram '" + (
path ) +
"'" ); }
144 info() <<
"The native ROOT printout for 3D-histogram '" << (
path ) <<
"':" <<
endmsg;
150 for (
auto&
path : m_1Ps ) {
152 AIDA::IProfile1D* aida = 0;
154 if ( sc.
isFailure() || 0 == aida ) {
return Error(
"Unable to retrieve 1D-profile '" + (
path ) +
"'" ); }
157 if ( 0 ==
root ) {
return Error(
"Unable to convert to ROOT the 1D-profile '" + (
path ) +
"'" ); }
159 info() <<
"The native ROOT printout for 1D-profile '" << (
path ) <<
"':" <<
endmsg;
165 for (
auto&
path : m_2Ps ) {
167 AIDA::IProfile2D* aida = 0;
169 if ( sc.
isFailure() || 0 == aida ) { Error(
"Unable to retrieve 2D-profile '" + (
path ) +
"'" ).
ignore(); }
172 if ( 0 ==
root ) { Error(
"Unable to convert to ROOT the 2D-profile '" + (
path ) +
"'" ).ignore(); }
174 info() <<
"The native ROOT printout for 2D-profile '" << (
path ) <<
"':" <<
endmsg;
Gaudi::Property< std::vector< std::string > > m_3Ds
Gaudi::Property< std::vector< std::string > > m_2Ps
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Gaudi::Property< std::vector< std::string > > m_1Ps
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
StatusCode execute() override
execution of the algorithm
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
Gaudi::Property< std::vector< std::string > > m_2Ds
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Gaudi::Property< std::vector< std::string > > m_1Ds
constexpr static const auto SUCCESS
StatusCode finalize() override
finalization of the algorithm
#define DECLARE_COMPONENT(type)
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
StatusCode finalize() override
standard finalization method
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
Implementation of property with value of concrete type.
Aida2Root(const std::string &name, ISvcLocator *pSvc)