20#ifndef BDSPRIMARYGENERATORHEPMC_H
21#define BDSPRIMARYGENERATORHEPMC_H
23#include "BDSEventGeneratorFileType.hh"
24#include "BDSPrimaryGeneratorFile.hh"
27#include "G4RotationMatrix.hh"
28#include "G4ThreeVector.hh"
29#include "G4VPrimaryGenerator.hh"
64 const G4String& fileNameIn,
67 G4bool removeUnstableWithoutDecayIn =
true,
68 G4bool warnAboutSkippedParticlesIn =
true);
86 void OpenFile(G4bool usualPrintOut =
true);
105 void HepMC2G4(
const HepMC3::GenEvent* hepmcevt, G4Event* g4event);
110 HepMC3::GenEvent* hepmcEvent;
113 HepMC3::Reader* reader;
115 G4bool removeUnstableWithoutDecay;
116 G4bool warnAboutSkippedParticles;
118 G4RotationMatrix referenceBeamMomentumOffset;
A wrapper of BDSBunch to include a filter for the events loaded by an event generator.
Loader to use any HepMC3 compatible file.
void SkipEvents(G4int nEventsToSkip)
virtual void RecreateAdvanceToEvent(G4int eventOffset)
Advance to the correct event number in the file for recreation.
BDSPrimaryGeneratorFileHEPMC()=delete
Do not require default constructor.
HepMC3::GenEvent * GetHepMCGenEvent() const
Accessor.
G4long CountEventsInFile()
virtual void GeneratePrimaryVertex(G4Event *anEvent)
void HepMC2G4(const HepMC3::GenEvent *hepmcevt, G4Event *g4event)
Conversion from HepMC::GenEvent to G4Event.
void OpenFile(G4bool usualPrintOut=true)
Construct the member "reader" and open the file for reading.
Common interface for any primary generators that are file based.