CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
lhef::BranchingRatios Class Reference

#include <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
 

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.

15 {}
lhef::BranchingRatios::~BranchingRatios ( )
inline

Definition at line 16 of file BranchingRatios.h.

16 {}

Member Function Documentation

double lhef::BranchingRatios::get ( int  pdgId,
const Hadronisation hadronisation 
) const
private

Definition at line 38 of file BranchingRatios.cc.

References cache, pos, and lhef::Hadronisation::totalBranchingRatio().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

40 {
41  std::map<int, double>::const_iterator pos = cache.find(pdgId);
42  if (pos == cache.end()) {
43  double val = hadronisation->totalBranchingRatio(pdgId);
44  if (val <= 0.0)
45  val = 1.0;
46  if (val < 0.99)
47  edm::LogInfo("Generator|LHEInterface")
48  << "Particle with pdgId " << pdgId
49  << " only partly decayed in hadronizer, "
50  "reducing respective event cross-section "
51  "contribution with a factor of "
52  << val << "." << std::endl;
53 
54  cache.insert(std::make_pair(pdgId, val));
55  return val;
56  } else
57  return pos->second;
58 }
std::map< int, double > cache
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().

28 {
29  double factor = 1.0;
30  const HEPEUP *hepeup = event->getHEPEUP();
31  for(int i = 0; i < hepeup->NUP; i++) {
32  if (hepeup->ISTUP[i] == 1)
33  factor *= get(hepeup->IDUP[i], hadronisation);
34  }
35  return factor;
36 }
int i
Definition: DBlmapReader.cc:9
void lhef::BranchingRatios::reset ( void  )

Definition at line 13 of file BranchingRatios.cc.

References cache.

14 {
15  cache.clear();
16 }
std::map< int, double > cache
void lhef::BranchingRatios::set ( int  pdgId,
bool  both = true,
double  value = 1.0 
)

Member Data Documentation

std::map<int, double> lhef::BranchingRatios::cache
mutableprivate

Definition at line 27 of file BranchingRatios.h.

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