CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalFenixPeakFinder Class Reference

calculates the peak for Fenix strip, barrel input : 18 bits output: boolean More...

#include <EcalFenixPeakFinder.h>

Public Member Functions

 EcalFenixPeakFinder ()
 
virtual std::vector< int > process (std::vector< int > &filtout, std::vector< int > &output)
 
virtual ~EcalFenixPeakFinder ()
 

Private Member Functions

int process ()
 
int setInput (int input)
 

Private Attributes

int buffer_ [3]
 
bool disabled
 
int inputsAlreadyIn_
 

Detailed Description

calculates the peak for Fenix strip, barrel input : 18 bits output: boolean

\ class EcalFenixPeakFinder —>gets the sample where the value is max. the value is 1 for this max sample, 0 for the others .needs 3 samples to proceed. -—> do we really need caloVShape?

Definition at line 17 of file EcalFenixPeakFinder.h.

Constructor & Destructor Documentation

◆ EcalFenixPeakFinder()

EcalFenixPeakFinder::EcalFenixPeakFinder ( )

Definition at line 3 of file EcalFenixPeakFinder.cc.

3 : inputsAlreadyIn_(0) {}

◆ ~EcalFenixPeakFinder()

EcalFenixPeakFinder::~EcalFenixPeakFinder ( )
virtual

Definition at line 5 of file EcalFenixPeakFinder.cc.

5 {}

Member Function Documentation

◆ process() [1/2]

int EcalFenixPeakFinder::process ( )
private

Definition at line 19 of file EcalFenixPeakFinder.cc.

19  {
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 }

References buffer_, and inputsAlreadyIn_.

Referenced by process(), and EcalFenixStrip::process_part1().

◆ process() [2/2]

std::vector< int > EcalFenixPeakFinder::process ( std::vector< int > &  filtout,
std::vector< int > &  output 
)
virtual

Definition at line 28 of file EcalFenixPeakFinder.cc.

28  {
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 }

References buffer_, mps_fire::i, inputsAlreadyIn_, convertSQLitetoXML_cfg::output, process(), and setInput().

◆ setInput()

int EcalFenixPeakFinder::setInput ( int  input)
private

Definition at line 7 of file EcalFenixPeakFinder.cc.

7  {
8  if (inputsAlreadyIn_ < 3) {
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 }

References buffer_, mps_fire::i, input, and inputsAlreadyIn_.

Referenced by process().

Member Data Documentation

◆ buffer_

int EcalFenixPeakFinder::buffer_[3]
private

Definition at line 24 of file EcalFenixPeakFinder.h.

Referenced by process(), and setInput().

◆ disabled

bool EcalFenixPeakFinder::disabled
private

Definition at line 19 of file EcalFenixPeakFinder.h.

◆ inputsAlreadyIn_

int EcalFenixPeakFinder::inputsAlreadyIn_
private

Definition at line 23 of file EcalFenixPeakFinder.h.

Referenced by process(), and setInput().

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::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