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

Classes

struct  IntWithFixedWidth
 helper struct to print integers with fixed width 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>
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 48 of file Utils.h.

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

◆ formatTitle()

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

Definition at line 41 of file Utils.h.

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

◆ sqrt_or_zero()

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

sqrt or zero

Definition at line 73 of file Utils.h.

73 {
74 return ( x > 0 ? std::sqrt( x ) : T{ 0 } );
75 }

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 58 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 60 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 62 of file Utils.h.