9 #include <generators/modules/bbbreminput/BBBremInputModule.h>
11 #include <framework/logging/Logger.h>
12 #include <framework/datastore/DataStore.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/dataobjects/EventMetaData.h>
33 setDescription(
"Generates low scattering angle radiative Bhabha events (Beam-Beam Bremsstrahlung).");
36 addParam(
"MinPhotonEnergyFraction", m_photonEFrac,
"Fraction of the minimum photon energy.", 0.000001);
37 addParam(
"Unweighted", m_unweighted,
"Produce unweighted or weighted events.",
true);
38 addParam(
"MaxWeight", m_maxWeight,
"The max weight (only for Unweighted=True).", 2000.0);
39 addParam(
"DensityCorrectionMode", m_densityCorrectionMode,
"Mode for bunch density correction (none=0, hard=1 (default), soft=2)",
41 addParam(
"DensityCorrectionParameter", m_DensityCorrectionParameter,
"Density correction parameter tc (=(hbarc/sigma_y)^2)",
46 BBBremInputModule::~BBBremInputModule()
52 void BBBremInputModule::initialize()
58 m_initial.initialize();
63 void BBBremInputModule::event()
66 if (m_beamParams.hasChanged()) {
68 initializeGenerator();
70 B2FATAL(
"BBBremInputModule::event(): BeamParameters have changed within a job, this is not supported for BBBREM!");
86 double weight = m_generator.generateEvent(m_mcGraph, vertex, boost);
88 m_mcGraph.generateList(
"", MCParticleGraph::c_setDecayInfo | MCParticleGraph::c_checkCyclic);
91 evtMetaData->setGeneratedWeight(weight);
95 void BBBremInputModule::terminate()
99 B2RESULT(
"Cross-section (weighted): " << m_generator.getCrossSection() <<
" +/- " <<
100 m_generator.getCrossSectionError() <<
" [mb]");
101 B2RESULT(
"Maximum weight delivered: " << m_generator.getMaxWeightDelivered());
102 B2RESULT(
"Overweight bias cross-section (unweighted): " << m_generator.getCrossSectionOver() <<
" +/- " <<
103 m_generator.getCrossSectionErrorOver() <<
" [mb]");
106 void BBBremInputModule::initializeGenerator()
110 double centerOfMassEnergy = nominal.getMass();
112 m_generator.init(centerOfMassEnergy, m_photonEFrac, m_unweighted, m_maxWeight, m_densityCorrectionMode,
113 m_DensityCorrectionParameter);
115 m_initialized =
true;
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.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Type-safe access to single objects in the data store.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.