CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchingRatios.cc
Go to the documentation of this file.
1 #include <map>
2 
3 #include <boost/shared_ptr.hpp>
4 
6 
10 
11 namespace lhef {
12 
14 {
15  cache.clear();
16 }
17 
18 void BranchingRatios::set(int pdgId, bool both, double value)
19 {
20  cache[pdgId] = value;
21  if (both)
22  cache[-pdgId] = value;
23 }
24 
26  const Hadronisation *hadronisation,
27  const boost::shared_ptr<LHEEvent> &event) const
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 }
37 
39  const Hadronisation *hadronisation) const
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 }
59 
60 } // namespace lhef
int i
Definition: DBlmapReader.cc:9
void set(int pdgId, bool both=true, double value=1.0)
double getFactor(const Hadronisation *hadronisation, const boost::shared_ptr< LHEEvent > &event) const
std::map< int, double > cache
virtual double totalBranchingRatio(int pdgId) const
Definition: Hadronisation.h:37
double get(int pdgId, const Hadronisation *hadronisation) const
std::vector< int > ISTUP
Definition: LesHouches.h:230
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< int > IDUP
Definition: LesHouches.h:225