00001 #include "FastShowerUtils/Normalisers/HadLateHcalNormaliser.h" 00002 00003 #include "FastShowerUtils/IConfigurer.h" 00004 #include "FastShowerUtils/Normalisations.h" 00005 #include "FastShowerUtils/ParticleParameters.h" 00006 #include "FastShowerUtils/IFnOfParticleParameters.h" 00007 00008 #include <cmath> 00009 #include <pair.h> 00010 #include <iostream> 00011 namespace FastShower{ 00012 // 00013 HadLateHcalNormaliser::HadLateHcalNormaliser(const IConfigurer* c, 00014 const std::string& s): 00015 INormaliser(), DebugBase(s){ 00016 m_etaResponse = c->findFnPP("HcalEtaResponse"); 00017 m_coreFraction = c->findFnPP("HcalCoreFraction"); 00018 cout<<text()<<": finishing construction"<<endl; 00019 } 00020 // 00021 HadLateHcalNormaliser::~HadLateHcalNormaliser(){ 00022 delete m_etaResponse; 00023 } 00024 // 00025 INormaliser* HadLateHcalNormaliser::clone() const{ 00026 return new HadLateHcalNormaliser(*this); 00027 } 00028 // 00029 void HadLateHcalNormaliser::scale(Normalisations& n, 00030 const ParticleParameters& pp) const { 00031 double coreFrac = m_coreFraction->value(pp); 00032 double haloFrac = 1 - coreFrac; 00033 00034 double etaResponse = m_etaResponse->value(pp); 00035 00036 n.scaleCore(coreFrac*etaResponse); 00037 n.scaleHalo(haloFrac*etaResponse); 00038 } 00039 // 00040 void HadLateHcalNormaliser::components(IDebug::Cpts& v) const{ 00041 v.push_back(m_coreFraction); 00042 v.push_back(m_etaResponse); 00043 } 00044 }//namespace 00045