Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
SimCalorimetry
EcalEBTrigPrimAlgos
src
EcalEBFenixPeakFinder.cc
Go to the documentation of this file.
1
#include <
SimCalorimetry/EcalEBTrigPrimAlgos/interface/EcalEBFenixPeakFinder.h
>
2
#include <iostream>
3
4
EcalEBFenixPeakFinder::EcalEBFenixPeakFinder
() : inputsAlreadyIn_(0) {}
5
6
EcalEBFenixPeakFinder::~EcalEBFenixPeakFinder
() {}
7
8
int
EcalEBFenixPeakFinder::setInput
(
int
input
) {
9
if
(
inputsAlreadyIn_
< 3) {
10
//std::cout << " EcalEBFenixPeakFinder::setInput inputsAlreadyIn_<3 input " << input << std::endl;
11
buffer_
[
inputsAlreadyIn_
] =
input
;
12
inputsAlreadyIn_
++;
13
}
else
{
14
for
(
int
i
= 0;
i
< 2;
i
++) {
15
buffer_
[
i
] =
buffer_
[
i
+ 1];
16
//std::cout << " EcalEBFenixPeakFinder::setInput inputsAlreadyIn buffer " << buffer_[i] << std::endl;
17
}
18
buffer_
[2] =
input
;
19
}
20
return
1;
21
}
22
23
int
EcalEBFenixPeakFinder::process
() {
24
if
(
inputsAlreadyIn_
< 3)
25
return
0;
26
if
(
buffer_
[1] >
buffer_
[0] &&
buffer_
[1] >
buffer_
[2])
27
return
1;
28
else
29
return
0;
30
}
31
32
std::vector<int>
EcalEBFenixPeakFinder::process
(std::vector<int> &filtout, std::vector<int> &
output
) {
33
// FIXME: 3
34
inputsAlreadyIn_
= 0;
35
for
(
unsigned
int
i
= 0;
i
< 3;
i
++)
36
buffer_
[
i
] = 0;
37
38
// std::vector<int> output;
39
40
//std::cout << " EcalEBFenixPeakFinder::process( " << filtout.size() << std::endl;
41
// attention, we have to shift by one, because the peak is found one too late
42
for
(
unsigned
int
i
= 0;
i
< filtout.size();
i
++) {
43
setInput
(filtout[
i
]);
44
for
(
unsigned
int
i = 0; i < 3; i++) {
45
// std::cout << " buffer_ " << buffer_[i];
46
}
47
//std::cout << " " << std::endl;
48
49
if
(i > 0) {
50
// int outone = process();
51
// output.push_back(outone);
52
output[i - 1] =
process
();
53
}
54
}
55
// output.resize(filtout.size());
56
57
return
output
;
58
}
EcalEBFenixPeakFinder::~EcalEBFenixPeakFinder
virtual ~EcalEBFenixPeakFinder()
Definition:
EcalEBFenixPeakFinder.cc:6
mps_fire.i
i
Definition:
mps_fire.py:428
EcalEBFenixPeakFinder::inputsAlreadyIn_
int inputsAlreadyIn_
Definition:
EcalEBFenixPeakFinder.h:22
EcalEBFenixPeakFinder::process
int process()
Definition:
EcalEBFenixPeakFinder.cc:23
input
static std::string const input
Definition:
EdmProvDump.cc:47
EcalEBFenixPeakFinder::setInput
int setInput(int input)
Definition:
EcalEBFenixPeakFinder.cc:8
EcalEBFenixPeakFinder::EcalEBFenixPeakFinder
EcalEBFenixPeakFinder()
Definition:
EcalEBFenixPeakFinder.cc:4
convertSQLitetoXML_cfg.output
tuple output
Definition:
convertSQLitetoXML_cfg.py:72
EcalEBFenixPeakFinder::buffer_
int buffer_[3]
Definition:
EcalEBFenixPeakFinder.h:23
EcalEBFenixPeakFinder.h
Generated for CMSSW Reference Manual by
1.8.5