15 #define class class GAUDI_API
16 #include "AIDA/IHistogram1D.h"
17 #include "AIDA/IAxis.h"
32 #include "boost/format.hpp"
46 const std::string s_histoFormatStat =
47 "| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |" ;
50 const std::string s_histoFormatStatOnly =
51 "| %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |" ;
54 const std::string s_histoFormatStat1 =
55 "| %3$=7d |%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%15$-9.3g|" ;
60 const std::string s_histoFormatShapeOnly =
61 "|%8$11.5g |%10$11.5g |%12$11.5g |%14$11.5g |%19$11.5g/%21$-11.5g|" ;
67 const std::string s_histoFormatShape =
68 "|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%15$-9.3g|%19$9.3g+-%20$-9.3g|%21$9.3g+-%22$-9.3g|" ;
71 const std::string s_histoFormatLineTitle =
72 " %2$-45.45s mean/sigma/skew/kurtosis = %8$10.4g/%10$10.4g/%12$10.4g/%14$10.4g" ;
75 const std::string s_histoFormatLineOnly =
76 " mean/sigma/skew/kurtosis = %8$10.4g/%10$10.4g/%12$10.4g/%14$10.4g" ;
79 const std::string s_histoFormatOld =
80 " %2$-45.45s Ents/All=%7$5s/%3$5s<X>/sX=%8$.5g/%10$-.5g" ;
83 const std::string s_histoFormatPathTitle =
"| %1$-45.45s | %2$-45.45s | " ;
86 const std::string s_histoFormatFull =
87 "| %1$-45.45s | %2$-45.45s | %3$=7d |%4$5d/%5$-5d|%6$9.3g | %7$-9.3g|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%15$-9.3g|" ;
89 const std::string s_histoFormatFullStat =
90 "| %3$=7d |%4$5d/%5$-5d|%6$9.3g | %7$-9.3g|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%15$-9.3g|" ;
95 const std::string s_histoFormatStatHeader =
96 "| Title | # | Mean | RMS | Skewness | Kurtosis |" ;
99 const std::string s_histoFormatStatOnlyHeader =
100 "| # | Mean | RMS | Skewness | Kurtosis |" ;
103 const std::string s_histoFormatStat1Header =
104 "| # | Mean+-Error | RMS+-Error | Skewness+-Error | Kurtosis+-Error |" ;
107 const std::string s_histoFormatShapeOnlyHeader =
108 "| Mean | RMS | Skewness | Kurtosis | Underflow%/Overflow% |" ;
111 const std::string s_histoFormatShapeHeader =
112 "| Mean | RMS | Skewness | Kurtosis | Underflow [%] | Overflow [%] |" ;
115 const std::string s_histoFormatLineTitleHeader =
" Title " ;
118 const std::string s_histoFormatLineOnlyHeader =
"" ;
121 const std::string s_histoFormatOldHeader =
"" ;
124 const std::string s_histoFormatPathTitleHeader =
125 "| Path in Histogram Data Store | Title | ";
128 const std::string s_histoFormatFullHeader =
129 "| Path in Histogram Data Store | Title | # |Udflw/Ovflw| nEff | Sum | Mean+-Error | RMS+-Error | Skewness+-Error | Kurtosis+-Error |" ;
132 const std::string s_histoFormatFullStatHeader =
133 "| # |Udflw/Ovflw| nEff | Sum | Mean+-Error | RMS+-Error | Skewness+-Error | Kurtosis+-Error |" ;
143 case Old :
return s_histoFormatOld ;
144 case Full :
return s_histoFormatFull ;
145 case FullStat :
return s_histoFormatFullStat ;
146 case Stat :
return s_histoFormatStat ;
147 case StatOnly :
return s_histoFormatStatOnly ;
148 case Stat1 :
return s_histoFormatStat1 ;
149 case ShapeOnly :
return s_histoFormatShapeOnly ;
150 case Shape :
return s_histoFormatShape ;
151 case LineTitle :
return s_histoFormatLineTitle ;
152 case LineOnly :
return s_histoFormatLineOnly ;
153 case PathTitle :
return s_histoFormatPathTitle ;
157 return s_histoFormatStat ;
166 case Old :
return s_histoFormatOldHeader ;
167 case Full :
return s_histoFormatFullHeader ;
168 case FullStat :
return s_histoFormatFullStatHeader ;
169 case Stat :
return s_histoFormatStatHeader ;
170 case Stat1 :
return s_histoFormatStat1Header ;
171 case StatOnly :
return s_histoFormatStatOnlyHeader ;
172 case ShapeOnly :
return s_histoFormatShapeOnlyHeader ;
173 case Shape :
return s_histoFormatShapeHeader ;
174 case LineTitle :
return s_histoFormatLineTitleHeader ;
175 case LineOnly :
return s_histoFormatLineOnlyHeader ;
176 case PathTitle :
return s_histoFormatPathTitleHeader ;
180 return s_histoFormatStatHeader ;
187 if ( 0 == aida ) {
return "" ; }
189 if ( 0 ==
object ) {
return "" ; }
191 if ( 0 == registry ) {
return "" ; }
193 std::string::size_type
n = _path.find(
"/stat/") ;
194 if ( 0 == n ) {
return std::string(_path,6) ; }
203 (
const AIDA::IHistogram1D* histo ,
204 const std::string& fmt )
206 if ( 0 == histo ) {
return "<NULL>" ; }
207 using namespace Gaudi::Utils ;
208 using namespace boost::io ;
211 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
214 % (
"\"" +
path ( histo ) +
"\"" )
215 % (
"\"" + histo -> title () +
"\"" )
216 % histo -> allEntries ()
217 % histo -> binEntries ( AIDA::IAxis::UNDERFLOW_BIN )
218 % histo -> binEntries ( AIDA::IAxis::OVERFLOW_BIN )
219 % histo -> equivalentBinEntries ()
220 % histo -> sumBinHeights ()
230 % histo -> sumAllBinHeights ()
252 (
const AIDA::IHistogram1D* histo ,
253 const std::string& ID ,
254 const std::string& fmt1 ,
255 const std::string& fmt2 )
257 using namespace boost::io ;
260 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
264 %
format ( histo , fmt2 ) ;
272 (
const std::string& val1 ,
273 const std::string& val2 ,
274 const std::string& fmt )
276 using namespace boost::io ;
279 _fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
291 : m_header (
Gaudi::Utils::Histos::Formats::
header ( ID ) )
293 , m_format (
Gaudi::Utils::Histos::Formats::
format ( ID ) )
298 const std::string&
header ,
299 const std::string& footer )
300 : m_header ( header )
301 , m_footer ( footer )
302 , m_format ( format )
308 (
const AIDA::IHistogram1D* histo )
const
316 (
const AIDA::IHistogram1D* histo ,
317 const std::string& ID ,
318 const std::string& fmt )
const
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
Table(const int ID=0)
constructor from enum
Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface...
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the historgam according to the specified format.
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
The IRegistry represents the entry door to the environment any data object residing in a transient da...
static double sumBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum bin height ("in-range integral")
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on fraction of overflow entries (useful for shape comparison)
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
virtual const id_type & identifier() const =0
Full identifier (or key)
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
This is a number of static methods for bootstrapping the Gaudi framework.
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
A DataObject is the base class of any identifiable object on any data store.
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
std::string toString(const AIDA::IHistogram1D *histo) const
make the string representation according to the default format