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
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 }
00033
00034
00035 EcalFenixStrip::~EcalFenixStrip() {
00036 for (int i=0;i<nbMaxXtals_;i++) delete linearizer_[i];
00037 delete adder_;
00038 delete amplitude_filter_;
00039 delete peak_finder_;
00040 delete fenixFormatterEB_;
00041 delete fenixFormatterEE_;
00042 delete fgvbEE_;
00043 }
00044
00045
00046 void EcalFenixStrip::process_part2_barrel(uint32_t stripid,const EcalTPGSlidingWindow * ecaltpgSlidW) {
00047
00048
00049 this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW) ;
00050 this->getFormatterEB()->process(peak_out_,filt_out_,format_out_);
00051
00052 if (debug_) {
00053 std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl;
00054 std::cout<< "value : "<<std::endl;
00055 for (unsigned int i =0; i<format_out_.size();i++){
00056 std::cout <<" "<<format_out_[i];
00057 }
00058 std::cout<<std::endl;
00059
00060 }
00061 return;
00062
00063 }
00064
00065 void EcalFenixStrip::process_part2_endcap(uint32_t stripid,const EcalTPGSlidingWindow * ecaltpgSlidW,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE) {
00066
00067
00068 this->getFGVB()->setParameters(stripid,ecaltpgFgStripEE);
00069 this->getFGVB()->process(lin_out_,fgvb_out_);
00070
00071
00072 this->getFormatterEE()->setParameters(stripid,ecaltpgSlidW) ;
00073
00074 this->getFormatterEE()->process(fgvb_out_,peak_out_,filt_out_,format_out_);
00075
00076
00077 if (debug_) {
00078 std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl;
00079 std::cout<< "value : "<<std::endl;
00080 for (unsigned int i =0; i<format_out_.size();i++){
00081 std::cout <<" "<<std::dec<<format_out_[i];
00082 }
00083 std::cout<<std::endl;
00084 }
00085
00086 return;
00087 }