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

SNHadEarlyEcalBar1.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // Implementation of SNHadEarlyEcalBar1
00003 // ================================================
00004 
00005 #include "FastShowerUtils/Samplers/SNHadEarlyEcalBar1.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   SNHadEarlyEcalBar1::SNHadEarlyEcalBar1(IUpdatingGaussian* g): 
00022     ISampler(), ICellSN(), DebugBase("SNHadEarlyEcalBar1"), m_peak(g){}
00023   //
00025   SNHadEarlyEcalBar1::SNHadEarlyEcalBar1(const IConfigurer* configurer,
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* SNHadEarlyEcalBar1::clone() const {
00033     return new SNHadEarlyEcalBar1(*this);
00034   }
00035   //
00036   void SNHadEarlyEcalBar1::sample(const PolyArgs& pa,
00037                                   CoreSamples& cs) const{
00038     pair<double, double>  peakParams = m_peak->parameters(pa);
00039     double peakMean  = peakParams.first;
00040     if (peakMean<=0.0) {
00041       // in this case the gaussian has mean/sigma 0/0 (all is deposited in C0!) 
00042       cs.fill(this,0.0);
00043     } else {
00044       // need  fabs(mean - fabs(m_gaussDist())*sigma)  as processor
00045       cs.fill(this,m_peak->sample(0.0, 100, peakMean, 0, pa));
00046     }
00047   }
00048   //
00049   double SNHadEarlyEcalBar1::lastValue(const CoreSamples& cs) const {
00050     return cs.give(this);
00051   }
00052   //
00053   void SNHadEarlyEcalBar1::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