The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Histograming::Sink::details::BinAvValue< TYPE > Struct Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Histograming/Sink/Utils.h>

Public Member Functions

 BinAvValue (const TYPE minV, const TYPE maxV, unsigned int nbins, const bool isInt)
auto operator() (const unsigned int n) const

Private Attributes

TYPE m_min { 0 }
TYPE m_max { 0 }
TYPE m_binSize { 0 }
bool m_isInt { false }

Detailed Description

template<typename TYPE>
struct Gaudi::Histograming::Sink::details::BinAvValue< TYPE >

Definition at line 607 of file Utils.h.

Constructor & Destructor Documentation

◆ BinAvValue()

template<typename TYPE>
Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::BinAvValue ( const TYPE minV,
const TYPE maxV,
unsigned int nbins,
const bool isInt )
inline

Member Function Documentation

◆ operator()()

template<typename TYPE>
auto Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::operator() ( const unsigned int n) const
inline

Definition at line 617 of file Utils.h.

617 {
618 TYPE binAv{ 0 };
619 if ( m_isInt ) {
620 // Need to find all int values that are in range for this bin and form average
621 const auto binMin = m_min + ( n - 1.0 ) * m_binSize;
622 const auto binMax = binMin + m_binSize;
623 unsigned int nAv{ 0 };
624 for ( auto iv = std::floor( binMin ); iv < std::ceil( binMax ); iv += 1.0 ) {
625 if ( binMin <= iv && iv <= binMax ) {
626 binAv += iv;
627 ++nAv;
628 }
629 }
630 binAv = ( nAv > 0 ? binAv / nAv : 0 );
631 } else {
632 // For floats just use bin centre
633 binAv = m_min + ( n - 0.5 ) * m_binSize;
634 }
635 return binAv;
636 }

Member Data Documentation

◆ m_binSize

template<typename TYPE>
TYPE Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::m_binSize { 0 }
private

Definition at line 609 of file Utils.h.

609{ 0 }, m_max{ 0 }, m_binSize{ 0 };

◆ m_isInt

template<typename TYPE>
bool Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::m_isInt { false }
private

Definition at line 610 of file Utils.h.

610{ false };

◆ m_max

template<typename TYPE>
TYPE Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::m_max { 0 }
private

Definition at line 609 of file Utils.h.

609{ 0 }, m_max{ 0 }, m_binSize{ 0 };

◆ m_min

template<typename TYPE>
TYPE Gaudi::Histograming::Sink::details::BinAvValue< TYPE >::m_min { 0 }
private

Definition at line 609 of file Utils.h.

609{ 0 }, m_max{ 0 }, m_binSize{ 0 };

The documentation for this struct was generated from the following file:
  • GaudiKernel/include/Gaudi/Histograming/Sink/Utils.h