CMS 3D CMS Logo

EcalFenixStripFgvbEE.cc

Go to the documentation of this file.
00001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStripFgvbEE.h>
00002 #include <DataFormats/EcalDigi/interface/EEDataFrame.h>
00003 #include <CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h>
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 
00006 EcalFenixStripFgvbEE::EcalFenixStripFgvbEE()
00007 {
00008 }
00009 
00010 EcalFenixStripFgvbEE::~EcalFenixStripFgvbEE(){
00011 }
00012 
00013 void EcalFenixStripFgvbEE::process( std::vector<std::vector<int> > &linout ,std::vector<int> & output)
00014 {
00015   unsigned int maskFgvb[]={1,2,4,8,0x10};
00016 
00017   //  int threshold_fg = (*params_)[6];
00018   //  int lut_fg = (*params_)[7];
00019 
00020   int threshold_fg = fgparams_->threshold ;
00021   int lut_fg = fgparams_->lut ;
00022 
00023   
00024   std::vector<int> indexLut(output.size());
00025 
00026   for (unsigned int i=0;i<output.size();i++) {
00027     output[i]=0;
00028     indexLut[i]=0;
00029     for (unsigned int ixtal=0;ixtal<linout.size();ixtal++) {
00030       int adc=linout[ixtal][i];
00031       int res= (adc>threshold_fg) ? 1 : 0;
00032       indexLut[i]=indexLut[i] | (res <<ixtal & maskFgvb[ixtal]);
00033     }
00034     int mask = 1<<indexLut[i];
00035     output[i]= lut_fg & mask;
00036     if (output[i]>0) output[i]=1;
00037   }
00038   return;
00039 }  
00040 
00041 void EcalFenixStripFgvbEE::setParameters(uint32_t id,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE)
00042 {
00043   const EcalTPGFineGrainStripEEMap &fgmap = ecaltpgFgStripEE -> getMap();
00044   EcalTPGFineGrainStripEEMapIterator it=fgmap.find(id);
00045   if (it!=fgmap.end()) fgparams_=&(*it).second;
00046   else edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainStripEEMap entry for "<<id;
00047    
00048     
00049 
00050 }

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