ATLAS Offline Software
Loading...
Searching...
No Matches
CalHist Class Reference
Collaboration diagram for CalHist:

Public Member Functions

 CalHist ()
 ~CalHist ()
int IncreaseBin (short, unsigned short)
void GetArray (std::vector< int > &, int)

Public Attributes

int maxvalue

Private Attributes

map< short, unsigned short > m_hist

Detailed Description

Definition at line 76 of file TRTCalib_bhadd.cxx.

Constructor & Destructor Documentation

◆ CalHist()

CalHist::CalHist ( )

Definition at line 92 of file TRTCalib_bhadd.cxx.

93{
94 maxvalue = 0;
95}

◆ ~CalHist()

CalHist::~CalHist ( )

Definition at line 97 of file TRTCalib_bhadd.cxx.

97{}

Member Function Documentation

◆ GetArray()

void CalHist::GetArray ( std::vector< int > & array,
int nbins )

Definition at line 126 of file TRTCalib_bhadd.cxx.

127{
128 for (int ibin = 0; ibin < nbins; ibin++)
129 {
130 if (m_hist.find(ibin) != m_hist.end())
131 array.at(ibin) = m_hist[ibin];
132 else
133 array.at(ibin) = 0;
134 }
135}
map< short, unsigned short > m_hist

◆ IncreaseBin()

int CalHist::IncreaseBin ( short bin,
unsigned short value )

Definition at line 99 of file TRTCalib_bhadd.cxx.

100{
101 if (m_hist.find(bin) == m_hist.end())
102 {
103 m_hist[bin] = value;
104 if (m_hist[bin] > maxvalue)
106 return 1;
107 }
108 else
109 {
110 m_hist[bin] = m_hist[bin] + value;
111 if (m_hist[bin] > maxvalue)
113 return 0;
114 }
115}

Member Data Documentation

◆ m_hist

map<short, unsigned short> CalHist::m_hist
private

Definition at line 89 of file TRTCalib_bhadd.cxx.

◆ maxvalue

int CalHist::maxvalue

Definition at line 85 of file TRTCalib_bhadd.cxx.


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