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

SNHadEarlyHcalBar1.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // Implementation of SNHadEarlyHcalBar1
00003 // ================================================
00004 
00005 #include "FastShowerUtils/Samplers/SNHadEarlyHcalBar1.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   SNHadEarlyHcalBar1::SNHadEarlyHcalBar1(IUpdatingGaussian* g): 
00022     ISampler(), ICellSN(), DebugBase("SNHadEarlyHcalBar1"), m_peak(g){}
00023   //
00024   SNHadEarlyHcalBar1::SNHadEarlyHcalBar1(const IConfigurer* configurer,
00025                                          const std::string& s):
00026     DebugBase(s), m_peak(0){
00027     m_peak = configurer->findIUG( text()+"Peak" ) ;
00028     cout<<text()<<" finishing construction"<<endl;
00029   }
00030   //
00031   ISampler* SNHadEarlyHcalBar1::clone() const {
00032     return new SNHadEarlyHcalBar1(*this);
00033   }
00034   //
00035   void SNHadEarlyHcalBar1::sample(const PolyArgs& pa,
00036                                   CoreSamples& cs) const{
00037 
00038     pair<double, double>  peakParams = m_peak->parameters(pa);
00039     double peakMean  = peakParams.first;
00040 
00041     if (peakMean<=0.0) {
00042       // in this case the gaussian has mean/sigma 0/0 (all is deposited in C0!) 
00043       cs.fill(this,0.0);
00044     } else {
00045       // need  fabs(mean - fabs(m_gaussDist())*sigma)  as processor
00046       cs.fill(this,m_peak->sample(0.0, 100, peakMean, 0, pa));
00047     }
00048   }
00049   //
00050   double SNHadEarlyHcalBar1::lastValue(const CoreSamples& cs) const {
00051     return cs.give(this);
00052   }
00053   //
00054   void SNHadEarlyHcalBar1::components(IDebug::Cpts& v) const{
00055     v.push_back(m_peak);
00056   }
00057 }//namespace
00058 
00059 
00060 
00061 

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