FairRoot/PandaRoot
PndEmcPSAFPGAFilterCF.cxx
Go to the documentation of this file.
2 
4  buffer(0)
5  ,bpointer(0)
6 {
7 }
8 
10 {
11  buffer.resize(0);
12 }
13 
14 void PndEmcPSAFPGAFilterCF::set(unsigned int newBufferSize, float newRatio)
15 {
16  buffer.resize(newBufferSize);
17  for(unsigned int i=0; i<newBufferSize; i++)
18  buffer[i]=0;
19  ratio = newRatio;
20  bpointer=0;
21 }
22 
24 {
25  bpointer = 0;
26  for(unsigned int i=0; i<buffer.size(); i++)
27  buffer[i]=0;
28 }
29 
30 float PndEmcPSAFPGAFilterCF::put(float valueToStore){
31  bpointer %= buffer.size();
32  float cfd = buffer[bpointer] - ratio * valueToStore;
33  buffer[bpointer] = valueToStore;
34  bpointer++;
35  return cfd;
36 };
37 
Int_t i
Definition: run_full.C:25
void set(unsigned int newBufferSize, float newRatio)
std::vector< float > buffer
virtual float put(float valueToStore)