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

ANHadEarlyEcalEc1.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // Implementation of ANHadEarlyEcalEc1
00003 // ================================================
00004 
00005 #include "FastShowerUtils/Samplers/ANHadEarlyEcalEc1.h"
00006 
00007 #include "FastShowerUtils/ParticleParameters.h"
00008 #include "FastShowerUtils/PolyArgs.h"
00009 #include "FastShowerUtils/CoreSamples.h"
00010 #include "FastShowerUtils/LinearProcessor.h"
00011 #include "FastShowerUtils/UpdatingGaussian.h"
00012 #include "FastShowerUtils/IInTail.h"
00013 #include "FastShowerUtils/IConfigurer.h"
00014 #include <cmath>
00015 #include <iostream>
00016 
00017 namespace FastShower{
00018 
00019   using std::pair;
00020 
00021   //
00022   ANHadEarlyEcalEc1::ANHadEarlyEcalEc1(IUpdatingGaussian* g, 
00023                                          IProcessedDist* t,
00024                                          IInTail* it):
00025     ISampler(), ICellAN(), DebugBase("ANHadEarlyEcalEc1"), 
00026     m_peak(g), m_tail(t), m_inTail(it){}
00027   //
00028   ANHadEarlyEcalEc1::ANHadEarlyEcalEc1(const IConfigurer* configurer,
00029                                        const std::string& s):
00030     DebugBase(s), m_peak(0), m_tail(0), m_inTail(0){
00031     m_peak           = configurer->findIUG( text()+"Peak" ) ;
00032     m_tail           = configurer->makeProcessedFlat( text() );
00033     m_inTail         = configurer->makeIInTail( text() );
00034     cout<<text()<<" finishing construction"<<endl;
00035   }
00036   //
00037   ISampler* ANHadEarlyEcalEc1::clone() const {
00038     return new ANHadEarlyEcalEc1(*this);
00039   }
00040   //
00041   void ANHadEarlyEcalEc1::sample(const PolyArgs& pa, 
00042                                  CoreSamples& cs) const {
00043     if( m_inTail->operator()(pa) ){
00044       cs.fill(this, evalTail(pa));
00045     }else{
00046       cs.fill(this, evalPeak(pa));
00047     }
00048   }
00050   double ANHadEarlyEcalEc1::evalTail(const PolyArgs&) const {
00051 
00052     //calculate ther upper and lower limits of the tail
00053     double uLimit = 0.10;
00054     double lLimit = 0.0;
00055     LinearProcessor lp( (uLimit-lLimit), lLimit );
00056     return m_tail->sample(&lp);
00057   }
00059   double ANHadEarlyEcalEc1::evalPeak(const PolyArgs& pa) const {
00060     return m_peak->sample(0.10, 100, 1.0, 100, pa);
00061   }
00063   double ANHadEarlyEcalEc1::lastValue(const CoreSamples& cs) const {
00064     return cs.give(this);
00065   }
00067   void ANHadEarlyEcalEc1::components(IDebug::Cpts& v) const{
00068     v.push_back(m_peak);
00069     v.push_back(m_tail);
00070     v.push_back(m_inTail);
00071   }
00072  
00073 }//namespace

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