9#include <generators/modules/aafhinput/AafhInputModule.h>
10#include <generators/utilities/scaleParticleEnergies.h>
11#include <framework/logging/Logger.h>
13#include <Math/Vector3D.h>
29 setDescription(
"AAFH Generator to generate non-radiative two-photon events like e+e- -> e+e-e+e-");
33 "decay mode to generate."
34 " 1: e+e- -> mu+mu-L+L-,"
35 " 2: e+e- -> mu+mu-mu+mu-,"
36 " 3: e+e- -> e+e-mu+mu-,"
37 " 4: e+e- -> e+e-L+L-,"
38 " 5: e+e- -> e+e-e+e-. "
39 "L is a user defined particle (default: tau)",
43 " 1: apply once for the final event weight,"
44 " 2: apply for the subgenerator weight and for the final weight",
47 "Maximum tries for event generation (ITOT)",
50 "maximum expected final weight for rejection scheme (ESFT)",
53 "maximum expected subgenerator weight for rejection scheme (ESWE)",
56 "relative weights of the subgenerators: this must be a list of four "
57 "or eight values (first four are interpreted as WAP, rest as WBP) "
58 "which specify the relative weights for each of the "
59 "four sub generators. The original code states that it the program "
60 "run most efficient when the maximum weight is equal in all sub "
61 "generators and that if one wants to be sure that all peaks in the "
62 "differential cross section are accounted the chance to enter each "
63 "sub generator should be equal. Values which try to fulfill both "
64 "conditions are printed at after generation when the output level "
68 "suppression limits for the matrix element calculations. This must "
69 "be a list of four values, [FACE, FACM, FACL, PROC]. For FACE, FACM "
70 "and FACL these specify the size of the propagator for which the "
71 "corresponding spin configurations will be omitted. A value of 1e3 "
72 "will calculate the dominat part correctly and a very large value "
73 "compared to the mass (i.e. 1e50) will calculate it exactly. PROC "
74 "specifies that feynman diagrams which contribute less than 1/PROC "
75 "of the biggest contribution are omitted. For exact calculation it "
76 "should be very big but 1e9 should be considerably faster without "
77 "affecting the result very much",
80 "minimum invariant mass of generated fermion pair. Will "
81 "automatically be set to at least 2 times the generated particle "
85 "name of the generated particle for mode 1 and 4",
105 B2FATAL(
"AafhInputModule::event(): BeamParameters have changed within a job, this is not supported for AAFH!");
113 ROOT::Math::LorentzRotation boost = initial.
getCMSToLab();
116 ROOT::Math::XYZVector vertex = initial.
getVertex();
127 for (
size_t i = 0; i < mpg.
size(); ++i) {
128 mpg[i].set4Vector(boost * mpg[i].get4Vector());
130 ROOT::Math::XYZVector v3 = mpg[i].getProductionVertex();
132 mpg[i].setProductionVertex(v3);
133 mpg[i].setValidVertex(
true);
148 const double beamEnergy = nominal.getMass() / 2.;
152 B2ERROR(
"AafhInputModule::initializeGenerator: 'mode' must be a value between 1 and 5");
155 B2ERROR(
"AafhInputModule::initializeGenerator: 'rejection' must be a value between 1 and 2");
ERejection
Rejection mode.
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
GeneratorBaseModule()
Constructor.
This class contains the initial state for the given event.
const ROOT::Math::LorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
const ROOT::Math::XYZVector & getVertex() const
Get the position of the collision.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
Class to build, validate and sort a particle decay chain.
@ c_setDecayInfo
Set decay time and vertex.
size_t size() const
Return the number of particles in the graph.
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 setDescription(const std::string &description)
Sets the description of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void scaleParticleEnergies(MCParticleGraph &mpg, double EcmsTarget)
Scale momenta of the particles by a constant factor such that total energy is changed to EcmsTarget.
Abstract base class for different kinds of events.