The Gaudi Framework  master (9f3f8895)
Loading...
Searching...
No Matches
Gaudi::Histograming::Sink::detail Namespace Reference

Classes

struct  IntWithFixedWidth
 helper struct to print integers with fixed width More...
class  WeightedMoments
 Numerically stable accumulator of the weighted mean and central moments (up to the 4th) of a distribution. More...

Functions

std::string formatTitle (std::string_view title, unsigned int width)
std::string formatName (std::string_view name, unsigned int width)
template<typename T>
T sqrt_or_zero (const T x)
 sqrt or zero

Variables

constexpr std::string_view histo1DFormatting
constexpr std::string_view histo2DFormatting
constexpr std::string_view histo3DFormatting

Function Documentation

◆ formatName()

std::string Gaudi::Histograming::Sink::detail::formatName ( std::string_view name,
unsigned int width )
inline

Definition at line 46 of file Utils.h.

46 {
47 if ( name.size() > width ) {
48 const auto preSize = ( width / 2 ) - 2;
49 const auto postSize = width - preSize - 3;
50 return fmt::format( "{:.{}s}...{:.{}s}", name.substr( 0, preSize ), preSize,
51 name.substr( name.size() - postSize, postSize ), postSize );
52 } else {
53 return std::string{ name };
54 }
55 }

◆ formatTitle()

std::string Gaudi::Histograming::Sink::detail::formatTitle ( std::string_view title,
unsigned int width )
inline

Definition at line 39 of file Utils.h.

39 {
40 if ( title.size() > width ) {
41 return fmt::format( "\"{:.{}s}...\"", title, width - 3 );
42 } else {
43 return fmt::format( "\"{:.{}s}\"", title, width );
44 }
45 }

◆ sqrt_or_zero()

template<typename T>
T Gaudi::Histograming::Sink::detail::sqrt_or_zero ( const T x)
inline

sqrt or zero

Definition at line 71 of file Utils.h.

71 {
72 return ( x > 0 ? std::sqrt( x ) : T{ 0 } );
73 }

Variable Documentation

◆ histo1DFormatting

std::string_view Gaudi::Histograming::Sink::detail::histo1DFormatting
constexpr
Initial value:
=
" | {:{}.{}s} | {:{}s} | {:10} |{:11.5g} | {:<#11.5g}|{:11.5g} |{:11.5g} |"

Definition at line 56 of file Utils.h.

◆ histo2DFormatting

std::string_view Gaudi::Histograming::Sink::detail::histo2DFormatting
constexpr
Initial value:
=
" ID={:{}.{}s} {:{}s} Ents/All={:>5.0f}/{:<5.0f}<X>/sX={:.5g}/{:<.5g},<Y>/sY={:.5g}/{:<.5g}"

Definition at line 58 of file Utils.h.

◆ histo3DFormatting

std::string_view Gaudi::Histograming::Sink::detail::histo3DFormatting
constexpr
Initial value:
=
" ID={:{}.{}s} {:{}s} "
"Ents/All={:>5.0f}/{:<5.0f}<X>/sX={:.5g}/{:<.5g},<Y>/sY={:.5g}/{:<.5g},<Z>/sZ={:.5g}/{:<.5g}"

Definition at line 60 of file Utils.h.