11#include <framework/core/Module.h>
12#include <mdst/dataobjects/MCParticle.h>
13#include <mdst/dataobjects/MCParticleGraph.h>
14#include <generators/evtgen/EvtGenInterface.h>
20namespace HepMC {
class GenEvent; }
41 class HerwigHepMCFragmentationModule :
public Module {
44 HerwigHepMCFragmentationModule();
45 virtual ~HerwigHepMCFragmentationModule();
52 virtual void event()
override;
Class to interface EvtGen.
Helper class for Herwig fragmentation modules.
std::string m_userDecFile
EvtGen user decay file.
int m_successCounter
Counts successfully processed events.
bool m_coherentMixing
Coherent B0/B0bar mixing in EvtGen.
std::map< int, std::string > m_sidecarMap
Mapping from global event number to sidecar filename (basename only).
virtual void initialize() override
Open and validate HepMC file; load all events and manifest; initialize EvtGen.
std::string m_decFile
EvtGen main decay file.
virtual void event() override
Load one HepMC event, reconstruct MCParticle truth tree, apply EvtGen decays.
virtual void terminate() override
Log success rate; warn if below 97% threshold.
bool applyEvtGenDecays()
Apply EvtGen filter and write decayed particles to StoreArray.
std::string m_hepmcPath
Resolved path to all_events.hepmc.
std::map< int, HepMC::GenEvent * > m_hepmcEvents
Mapping from global basf2 event number to HepMC event stored in memory.
bool m_useEvtGen
Use EvtGen for particle decays (default true).
std::string m_workDir
Working directory written by HerwigLHEWriterModule (Stage 1).
bool m_keepTempFiles
If false, delete WorkDir and all pipeline files in terminate().
int m_eventCounter
Counts event() calls.
bool loadManifest()
Load the manifest.txt written by HerwigLHEWriterModule::terminate().
bool loadKKMCSidecar(int globalEvtNum, std::vector< int > &quarkIndices)
Add KKMC particles from sidecar file to m_mcParticleGraph.
MCParticleGraph m_mcParticleGraph
Particle graph rebuilt per event.
std::unique_ptr< HerwigFragHelper > m_helper
Two-pass HepMC-to-graph helper.
bool loadHepMCEvents()
Load all HepMC events from all_events.hepmc into m_hepmcEvents map.
EvtGenInterface m_evtGenInterface
Persistent EvtGen interface; setup() called once in initialize().
Class to build, validate and sort a particle decay chain.
Abstract base class for different kinds of events.