ATLAS Offline Software
Loading...
Searching...
No Matches
TrigHisto Class Reference

The base class for TrigHisto1D and TrigHisto2D. This class should never be stored or used directly. More...

#include <TrigHisto.h>

Inheritance diagram for TrigHisto:
Collaboration diagram for TrigHisto:

Public Member Functions

 TrigHisto ()=default
 TrigHisto (TrigHisto &&)=default
 User declared d'tor means we have to explicitly enable move operations.
TrigHistooperator= (TrigHisto &&)=default
virtual ~TrigHisto ()=default
void clear (void)
 Zero all histogram bins.
unsigned int nbins_x (void) const
 Return the number of bins along the y-axis, not including the under and overflow.
float min_x () const
 Return the minimum along the x-axis.
float max_x () const
 Return the maximum along the x-axis.
const std::vector< float > & contents () const
 Return the bin contents of the histogram, including the under and overflow bins.

Protected Member Functions

unsigned int findBin (unsigned int nbins, float h_min, float h_max, float binSize, float value) const

Protected Attributes

std::vector< float > m_contents
unsigned int m_nbins_x {}
unsigned int m_underflowBin_x {}
unsigned int m_overflowBin_x {}
float m_min_x {}
float m_max_x {}
float m_binSize_x {}

Detailed Description

The base class for TrigHisto1D and TrigHisto2D. This class should never be stored or used directly.

Author
W. H. Bell W.Bel.nosp@m.l@ce.nosp@m.rn.ch

Definition at line 32 of file TrigHisto.h.

Constructor & Destructor Documentation

◆ TrigHisto() [1/2]

TrigHisto::TrigHisto ( )
default

◆ TrigHisto() [2/2]

TrigHisto::TrigHisto ( TrigHisto && )
default

User declared d'tor means we have to explicitly enable move operations.

◆ ~TrigHisto()

virtual TrigHisto::~TrigHisto ( )
virtualdefault

Member Function Documentation

◆ clear()

void TrigHisto::clear ( void )

Zero all histogram bins.

Definition at line 12 of file TrigHisto.cxx.

12 {
13 for (auto& v : m_contents) {
14 v = 0.f;
15 }
16}
std::vector< float > m_contents
Definition TrigHisto.h:74

◆ contents()

const std::vector< float > & TrigHisto::contents ( ) const
inline

Return the bin contents of the histogram, including the under and overflow bins.

Definition at line 61 of file TrigHisto.h.

61 {
62 return m_contents;
63 }

◆ findBin()

unsigned int TrigHisto::findBin ( unsigned int nbins,
float h_min,
float h_max,
float binSize,
float value ) const
protected
Returns
which bin this value corresponds to. (Supply bin limits such that it might be used for 1D or 2D derived class.)

Definition at line 21 of file TrigHisto.cxx.

25 {
26 unsigned int ibin = 0;
27
28 if(value < h_min) { // Underflow
29 ibin = 0;
30 }
31 else if( !(value < h_max)) { // Overflow (catches NaN)
32 ibin = nbins+1;
33 }
34 else {
35 while(value > (ibin*binSize+h_min) && ibin <= nbins) { // None under/overflow from 1 to nbins
36 ibin++;
37 }
38 }
39
40 return ibin;
41}

◆ max_x()

float TrigHisto::max_x ( ) const
inline

Return the maximum along the x-axis.

Definition at line 55 of file TrigHisto.h.

55 {
56 return m_max_x;
57 }
float m_max_x
Definition TrigHisto.h:81

◆ min_x()

float TrigHisto::min_x ( ) const
inline

Return the minimum along the x-axis.

Definition at line 50 of file TrigHisto.h.

50 {
51 return m_min_x;
52 }
float m_min_x
Definition TrigHisto.h:80

◆ nbins_x()

unsigned int TrigHisto::nbins_x ( void ) const
inline

Return the number of bins along the y-axis, not including the under and overflow.

Definition at line 45 of file TrigHisto.h.

45 {
46 return m_nbins_x;
47 }
unsigned int m_nbins_x
Definition TrigHisto.h:77

◆ operator=()

TrigHisto & TrigHisto::operator= ( TrigHisto && )
default

Member Data Documentation

◆ m_binSize_x

float TrigHisto::m_binSize_x {}
protected

Definition at line 82 of file TrigHisto.h.

82{};

◆ m_contents

std::vector<float> TrigHisto::m_contents
protected

Definition at line 74 of file TrigHisto.h.

◆ m_max_x

float TrigHisto::m_max_x {}
protected

Definition at line 81 of file TrigHisto.h.

81{};

◆ m_min_x

float TrigHisto::m_min_x {}
protected

Definition at line 80 of file TrigHisto.h.

80{};

◆ m_nbins_x

unsigned int TrigHisto::m_nbins_x {}
protected

Definition at line 77 of file TrigHisto.h.

77{};

◆ m_overflowBin_x

unsigned int TrigHisto::m_overflowBin_x {}
protected

Definition at line 79 of file TrigHisto.h.

79{};

◆ m_underflowBin_x

unsigned int TrigHisto::m_underflowBin_x {}
protected

Definition at line 78 of file TrigHisto.h.

78{};

The documentation for this class was generated from the following files: