10 #include <generators/modules/koralwinput/KoralWInputModule.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/utilities/FileSystem.h>
27 setDescription(
"Generates four fermion final state events with KoralW.");
30 addParam(
"DataPath", m_dataPath,
"The path to the KoralW input data files.",
31 FileSystem::findFile(
"/data/generators/koralw"));
32 addParam(
"UserDataFile", m_userDataFile,
"The filename of the user KoralW input data file.",
33 FileSystem::findFile(
"/data/generators/koralw/KoralW_eeee.data"));
36 KoralWInputModule::~KoralWInputModule()
40 void KoralWInputModule::initialize()
45 m_initial.initialize();
48 m_generator.setCMSEnergy(beams.
getMass());
49 m_generator.init(m_dataPath, m_userDataFile);
53 void KoralWInputModule::event()
56 if (not m_initialized)
57 B2FATAL(
"KorlalW is not properly initialized.");
60 if (m_beamParams.hasChanged() and not m_firstEvent)
61 B2FATAL(
"BeamParameters have changed within a job, this is not supported for KoralW.");
67 m_generator.generateEvent(m_mcGraph, vertex, boost);
68 m_mcGraph.generateList(
"", MCParticleGraph::c_setDecayInfo | MCParticleGraph::c_checkCyclic);
71 void KoralWInputModule::terminate()
75 B2RESULT(
"Total cross section: " << m_generator.getCrossSection() <<
" pb +- " << m_generator.getCrossSectionError() <<
" pb");
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
This class contains the initial state for the given event.
const TLorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
const TVector3 & getVertex() const
Get the position of the collision.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.