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