CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixStrip.cc

Go to the documentation of this file.
00001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStrip.h>
00002 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStripFgvbEE.h>
00003 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStripFormatEB.h>
00004 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixStripFormatEE.h>
00005 
00006 #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
00007 
00008 #include <DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h>
00009 
00010 //-------------------------------------------------------------------------------------
00011 EcalFenixStrip::EcalFenixStrip(const edm::EventSetup & setup, const EcalElectronicsMapping* theMapping,bool debug, bool famos,int maxNrSamples, int nbMaxXtals): theMapping_(theMapping), debug_(debug), famos_(famos), nbMaxXtals_(nbMaxXtals)
00012 { 
00013   linearizer_.resize(nbMaxXtals_);
00014   for (int i=0;i<nbMaxXtals_;i++) linearizer_[i] = new  EcalFenixLinearizer(famos_); 
00015   adder_ = new  EcalFenixEtStrip();
00016   amplitude_filter_ = new EcalFenixAmplitudeFilter();
00017   peak_finder_ = new  EcalFenixPeakFinder();
00018   fenixFormatterEB_ = new EcalFenixStripFormatEB();
00019   fenixFormatterEE_ = new EcalFenixStripFormatEE();
00020   fgvbEE_ = new EcalFenixStripFgvbEE();
00021 
00022   // prepare data storage for all events
00023   std::vector <int> v;
00024   v.resize(maxNrSamples);
00025   lin_out_.resize(nbMaxXtals_);  
00026   for (int i=0;i<5;i++) lin_out_[i]=v;
00027   add_out_.resize(maxNrSamples);
00028   filt_out_.resize(maxNrSamples);
00029   peak_out_.resize(maxNrSamples);
00030   format_out_.resize(maxNrSamples);
00031   fgvb_out_.resize(maxNrSamples);
00032   fgvb_out_temp_.resize(maxNrSamples);
00033 }
00034 
00035 //-------------------------------------------------------------------------------------
00036 EcalFenixStrip::~EcalFenixStrip() {
00037   for (int i=0;i<nbMaxXtals_;i++) delete linearizer_[i]; 
00038   delete adder_; 
00039   delete amplitude_filter_; 
00040   delete peak_finder_;
00041   delete fenixFormatterEB_;
00042   delete fenixFormatterEE_;
00043   delete fgvbEE_;
00044 }
00045 
00046 //----------------------------------------------------------------------------------
00047 void EcalFenixStrip::process_part2_barrel(uint32_t stripid,const EcalTPGSlidingWindow * ecaltpgSlidW,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE) {
00048   
00049   // call  Fgvb
00050   //this->getFGVB()->setParameters(stripid,ecaltpgFgStripEE);
00051   //this->getFGVB()->process(lin_out_,fgvb_out_);
00052 
00053   // call formatter
00054   this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW) ; 
00055   this->getFormatterEB()->process(fgvb_out_,peak_out_,filt_out_,format_out_);     
00056   //this is a test:
00057   if (debug_) {
00058     std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl; 
00059     std::cout<< "value : "<<std::endl;
00060     for (unsigned int i =0; i<format_out_.size();i++){
00061       std::cout <<" "<<format_out_[i];
00062     }    
00063     std::cout<<std::endl;
00064 
00065   }
00066   return;
00067 
00068 }
00069 //-------------------------------------------------------------------------------------
00070 void  EcalFenixStrip::process_part2_endcap(uint32_t stripid,const EcalTPGSlidingWindow * ecaltpgSlidW,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE,const EcalTPGStripStatus * ecaltpgStripStatus) {
00071    
00072   // call  Fgvb
00073   //this->getFGVB()->setParameters(stripid,ecaltpgFgStripEE); 
00074   //this->getFGVB()->process(lin_out_,fgvb_out_);
00075 
00076   // call formatter
00077   this->getFormatterEE()->setParameters(stripid,ecaltpgSlidW,ecaltpgStripStatus) ;
00078 
00079   this->getFormatterEE()->process(fgvb_out_,peak_out_,filt_out_,format_out_);
00080      
00081   //this is a test:
00082    if (debug_) {
00083      std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl; 
00084       std::cout<< "value : "<<std::endl;
00085       for (unsigned int i =0; i<format_out_.size();i++){
00086         std::cout <<" "<<std::dec<<format_out_[i];
00087       }    
00088      std::cout<<std::endl;
00089    }
00090 
00091    return;
00092 }