ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigInDetEvent
src
TrigHisto.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigInDetEvent/TrigHisto.h
"
6
7
//---------------------------------------------------------------
8
9
TrigHisto::TrigHisto
(
void
):
m_nbins_x
(0),
10
m_underflowBin_x
(0),
11
m_overflowBin_x
(0),
12
m_min_x
(0.),
13
m_max_x
(0.),
14
m_binSize_x
(0.) {
15
}
16
17
//---------------------------------------------------------------
18
19
TrigHisto::~TrigHisto
(
void
) {
20
}
21
22
//---------------------------------------------------------------
23
24
void
TrigHisto::clear
(
void
) {
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
}
29
30
//---------------------------------------------------------------
31
32
// Require histogram sizes such that it might be called by TrigHisto2D too.
33
unsigned
int
TrigHisto::findBin
(
unsigned
int
nbins,
34
float
h_min,
35
float
h_max,
36
float
binSize,
37
float
value)
const
{
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
}
54
55
//---------------------------------------------------------------
TrigHisto.h
TrigHisto::TrigHisto
TrigHisto(void)
Definition
TrigHisto.cxx:9
TrigHisto::m_nbins_x
unsigned int m_nbins_x
Definition
TrigHisto.h:76
TrigHisto::m_underflowBin_x
unsigned int m_underflowBin_x
Definition
TrigHisto.h:77
TrigHisto::m_overflowBin_x
unsigned int m_overflowBin_x
Definition
TrigHisto.h:78
TrigHisto::m_binSize_x
float m_binSize_x
Definition
TrigHisto.h:81
TrigHisto::findBin
unsigned int findBin(unsigned int nbins, float h_min, float h_max, float binSize, float value) const
Definition
TrigHisto.cxx:33
TrigHisto::m_min_x
float m_min_x
Definition
TrigHisto.h:79
TrigHisto::clear
void clear(void)
Zero all histogram bins.
Definition
TrigHisto.cxx:24
TrigHisto::m_itr
std::vector< float >::iterator m_itr
Definition
TrigHisto.h:72
TrigHisto::m_itr_end
std::vector< float >::iterator m_itr_end
Definition
TrigHisto.h:73
TrigHisto::~TrigHisto
virtual ~TrigHisto(void)
Definition
TrigHisto.cxx:19
TrigHisto::m_max_x
float m_max_x
Definition
TrigHisto.h:80
TrigHisto::m_contents
std::vector< float > m_contents
Definition
TrigHisto.h:71
Generated on
for ATLAS Offline Software by
1.14.0