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

SingleShowererSelector.cxx

Go to the documentation of this file.
00001 #include "FastShowerUtils/SingleShowererSelector.h"
00002 
00003 #include "FastShowerUtils/Gridlet.h"
00004 #include "FastShowerUtils/IConfigurer.h"
00005 #include "FastShowerUtils/INormaliser.h"
00006 #include "FastShowerUtils/Normalisations.h"
00007 #include "FastShowerUtils/ParticleParameters.h"
00008 #include "FastShowerUtils/IFnOfParticleParameters.h"
00009 #include "FastShowerUtils/ISingleShowererSelectorConfig.h"
00010 
00011 #include <assert.h>
00012 #include <iostream>
00013 namespace FastShower{
00014 
00015   SingleShowererSelector::SingleShowererSelector(const ISingleShowererSelectorConfig& conf): 
00016     IShowererSelector(), DebugBase("SingleShowererSelector"){
00017     m_acceptor = conf.acceptor();
00018     m_ehSharer = conf.ehSharer();
00019     m_resolution = conf.resolution();
00020     m_showerer = conf.showerer();
00021     cout<<"End Of SingleShowererSelectorSelector construction"<<endl;
00022   }
00023   //
00024   bool SingleShowererSelector::accept(ParticleParameters& pp, 
00025                                       Gridlet* g) const{
00026     if (m_acceptor->accept(pp)){
00027       std::pair<double, double> ehFracs = m_ehSharer->value(pp);
00028       double energy = pp.rawEnergy();
00029       double resolution = m_resolution->value(pp);
00030       
00031       Normalisations eNs(ehFracs.first * resolution* energy);
00032       Normalisations hNs(ehFracs.second * resolution* energy);
00033       m_showerer->shower(pp,g,eNs,hNs);
00034       return true;
00035     }
00036     return false;
00037   }
00038   //
00039   void SingleShowererSelector::components(IDebug::Cpts& c) const{
00040     c.push_back(m_acceptor);
00041     c.push_back(m_ehSharer);
00042     c.push_back(m_resolution);
00043     c.push_back(m_showerer);
00044   }
00045 
00046 }//namespace
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 

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