The Gaudi Framework  v40r0 (475e45c1)
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 More...
 

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 55 of file Utils.h.

55  {
56  if ( name.size() > width ) {
57  const auto preSize = ( width / 2 ) - 2;
58  const auto postSize = width - preSize - 3;
59  return fmt::format( "{:.{}s}...{:.{}s}", name.substr( 0, preSize ), preSize,
60  name.substr( name.size() - postSize, postSize ), postSize );
61  } else {
62  return std::string{ name };
63  }
64  }

◆ formatTitle()

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

Definition at line 48 of file Utils.h.

48  {
49  if ( title.size() > width ) {
50  return fmt::format( "\"{:.{}s}...\"", title, width - 3 );
51  } else {
52  return fmt::format( "\"{:.{}s}\"", title, width );
53  }
54  }

◆ sqrt_or_zero()

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

sqrt or zero

Definition at line 80 of file Utils.h.

80  {
81  return ( x > 0 ? std::sqrt( x ) : T{ 0 } );
82  }

Variable Documentation

◆ histo1DFormatting

constexpr 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 65 of file Utils.h.

◆ histo2DFormatting

constexpr 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 67 of file Utils.h.

◆ histo3DFormatting

constexpr 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 69 of file Utils.h.

Gaudi::Accumulators::sqrt
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition: Counters.h:34
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:99
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77