CMS 3D CMS Logo

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

#include <EcalFenixMaxof2.h>

Public Member Functions

 EcalFenixMaxof2 (int maxNrSamples, int nbMaxStrips)
 
void process (std::vector< std::vector< int >> &, int nStr, int bitMask, 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::EcalFenixMaxof2 ( int  maxNrSamples,
int  nbMaxStrips 
)

Definition at line 5 of file EcalFenixMaxof2.cc.

5  : nbMaxStrips_(nbMaxStrips) {
6  std::vector<int> vec(maxNrSamples, 0);
7  for (int i2strip = 0; i2strip < nbMaxStrips_ - 1; ++i2strip)
8  sumby2_.push_back(vec);
9 }

References nbMaxStrips_, and sumby2_.

◆ ~EcalFenixMaxof2()

EcalFenixMaxof2::~EcalFenixMaxof2 ( )
virtual

Definition at line 11 of file EcalFenixMaxof2.cc.

11 {}

Member Function Documentation

◆ process()

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

Definition at line 13 of file EcalFenixMaxof2.cc.

16  {
17  int mask = (1 << bitMask) - 1;
18  for (int i2strip = 0; i2strip < nstrip - 1; ++i2strip)
19  for (unsigned int i = 0; i < output.size(); i++)
20  sumby2_[i2strip][i] = 0;
21  for (unsigned int i = 0; i < output.size(); i++)
22  output[i] = 0;
23 
24  for (unsigned int i = 0; i < output.size(); i++) {
25  if (nstrip - 1 == 0) {
26  output[i] = ((bypasslinout[0][i]) & mask);
27  } else {
28  for (int i2strip = 0; i2strip < nstrip - 1; ++i2strip) {
29  sumby2_[i2strip][i] = ((bypasslinout[i2strip][i]) & mask) + ((bypasslinout[i2strip + 1][i]) & mask);
30  if (sumby2_[i2strip][i] > output[i]) {
31  output[i] = sumby2_[i2strip][i];
32  }
33  }
34  }
35  }
36  return;
37 }

References mps_fire::i, convertSQLitetoXML_cfg::output, and sumby2_.

Referenced by EcalFenixTcp::process_part2_barrel().

Member Data Documentation

◆ nbMaxStrips_

int EcalFenixMaxof2::nbMaxStrips_
private

Definition at line 25 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2().

◆ sumby2_

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

Definition at line 26 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2(), and process().

EcalFenixMaxof2::sumby2_
std::vector< std::vector< int > > sumby2_
Definition: EcalFenixMaxof2.h:26
mps_fire.i
i
Definition: mps_fire.py:355
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
EcalFenixMaxof2::nbMaxStrips_
int nbMaxStrips_
Definition: EcalFenixMaxof2.h:25