The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
HistoStats.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11// ============================================================================
12// STD & STL
13// ============================================================================
14#include <climits>
15#include <cmath>
16#include <limits>
17// ============================================================================
18// AIDA
19// ============================================================================
20#include <AIDA/IAxis.h>
21#include <AIDA/IHistogram1D.h>
22#include <AIDA/IProfile1D.h>
23// ============================================================================
24// GaudiUtils
25// ============================================================================
27// ============================================================================
33// ============================================================================
34namespace {
35 // ==========================================================================
37 const constexpr double s_bad = std::numeric_limits<float>::lowest();
39 const constexpr long s_long_bad = std::numeric_limits<int>::min();
40 // ==========================================================================
41 // implementations
42 // ============================================================================
43 // effective entries
44 // ============================================================================
45 double _nEff( const AIDA::IHistogram1D* histo ) { return ( histo ? histo->equivalentBinEntries() : s_bad ); }
46 double _nEff( const AIDA::IProfile1D* histo ) {
47 // best guess at equivalent method ...
48 return ( histo ? histo->sumBinHeights() : s_bad );
49 }
50 // ============================================================================
51 // rms
52 // ============================================================================
53 template <typename HISTO>
54 double _rms( const HISTO* histo ) {
55 return ( histo ? histo->rms() : s_bad );
56 }
57 // ============================================================================
58 // mean
59 // ============================================================================
60 template <typename HISTO>
61 double _mean( const HISTO* histo ) {
62 return ( histo ? histo->mean() : s_bad );
63 }
64 // ============================================================================
65 // moment
66 // ============================================================================
67 template <typename HISTO>
68 double _moment( const HISTO* histo, const unsigned int order, const double value = 0 ) {
69 if ( !histo ) { return s_bad; } // RETURN
70 if ( 0 == order ) { return 1.0; } // RETURN
71 if ( 1 == order ) { return _mean( histo ) - value; } // RETURN
72 if ( 2 == order ) {
73 const auto _r = _rms( histo );
74 const auto _d = value - _mean( histo );
75 return std::pow( _r, 2 ) + std::pow( _d, 2 ); // RETURN
76 }
77 const auto n = _nEff( histo );
78 if ( 0 >= n ) { return 0.0; } // RETURN
79 // get the exis
80 const auto& axis = histo->axis();
81 // number of bins
82 const auto nBins = axis.bins();
83 double result{ 0 }, weight{ 0 };
84 // loop over all bins
85 for ( int i = 0; i < nBins; ++i ) {
86 const auto lE = axis.binLowerEdge( i );
87 const auto uE = axis.binUpperEdge( i );
88 //
89 const auto yBin = histo->binHeight( i ); // bin weight
90 const auto xBin = 0.5 * double( lE + uE ); // bin center
91 //
92 weight += yBin;
93 result += yBin * std::pow( xBin - value, order );
94 }
95 if ( weight > std::numeric_limits<double>::epsilon() ) { result /= weight; }
96 return result;
97 }
98 // ============================================================================
99 // moment error
100 // ============================================================================
101 template <typename HISTO>
102 double _momentErr( const HISTO* histo, const unsigned int order ) {
103 if ( !histo ) { return s_bad; } // RETURN
104 const auto n = _nEff( histo );
105 if ( 0 >= n ) { return 0.0; } // RETURN
106 const auto a2o = _moment( histo, 2 * order ); // a(2o)
107 const auto ao = _moment( histo, order ); // a(o)
108 const auto result = std::max( 0.0, ( a2o - std::pow( ao, 2 ) ) / n );
109 return std::sqrt( result ); // RETURN
110 }
111 // ============================================================================
112 // central moment
113 // ============================================================================
114 template <typename HISTO>
115 double _centralMoment( const HISTO* histo, const unsigned int order ) {
116 if ( !histo ) { return s_bad; } // RETURN
117 if ( 0 == order ) { return 1.0; } // RETURN
118 if ( 1 == order ) { return 0.0; } // RETURN
119 if ( 2 == order ) {
120 return std::pow( _rms( histo ), 2 ); // RETURN
121 }
122 // delegate the actual evaluation to another method:
123 return _moment( histo, order, _mean( histo ) );
124 }
125 // ============================================================================
126 // central moment error
127 // ============================================================================
128 template <typename HISTO>
129 double _centralMomentErr( const HISTO* histo, const unsigned int order ) {
130 if ( !histo ) { return s_bad; } // RETURN
131 const auto n = _nEff( histo );
132 if ( 0 >= n ) { return 0.0; } // RETURN
133 const auto mu2 = _centralMoment( histo, 2 ); // mu(2)
134 const auto muo = _centralMoment( histo, order ); // mu(o)
135 const auto mu2o = _centralMoment( histo, 2 * order ); // mu(2o)
136 const auto muom = _centralMoment( histo, order - 1 ); // mu(o-1)
137 const auto muop = _centralMoment( histo, order + 1 ); // mu(o+1)
138 const auto result =
139 ( mu2o - ( 2.0 * order * muom * muop ) - std::pow( muo, 2 ) + ( order * order * mu2 * muom * muom ) ) / n;
140 return std::sqrt( std::max( 0.0, result ) ); // RETURN
141 }
142 // ============================================================================
143 // get the skewness for the histogram
144 // ============================================================================
145 template <typename HISTO>
146 double _skewness( const HISTO* histo ) {
147 if ( !histo ) { return s_bad; } // RETURN
148 const auto mu3 = _centralMoment( histo, 3 );
149 const auto s3 = std::pow( _rms( histo ), 3 );
150 return ( std::fabs( s3 ) > 0 ? mu3 / s3 : 0.0 );
151 }
152 // ============================================================================
153 // get the error in skewness
154 // ============================================================================
155 template <typename HISTO>
156 double _skewnessErr( const HISTO* histo ) {
157 if ( !histo ) { return s_bad; } // RETURN
158 const auto n = _nEff( histo );
159 if ( 2 > n ) { return 0.0; } // RETURN
160 const auto result = 6.0 * ( n - 2 ) / ( ( n + 1 ) * ( n + 3 ) );
161 return std::sqrt( result );
162 }
163 // ============================================================================
164 // get the kurtosis for the histogram
165 // ============================================================================
166 template <typename HISTO>
167 double _kurtosis( const HISTO* histo ) {
168 if ( !histo ) { return s_bad; } // RETURN
169 const auto mu4 = _centralMoment( histo, 4 );
170 const auto s4 = std::pow( _rms( histo ), 4 );
171 return ( std::fabs( s4 ) > 0 ? mu4 / s4 - 3.0 : 0.0 );
172 }
173 // ============================================================================
174 // get the error in kurtosis
175 // ============================================================================
176 template <typename HISTO>
177 double _kurtosisErr( const HISTO* histo ) {
178 if ( !histo ) { return s_bad; } // RETURN
179 const auto n = _nEff( histo );
180 if ( 3 > n ) { return 0.0; } // RETURN
181 auto result = 24.0 * n;
182 result *= ( n - 2 ) * ( n - 3 );
183 result /= ( n + 1 ) * ( n + 1 );
184 result /= ( n + 3 ) * ( n + 5 );
185 return std::sqrt( result );
186 }
187 // ============================================================================
188 // get an error in the mean value
189 // ============================================================================
190 template <typename HISTO>
191 double _meanErr( const HISTO* histo ) {
192 if ( !histo ) { return s_bad; }
193 const auto n = _nEff( histo );
194 return ( 0 >= n ? 0.0 : _rms( histo ) / std::sqrt( n ) );
195 }
196 // ============================================================================
197 // get the error in rms
198 // ============================================================================
199 template <typename HISTO>
200 double _rmsErr( const HISTO* histo ) {
201 if ( !histo ) { return s_bad; }
202 const auto n = _nEff( histo );
203 if ( 1 >= n ) { return 0.0; }
204 auto result = 2.0 + _kurtosis( histo );
205 result += 2.0 / ( n - 1 );
206 result /= 4.0 * n;
207 return _rms( histo ) * std::sqrt( std::max( result, 0.0 ) );
208 }
209 // ============================================================================
210 // get an error in the sum bin height ("in range integral")
211 // ============================================================================
212 template <typename HISTO>
213 double _sumBinHeightErr( const HISTO* histo ) {
214 if ( !histo ) { return s_bad; }
215 //
216 double error2 = 0;
217 // get the exis
218 const auto& axis = histo->axis();
219 // number of bins
220 const auto nBins = axis.bins();
221 // loop over all bins
222 for ( int i = 0; i < nBins; ++i ) {
223 // accumulate the errors in each bin
224 error2 += std::pow( histo->binError( i ), 2 );
225 }
226 return std::sqrt( error2 );
227 }
228 // ============================================================================
229 // get an error in the sum all bin height ("integral")
230 // ============================================================================
231 template <typename HISTO>
232 double _sumAllBinHeightErr( const HISTO* histo ) {
233 if ( !histo ) { return s_bad; }
234 //
235 const auto error = _sumBinHeightErr( histo );
236 if ( 0 > error ) { return s_bad; }
238 const auto err1 = histo->binError( AIDA::IAxis::UNDERFLOW_BIN );
239 const auto err2 = histo->binError( AIDA::IAxis::OVERFLOW_BIN );
240 //
241 return std::sqrt( std::pow( error, 2 ) + std::pow( err1, 2 ) + std::pow( err2, 2 ) );
242 }
243 // ============================================================================
244 // the fraction of overflow entries (useful for shape comparison)
245 // ============================================================================
246 template <typename HISTO>
247 double _overflowEntriesFrac( const HISTO* histo ) {
248 if ( !histo ) { return s_bad; } // RETURN
249 const auto overflow = histo->binEntries( AIDA::IAxis::OVERFLOW_BIN );
250 if ( 0 == overflow ) { return 0; } // RETURN
251 const auto all = histo->allEntries();
252 if ( 0 == all ) { return 0; } // "CONVENTION?" RETURN
253 if ( 0 > all ) { return s_bad; } // Lets be a bit paranoic, RETURN
254 //
255 return (double)overflow / (double)all;
256 }
257 // ============================================================================
258 // the fraction of underflow entries (useful for shape comparison)
259 // ============================================================================
260 template <typename HISTO>
261 double _underflowEntriesFrac( const HISTO* histo ) {
262 if ( !histo ) { return s_bad; } // RETURN
263 const auto underflow = histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN );
264 if ( 0 == underflow ) { return 0; } // RETURN
265 const auto all = histo->allEntries();
266 if ( 0 == all ) { return 0; } // "CONVENTION?" RETURN
267 if ( 0 > all ) { return s_bad; } // Lets be a bit paranoic, RETURN
268 //
269 return (double)underflow / (double)all;
270 }
271 // ============================================================================
272 // the fraction of overflow integral (useful for shape comparison)
273 // ============================================================================
274 template <typename HISTO>
275 double _overflowIntegralFrac( const HISTO* histo ) {
276 if ( !histo ) { return s_bad; } // RETURN
277 const auto overflow = histo->binHeight( AIDA::IAxis::OVERFLOW_BIN );
278 const auto all = histo->sumAllBinHeights();
279 if ( all < std::numeric_limits<double>::epsilon() ) { return 0; } // "CONVENTION?" RETURN
280 //
281 return (double)overflow / (double)all;
282 }
283 // ============================================================================
284 // the fraction of underflow entries (useful for shape comparison)
285 // ============================================================================
286 template <typename HISTO>
287 double _underflowIntegralFrac( const HISTO* histo ) {
288 if ( !histo ) { return s_bad; } // RETURN
289 const auto underflow = histo->binHeight( AIDA::IAxis::UNDERFLOW_BIN );
290 const auto all = histo->sumAllBinHeights();
291 if ( all < std::numeric_limits<double>::epsilon() ) { return 0; } // "CONVENTION?" RETURN
292 //
293 return (double)underflow / (double)all;
294 }
295 // ============================================================================
296 // error on fraction of overflow entries (useful for shape comparison)
297 // ============================================================================
298 template <typename HISTO>
299 double _overflowEntriesFracErr( const HISTO* histo ) {
300 if ( !histo ) { return s_bad; } // RETURN
301 //
302 const auto overflow = histo->binEntries( AIDA::IAxis::OVERFLOW_BIN );
303 const auto all = histo->allEntries();
304 //
305 if ( 0 > overflow || 0 >= all || overflow > all ) { return s_bad; }
306 //
307 const double n = std::max( (double)overflow, 1.0 );
308 const double N = all;
309 const double n1 = std::max( N - n, 1.0 );
310 //
311 return std::sqrt( n * ( n1 / N ) ) / N; // use the binomial formula
312 }
313 // ============================================================================
314 // error on fraction of underflow entries (useful for shape comparison)
315 // ============================================================================
316 template <typename HISTO>
317 double _underflowEntriesFracErr( const HISTO* histo ) {
318 if ( !histo ) { return s_bad; } // RETURN
319 //
320 const auto underflow = histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN );
321 const auto all = histo->allEntries();
322 //
323 if ( 0 > underflow || 0 >= all || underflow > all ) { return s_bad; }
324 //
325 const double n = std::max( (double)underflow, 1.0 );
326 const double N = all;
327 const double n1 = std::max( N - n, 1.0 );
328 //
329 return std::sqrt( n * ( n1 / N ) ) / N; // use the binomial formula
330 }
331 // ============================================================================
332 // the error on fraction of overflow intergal
333 // ============================================================================
334 template <typename HISTO>
335 double _overflowIntegralFracErr( const HISTO* histo ) {
336 if ( !histo ) { return s_bad; } // RETURN
337 //
338 const auto all = histo->sumAllBinHeights();
339 if ( all < std::numeric_limits<double>::epsilon() ) { return s_bad; } // RETURN
340 const auto overflow = histo->binHeight( AIDA::IAxis::OVERFLOW_BIN );
341 const auto oErr = histo->binError( AIDA::IAxis::OVERFLOW_BIN );
342 if ( 0 > oErr ) { return s_bad; } // RETURN
343 const auto aErr = _sumAllBinHeightErr( histo );
344 if ( 0 > aErr ) { return s_bad; } // RETURN
345 //
346 auto error2 = std::pow( (double)oErr, 2 );
347 error2 += ( std::pow( (double)aErr, 2 ) * std::pow( (double)overflow, 2 ) / std::pow( (double)all, 2 ) );
348 error2 /= std::pow( (double)all, 2 );
349 //
350 return std::sqrt( error2 );
351 }
352 // ============================================================================
353 // the error on fraction of overflow intergal
354 // ============================================================================
355 template <typename HISTO>
356 double _underflowIntegralFracErr( const HISTO* histo ) {
357 if ( !histo ) { return s_bad; } // RETURN
358 //
359 const auto all = histo->sumAllBinHeights();
360 if ( all < std::numeric_limits<double>::epsilon() ) { return s_bad; } // RETURN
361 const auto underflow = histo->binHeight( AIDA::IAxis::UNDERFLOW_BIN );
362 const auto oErr = histo->binError( AIDA::IAxis::UNDERFLOW_BIN );
363 if ( 0 > oErr ) { return s_bad; } // RETURN
364 const auto aErr = _sumAllBinHeightErr( histo );
365 if ( 0 > aErr ) { return s_bad; } // RETURN
366 //
367 auto error2 = std::pow( (double)oErr, 2 );
368 error2 += ( std::pow( (double)aErr, 2 ) * std::pow( (double)underflow, 2 ) / std::pow( (double)all, 2 ) );
369 error2 /= std::pow( (double)all, 2 );
370 //
371 return std::sqrt( error2 );
372 }
373 // ============================================================================
374 // # entries
375 // ============================================================================
376 template <typename HISTO>
377 long _nEntries( const HISTO* histo, const int imax ) {
378 if ( !histo ) { return s_long_bad; } // RETURN
379 if ( 0 > imax ) { return 0; } // RETURN
380 long result = histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN );
381
382 // get the exis
383 const auto& axis = histo->axis();
384 // number of bins
385 const auto nBins = axis.bins();
386 // loop over bins
387 for ( int i = 0; i < nBins && i < imax; ++i ) { result += histo->binEntries( i ); }
388 //
389 if ( nBins < imax ) { result += histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ); }
390 //
391 return result;
392 }
393 // ============================================================================
394 // # entries
395 // ============================================================================
396 template <typename HISTO>
397 long _nEntries( const HISTO* histo,
398 const int imin, // minimal bin number (included)
399 const int imax ) // maximal bin number (not included)
400 {
401 if ( !histo ) { return s_long_bad; } // RETURN
402 if ( imin == imax ) { return 0; } // RETURN
403 if ( imax < imin ) { return _nEntries( histo, imax, imin ); } // RETURN
404 //
405 long result = 0;
406 if ( 0 > imin ) { result += histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ); }
407 // get the exis
408 const auto& axis = histo->axis();
409 // number of bins
410 const auto nBins = axis.bins();
411 if ( nBins < imin ) { return 0; } // RETURN
412 // loop over bins
413 for ( int i = imin; i < nBins && imin <= i && i < imax; ++i ) { result += histo->binEntries( i ); }
414 //
415 if ( nBins < imax ) { result += histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ); }
416 //
417 return result; // RETURN
418 }
419 // ============================================================================
420 // get the fraction of entries in histogram up to the given bin (not-included)
421 // ============================================================================
422 template <typename HISTO>
423 double _nEntriesFrac( const HISTO* histo, const int imax ) {
424 if ( !histo ) { return s_bad; } // RETURN
425 //
426 const auto N = histo->allEntries();
427 if ( 0 >= N ) { return s_bad; } // RETURN
428 const auto n = _nEntries( histo, imax );
429 if ( 0 > n ) { return s_bad; } // RETURN
430 if ( n > N ) { return s_bad; } // RETURN
431 //
432 return (double)n / (double)N; // RETURN
433 }
434 // ============================================================================
435 /* get fraction of entries in histogram form the certain
436 * minimal bin up to the certain maximal bin (not-included) */
437 // ============================================================================
438 template <typename HISTO>
439 double _nEntriesFrac( const HISTO* histo,
440 const int imin, // minimal bin number (included)
441 const int imax ) // maximal bin number (not included)
442 {
443 if ( !histo ) { return s_bad; } // RETURN
444 const auto N = histo->allEntries();
445 if ( 0 >= N ) { return s_bad; } // RETURN
446 const auto n = _nEntries( histo, imin, imax );
447 if ( 0 > n ) { return s_bad; } // RETURN
448 if ( n > N ) { return s_bad; } // RETURN
449 //
450 return (double)n / (double)N; // RETURN
451 }
452 // ============================================================================
453 // # entries fraction error
454 // ============================================================================
455 template <typename HISTO>
456 double _nEntriesFracErr( const HISTO* histo, const int imax ) {
457 if ( !histo ) { return s_bad; } // RETURN
458 //
459 const auto N = histo->allEntries();
460 if ( 0 >= N ) { return s_bad; } // RETURN
461 const auto n = _nEntries( histo, imax );
462 if ( 0 > n ) { return s_bad; } // RETURN
463 if ( n > N ) { return s_bad; } // RETURN
464 //
465 const auto _n1 = std::max( (double)n, 1.0 );
466 const auto _n2 = std::max( (double)( N - n ), 1.0 );
467 //
468 return std::sqrt( _n1 * ( _n2 / N ) ) / N; // RETURN
469 }
470 // ============================================================================
471 // get the (binomial) error for the fraction of entries in histogram
472 // ============================================================================
473 template <typename HISTO>
474 double _nEntriesFracErr( const HISTO* histo,
475 const int imin, // minimal bin number (included)
476 const int imax ) // maximal bin number (not included)
477 {
478 if ( !histo ) { return s_bad; } // RETURN
479 //
480 const auto N = histo->allEntries();
481 if ( 0 >= N ) { return s_bad; } // RETURN
482 const auto n = _nEntries( histo, imin, imax );
483 if ( 0 > n ) { return s_bad; } // RETURN
484 if ( n > N ) { return s_bad; } // RETURN
485 //
486 const auto _n1 = std::max( (double)n, 1.0 );
487 const auto _n2 = std::max( (double)( N - n ), 1.0 );
488 //
489 return std::sqrt( _n1 * ( _n2 / N ) ) / N; // RETURN
490 }
491} // namespace
492// ============================================================================
493/* get the moment of the certain around the specified "value"
494 * @param histo histogram
495 * @param order the moment order
496 * @param value central value
497 * @return the evaluated moment
498 */
499// ============================================================================
500double Gaudi::Utils::HistoStats::moment( const AIDA::IHistogram1D* histo, const unsigned int order,
501 const double value ) {
502 return _moment( histo, order, value );
503}
504// ============================================================================
505/* get the moment of the certain around the specified "value"
506 * @param histo histogram
507 * @param order the moment order
508 * @param value central value
509 * @return the evaluated moment
510 */
511// ============================================================================
512double Gaudi::Utils::HistoStats::moment( const AIDA::IProfile1D* histo, const unsigned int order, const double value ) {
513 return _moment( histo, order, value );
514}
515// ============================================================================
522// ============================================================================
523double Gaudi::Utils::HistoStats::momentErr( const AIDA::IHistogram1D* histo, const unsigned int order ) {
524 return _momentErr( histo, order );
525}
526// ============================================================================
533// ============================================================================
534double Gaudi::Utils::HistoStats::momentErr( const AIDA::IProfile1D* histo, const unsigned int order ) {
535 return _momentErr( histo, order );
536}
537// ============================================================================
538/* evaluate the central momentum (around the mean value)
539 * @param histo histogram
540 * @param order the momentm order
541 * @param value central value
542 * @return the evaluated central moment
543 */
544// ============================================================================
545double Gaudi::Utils::HistoStats::centralMoment( const AIDA::IHistogram1D* histo, const unsigned int order ) {
546 return _centralMoment( histo, order );
547}
548// ============================================================================
549/* evaluate the central momentum (around the mean value)
550 * @param histo histogram
551 * @param order the momentm order
552 * @param value central value
553 * @return the evaluated central moment
554 */
555// ============================================================================
556double Gaudi::Utils::HistoStats::centralMoment( const AIDA::IProfile1D* histo, const unsigned int order ) {
557 return _centralMoment( histo, order );
558}
559// ============================================================================
560/* evaluate the uncertanty for 'bin-by-bin'-central momentum
561 * (around the mean value)
562 * ( the uncertanty is calculated with O(1/n2) precision)
563 * @param histo histogram
564 * @param order the moment parameter
565 * @param value central value
566 * @return the evaluated uncertanty in the central moment
567 */
568// ============================================================================
569double Gaudi::Utils::HistoStats::centralMomentErr( const AIDA::IHistogram1D* histo, const unsigned int order ) {
570 return _centralMomentErr( histo, order );
571}
572// ============================================================================
573/* evaluate the uncertanty for 'bin-by-bin'-central momentum
574 * (around the mean value)
575 * ( the uncertanty is calculated with O(1/n2) precision)
576 * @param histo histogram
577 * @param order the moment parameter
578 * @param value central value
579 * @return the evaluated uncertanty in the central moment
580 */
581// ============================================================================
582double Gaudi::Utils::HistoStats::centralMomentErr( const AIDA::IProfile1D* histo, const unsigned int order ) {
583 return _centralMomentErr( histo, order );
584}
585// ============================================================================
586// get the skewness for the histogram
587// ============================================================================
588double Gaudi::Utils::HistoStats::skewness( const AIDA::IHistogram1D* histo ) { return _skewness( histo ); }
589// ============================================================================
590// get the skewness for the profile
591// ============================================================================
592double Gaudi::Utils::HistoStats::skewness( const AIDA::IProfile1D* histo ) { return _skewness( histo ); }
593// ============================================================================
594// get the error in skewness
595// ============================================================================
596double Gaudi::Utils::HistoStats::skewnessErr( const AIDA::IHistogram1D* histo ) { return _skewnessErr( histo ); }
597// ============================================================================
598// get the error in skewness
599// ============================================================================
600double Gaudi::Utils::HistoStats::skewnessErr( const AIDA::IProfile1D* histo ) { return _skewnessErr( histo ); }
601// ============================================================================
602// get the kurtosis for the histogram
603// ============================================================================
604double Gaudi::Utils::HistoStats::kurtosis( const AIDA::IHistogram1D* histo ) { return _kurtosis( histo ); }
605// ============================================================================
606// get the kurtosis for the histogram
607// ============================================================================
608double Gaudi::Utils::HistoStats::kurtosis( const AIDA::IProfile1D* histo ) { return _kurtosis( histo ); }
609// ============================================================================
610// get the error in kurtosis
611// ============================================================================
612double Gaudi::Utils::HistoStats::kurtosisErr( const AIDA::IHistogram1D* histo ) { return _kurtosisErr( histo ); }
613// ============================================================================
614// get the error in kurtosis
615// ============================================================================
616double Gaudi::Utils::HistoStats::kurtosisErr( const AIDA::IProfile1D* histo ) { return _kurtosisErr( histo ); }
617// ============================================================================
618// get the effective entries
619// ============================================================================
620double Gaudi::Utils::HistoStats::nEff( const AIDA::IHistogram1D* histo ) { return _nEff( histo ); }
621// ============================================================================
622// get the effective entries
623// ============================================================================
624double Gaudi::Utils::HistoStats::nEff( const AIDA::IProfile1D* histo ) { return _nEff( histo ); }
625// ============================================================================
626// get the mean value for the histogram
627// ============================================================================
628double Gaudi::Utils::HistoStats::mean( const AIDA::IHistogram1D* histo ) { return _mean( histo ); }
629// ============================================================================
630// get the mean value for the histogram
631// ============================================================================
632double Gaudi::Utils::HistoStats::mean( const AIDA::IProfile1D* histo ) { return _mean( histo ); }
633// ============================================================================
634// get an error in the mean value
635// ============================================================================
636double Gaudi::Utils::HistoStats::meanErr( const AIDA::IHistogram1D* histo ) { return _meanErr( histo ); }
637// ============================================================================
638// get an error in the mean value
639// ============================================================================
640double Gaudi::Utils::HistoStats::meanErr( const AIDA::IProfile1D* histo ) { return _meanErr( histo ); }
641// ============================================================================
642// get the rms value for the histogram
643// ============================================================================
644double Gaudi::Utils::HistoStats::rms( const AIDA::IHistogram1D* histo ) { return _rms( histo ); }
645// ============================================================================
646// get the rms value for the histogram
647// ============================================================================
648double Gaudi::Utils::HistoStats::rms( const AIDA::IProfile1D* histo ) { return _rms( histo ); }
649// ============================================================================
650// get the error in rms
651// ============================================================================
652double Gaudi::Utils::HistoStats::rmsErr( const AIDA::IHistogram1D* histo ) { return _rmsErr( histo ); }
653// ============================================================================
654// get the error in rms
655// ============================================================================
656double Gaudi::Utils::HistoStats::rmsErr( const AIDA::IProfile1D* histo ) { return _rmsErr( histo ); }
657// ============================================================================
658// get an error in the sum bin height ("in range integral")
659// ============================================================================
660double Gaudi::Utils::HistoStats::sumBinHeightErr( const AIDA::IHistogram1D* histo ) {
661 return _sumBinHeightErr( histo );
662}
663// ============================================================================
664// get an error in the sum bin height ("in range integral")
665// ============================================================================
666double Gaudi::Utils::HistoStats::sumBinHeightErr( const AIDA::IProfile1D* histo ) { return _sumBinHeightErr( histo ); }
667// ============================================================================
668// get an error in the sum all bin height ("integral")
669// ============================================================================
670double Gaudi::Utils::HistoStats::sumAllBinHeightErr( const AIDA::IHistogram1D* histo ) {
671 return _sumAllBinHeightErr( histo );
672}
673// ============================================================================
674// get an error in the sum all bin height ("integral")
675// ============================================================================
676double Gaudi::Utils::HistoStats::sumAllBinHeightErr( const AIDA::IProfile1D* histo ) {
677 return _sumAllBinHeightErr( histo );
678}
679// ============================================================================
680// the fraction of overflow entries (useful for shape comparison)
681// ============================================================================
682double Gaudi::Utils::HistoStats::overflowEntriesFrac( const AIDA::IHistogram1D* histo ) {
683 return _overflowEntriesFrac( histo );
684}
685// ============================================================================
686// the fraction of overflow entries (useful for shape comparison)
687// ============================================================================
688double Gaudi::Utils::HistoStats::overflowEntriesFrac( const AIDA::IProfile1D* histo ) {
689 return _overflowEntriesFrac( histo );
690}
691// ============================================================================
692// the fraction of underflow entries (useful for shape comparison)
693// ============================================================================
694double Gaudi::Utils::HistoStats::underflowEntriesFrac( const AIDA::IHistogram1D* histo ) {
695 return _underflowEntriesFrac( histo );
696}
697// ============================================================================
698// the fraction of underflow entries (useful for shape comparison)
699// ============================================================================
700double Gaudi::Utils::HistoStats::underflowEntriesFrac( const AIDA::IProfile1D* histo ) {
701 return _underflowEntriesFrac( histo );
702}
703// ============================================================================
704// the fraction of overflow integral (useful for shape comparison)
705// ============================================================================
706double Gaudi::Utils::HistoStats::overflowIntegralFrac( const AIDA::IHistogram1D* histo ) {
707 return _overflowIntegralFrac( histo );
708}
709// ============================================================================
710// the fraction of overflow integral (useful for shape comparison)
711// ============================================================================
712double Gaudi::Utils::HistoStats::overflowIntegralFrac( const AIDA::IProfile1D* histo ) {
713 return _overflowIntegralFrac( histo );
714}
715// ============================================================================
716// the fraction of underflow entries (useful for shape comparison)
717// ============================================================================
718double Gaudi::Utils::HistoStats::underflowIntegralFrac( const AIDA::IHistogram1D* histo ) {
719 return _underflowIntegralFrac( histo );
720}
721// ============================================================================
722// the fraction of underflow entries (useful for shape comparison)
723// ============================================================================
724double Gaudi::Utils::HistoStats::underflowIntegralFrac( const AIDA::IProfile1D* histo ) {
725 return _underflowIntegralFrac( histo );
726}
727// ============================================================================
728// error on fraction of overflow entries (useful for shape comparison)
729// ============================================================================
730double Gaudi::Utils::HistoStats::overflowEntriesFracErr( const AIDA::IHistogram1D* histo ) {
731 return _overflowEntriesFracErr( histo );
732}
733// ============================================================================
734// error on fraction of overflow entries (useful for shape comparison)
735// ============================================================================
736double Gaudi::Utils::HistoStats::overflowEntriesFracErr( const AIDA::IProfile1D* histo ) {
737 return _overflowEntriesFracErr( histo );
738}
739// ============================================================================
740// error on fraction of underflow entries (useful for shape comparison)
741// ============================================================================
742double Gaudi::Utils::HistoStats::underflowEntriesFracErr( const AIDA::IHistogram1D* histo ) {
743 return _underflowEntriesFracErr( histo );
744}
745// ============================================================================
746// error on fraction of underflow entries (useful for shape comparison)
747// ============================================================================
748double Gaudi::Utils::HistoStats::underflowEntriesFracErr( const AIDA::IProfile1D* histo ) {
749 return _underflowEntriesFracErr( histo );
750}
751// ============================================================================
752// the error on fraction of overflow intergal
753// ============================================================================
754double Gaudi::Utils::HistoStats::overflowIntegralFracErr( const AIDA::IHistogram1D* histo ) {
755 return _overflowIntegralFracErr( histo );
756}
757// ============================================================================
758// the error on fraction of overflow intergal
759// ============================================================================
760double Gaudi::Utils::HistoStats::overflowIntegralFracErr( const AIDA::IProfile1D* histo ) {
761 return _overflowIntegralFracErr( histo );
762}
763// ============================================================================
764// the error on fraction of overflow intergal
765// ============================================================================
766double Gaudi::Utils::HistoStats::underflowIntegralFracErr( const AIDA::IHistogram1D* histo ) {
767 return _underflowIntegralFracErr( histo );
768}
769// ============================================================================
770// the error on fraction of overflow intergal
771// ============================================================================
772double Gaudi::Utils::HistoStats::underflowIntegralFracErr( const AIDA::IProfile1D* histo ) {
773 return _underflowIntegralFracErr( histo );
774}
775// ============================================================================
776/* get number of entries in histogram up to the certain
777 * bin (not-included)
778 * @attention underflow bin is included!
779 * @param histo the pointer to the histogram
780 * @param imax the bin number (not included)
781 * @param number of entries
782 */
783// ============================================================================
784long Gaudi::Utils::HistoStats::nEntries( const AIDA::IHistogram1D* histo, const int imax ) {
785 return _nEntries( histo, imax );
786}
787// ============================================================================
788/* get number of entries in histogram up to the certain
789 * bin (not-included)
790 * @attention underflow bin is included!
791 * @param histo the pointer to the histogram
792 * @param imax the bin number (not included)
793 * @param number of entries
794 */
795// ============================================================================
796long Gaudi::Utils::HistoStats::nEntries( const AIDA::IProfile1D* histo, const int imax ) {
797 return _nEntries( histo, imax );
798}
799// ============================================================================
800/* get number of entries in histogram form the certain
801 * minimal bin up to the certain maximal bin (not-included)
802 * @param histo the pointer to the histogram
803 * @param imin the minimal bin number (included)
804 * @param imax the maximal bin number (not included)
805 * @param number of entries
806 */
807// ============================================================================
808long Gaudi::Utils::HistoStats::nEntries( const AIDA::IHistogram1D* histo,
809 const int imin, // minimal bin number (included)
810 const int imax ) // maximal bin number (not included)
811{
812 return _nEntries( histo, imin, imax );
813}
814// ============================================================================
815/* get number of entries in histogram form the certain
816 * minimal bin up to the certain maximal bin (not-included)
817 * @param histo the pointer to the histogram
818 * @param imin the minimal bin number (included)
819 * @param imax the maximal bin number (not included)
820 * @param number of entries
821 */
822// ============================================================================
823long Gaudi::Utils::HistoStats::nEntries( const AIDA::IProfile1D* histo,
824 const int imin, // minimal bin number (included)
825 const int imax ) // maximal bin number (not included)
826{
827 return _nEntries( histo, imin, imax );
828}
829// ============================================================================
830/* get the fraction of entries in histogram up to the certain
831 * bin (not-included)
832 * @attention underflow bin is included!
833 * @param histo the pointer to the histogram
834 * @param imax the bin number (not included)
835 * @param fraction of entries
836 */
837// ============================================================================
838double Gaudi::Utils::HistoStats::nEntriesFrac( const AIDA::IHistogram1D* histo, const int imax ) {
839 return _nEntriesFrac( histo, imax );
840}
841// ============================================================================
842/* get the fraction of entries in histogram up to the certain
843 * bin (not-included)
844 * @attention underflow bin is included!
845 * @param histo the pointer to the histogram
846 * @param imax the bin number (not included)
847 * @param fraction of entries
848 */
849// ============================================================================
850double Gaudi::Utils::HistoStats::nEntriesFrac( const AIDA::IProfile1D* histo, const int imax ) {
851 return _nEntriesFrac( histo, imax );
852}
853// ============================================================================
854/* get fraction of entries in histogram form the certain
855 * minimal bin up to the certain maximal bin (not-included)
856 * @param histo the pointer to the histogram
857 * @param imin the minimal bin number (included)
858 * @param imax the maximal bin number (not included)
859 * @param fraction of entries
860 */
861// ============================================================================
862double Gaudi::Utils::HistoStats::nEntriesFrac( const AIDA::IHistogram1D* histo,
863 const int imin, // minimal bin number (included)
864 const int imax ) // maximal bin number (not included)
865{
866 return _nEntriesFrac( histo, imin, imax );
867}
868// ============================================================================
869/* get fraction of entries in histogram form the certain
870 * minimal bin up to the certain maximal bin (not-included)
871 * @param histo the pointer to the histogram
872 * @param imin the minimal bin number (included)
873 * @param imax the maximal bin number (not included)
874 * @param fraction of entries
875 */
876// ============================================================================
877double Gaudi::Utils::HistoStats::nEntriesFrac( const AIDA::IProfile1D* histo,
878 const int imin, // minimal bin number (included)
879 const int imax ) // maximal bin number (not included)
880{
881 return _nEntriesFrac( histo, imin, imax );
882}
883// ============================================================================
884/* get the (binominal) error for the fraction of entries
885 * in histogram up to the certain bin (not-included)
886 * @attention underflow bin is included!
887 * @param histo the pointer to the histogram
888 * @param imax the bin number (not included)
889 * @param error for the fraction of entries
890 */
891// ============================================================================
892double Gaudi::Utils::HistoStats::nEntriesFracErr( const AIDA::IHistogram1D* histo, const int imax ) {
893 return _nEntriesFracErr( histo, imax );
894}
895// ============================================================================
896/* get the (binominal) error for the fraction of entries
897 * in histogram up to the certain bin (not-included)
898 * @attention underflow bin is included!
899 * @param histo the pointer to the histogram
900 * @param imax the bin number (not included)
901 * @param error for the fraction of entries
902 */
903// ============================================================================
904double Gaudi::Utils::HistoStats::nEntriesFracErr( const AIDA::IProfile1D* histo, const int imax ) {
905 return _nEntriesFracErr( histo, imax );
906}
907// ============================================================================
908/* get the (binomial) error for the fraction of entries in histogram
909 * from the certain minimal bin up to the certain maximal bin (not-included)
910 * @param histo the pointer to the histogram
911 * @param imin the minimal bin number (included)
912 * @param imax the maximal bin number (not included)
913 * @param error for the fraction of entries
914 */
915// ============================================================================
916double Gaudi::Utils::HistoStats::nEntriesFracErr( const AIDA::IHistogram1D* histo,
917 const int imin, // minimal bin number (included)
918 const int imax ) // maximal bin number (not included)
919{
920 return _nEntriesFracErr( histo, imin, imax );
921}
922// ============================================================================
923/* get the (binomial) error for the fraction of entries in histogram
924 * from the certain minimal bin up to the certain maximal bin (not-included)
925 * @param histo the pointer to the histogram
926 * @param imin the minimal bin number (included)
927 * @param imax the maximal bin number (not included)
928 * @param error for the fraction of entries
929 */
930// ============================================================================
931double Gaudi::Utils::HistoStats::nEntriesFracErr( const AIDA::IProfile1D* histo,
932 const int imin, // minimal bin number (included)
933 const int imax ) // maximal bin number (not included)
934{
935 return _nEntriesFracErr( histo, imin, imax );
936}
937// ============================================================================
938// The END
939// ============================================================================
static double overflowEntriesFracErr(const AIDA::IHistogram1D *histo)
error on 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 mean(const AIDA::IHistogram1D *histo)
get the mean value for the histogram (just for completeness)
static double overflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow intergal (useful for shape comparison)
static double moment(const AIDA::IHistogram1D *histo, const unsigned int order, const double value=0)
get the "bin-by-bin"-moment around the specified "value"
static double kurtosis(const AIDA::IHistogram1D *histo)
get the kurtosis for the histogram
static double underflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow entries (useful for shape comparison)
static long nEntries(const AIDA::IHistogram1D *histo, const int imax)
get number of entries in histogram up to the certain bin (not-included)
static double kurtosisErr(const AIDA::IHistogram1D *histo)
get the error in kurtosis for the histogram
static double underflowIntegralFrac(const AIDA::IHistogram1D *histo)
the fraction of underflow integral (useful for shape comparison)
static double underflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow integral
static double centralMoment(const AIDA::IHistogram1D *histo, const unsigned int order)
evaluate the 'bin-by-bin'-central moment (around the mean value)
static double rmsErr(const AIDA::IHistogram1D *histo)
get an error in the rms value
static double nEntriesFracErr(const AIDA::IHistogram1D *histo, const int imax)
get the (binominal) error for the fraction of entries in histogram up to the certain bin (not-include...
static double nEntriesFrac(const AIDA::IHistogram1D *histo, const int imax)
get the fraction of entries in histogram up to the certain bin (not-included)
static double skewnessErr(const AIDA::IHistogram1D *histo)
get the error in skewness for the histogram
static double rms(const AIDA::IHistogram1D *histo)
get the rms value for the histogram (just for completeness)
static double skewness(const AIDA::IHistogram1D *histo)
get the skewness for the histogram
static double nEff(const AIDA::IHistogram1D *histo)
get the effective entries (just for completeness)
static double meanErr(const AIDA::IHistogram1D *histo)
get an error in the mean value
static double underflowEntriesFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of underflow entries (useful for shape comparison)
static double centralMomentErr(const AIDA::IHistogram1D *histo, const unsigned int order)
evaluate the uncertanty for 'bin-by-bin'-central moment (around the mean value) ( the uncertanty is c...
static double overflowIntegralFracErr(const AIDA::IHistogram1D *histo)
the error on fraction of overflow intergal
static double sumAllBinHeightErr(const AIDA::IHistogram1D *histo)
get an error in the sum of all bin height ("integral")
static double momentErr(const AIDA::IHistogram1D *histo, const unsigned int order)
evaluate the uncertanty for 'bin-by-bin'-moment
static double overflowEntriesFrac(const AIDA::IHistogram1D *histo)
the fraction of overflow entries (useful for shape comparison)
all
decorate service
Definition decorators.py:53
int N
Definition IOTest.py:112