00001
00002
00003
00004
00005 #include "FastShowerUtils/Samplers/SNHadLateHcalBar1.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 SNHadLateHcalBar1::SNHadLateHcalBar1(IUpdatingGaussian* g):
00022 ISampler(), ICellSN(), DebugBase("SNHadLateHcalBar1"), m_peak(g){}
00023
00025
00026 const std::string& s):
00027 DebugBase(s), m_peak(0){
00028 m_peak = c->findIUG( text()+"Peak" ) ;
00029 cout<<text()<<" finishing construction"<<endl;
00030 }
00031
00032 ISampler* SNHadLateHcalBar1::clone() const {
00033 return new SNHadLateHcalBar1(*this);
00034 }
00035
00036 void SNHadLateHcalBar1::sample(const PolyArgs& pa,
00037 CoreSamples& cs) const{
00038
00039 pair<double, double> peakParams = m_peak->parameters(pa);
00040 double peakMean = peakParams.first;
00041
00042 if (peakMean<=0.0) {
00043
00044 cs.fill(this,0.0);
00045 } else {
00046 cs.fill(this,m_peak->sample(0.0, 100, peakMean, 0, pa));
00047 }
00048 }
00049
00050 double SNHadLateHcalBar1::lastValue(const CoreSamples& cs) const {
00051 return cs.give(this);
00052 }
00053
00054 void SNHadLateHcalBar1::components(IDebug::Cpts& v) const{
00055 v.push_back(m_peak);
00056 }
00057 }
00058
00059
00060
00061