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-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigInDetEvent/TrigHisto.h
"
6
7
8
9
10
//---------------------------------------------------------------
11
12
void
TrigHisto::clear
(
void
) {
13
for
(
auto
& v :
m_contents
) {
14
v = 0.f;
15
}
16
}
17
18
//---------------------------------------------------------------
19
20
// Require histogram sizes such that it might be called by TrigHisto2D too.
21
unsigned
int
TrigHisto::findBin
(
unsigned
int
nbins,
22
float
h_min,
23
float
h_max,
24
float
binSize,
25
float
value)
const
{
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
}
42
TrigHisto.h
TrigHisto::findBin
unsigned int findBin(unsigned int nbins, float h_min, float h_max, float binSize, float value) const
Definition
TrigHisto.cxx:21
TrigHisto::clear
void clear(void)
Zero all histogram bins.
Definition
TrigHisto.cxx:12
TrigHisto::m_contents
std::vector< float > m_contents
Definition
TrigHisto.h:74
Generated on
for ATLAS Offline Software by
1.16.1