Improve event ID handling
We've always treated event IDs as "OpaqueId"s, indexed from zero onward. This didn't always match with the way Geant4/HepMC recorded event numbers but we ignored it and output warnings about nonconsecutive event IDs. With #1447 we really discovered that event "IDs" are arbitrary: they're more like integer labels, and we introduced UniqueEventId to denote this for integrating with Geant4.
I think we need a more consistent mapping across libraries and input files, injecting primaries one event at a time (primaries will no longer have an event ID, you just have to group them). Then the primary generator (or whatever) can keep a map of "numerical event label" to EventId (consecutive).
@wdconinc noticed that hepmc files don't work properly in the .mac input. This is related to this issue and #1390 and the refactoring of the hepmc3 generators. I think we should:
- Refactor
PrimaryGeneratoras a distribution and remove the EventId. - Construct the primary generator in user action initialization for sharing among threads; and save number of requested events
- Move generator initialization code from GlobalSetup to RunAction