CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalFenixMaxof2 Class Reference

#include <EcalFenixMaxof2.h>

List of all members.

Public Member Functions

 EcalFenixMaxof2 (int maxNrSamples, int nbMaxStrips)
void process (std::vector< std::vector< int > > &, int nStr, std::vector< int > &out)
virtual ~EcalFenixMaxof2 ()

Private Attributes

int nbMaxStrips_
std::vector< std::vector< int > > sumby2_

Detailed Description

finds max sum of two adjacent samples

input: 5x 12 bits (les 12 premiers bits sortant du bypasslin) output: 12 bits

computes 4 sums of 2 strips and gives the max max limited by 0xfff

Definition at line 18 of file EcalFenixMaxof2.h.


Constructor & Destructor Documentation

EcalFenixMaxof2::EcalFenixMaxof2 ( int  maxNrSamples,
int  nbMaxStrips 
)

Definition at line 6 of file EcalFenixMaxof2.cc.

References nbMaxStrips_, and sumby2_.

                                                                  : nbMaxStrips_(nbMaxStrips)
{
  std::vector<int> vec(maxNrSamples,0);
  for (int i2strip =0;i2strip<nbMaxStrips_-1;++i2strip)
    sumby2_.push_back(vec);
}
EcalFenixMaxof2::~EcalFenixMaxof2 ( ) [virtual]

Definition at line 13 of file EcalFenixMaxof2.cc.

                                 {
}

Member Function Documentation

void EcalFenixMaxof2::process ( std::vector< std::vector< int > > &  bypasslinout,
int  nStr,
std::vector< int > &  out 
)

Definition at line 16 of file EcalFenixMaxof2.cc.

References i, and sumby2_.

Referenced by EcalFenixTcp::process_part2_barrel().

{
  for (int i2strip =0;i2strip<nstrip-1;++i2strip)
    for (unsigned int i=0;i<output.size();i++)      sumby2_[i2strip][i]=0; 
  for (unsigned int i=0;i<output.size();i++) output[i] = 0;
  
  for (unsigned int i=0;i<output.size();i++){
    if (nstrip-1==0){
      output[i]=bypasslinout[0][i];
    }else {
      for ( int i2strip=0; i2strip< nstrip-1;++i2strip){ 
        sumby2_[i2strip][i]= bypasslinout[i2strip][i]+bypasslinout[i2strip+1][i];
        if (sumby2_[i2strip][i]>output[i]){
          output[i]=sumby2_[i2strip][i];
        }
      }
    }
  }
  return;
}

Member Data Documentation

Definition at line 26 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2().

std::vector<std::vector<int> > EcalFenixMaxof2::sumby2_ [private]

Definition at line 27 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2(), and process().