CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixMaxof2.cc

Go to the documentation of this file.
00001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixMaxof2.h>
00002 
00003 
00004 // global type definitions for class implementation in source file defined by Tag entries in ArgoUML
00005 // Result: typedef <typedef_global_source> <tag_value>;
00006 EcalFenixMaxof2::EcalFenixMaxof2(int maxNrSamples, int nbMaxStrips) : nbMaxStrips_(nbMaxStrips)
00007 {
00008   std::vector<int> vec(maxNrSamples,0);
00009   for (int i2strip =0;i2strip<nbMaxStrips_-1;++i2strip)
00010     sumby2_.push_back(vec);
00011 }
00012   
00013 EcalFenixMaxof2::~EcalFenixMaxof2(){
00014 }
00015   
00016 void EcalFenixMaxof2::process(std::vector<std::vector <int> > &bypasslinout, int nstrip,std::vector<int> &output)
00017 {
00018   for (int i2strip =0;i2strip<nstrip-1;++i2strip)
00019     for (unsigned int i=0;i<output.size();i++)      sumby2_[i2strip][i]=0; 
00020   for (unsigned int i=0;i<output.size();i++) output[i] = 0;
00021   
00022   for (unsigned int i=0;i<output.size();i++){
00023     if (nstrip-1==0){
00024       output[i]=bypasslinout[0][i];
00025     }else {
00026       for ( int i2strip=0; i2strip< nstrip-1;++i2strip){ 
00027         sumby2_[i2strip][i]= bypasslinout[i2strip][i]+bypasslinout[i2strip+1][i];
00028         if (sumby2_[i2strip][i]>output[i]){
00029           output[i]=sumby2_[i2strip][i];
00030         }
00031       }
00032     }
00033   }
00034   return;
00035 }
00036 
00037