CMS 3D CMS Logo

EcalFenixPeakFinder.cc
Go to the documentation of this file.
2 
4  :inputsAlreadyIn_(0){
5 }
6 
7 
9 }
10 
12 {
13  if(inputsAlreadyIn_<3)
14  {
17  }
18  else
19  {
20  for(int i=0; i<2; i++) buffer_[i]=buffer_[i+1];
21  buffer_[2]=input;
22  }
23  return 1;
24 }
25 
27 {
28 
29  if(inputsAlreadyIn_<3) return 0;
30  if(buffer_[1]>buffer_[0] && buffer_[1]>buffer_[2]) return 1;
31  else return 0;
32 
33 }
34 
35 std::vector<int> EcalFenixPeakFinder::process(std::vector<int> &filtout, std::vector<int> & output)
36 {
37 
38  // FIXME: 3
40  for (unsigned int i =0;i<3;i++) buffer_[i]=0;
41 
42  // std::vector<int> output;
43 
44  // attention, we have to shift by one, because the peak is found one too late
45  for (unsigned int i =0;i<filtout.size();i++){
46 
47  setInput(filtout[i]);
48  if (i>0) {
49  // int outone = process();
50  // output.push_back(outone);
51  output[i-1]= process();
52  }
53  }
54  // output.resize(filtout.size());
55 
56  return output;
57 }
58 
59 
static std::string const input
Definition: EdmProvDump.cc:44