test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixMaxof2.cc
Go to the documentation of this file.
2 
3 
4 // global type definitions for class implementation in source file defined by Tag entries in ArgoUML
5 // Result: typedef <typedef_global_source> <tag_value>;
6 EcalFenixMaxof2::EcalFenixMaxof2(int maxNrSamples, int nbMaxStrips) : nbMaxStrips_(nbMaxStrips)
7 {
8  std::vector<int> vec(maxNrSamples,0);
9  for (int i2strip =0;i2strip<nbMaxStrips_-1;++i2strip)
10  sumby2_.push_back(vec);
11 }
12 
14 }
15 
16 void EcalFenixMaxof2::process(std::vector<std::vector <int> > &bypasslinout, int nstrip, int bitMask,std::vector<int> &output)
17 {
18  int mask = (1<<bitMask)-1;
19  for (int i2strip =0;i2strip<nstrip-1;++i2strip)
20  for (unsigned int i=0;i<output.size();i++) sumby2_[i2strip][i]=0;
21  for (unsigned int i=0;i<output.size();i++) output[i] = 0;
22 
23  for (unsigned int i=0;i<output.size();i++){
24  if (nstrip-1==0){
25  output[i]=((bypasslinout[0][i])&mask);
26  }else {
27  for ( int i2strip=0; i2strip< nstrip-1;++i2strip){
28  sumby2_[i2strip][i]= ((bypasslinout[i2strip][i])&mask)+((bypasslinout[i2strip+1][i])&mask);
29  if (sumby2_[i2strip][i]>output[i]){
30  output[i]=sumby2_[i2strip][i];
31  }
32  }
33  }
34  }
35  return;
36 }
37 
38 
int i
Definition: DBlmapReader.cc:9
void process(std::vector< std::vector< int > > &, int nStr, int bitMask, std::vector< int > &out)
std::vector< std::vector< int > > sumby2_
EcalFenixMaxof2(int maxNrSamples, int nbMaxStrips)
virtual ~EcalFenixMaxof2()