Consider the following file. It has the form
HepMC::Version 2.06.09
HepMC::IO_GenEvent-START_EVENT_LISTING
E ...
N ...
U ...
C ...
V ...
P ... YY 0 0 XX 0
V ...
P ... 2 0 0 0 0
P ... 2 0 0 0 0
P ... 1 0 0 0 0
P ... 1 0 0 0 0
E ...
...
Could you please tell me how to extract only the rows
E ...
and those starting from P with
P ... 1 0 0 0 0
This is how I tried to do it:
file = Import["tag_1_pythia8_events.hepmc", "Table"];
Cases[file, {"E", __} || {__, 1, 0, 0, 0, 0}]
But I do not know the syntax well: the "||" construction does not work.
Alternatives
instead ofOr
. That is, use single|
instead of double||
. $\endgroup$