Main Page
Namespaces
Classes
Package Documentation
SimCalorimetry
EcalEBTrigPrimAlgos
src
EcalFenixPeakFinder.cc
Go to the documentation of this file.
1
#include <
SimCalorimetry/EcalEBTrigPrimAlgos/interface/EcalFenixPeakFinder.h
>
2
#include <iostream>
3
4
EcalFenixPeakFinder::EcalFenixPeakFinder
()
5
:inputsAlreadyIn_(0){
6
}
7
8
9
EcalFenixPeakFinder::~EcalFenixPeakFinder
(){
10
}
11
12
int
EcalFenixPeakFinder::setInput
(
int
input
)
13
{
14
if
(
inputsAlreadyIn_
<3)
15
{
16
//std::cout << " EcalFenixPeakFinder::setInput inputsAlreadyIn_<3 input " << input << std::endl;
17
buffer_
[
inputsAlreadyIn_
]=
input
;
18
inputsAlreadyIn_
++;
19
}
20
else
21
{
22
for
(
int
i
=0;
i
<2;
i
++) {
23
buffer_
[
i
]=
buffer_
[
i
+1];
24
//std::cout << " EcalFenixPeakFinder::setInput inputsAlreadyIn buffer " << buffer_[i] << std::endl;
25
}
26
buffer_
[2]=
input
;
27
}
28
return
1;
29
}
30
31
int
EcalFenixPeakFinder::process
()
32
{
33
34
if
(
inputsAlreadyIn_
<3)
return
0;
35
if
(
buffer_
[1]>
buffer_
[0] &&
buffer_
[1]>
buffer_
[2])
return
1;
36
else
return
0;
37
38
}
39
40
std::vector<int>
EcalFenixPeakFinder::process
(std::vector<int> &filtout, std::vector<int> &
output
)
41
{
42
43
// FIXME: 3
44
inputsAlreadyIn_
=0;
45
for
(
unsigned
int
i
=0;
i
<3;
i
++)
buffer_
[
i
]=0;
46
47
// std::vector<int> output;
48
49
//std::cout << " EcalFenixPeakFinder::process( " << filtout.size() << std::endl;
50
// attention, we have to shift by one, because the peak is found one too late
51
for
(
unsigned
int
i
=0;
i
<filtout.size();
i
++){
52
53
setInput
(filtout[
i
]);
54
for
(
unsigned
int
i =0;i<3;i++){
55
// std::cout << " buffer_ " << buffer_[i];
56
}
57
//std::cout << " " << std::endl;
58
59
if
(i>0) {
60
// int outone = process();
61
// output.push_back(outone);
62
output[i-1]=
process
();
63
}
64
}
65
// output.resize(filtout.size());
66
67
return
output
;
68
}
69
70
mps_fire.i
i
Definition:
mps_fire.py:330
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.h
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