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 75 of file TRTCalib_bhadd.cxx.

Constructor & Destructor Documentation

◆ CalHist()

CalHist::CalHist ( )

Definition at line 91 of file TRTCalib_bhadd.cxx.

92{
93 maxvalue = 0;
94}

◆ ~CalHist()

CalHist::~CalHist ( )

Definition at line 96 of file TRTCalib_bhadd.cxx.

96{}

Member Function Documentation

◆ GetArray()

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

Definition at line 125 of file TRTCalib_bhadd.cxx.

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

◆ IncreaseBin()

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

Definition at line 98 of file TRTCalib_bhadd.cxx.

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

Member Data Documentation

◆ m_hist

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

Definition at line 88 of file TRTCalib_bhadd.cxx.

◆ maxvalue

int CalHist::maxvalue

Definition at line 84 of file TRTCalib_bhadd.cxx.


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