CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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, int bitOddEven, 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

As in the firmware the computation is performed only on the even energy sum, so the oddEvenFlag (14th bit) is used to exclude the energy of the odd strips from the computation. D.Valsecchi.

Definition at line 20 of file EcalFenixMaxof2.h.

Constructor & Destructor Documentation

◆ EcalFenixMaxof2()

EcalFenixMaxof2::EcalFenixMaxof2 ( int  maxNrSamples,
int  nbMaxStrips 
)

Definition at line 5 of file EcalFenixMaxof2.cc.

References nbMaxStrips_, and sumby2_.

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 }
std::vector< std::vector< int > > 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,
int  bitOddEven,
std::vector< int > &  out 
)

Definition at line 13 of file EcalFenixMaxof2.cc.

References mps_fire::i, gpuClustering::pixelStatus::mask, convertSQLitetoXML_cfg::output, and sumby2_.

Referenced by EcalFenixTcp::process_part2_barrel().

14  {
15  int mask = (1 << bitMask) - 1;
16  bool strip_oddmask[nstrip][output.size()];
17 
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  // Prepare also the mask of strips to be avoided because of the odd>even energy flag
25  for (int istrip = 0; istrip < nstrip; ++istrip) {
26  for (unsigned int i = 0; i < output.size(); i++) {
27  if ((bypasslinout[istrip][i] >> bitOddEven) & 1)
28  strip_oddmask[istrip][i] = false;
29  else
30  strip_oddmask[istrip][i] = true;
31  }
32  }
33 
34  for (unsigned int i = 0; i < output.size(); i++) {
35  if (nstrip - 1 == 0) {
36  output[i] = strip_oddmask[0][i] * ((bypasslinout[0][i]) & mask);
37  } else {
38  for (int i2strip = 0; i2strip < nstrip - 1; ++i2strip) {
39  sumby2_[i2strip][i] = strip_oddmask[i2strip][i] * ((bypasslinout[i2strip][i]) & mask) +
40  strip_oddmask[i2strip + 1][i] * ((bypasslinout[i2strip + 1][i]) & mask);
41  if (sumby2_[i2strip][i] > output[i]) {
42  output[i] = sumby2_[i2strip][i];
43  }
44  }
45  }
46  }
47  return;
48 }
std::vector< std::vector< int > > sumby2_
constexpr uint32_t mask
Definition: gpuClustering.h:26

Member Data Documentation

◆ nbMaxStrips_

int EcalFenixMaxof2::nbMaxStrips_
private

Definition at line 27 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2().

◆ sumby2_

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

Definition at line 28 of file EcalFenixMaxof2.h.

Referenced by EcalFenixMaxof2(), and process().