 |
Belle II Software
release-05-01-25
|
11 #include <generators/modules/babayaganloinput/BabayagaNLOInputModule.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/utilities/FileSystem.h>
15 #include <framework/utilities/IOIntercept.h>
30 double babayaganlo_getrandomcmsenergy_()
32 return BabayagaNLOInputModule::generateCMSEnergy();
39 BabayagaNLOInputModule::BabayagaNLOInputModule() :
Module()
42 setDescription(
"Generates radiative Bhabha scattering and exclusive two-photon events with the high precision QED generator called BabaYaga@NLO.");
45 addParam(
"VacuumPolarization",
m_vacPol,
"Vacuum polarization: off, hadr5 (Jegerlehner) or hlmnt (Teubner, default)",
46 std::string(
"hlmnt"));
47 addParam(
"Model",
m_model,
"Model: ps or matched (default)", std::string(
"matched"));
48 addParam(
"Order",
m_order,
"Order: born, alpha, exp (default)", std::string(
"exp"));
49 addParam(
"Mode",
m_mode,
"Mode: weighted or unweighted (default)", std::string(
"unweighted"));
52 "Fractional minimum energy for leptons (ee or mm mode) or photons (gg mode) in the final state [fraction of ECMS]", -1.0);
53 addParam(
"MinEnergy",
m_eMin,
"Minimum energy for leptons (ee or mm mode) or photons (gg mode) in the final state [GeV]", 0.10);
54 addParam(
"Epsilon",
m_epsilon,
"Soft/hard photon separator [fraction of ECMS/2], must be <=1e-7 for ee and mumu, <=1e-5 for gg",
58 addParam(
"FMax",
m_fMax,
"Maximum of differential cross section weight (fmax)", -1.);
59 addParam(
"NPhotons",
m_nPhot,
"Fixed number of (hard) photons are generated, -1 for any number", -1);
60 addParam(
"SearchMax",
m_nSearchMax,
"Number of events used to search for maximum of differential cross section", 500000);
64 addParam(
"DebugEnergySpread",
m_Spread,
"TEMPORARY SOLUTION! Approximate energy spread per beam (CMS)", 5.e-3);
70 addParam(
"UserMode",
m_userMode,
"User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE or NONE (default)",
72 addParam(
"EEMIN",
m_eemin,
"Minimum CMS energy of the tagged e-/e+ (GeV)", -1.0);
73 addParam(
"TEMIN",
m_temin,
"Minimum CMS angle between the tagged e-/e+ and -z axis (deg)", -1.0);
74 addParam(
"EGMIN",
m_egmin,
"Minimum CMS energy of the gamma (GeV)", -1.0);
75 addParam(
"TGMIN",
m_tgmin,
"Minimum CMS angle between the gamma and -z axis (deg)", -1.0);
76 addParam(
"EEVETO",
m_eeveto,
"Minimum CMS energy to veto e-/e+ (GeV)", -1.0);
77 addParam(
"TEVETO",
m_teveto,
"Maximum CMS theta of e-/e+ in final state (deg)", -1.0);
78 addParam(
"EGVETO",
m_egveto,
"Minimum CMS energy to veto gamma (GeV)", -1.0);
79 addParam(
"TGVETO",
m_tgveto,
"Maximum CMS angle between the gamma and -z axis (deg)", -1.0);
80 addParam(
"MaxPrescale",
m_maxprescale,
"Maximum prescale factor (used for maximum differential cross section)", 1.0);
95 mcparticle.registerInDataStore();
101 m_th1dSDif =
new TH1D(
"sdif",
"sdif", 1000, 0., 100000.);
118 B2FATAL(
"BabayagaNLOInputModule::event(): BeamParameters have changed within a job, this is not supported for BABAYAGA!");
126 double ecm = initial.
getMass();
173 double ecmnominal = nominal.getMass();
180 B2INFO(
"Setting EMIN using fraction " <<
m_eMinFrac <<
" of CMS energy: cut=" <<
m_eMinFrac * ecmnominal <<
" GeV");
186 B2INFO(
"Setting FMax manually (no maximum search is performed)." <<
197 initLogCapture.
start();
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
void setMaxAcollinearity(double maxAcollinearity)
Sets maximum acollinearity angle between finale state leptons/photons in degrees.
void setVacPol(const std::string &vacPol)
Sets vacuum polarization.
void setEGMIN(double egmin)
Sets the minimum CMS energy of the gamma.
void setEEVETO(double eeveto)
Sets the minimum CMS energy to veto e-/e+.
void setDescription(const std::string &description)
Sets the description of the module.
void setTGVETO(double tgveto)
Sets the maximum CMS angle between the gamma and -z axis.
void setMode(const std::string &mode)
Sets mode: weighted or unweighted.
void setModel(const std::string &model)
Sets model: matched or ps.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void setScatAngle(std::pair< double, double > angleRange)
Sets the theta scattering angle range for the scattered particles.
void setEpsilon(double epsilon)
Sets soft/hard photon energy separator.
@ c_checkCyclic
Check for cyclic dependencies.
void setEGVETO(double egveto)
Sets the minimum CMS energy to veto gamma.
const BeamParameters & getBeamParameters() const
Return reference to nominal beam parameters.
void setVPUncertainty(bool vpuncertainty)
Calculate VP uncertainty by internal reweighting (on/off)
bool finish()
Finish the capture and emit the message if output has appeard on stdout or stderr.
void generateEvent(MCParticleGraph &mcGraph, double ecm, TVector3 vertex, TLorentzRotation boost)
Generates one single event.
@ c_Info
Info: for informational messages, e.g.
void setMinEnergy(double minEnergy)
Sets minimum energy for leptons/photons in the final state, in GeV.
void setTGMIN(double tgmin)
Sets the minimum CMS angle between the gamma and -z axis.
@ c_setDecayInfo
Set decay time and vertex.
void term()
Terminates the generator.
void setEEMIN(double eemin)
Sets the minimum CMS energy of the tagged e-/e+.
void initExtraInfo()
Initializes the extra info.
void setFinalState(const std::string &finalState)
Sets final state minimum energy.
void setUserMode(const std::string &usermode)
Sets User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE or NONE (default)
This class contains the initial state for the given event.
void setCmsEnergyNominal(double cmsEnergyNominal)
Sets nominal ECM.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
Abstract base class for different kinds of events.
void setNPhotons(int nPhot)
Sets the fixed number of nphot (hard) photons.
Class to store variables with their name which were sent to the logging service.
bool start()
Start intercepting the output.
std::vector< T > make_vector(T const &t1, T const &t2)
make_vector.
void setFMax(double fMax)
Maximum differential cross section.
void setEnergySpread(double spread)
TEMPORARY SOLUTION! Approximate energy spread per beam (CMS)
const TVector3 & getVertex() const
Get the position of the collision.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
std::pair< T, T > vectorToPair(std::vector< T > &vec, const std::string &name="")
void setOrder(const std::string &order)
Sets Order: born, alpha or exp.
void initialize()
function to be executed on initialize()
Capture stdout and stderr and convert into log messages.
const TLorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
void setNSearchMax(int nSearchMax)
Sets the number of events used to search maximum.
MCInitialParticles & generate()
Generate a new event.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
void setTEVETO(double teveto)
Sets the maximum CMS theta of e-/e+ in final state.
void clear()
Reset particles and decay information to make the class reusable.
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
void setNSKDataFile(const std::string &NSKDataFile)
Sets NSK VP data file.
void setTEMIN(double temin)
Sets the minimum CMS angle between the tagged e-/e+ and -z axis.
void init()
Initializes the generator.
void setMaxPrescale(double maxprescale)
Sets the maximum prescale value.