![]() |
![]() |
#include <GeneratorInterface/LHEInterface/interface/BranchingRatios.h>
Public Member Functions | |
BranchingRatios () | |
double | getFactor (const Hadronisation *hadronisation, const boost::shared_ptr< LHEEvent > &event) const |
void | reset () |
void | set (int pdgId, bool both=true, double value=1.0) |
~BranchingRatios () | |
Private Member Functions | |
double | get (int pdgId, const Hadronisation *hadronisation) const |
Private Attributes | |
std::map< int, double > | cache |
Definition at line 13 of file BranchingRatios.h.
lhef::BranchingRatios::BranchingRatios | ( | ) | [inline] |
lhef::BranchingRatios::~BranchingRatios | ( | ) | [inline] |
double lhef::BranchingRatios::get | ( | int | pdgId, | |
const Hadronisation * | hadronisation | |||
) | const [private] |
Definition at line 38 of file BranchingRatios.cc.
References cache, lat::endl(), and lhef::Hadronisation::totalBranchingRatio().
00040 { 00041 std::map<int, double>::const_iterator pos = cache.find(pdgId); 00042 if (pos == cache.end()) { 00043 double val = hadronisation->totalBranchingRatio(pdgId); 00044 if (val <= 0.0) 00045 val = 1.0; 00046 if (val < 0.99) 00047 edm::LogInfo("Generator|LHEInterface") 00048 << "Particle with pdgId " << pdgId 00049 << " only partly decayed in hadronizer, " 00050 "reducing respective event cross-section " 00051 "contribution with a factor of " 00052 << val << "." << std::endl; 00053 00054 cache.insert(std::make_pair(pdgId, val)); 00055 return val; 00056 } else 00057 return pos->second; 00058 }
double lhef::BranchingRatios::getFactor | ( | const Hadronisation * | hadronisation, | |
const boost::shared_ptr< LHEEvent > & | event | |||
) | const |
Definition at line 25 of file BranchingRatios.cc.
References i, lhef::HEPEUP::IDUP, lhef::HEPEUP::ISTUP, and lhef::HEPEUP::NUP.
Referenced by LHEProducer::filter().
00028 { 00029 double factor = 1.0; 00030 const HEPEUP *hepeup = event->getHEPEUP(); 00031 for(int i = 0; i < hepeup->NUP; i++) { 00032 if (hepeup->ISTUP[i] == 1) 00033 factor *= get(hepeup->IDUP[i], hadronisation); 00034 } 00035 return factor; 00036 }
Definition at line 13 of file BranchingRatios.cc.
References cache.
00014 { 00015 cache.clear(); 00016 }
Definition at line 18 of file BranchingRatios.cc.
References cache.
Referenced by LHEProducer::LHEProducer().
std::map<int, double> lhef::BranchingRatios::cache [mutable, private] |