11 #include <generators/modules/bhwideinput/BHWideInputModule.h>
13 #include <framework/datastore/StoreArray.h>
30 setDescription(
"Generates radiative BhaBha scattering events with BHWide.");
33 addParam(
"ScatteringAngleRangePositron", m_ScatteringAngleRangePositron,
34 "Min [0] and Max [1] value for the scattering angle [deg] of the positron.", make_vector(15.0, 165.0));
35 addParam(
"ScatteringAngleRangeElectron", m_ScatteringAngleRangeElectron,
36 "Min [0] and Max [1] value for the scattering angle [deg] of the electron.", make_vector(15.0, 165.0));
37 addParam(
"MaxAcollinearity", m_maxAcollinearity,
"Maximum acollinearity angle between finale state leptons/photons [degree]",
39 addParam(
"MinEnergy", m_eMin,
"Minimum energy for electrons in the final state [GeV] (default: 0.2 GeV)", 0.2);
40 addParam(
"VacuumPolarization", m_vacPolString,
41 "Vacuum polarization: off (off - EW off, too), Burkhardt89 (bhlumi), Eidelman/Jegerlehner95 (eidelman) or Burkhardt/Pietrzyk95 (burkhardt)",
42 std::string(
"burkhardt"));
43 addParam(
"WtMax", m_wtMax,
"Maximum of weight (wtmax, default: 3.0), if <0: internal maximum search", 3.);
44 addParam(
"WeakCorrections", m_weakCorrections,
"EW correction ON/OFF",
true);
47 m_vacPol = BHWide::PhotonVacPolarization::PP_BURKHARDT;
52 BHWideInputModule::~BHWideInputModule()
58 void BHWideInputModule::initialize()
61 mcparticle.registerInDataStore();
64 m_initial.initialize();
69 void BHWideInputModule::event()
72 if (m_beamParams.hasChanged()) {
74 initializeGenerator();
76 B2FATAL(
"BHWideInputModule::event(): BeamParameters have changed within a job, this is not supported for BHWide!");
90 m_generator.generateEvent(m_mcGraph, vertex, boost);
91 m_mcGraph.generateList(
"", MCParticleGraph::c_setDecayInfo | MCParticleGraph::c_checkCyclic);
96 void BHWideInputModule::terminate()
100 B2RESULT(
"BHWideInputModule: Total cross section: " << m_generator.getCrossSection() * 0.001 <<
" nb +- " <<
101 m_generator.getCrossSection() *
102 m_generator.getCrossSectionError() * 0.001 <<
" nb");
105 void BHWideInputModule::initializeGenerator()
108 double ecm = nominal.getMass();
110 m_generator.setScatAnglePositron(vectorToPair(m_ScatteringAngleRangePositron,
"ScatteringAngleRangePositron"));
111 m_generator.setScatAngleElectron(vectorToPair(m_ScatteringAngleRangeElectron,
"ScatteringAngleRangeElectron"));
113 m_generator.setMinEnergyFinalStatePos(m_eMin);
114 m_generator.setMinEnergyFinalStateElc(m_eMin);
115 m_generator.setMaxAcollinearity(m_maxAcollinearity);
116 m_generator.setMaxRejectionWeight(m_wtMax);
118 if (m_weakCorrections == 0) {
119 m_generator.enableWeakCorrections(0);
121 m_generator.enableWeakCorrections(1);
125 if (m_vacPolString ==
"off") {
126 m_vacPol = BHWide::PhotonVacPolarization::PP_OFF;
128 if (m_weakCorrections == 1) {
129 B2INFO(
"BHWideInputModule: Switching OFF EW corrections");
131 m_generator.enableWeakCorrections(0);
132 }
else if (m_vacPolString ==
"bhlumi") m_vacPol = BHWide::PhotonVacPolarization::PP_BHLUMI;
133 else if (m_vacPolString ==
"burkhardt") m_vacPol = BHWide::PhotonVacPolarization::PP_BURKHARDT;
134 else if (m_vacPolString ==
"eidelman") m_vacPol = BHWide::PhotonVacPolarization::PP_EIDELMAN;
135 else B2FATAL(
"BHWideInputModule: Vacuum Polarization option does not exist: " << m_vacPolString);
136 m_generator.setPhotonVacPolarization(m_vacPol);
138 m_generator.setCMSEnergy(ecm);
142 m_initialized =
true;