HepMC3 Asciiv3 Reader crashes for some ordering of objects in the record ( By Enrico Bothmann)
Description:
The following two snippets should represent the same topology:
____
beam 1 ------O------/ \----- outgoing a
| |
beam 2 ------O------\____/----- outgoing b
The two "O"s represent beam vertices. As they have one incoming and one outgoing, they do not appear explicitly in the ascii record. The big blob represent another vertex (e.g. be the hard process).
When I first add the beams, I get this:
HepMC::Version 3.02.06
HepMC::Asciiv3-START_EVENT_LISTING
W Weight\|EXTRA__NTrials
T Pepper\|0.0.2\|
E 0 3 6
U GEV MM
W 6.0391388875660014152527e+08 4.0000000000000000000000e+00
A 0 GenCrossSection 1.50978472e+08 1.50978472e+08 4 1 -1.00000000e+00 -1.00000000e+00
A 0 GenPdfInfo 3 -3 9.35595457e-02 1.59887347e-02 8.31517839e+03 -1.00000000e+00 -1.00000000e+00 -1 -1
P 1 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 -7.0000000000000000e+03 7.0000000000000000e+03 -0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 7.0000000000000000e+03 7.0000000000000000e+03 -0.0000000000000000e+00 4
P 3 1 3 -0.0000000000000000e+00 -0.0000000000000000e+00 -6.5491682011858074e+02 6.5491682011858074e+02 4.2874221005619445e-06 3
P 4 2 -3 -0.0000000000000000e+00 -0.0000000000000000e+00 1.1192114294880145e+02 1.1192114294880145e+02 -7.3479132013264324e-07 3
V -3 0 [3,4]
P 5 -3 3 6.8529755166076676e+00 -6.7404772174505837e+01 -6.4271688215998779e+02 6.4627808039479714e+02 -3.8767937910880990e-06 1
P 6 -3 -3 -6.8529755166076676e+00 6.7404772174505837e+01 9.9721204990208591e+01 1.2055988267258502e+02 1.2627239930021727e-06 1
HepMC::Asciiv3-END_EVENT_LISTING
When I add the beams after setting up the rest, I get this:
HepMC::Version 3.02.06
HepMC::Asciiv3-START_EVENT_LISTING
W Weight\|EXTRA__NTrials
T Pepper\|0.0.2\|
E 0 3 6
U GEV MM
W 6.0391388875660014152527e+08 4.0000000000000000000000e+00
A 0 GenCrossSection 1.50978472e+08 1.50978472e+08 4 1 -1.00000000e+00 -1.00000000e+00
A 0 GenPdfInfo 3 -3 9.35595457e-02 1.59887347e-02 8.31517839e+03 -1.00000000e+00 -1.00000000e+00 -1 -1
P 1 5 3 -0.0000000000000000e+00 -0.0000000000000000e+00 -6.5491682011858074e+02 6.5491682011858074e+02 4.2874221005619445e-06 3
P 2 6 -3 -0.0000000000000000e+00 -0.0000000000000000e+00 1.1192114294880145e+02 1.1192114294880145e+02 -7.3479132013264324e-07 3
V -1 0 [1,2]
P 3 -1 3 6.8529755166076676e+00 -6.7404772174505837e+01 -6.4271688215998779e+02 6.4627808039479714e+02 -3.8767937910880990e-06 1
P 4 -1 -3 -6.8529755166076676e+00 6.7404772174505837e+01 9.9721204990208591e+01 1.2055988267258502e+02 1.2627239930021727e-06 1
P 5 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 -7.0000000000000000e+03 7.0000000000000000e+03 -0.0000000000000000e+00 4
P 6 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 7.0000000000000000e+03 7.0000000000000000e+03 -0.0000000000000000e+00 4
HepMC::Asciiv3-END_EVENT_LISTING
The AsciiWriter is completely fine with that. However, the AsciiReader crashes when reading in the second event record:
ERROR::ReaderAscii: too few vertices were parsed
1 vs 3 expected
ERROR::ReaderAscii: event parsing failed. Returning empty event
DEBUG(1)::Parsing failed at line:
HepMC::Asciiv3-END_EVENT_LISTING
Expected behaviour (?): Both records can be read in without an issue.
Related MR : !264 (closed)