CMS 3D CMS Logo

lhef::BranchingRatios Class Reference

#include <GeneratorInterface/LHEInterface/interface/BranchingRatios.h>

List of all members.

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


Detailed Description

Definition at line 13 of file BranchingRatios.h.


Constructor & Destructor Documentation

lhef::BranchingRatios::BranchingRatios (  )  [inline]

Definition at line 15 of file BranchingRatios.h.

00015 {}

lhef::BranchingRatios::~BranchingRatios (  )  [inline]

Definition at line 16 of file BranchingRatios.h.

00016 {}


Member Function Documentation

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 }

void lhef::BranchingRatios::reset ( void   ) 

Definition at line 13 of file BranchingRatios.cc.

References cache.

00014 {
00015         cache.clear();
00016 }

void lhef::BranchingRatios::set ( int  pdgId,
bool  both = true,
double  value = 1.0 
)

Definition at line 18 of file BranchingRatios.cc.

References cache.

Referenced by LHEProducer::LHEProducer().

00019 {
00020         cache[pdgId] = value;
00021         if (both)
00022                 cache[-pdgId] = value;
00023 }


Member Data Documentation

std::map<int, double> lhef::BranchingRatios::cache [mutable, private]

Definition at line 27 of file BranchingRatios.h.

Referenced by get(), reset(), and set().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:48:46 2009 for CMSSW by  doxygen 1.5.4