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 (void)
virtual ~TrigHisto (void)
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 (void) const
 Return the minimum along the x-axis.
float max_x (void) const
 Return the maximum along the x-axis.
const std::vector< float > & contents (void) 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
std::vector< float >::iterator m_itr {}
std::vector< float >::iterator m_itr_end {}
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()

TrigHisto::TrigHisto ( void )

Definition at line 9 of file TrigHisto.cxx.

9 : m_nbins_x(0),
12 m_min_x(0.),
13 m_max_x(0.),
14 m_binSize_x(0.) {
15}
unsigned int m_nbins_x
Definition TrigHisto.h:76
unsigned int m_underflowBin_x
Definition TrigHisto.h:77
unsigned int m_overflowBin_x
Definition TrigHisto.h:78
float m_binSize_x
Definition TrigHisto.h:81
float m_min_x
Definition TrigHisto.h:79
float m_max_x
Definition TrigHisto.h:80

◆ ~TrigHisto()

TrigHisto::~TrigHisto ( void )
virtual

Definition at line 19 of file TrigHisto.cxx.

19 {
20}

Member Function Documentation

◆ clear()

void TrigHisto::clear ( void )

Zero all histogram bins.

Definition at line 24 of file TrigHisto.cxx.

24 {
25 m_itr = m_contents.begin();
26 m_itr_end = m_contents.end();
27 for(; m_itr != m_itr_end; ++m_itr) (*m_itr) = 0.;
28}
std::vector< float >::iterator m_itr
Definition TrigHisto.h:72
std::vector< float >::iterator m_itr_end
Definition TrigHisto.h:73
std::vector< float > m_contents
Definition TrigHisto.h:71

◆ contents()

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

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

Definition at line 58 of file TrigHisto.h.

58 {
59 return m_contents;
60 }

◆ 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 33 of file TrigHisto.cxx.

37 {
38 unsigned int ibin = 0;
39
40 if(value < h_min) { // Underflow
41 ibin = 0;
42 }
43 else if( !(value < h_max)) { // Overflow (catches NaN)
44 ibin = nbins+1;
45 }
46 else {
47 while(value > (ibin*binSize+h_min) && ibin <= nbins) { // None under/overflow from 1 to nbins
48 ibin++;
49 }
50 }
51
52 return ibin;
53}

◆ max_x()

float TrigHisto::max_x ( void ) const
inline

Return the maximum along the x-axis.

Definition at line 52 of file TrigHisto.h.

52 {
53 return m_max_x;
54 }

◆ min_x()

float TrigHisto::min_x ( void ) const
inline

Return the minimum along the x-axis.

Definition at line 47 of file TrigHisto.h.

47 {
48 return m_min_x;
49 }

◆ 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 42 of file TrigHisto.h.

42 {
43 return m_nbins_x;
44 }

Member Data Documentation

◆ m_binSize_x

float TrigHisto::m_binSize_x
protected

Definition at line 81 of file TrigHisto.h.

◆ m_contents

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

Definition at line 71 of file TrigHisto.h.

◆ m_itr

std::vector<float>::iterator TrigHisto::m_itr {}
protected

Definition at line 72 of file TrigHisto.h.

72{};

◆ m_itr_end

std::vector<float>::iterator TrigHisto::m_itr_end {}
protected

Definition at line 73 of file TrigHisto.h.

73{};

◆ m_max_x

float TrigHisto::m_max_x
protected

Definition at line 80 of file TrigHisto.h.

◆ m_min_x

float TrigHisto::m_min_x
protected

Definition at line 79 of file TrigHisto.h.

◆ m_nbins_x

unsigned int TrigHisto::m_nbins_x
protected

Definition at line 76 of file TrigHisto.h.

◆ m_overflowBin_x

unsigned int TrigHisto::m_overflowBin_x
protected

Definition at line 78 of file TrigHisto.h.

◆ m_underflowBin_x

unsigned int TrigHisto::m_underflowBin_x
protected

Definition at line 77 of file TrigHisto.h.


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