JHUGen MELA  v2.4.1
Matrix element calculations as used in JHUGen. MELA is an important tool that was used for the Higgs boson discovery and for precise measurements of its structure and interactions. Please see the website https://spin.pha.jhu.edu/ and papers cited there for more details, and kindly cite those papers when using this code.
Public Member Functions | Public Attributes | Static Private Attributes | List of all members
lhefile.LHEEvent Class Reference
Inheritance diagram for lhefile.LHEEvent:
Inheritance graph
[legend]
Collaboration diagram for lhefile.LHEEvent:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, event, isgen)
 
def extracteventparticles (cls, lines, isgen)
 
def __iter__ (self)
 

Public Attributes

 weights
 
 weight
 
 isgen
 
 inputevent
 

Static Private Attributes

 __metaclass__ = abc.ABCMeta
 

Detailed Description

Definition at line 21 of file lhefile.py.

Constructor & Destructor Documentation

◆ __init__()

def lhefile.LHEEvent.__init__ (   self,
  event,
  isgen 
)

Definition at line 23 of file lhefile.py.

23  def __init__(self, event, isgen):
24  lines = event.split("\n")
25 
26  self.weights = {}
27  for line in lines:
28  if "<wgt" not in line: continue
29  match = re.match("<wgt id='(.*)'>([0-9+Ee.-]*)</wgt>", line)
30  if match: self.weights[match.group(1)] = float(match.group(2))
31 
32  lines = [line for line in lines if not ("<" in line or ">" in line or not line.split("#")[0].strip())]
33  nparticles, _, weight, _, _, _ = lines[0].split()
34 
35  nparticles = int(nparticles)
36  self.weight = float(weight)
37  if nparticles != len(lines)-1:
38  raise ValueError("Wrong number of particles! Should be {}, have {}".format(nparticles, len(lines)-1))
39 
40  daughters, associated, mothers = (SimpleParticleCollection_t(_) for _ in self.extracteventparticles(lines[1:], isgen))
41  if not list(mothers): mothers = None
42  self.daughters, self.associated, self.mothers, self.isgen = self.inputevent = InputEvent(daughters, associated, mothers, isgen)
43 

Member Function Documentation

◆ __iter__()

def lhefile.LHEEvent.__iter__ (   self)

Definition at line 47 of file lhefile.py.

47  def __iter__(self):
48  return iter(self.inputevent)
49 

◆ extracteventparticles()

def lhefile.LHEEvent.extracteventparticles (   cls,
  lines,
  isgen 
)

Reimplemented in lhefile.LHEEvent_Offshell4l, lhefile.LHEEvent_StableHiggs, and lhefile.LHEEvent_Hwithdecay.

Definition at line 45 of file lhefile.py.

45  def extracteventparticles(cls, lines, isgen): "has to be a classmethod that returns daughters, associated, mothers"
46 

Member Data Documentation

◆ __metaclass__

lhefile.LHEEvent.__metaclass__ = abc.ABCMeta
staticprivate

Definition at line 22 of file lhefile.py.

◆ inputevent

lhefile.LHEEvent.inputevent

Definition at line 42 of file lhefile.py.

◆ isgen

lhefile.LHEEvent.isgen

Definition at line 42 of file lhefile.py.

◆ weight

lhefile.LHEEvent.weight

Definition at line 36 of file lhefile.py.

◆ weights

lhefile.LHEEvent.weights

Definition at line 26 of file lhefile.py.


The documentation for this class was generated from the following file:
lhefile.InputEvent
InputEvent
Definition: lhefile.py:19
testME_all.int
int
Definition: testME_all.py:13