00001
00002
00003
00004
00005 #include "FastShowerUtils/Samplers/SNEmEcalEc3.h"
00006
00007 #include "FastShowerUtils/ParticleParameters.h"
00008 #include "FastShowerUtils/PolyArgs.h"
00009 #include "FastShowerUtils/IFn.h"
00010 #include "FastShowerUtils/CoreSamples.h"
00011 #include "FastShowerUtils/IFnOfCoreSamples.h"
00012 #include "FastShowerUtils/LinearProcessor.h"
00013 #include "FastShowerUtils/ProcessedFlat.h"
00014 #include "FastShowerUtils/ProcessedNormal.h"
00015 #include "FastShowerUtils/IConfigurer.h"
00016 #include <cmath>
00017 #include <iostream>
00018
00019 namespace FastShower{
00020
00021 using std::pair;
00022
00023 const double SNEmEcalEc3::s_nSigma(3.0);
00024
00025
00026 SNEmEcalEc3::SNEmEcalEc3(IUpdatingGaussian* g):
00027 ISampler(), ICellSN(), DebugBase("SNEmEcalEc3"), m_peak(g){}
00029 SNEmEcalEc3::SNEmEcalEc3(const IConfigurer* configurer,
00030 const std::string&):
00031 DebugBase("SN3"), m_peak(0){
00032 m_peak = configurer->findIUG( text()+"Peak" ) ;
00033 cout<<text()<<" finishing construction"<<endl;
00034 }
00035
00036 ISampler* SNEmEcalEc3::clone() const {return new SNEmEcalEc3(*this);}
00037
00038 void SNEmEcalEc3::sample(const PolyArgs& pa, CoreSamples& cs) const{
00039
00040 pair<double, double> peakParams = m_peak->parameters(pa);
00041 double peakMean = peakParams.first;
00042
00043 if (peakMean<=0.0) {
00044
00045 cs.fill(this,0.0);
00046 } else {
00047 cs.fill(this,m_peak->sample(0.0,s_nSigma,peakMean,s_nSigma,pa));
00048 }
00049 }
00050 double SNEmEcalEc3::lastValue(const CoreSamples& cs) const {
00051 return cs.give(this);
00052 }
00053 void SNEmEcalEc3::components(IDebug::Cpts& v) const{
00054 v.push_back(m_peak);
00055 }
00056 }
00057
00058
00059
00060