CMS 3D CMS Logo

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   for (int i2strip =0;i2strip<nstrip-1;++i2strip)
00018     for (unsigned int i=0;i<output.size();i++)      sumby2_[i2strip][i]=0; 
00019 
00020   for (unsigned int i=0;i<output.size();i++){
00021     if (nstrip-1==0){
00022       output[i]=bypasslinout[0][i];
00023     }else {
00024       for ( int i2strip=0; i2strip< nstrip-1;++i2strip){ 
00025         sumby2_[i2strip][i]= bypasslinout[i2strip][i]+bypasslinout[i2strip+1][i];
00026         if (sumby2_[i2strip][i]>output[i]){
00027           output[i]=sumby2_[i2strip][i];
00028         }
00029       }
00030     }
00031   }
00032   return;
00033 }
00034 
00035 

Generated on Tue Jun 9 17:46:17 2009 for CMSSW by  doxygen 1.5.4