11 #include <generators/modules/bbbreminput/BBBremInputModule.h>
13 #include <framework/logging/Logger.h>
14 #include <framework/datastore/DataStore.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/dataobjects/EventMetaData.h>
35 setDescription(
"Generates low scattering angle radiative Bhabha events (Beam-Beam Bremsstrahlung).");
38 addParam(
"MinPhotonEnergyFraction", m_photonEFrac,
"Fraction of the minimum photon energy.", 0.000001);
39 addParam(
"Unweighted", m_unweighted,
"Produce unweighted or weighted events.",
true);
40 addParam(
"MaxWeight", m_maxWeight,
"The max weight (only for Unweighted=True).", 2000.0);
41 addParam(
"DensityCorrectionMode", m_densityCorrectionMode,
"Mode for bunch density correction (none=0, hard=1 (default), soft=2)",
43 addParam(
"DensityCorrectionParameter", m_DensityCorrectionParameter,
"Density correction parameter tc (=(hbarc/sigma_y)^2)",
48 BBBremInputModule::~BBBremInputModule()
54 void BBBremInputModule::initialize()
57 mcparticle.registerInDataStore();
60 m_initial.initialize();
65 void BBBremInputModule::event()
68 if (m_beamParams.hasChanged()) {
70 initializeGenerator();
72 B2FATAL(
"BBBremInputModule::event(): BeamParameters have changed within a job, this is not supported for BBBREM!");
88 double weight = m_generator.generateEvent(m_mcGraph, vertex, boost);
90 m_mcGraph.generateList(
"", MCParticleGraph::c_setDecayInfo | MCParticleGraph::c_checkCyclic);
93 evtMetaData->setGeneratedWeight(weight);
97 void BBBremInputModule::terminate()
101 B2RESULT(
"Cross-section (weighted): " << m_generator.getCrossSection() <<
" +/- " <<
102 m_generator.getCrossSectionError() <<
" [mb]");
103 B2RESULT(
"Maximum weight delivered: " << m_generator.getMaxWeightDelivered());
104 B2RESULT(
"Overweight bias cross-section (unweighted): " << m_generator.getCrossSectionOver() <<
" +/- " <<
105 m_generator.getCrossSectionErrorOver() <<
" [mb]");
108 void BBBremInputModule::initializeGenerator()
112 double centerOfMassEnergy = nominal.getMass();
114 m_generator.init(centerOfMassEnergy, m_photonEFrac, m_unweighted, m_maxWeight, m_densityCorrectionMode,
115 m_DensityCorrectionParameter);
117 m_initialized =
true;