Main Page
Namespaces
Classes
Package Documentation
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
21
if
(
inputsAlreadyIn_
< 3)
22
return
0;
23
if
(
buffer_
[1] >
buffer_
[0] &&
buffer_
[1] >
buffer_
[2])
24
return
1;
25
else
26
return
0;
27
}
28
29
std::vector<int>
EcalFenixPeakFinder::process
(std::vector<int> &filtout,
30
std::vector<int> &
output
) {
31
32
// FIXME: 3
33
inputsAlreadyIn_
= 0;
34
for
(
unsigned
int
i
= 0;
i
< 3;
i
++)
35
buffer_
[
i
] = 0;
36
37
// std::vector<int> output;
38
39
// attention, we have to shift by one, because the peak is found one too late
40
for
(
unsigned
int
i
= 0;
i
< filtout.size();
i
++) {
41
42
setInput
(filtout[
i
]);
43
if
(
i
> 0) {
44
// int outone = process();
45
// output.push_back(outone);
46
output[
i
- 1] =
process
();
47
}
48
}
49
// output.resize(filtout.size());
50
51
return
output
;
52
}
mps_fire.i
i
Definition:
mps_fire.py:338
EcalFenixPeakFinder.h
EcalFenixPeakFinder::~EcalFenixPeakFinder
virtual ~EcalFenixPeakFinder()
Definition:
EcalFenixPeakFinder.cc:9
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:32
EcalFenixPeakFinder::inputsAlreadyIn_
int inputsAlreadyIn_
Definition:
EcalFenixPeakFinder.h:23
input
static std::string const input
Definition:
EdmProvDump.cc:48
EcalFenixPeakFinder::EcalFenixPeakFinder
EcalFenixPeakFinder()
Definition:
EcalFenixPeakFinder.cc:4
EcalFenixPeakFinder::buffer_
int buffer_[3]
Definition:
EcalFenixPeakFinder.h:24
EcalFenixPeakFinder::setInput
int setInput(int input)
Definition:
EcalFenixPeakFinder.cc:12
EcalFenixPeakFinder::process
int process()
Definition:
EcalFenixPeakFinder.cc:31
Generated for CMSSW Reference Manual by
1.8.11