ATLAS Offline Software
Loading...
Searching...
No Matches
LArCalorimeter
LArSamplesMon
src
HistoryIterator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArSamplesMon/HistoryIterator.h
"
6
#include "
LArSamplesMon/History.h
"
7
#include "
LArSamplesMon/Interface.h
"
8
#include "
LArSamplesMon/Data.h
"
9
10
#include <iostream>
11
using
std::cout;
12
using
std::endl;
13
14
using namespace
LArSamples
;
15
16
17
HistoryIterator::HistoryIterator
(
const
Interface
& interface,
unsigned
int
pos
,
18
double
eMin,
double
adcMaxMin)
19
:
m_interface
(&interface),
m_pos
(
pos
),
20
m_eMin
(eMin),
m_adcMaxMin
(adcMaxMin)
21
{
22
if
(!
isValid
())
next
();
23
}
24
25
26
const
History
*
HistoryIterator::history
()
const
27
{
28
return
m_interface
->cellHistory(
m_pos
);
29
}
30
31
32
bool
HistoryIterator::isValid
()
const
33
{
34
if
(
m_pos
>=
Definitions::nChannels
)
return
false
;
35
unsigned
int
size =
m_interface
->historySize(
m_pos
);
36
if
(size == 0)
return
false
;
37
if
(
m_eMin
< 0 &&
m_adcMaxMin
< 0)
return
true
;
38
39
const
History
*
history
=
m_interface
->cellHistory(
m_pos
);
40
bool
found =
false
;
41
for
(
unsigned
int
i = 0; i <
history
->nData(); i++) {
42
if
(
history
->data(i)->energy() >
m_eMin
&&
history
->data(i)->adcMax() >
m_adcMaxMin
) {
43
found =
true
;
44
break
;
45
}
46
}
47
return
found;
48
}
49
50
51
const
History
*
HistoryIterator::next
()
52
{
53
m_pos
++;
54
55
for
(;
m_pos
<
m_interface
->end();
m_pos
++)
56
if
(
isValid
())
break
;
57
58
return
history
();
59
}
60
61
62
HistoryIterator
*
HistoryIterator::operator++
()
63
{
64
next
();
65
return
this
;
66
}
Data.h
HistoryIterator.h
History.h
Interface.h
LArSamples::HistoryIterator::m_pos
unsigned int m_pos
Definition
HistoryIterator.h:43
LArSamples::HistoryIterator::operator++
HistoryIterator * operator++()
Definition
HistoryIterator.cxx:62
LArSamples::HistoryIterator::pos
unsigned int pos() const
Definition
HistoryIterator.h:30
LArSamples::HistoryIterator::next
const History * next()
Definition
HistoryIterator.cxx:51
LArSamples::HistoryIterator::m_interface
const Interface * m_interface
Definition
HistoryIterator.h:42
LArSamples::HistoryIterator::HistoryIterator
HistoryIterator(const Interface &interface, unsigned int pos=0, double eMin=-1, double adcMaxMin=-1)
Constructor.
Definition
HistoryIterator.cxx:17
LArSamples::HistoryIterator::m_eMin
double m_eMin
Definition
HistoryIterator.h:45
LArSamples::HistoryIterator::isValid
bool isValid() const
Definition
HistoryIterator.cxx:32
LArSamples::HistoryIterator::m_adcMaxMin
double m_adcMaxMin
Definition
HistoryIterator.h:45
LArSamples::HistoryIterator::history
const History * history() const
Definition
HistoryIterator.cxx:26
LArSamples::History
Definition
History.h:35
LArSamples::Interface
Definition
Interface.h:36
LArSamples
Definition
AbsShape.h:24
LArSamples::Definitions::nChannels
static const unsigned int nChannels
Definition
LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:14
Generated on
for ATLAS Offline Software by
1.14.0