25 # pragma clang diagnostic push 26 # pragma clang diagnostic ignored "-Wkeyword-macro" 28 #define class class GAUDI_API 30 # pragma clang diagnostic pop 32 #include "AIDA/IAxis.h" 33 #include "AIDA/IHistogram1D.h" 34 #include "AIDA/IProfile1D.h" 49 #include "boost/algorithm/string/erase.hpp" 50 #include "boost/format.hpp" 63 const std::string s_histoFormatStat =
"| %2$-45.45s | %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |";
66 const std::string s_histoFormatStatOnly =
"| %3$=7d |%8$11.5g | %10$-11.5g|%12$11.5g |%14$11.5g |";
70 "| %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|";
75 const std::string s_histoFormatShapeOnly =
"|%8$11.5g |%10$11.5g |%12$11.5g |%14$11.5g |%19$11.5g/%21$-11.5g|";
81 const std::string s_histoFormatShape =
"|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%15$-9." 82 "3g|%19$9.3g+-%20$-9.3g|%21$9.3g+-%22$-9.3g|";
86 " %2$-45.45s mean/sigma/skew/kurtosis = %8$10.4g/%10$10.4g/%12$10.4g/%14$10.4g";
89 const std::string s_histoFormatLineOnly =
" mean/sigma/skew/kurtosis = %8$10.4g/%10$10.4g/%12$10.4g/%14$10.4g";
92 const std::string s_histoFormatOld =
" %2$-45.45s Ents/All=%7$5s/%3$5s<X>/sX=%8$.5g/%10$-.5g";
95 const std::string s_histoFormatPathTitle =
"| %1$-45.45s | %2$-45.45s | ";
98 const std::string s_histoFormatFull =
"| %1$-45.45s | %2$-45.45s | %3$=7d |%4$5d/%5$-5d|%6$9.3g | " 99 "%7$-9.3g|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9.3g+-%" 102 const std::string s_histoFormatFullStat =
"| %3$=7d |%4$5d/%5$-5d|%6$9.3g | " 103 "%7$-9.3g|%8$9.3g+-%9$-9.3g|%10$9.3g+-%11$-9.3g|%12$9.3g+-%13$-9.3g|%14$9." 110 "| Title | # | Mean | RMS | Skewness | Kurtosis |";
113 const std::string s_histoFormatStatOnlyHeader =
"| # | Mean | RMS | Skewness | Kurtosis |";
117 "| # | Mean+-Error | RMS+-Error | Skewness+-Error | Kurtosis+-Error |";
121 "| Mean | RMS | Skewness | Kurtosis | Underflow%/Overflow% |";
124 const std::string s_histoFormatShapeHeader =
"| Mean | RMS | Skewness | " 125 "Kurtosis | Underflow [%] | Overflow [%] |";
128 const std::string s_histoFormatLineTitleHeader =
" Title ";
131 const std::string s_histoFormatLineOnlyHeader =
"";
138 "| Path in Histogram Data Store | Title | ";
141 const std::string s_histoFormatFullHeader =
"| Path in Histogram Data Store | Title | " 142 "# |Udflw/Ovflw| nEff | Sum | Mean+-Error | " 143 "RMS+-Error | Skewness+-Error | Kurtosis+-Error |";
146 const std::string s_histoFormatFullStatHeader =
"| # |Udflw/Ovflw| nEff | Sum | Mean+-Error | " 147 " RMS+-Error | Skewness+-Error | Kurtosis+-Error |";
150 template <
typename HISTO>
151 decltype(
auto ) _title(
const HISTO* h ) {
156 boost::erase_all(
htitle,
"|" );
167 return s_histoFormatOld;
169 return s_histoFormatFull;
171 return s_histoFormatFullStat;
173 return s_histoFormatStat;
175 return s_histoFormatStatOnly;
177 return s_histoFormatStat1;
179 return s_histoFormatShapeOnly;
181 return s_histoFormatShape;
183 return s_histoFormatLineTitle;
185 return s_histoFormatLineOnly;
187 return s_histoFormatPathTitle;
192 return s_histoFormatStat;
200 return s_histoFormatOldHeader;
202 return s_histoFormatFullHeader;
204 return s_histoFormatFullStatHeader;
206 return s_histoFormatStatHeader;
208 return s_histoFormatStat1Header;
210 return s_histoFormatStatOnlyHeader;
212 return s_histoFormatShapeOnlyHeader;
214 return s_histoFormatShapeHeader;
216 return s_histoFormatLineTitleHeader;
218 return s_histoFormatLineOnlyHeader;
220 return s_histoFormatPathTitleHeader;
224 return s_histoFormatStatHeader;
230 if ( !aida ) {
return ""; }
231 const auto object = dynamic_cast<const DataObject*>( aida );
232 if ( !
object ) {
return ""; }
233 const auto registry =
object->registry();
235 const auto _path =
registry->identifier();
236 const auto n = _path.find(
"/stat/" );
245 if ( !histo ) {
return "<NULL>"; }
247 using namespace boost::io;
250 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
252 _fmt % (
"\"" +
path( histo ) +
"\"" )
253 % (
"\"" + _title( histo ) +
"\"" )
254 % histo->allEntries()
255 % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN )
256 % histo->binEntries( AIDA::IAxis::OVERFLOW_BIN )
258 % histo->sumBinHeights()
268 % histo->sumAllBinHeights()
291 if ( !histo ) {
return "<NULL>"; }
293 using namespace boost::io;
296 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
298 _fmt % (
"\"" +
path( histo ) +
"\"" )
299 % (
"\"" + _title( histo ) +
"\"" )
300 % histo->allEntries()
301 % histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN )
302 % histo->binEntries( AIDA::IAxis::OVERFLOW_BIN )
304 % histo->sumBinHeights()
314 % histo->sumAllBinHeights()
338 using namespace boost::io;
341 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
355 using namespace boost::io;
358 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
369 using namespace boost::io;
372 _fmt.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
388 : m_header(
header ), m_footer( footer ), m_format(
format ) {}
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
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 htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
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
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 histogram 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 rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
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")
std::string toString(const AIDA::IHistogram1D *histo) const
make the string representation according to the default format
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
static double mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
static double nEff(const AIDA::IHistogram1D *histo)
get the effective entries (just for completeness)
Header file for std:chrono::duration-based Counters.
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram