12 #include <generators/modules/koralwinput/KoralWInputModule.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/logging/Logger.h>
17 #include <framework/utilities/FileSystem.h>
29 setDescription(
"Generates four fermion final state events with KoralW.");
32 addParam(
"DataPath", m_dataPath,
"The path to the KoralW input data files.",
33 FileSystem::findFile(
"/data/generators/koralw"));
34 addParam(
"UserDataFile", m_userDataFile,
"The filename of the user KoralW input data file.",
35 FileSystem::findFile(
"/data/generators/koralw/KoralW_eeee.data"));
38 KoralWInputModule::~KoralWInputModule()
42 void KoralWInputModule::initialize()
45 mcparticle.registerInDataStore();
48 m_initial.initialize();
51 void KoralWInputModule::event()
54 if (m_beamParams.hasChanged()) {
56 initializeGenerator();
58 B2FATAL(
"KoralWInputModule::event(): BeamParameters have changed within a job, this is not supported for KORALW!");
72 m_generator.generateEvent(m_mcGraph, vertex, boost);
73 m_mcGraph.generateList(
"", MCParticleGraph::c_setDecayInfo | MCParticleGraph::c_checkCyclic);
76 void KoralWInputModule::terminate()
80 B2RESULT(
"Total cross section: " << m_generator.getCrossSection() <<
" pb +- " << m_generator.getCrossSectionError() <<
" pb");
83 void KoralWInputModule::initializeGenerator()
86 double ecm = nominal.getMass();
87 m_generator.setCMSEnergy(ecm);
89 m_generator.init(m_dataPath, m_userDataFile);