Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SNEmEcalBar3.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // Implementation of SNEmEcalBar3
00003 // ================================================
00004 
00005 #include "FastShowerUtils/Samplers/SNEmEcalBar3.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   const double SNEmEcalBar3::s_nSigma(3.0);
00022 
00023   //
00024   SNEmEcalBar3::SNEmEcalBar3(IUpdatingGaussian* g): 
00025     ISampler(), ICellSN(), DebugBase("SNEmEcalBar3"), m_peak(g){}
00026   //
00028   SNEmEcalBar3::SNEmEcalBar3(const IConfigurer* configurer,
00029                              const std::string&
00030                              ):
00031     DebugBase("SN3"), m_peak(0){
00032     m_peak           = configurer->findIUG( text()+"Peak" ) ;
00033     cout<<text()<<" finishing construction"<<endl;
00034   }
00036   ISampler* SNEmEcalBar3::clone() const {return new SNEmEcalBar3(*this);}
00037   //
00038   void SNEmEcalBar3::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       // in this case the gaussian has mean/sigma 0/0 (all is deposited in C0!) 
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 SNEmEcalBar3::lastValue(const CoreSamples& cs) const {
00051     return cs.give(this);
00052   }
00053   void SNEmEcalBar3::components(IDebug::Cpts& v) const{
00054     v.push_back(m_peak);
00055   }
00056 }//namespace
00057 
00058 
00059 
00060 

Generated on Tue Mar 18 11:50:05 2003 for FastShowerUtils by doxygen1.3-rc1