Read in pre generated hepmc? #22
Comments
Hi @ndawe, can you try and help, please? |
Thank you for the interest and the email. I’m no expert – others may be able to help more - but that function should indeed do the job, see https://github.com/scikit-hep/numpythia/blob/master/numpythia/__init__.py. |
Thanks all, apologies for the delay. I can now verify the issue was that I was using files generated in the HepMC2 format, using HepMC3 fixed the issue. Note that there is a conversion script included in the HepMC3 package that you can use to convert between the two, in case like me you use software which is configured only with HepMC2 (MadGraph5 in this case). Thanks again, Billy. |
Sorry to reopen. Now running with a converted HepMC3 file, I can only partially read in my file. I have 10k events, however only 12 seem to be read in before failing, with the error: ERROR::ReaderAscii: too few or too many particles were parsed Cheers, |
Hi, sorry to hear that. At this point I think you should try with a smaller file and attach it here, for testing. Have you by change tried to read it with the C++ code to make sure the file is actually fine. It seems odd to have such an error. |
The issue looks like it's in the ReaderAscii module within HepMC3, so maybe it is the file? Although the conversion example script has no issue parsing events so I am stumped. I had a flick through the source code in HepMC3 and there is mention of a bug "HepMC2 files produced with Pythia8 are known to have wrong information about number of particles in vertex", but as said no such issue arises when reading the original HepMC2 file. I've cut down the file to 50 events, however can't seem to attach? |
Oops, you're right, you cannot attach. Anything that is too big to be pasted here would need to be given a link to an external page, at least temporarily. In the end the python code calls the C++ so I would be tempted to say that you won't manage to read the file with the C++ either, in which case the issue is either the file or the C++ code. Maybe worth filing an issue on the HepMC repository so that an expert takes a look? |
No worries, as I suspect it is indeed a deeper issue with the C++ code. Unfortunately I cannot as HepMC is hosted on GitLab and so adding an issue requires a CERN account, however I may be able to come up with a work around for this. I'll update if I do manage to get in touch with them and find a solution. |
Ah, right. Thanks for the follow-up. Hopefully you will be able to get in touch via email. |
That's ok, we can ask @agbuckley to help. |
Good point, @kratsg. |
Thanks guys! A collaborator of mine has a CERN so could ask on my behalf, shall I hold fire in hope Andy will chime in? |
I would do both things in parallel. Changes of success are likely to double ;-). |
Hi all, sorry for the delay... snowed under as usual. I'm not sure when I'll get a chance to look at this, but if you contact the HepMC developer mailing list, then someone should get back to you: most likely Andrii Verbyitskyi, who's doing a lot of HepMC3 work at the moment. |
@BFord94, did you ever chase the issue and managed to sort the problem out? Anything to get back to us on? Else I would be tempted to close this at this point. |
Hi everyone, this issue went idle for a while. I suspect it can be closed at this point but feel free to reopen if necessary, |
Hi, I'm having this problem too, reading in a pre-generated hepmc file - I think it's related to numpythia using hepmc3.0.0 as opposed to a more recent verison, e.g. 3.2.3. ERROR::ReaderAscii: too few or too many particles were parsed |
Hi,
Just wondering if it is possible to read in a pre generated hepmc file (in my case from madgraph5+pythia8)? I try the hepmc_read() function and get an error
ERROR::ReaderAscii: too few or too many particles were parsed
ERROR::ReaderAscii: too few or too many vertices were parsed
ERROR::ReaderAscii: event parsing failed. Returning empty event
DEBUG(1)::Parsing failed at line:
E 0 -1 -1.0000000000000000e+00 -1.0000000000000000e+00 -1.0000000000000000e+00 0 0 180 1 2 0 1 2.3174000000000004e-02
Best regards,
Billy Ford
The text was updated successfully, but these errors were encountered: