SimCalorimetry
EcalTrigPrimAlgos
src
EcalFenixPeakFinder.cc
Go to the documentation of this file.
1
#include <
SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixPeakFinder.h
>
2
3
EcalFenixPeakFinder::EcalFenixPeakFinder
() : inputsAlreadyIn_(0) {}
4
5
EcalFenixPeakFinder::~EcalFenixPeakFinder
() {}
6
7
int
EcalFenixPeakFinder::setInput
(
int
input
) {
8
if
(
inputsAlreadyIn_
< 3) {
9
buffer_
[
inputsAlreadyIn_
] =
input
;
10
inputsAlreadyIn_
++;
11
}
else
{
12
for
(
int
i
= 0;
i
< 2;
i
++)
13
buffer_
[
i
] =
buffer_
[
i
+ 1];
14
buffer_
[2] =
input
;
15
}
16
return
1;
17
}
18
19
int
EcalFenixPeakFinder::process
() {
20
if
(
inputsAlreadyIn_
< 3)
21
return
0;
22
if
(
buffer_
[1] >
buffer_
[0] &&
buffer_
[1] >
buffer_
[2])
23
return
1;
24
else
25
return
0;
26
}
27
28
std::vector<int>
EcalFenixPeakFinder::process
(std::vector<int> &filtout, std::vector<int> &
output
) {
29
// FIXME: 3
30
inputsAlreadyIn_
= 0;
31
for
(
unsigned
int
i
= 0;
i
< 3;
i
++)
32
buffer_
[
i
] = 0;
33
34
// std::vector<int> output;
35
36
// attention, we have to shift by one, because the peak is found one too late
37
for
(
unsigned
int
i
= 0;
i
< filtout.size();
i
++) {
38
setInput
(filtout[
i
]);
39
if
(
i
> 0) {
40
// int outone = process();
41
// output.push_back(outone);
42
output
[
i
- 1] =
process
();
43
}
44
}
45
// output.resize(filtout.size());
46
47
return
output
;
48
}
mps_fire.i
i
Definition:
mps_fire.py:428
input
static const std::string input
Definition:
EdmProvDump.cc:48
EcalFenixPeakFinder::process
int process()
Definition:
EcalFenixPeakFinder.cc:19
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:72
EcalFenixPeakFinder::EcalFenixPeakFinder
EcalFenixPeakFinder()
Definition:
EcalFenixPeakFinder.cc:3
EcalFenixPeakFinder.h
EcalFenixPeakFinder::inputsAlreadyIn_
int inputsAlreadyIn_
Definition:
EcalFenixPeakFinder.h:23
EcalFenixPeakFinder::buffer_
int buffer_[3]
Definition:
EcalFenixPeakFinder.h:24
EcalFenixPeakFinder::setInput
int setInput(int input)
Definition:
EcalFenixPeakFinder.cc:7
EcalFenixPeakFinder::~EcalFenixPeakFinder
virtual ~EcalFenixPeakFinder()
Definition:
EcalFenixPeakFinder.cc:5
Generated for CMSSW Reference Manual by
1.8.16