Definition at line 21 of file lhefile.py.
◆ __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")
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))
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()
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))
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)
◆ __iter__()
def lhefile.LHEEvent.__iter__ |
( |
|
self | ) |
|
Definition at line 47 of file lhefile.py.
48 return iter(self.inputevent)
◆ extracteventparticles()
def lhefile.LHEEvent.extracteventparticles |
( |
|
cls, |
|
|
|
lines, |
|
|
|
isgen |
|
) |
| |
◆ __metaclass__
lhefile.LHEEvent.__metaclass__ = abc.ABCMeta |
|
staticprivate |
◆ inputevent
lhefile.LHEEvent.inputevent |
◆ isgen
◆ weight
◆ weights
The documentation for this class was generated from the following file: