CMS 3D CMS Logo

EcalFenixStripFormatEB.cc

Go to the documentation of this file.
00001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStripFormatEB.h>
00002 #include <CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h>
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 
00005   EcalFenixStripFormatEB::EcalFenixStripFormatEB() 
00006     : shift_(0)
00007 {
00008 }
00009 
00010   EcalFenixStripFormatEB::~EcalFenixStripFormatEB() {
00011   }
00012 
00013   int EcalFenixStripFormatEB::setInput(int input, int inputPeak) 
00014   {
00015     inputPeak_=inputPeak;
00016     input_=input;
00017     return 0;
00018   }  
00019   
00020   int EcalFenixStripFormatEB::process()
00021   {
00022     //    buffer_=input_>>shift_;  //FIXME: buffer why?
00023 
00024     if(inputPeak_==0) return 0;
00025     //    int output=buffer_;
00026     int output=input_>>shift_;
00027     if(output>0XFFF) output=0XFFF;   //ok: barrel saturates at 12 bits
00028     return output;    
00029   } 
00030 
00031 void EcalFenixStripFormatEB::process(std::vector<int> &peakout, std::vector<int> &filtout, std::vector<int> & output)
00032 {
00033   if  (peakout.size()!=filtout.size()){
00034     edm::LogWarning("EcalTPG")<<" problem in EcalFenixStripFormatEB: peak_out and filt_out don't have the same size";
00035   }
00036   for  (unsigned int i =0;i<filtout.size();i++){
00037     setInput(filtout[i],peakout[i]);
00038 
00039     output[i]=process();
00040   }
00041   return;
00042 }
00043 
00044 void EcalFenixStripFormatEB::setParameters(uint32_t& id, const EcalTPGSlidingWindow*& slWin)
00045 {
00046 
00047   const EcalTPGSlidingWindowMap &slwinmap = slWin -> getMap();
00048   EcalTPGSlidingWindowMapIterator it=slwinmap.find(id);
00049   if (it!=slwinmap.end()) shift_=(*it).second;
00050   else edm::LogWarning("EcalTPG")<<" could not find EcalTPGSlidingWindowMap entry for "<<id;
00051 }

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