9 #include <generators/modules/aafhinput/AafhInputModule.h>
10 #include <framework/logging/Logger.h>
26 setDescription(
"AAFH Generator to generate non-radiative two-photon events like e+e- -> e+e-e+e-");
29 addParam(
"mode", m_mode,
30 "decay mode to generate."
31 " 1: e+e- -> mu+mu-L+L-,"
32 " 2: e+e- -> mu+mu-mu+mu-,"
33 " 3: e+e- -> e+e-mu+mu-,"
34 " 4: e+e- -> e+e-L+L-,"
35 " 5: e+e- -> e+e-e+e-. "
36 "L is a user defined particle (default: tau)",
38 addParam(
"rejection", m_rejection,
40 " 1: apply once for the final event weight,"
41 " 2: apply for the subgenerator weight and for the final weight",
43 addParam(
"maxTries", m_maxTries,
44 "Maximum tries for event generation (ITOT)",
45 m_generator.getMaxTries());
46 addParam(
"maxFinalWeight", m_maxFinalWeight,
47 "maximum expected final weight for rejection scheme (ESFT)",
48 m_generator.getMaxFinalWeight());
49 addParam(
"maxSubgeneratorWeight", m_maxSubgeneratorWeight,
50 "maximum expected subgenerator weight for rejection scheme (ESWE)",
51 m_generator.getMaxSubGeneratorWeight());
52 addParam(
"subgeneratorWeights", m_subgeneratorWeights,
53 "relative weights of the subgenerators: this must be a list of four "
54 "or eight values (first four are interpreted as WAP, rest as WBP) "
55 "which specify the relativ weights for each of the "
56 "four sub generators. The orginial code states that it the program "
57 "run most efficient when the maximum weight is equal in all sub "
58 "generators and that if one wants to be sure that all peaks in the "
59 "differential cross section are accounted the chance to enter each "
60 "sub generator should be equal. Values which try to fullfill both "
61 "conditions are printed at after generation when the output level "
63 m_generator.getGeneratorWeights());
64 addParam(
"suppressionLimits", m_suppressionLimits,
65 "suppression limits for the matrix element calculations. This must "
66 "be a list of four values, [FACE, FACM, FACL, PROC]. For FACE, FACM "
67 "and FACL these specify the size of the propagator for which the "
68 "corresponding spin configurations will be omitted. A value of 1e3 "
69 "will calculate the dominat part correctly and a very large value "
70 "compared to the mass (i.e. 1e50) will calculate it exactly. PROC "
71 "specifies that feynman diagrams which contribute less than 1/PROC "
72 "of the biggest contribution are omitted. For exact calculation it "
73 "should be very big but 1e9 should be considerably faster without "
74 "affecting the result very much",
75 m_generator.getSuppressionLimits());
76 addParam(
"minMass", m_minMass,
77 "minimum invariant mass of generated fermion pair. Will "
78 "automatically be set to at least 2 times the generated particle "
81 addParam(
"particle", m_particle,
82 "name of the generated particle for mode 1 and 4",
83 m_generator.getParticle());
102 B2FATAL(
"AafhInputModule::event(): BeamParameters have changed within a job, this is not supported for AAFH!");
121 for (
size_t i = 0; i < mpg.
size(); ++i) {
122 mpg[i].set4Vector(boost * mpg[i].get4Vector());
124 TVector3 v3 = mpg[i].getProductionVertex();
126 mpg[i].setProductionVertex(v3);
127 mpg[i].setValidVertex(
true);
142 const double beamEnergy = nominal.getMass() / 2.;
145 if (m_mode < 1 || m_mode > 5) {
146 B2ERROR(
"AafhInputModule::initializeGenerator: 'mode' must be a value between 1 and 5");
148 if (m_rejection < 1 || m_rejection > 2) {
149 B2ERROR(
"AafhInputModule::initializeGenerator: 'rejection' must be a value between 1 and 2");
ERejection
Rejection mode.
void setMinimumMass(double minMass)
Set the minimum invariant mass for the generated event.
void finish()
calculate total cross section
void generateEvent(MCParticleGraph &mpg)
generate one event and add it to the graph in CMS
void initialize(double beamEnergy, EMode mode, ERejection rejection)
initialize the generator
void setMaxWeights(double subgeneratorWeight, double finalWeight)
Set the maximum expected weights for the rejection method.
void setMaxTries(int tries)
Set the maximum number of tries to generate an event.
void setSupressionLimits(std::vector< double > limits)
Set the suppression limits when calculation the matrix elements.
void setParticle(const std::string &particle)
Set the particle type for modes c_MuonParticle and c_ElectronParticle.
void setGeneratorWeights(const std::vector< double > &weights)
Set the relative weights for the sub generators.
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
const BeamParameters & getBeamParameters() const
Return reference to nominal beam parameters.
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.
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.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void initialize()
function to be executed on initialize()
MCInitialParticles & generate()
Generate a new event.
Abstract base class for different kinds of events.