Belle II Software development
TeeggInputModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <generators/modules/teegginput/TeeggInputModule.h>
10
11#include <framework/datastore/StoreArray.h>
12
13using namespace std;
14using namespace Belle2;
15
16//-----------------------------------------------------------------
17// Register the Module
18//-----------------------------------------------------------------
19REG_MODULE(TeeggInput);
20
21//-----------------------------------------------------------------
22// Implementation
23//-----------------------------------------------------------------
24
26{
27 //Set module properties
28 setDescription("Generates events with TEEGG.");
29
30 //Parameter definition
31 addParam("VACPOL", m_sVACPOL, "Vacuum polarization: off, nsk (Novosibirsk) or hlmnt (Teubner et al., default)",
32 std::string("hlmnt"));
33 addParam("CMSEnergy", m_cmsEnergy, "CMS energy [GeV] (default: take from xml)", 0.0);
34 addParam("TEVETO", m_TEVETO, "Maximum theta of e+ in final state (in deg)", 0.1);
35 addParam("TEMIN", m_TEMIN, "Minimum angle between the e- and -z axis (EGAMMA conf. only) (in deg)", 20.0);
36 addParam("TGMIN", m_TGMIN, "Minimum angle between the gamma and -z axis (in deg)", 20.0);
37 addParam("TGVETO", m_TGVETO, "Maximum angle between the gamma and -z axis(ETRON conf. only) (in deg)", 0.05);
38 addParam("EEMIN", m_EEMIN, "Minimum energy of the e- (EGAMMA and ETRON conf.) (in GeV)", 2.0);
39 addParam("EGMIN", m_EGMIN, "Minimum energy of the gamma (EGAMMA and GAMMA conf.) (in GeV)", 2.0);
40 addParam("PEGMIN", m_PEGMIN, "Minimum phi sep of e-gamma (EGAMMA config with hard rad. corr.) (in deg)", 0.0);
41 addParam("EEVETO", m_EEVETO, "Minimum energy to veto (GAMMA config with hard rad. corr.) (in GeV)", 0.0);
42 addParam("EGVETO", m_EGVETO, "Minimum energy to veto (ETRON/GAMMA config with hard rad. corr.) (in GeV)", 0.0);
43 addParam("PHVETO", m_PHVETO, "Minimum phi sep to veto (ETRON/GAMMA config with hard rad. corr. (in deg)", 0.0);
44 addParam("CUTOFF", m_CUTOFF, "Cutoff energy for radiative corrections (in CM frame) (in GeV)", 0.250);
45 addParam("EPS", m_EPS, "Param. epsilon_s (smaller val. increases sampling of k_s^pbc)", 0.01);
46 addParam("FRAPHI", m_FRAPHI, "Fraction of time phi_ks is generated with peak(hard rad corr)", 0.0);
47 addParam("EPSPHI", m_EPSPHI, "Param. epsilon_phi ('cutoff' of the phi_ks peak)", 1.0e-4);
48 addParam("WGHT1M", m_WGHT1M, "Maximum weight for generation of QP0, cos(theta QP)", 1.001);
49 addParam("WGHTMX", m_WGHTMX, "Maximum weight for the trial events", 1.000);
50 addParam("RADCOR", m_sRADCOR, "Specifies radiative correction (NONE, SOFT or HARD)", std::string("NONE"));
51 addParam("CONFIG", m_sCONFIG, "Specifies the event configuration (EGAMMA, GAMMA, GAMMAE or ETRON)", std::string("EGAMMA"));
52 addParam("MATRIX", m_sMATRIX, "Specifies which eeg matrix element (BK, BKM2, TCHAN or EPA)", std::string("BKM2"));
53 addParam("MTRXGG", m_sMTRXGG, "Specifies which eegg matrix element (EPADC, BEEGG or MEEGG)", std::string("EPADC"));
54 addParam("UNWEIGHTED", m_UNWGHT, "If true then generate unweighted events", 1);
55}
56
58{
59
60}
61
62
64{
65 //Initialize MCParticle collection.
66 StoreArray<MCParticle> mcparticle;
67 mcparticle.registerInDataStore();
68
69 //Initialize initial particle for beam parameters.
71
72 // Initialize ExtraInfo (holds vaccum polarization corrections)
74
75}
76
77
79{
80
81 // Check if the BeamParameters have changed (if they do, abort the job! otherwise cross section calculation will be a nightmare.)
82 if (m_beamParams.hasChanged()) {
83 if (!m_initialized) {
85 } else {
86 B2FATAL("TeeggInputModule::event(): BeamParameters have changed within a job, this is not supported for TEEGG!");
87 }
88 }
89
91
92 // initial particle from beam parameters
93 const MCInitialParticles& initial = m_initial.generate();
94
95 // true boost
96 ROOT::Math::LorentzRotation boost = initial.getCMSToLab();
97
98 // vertex
99 ROOT::Math::XYZVector vertex = initial.getVertex();
100
101 m_generator.generateEvent(m_mcGraph, vertex, boost);
103}
104
105
107{
109}
110
112{
113 const BeamParameters& nominal = m_initial.getBeamParameters();
114 m_cmsEnergy = nominal.getMass();
115
139
141
142 m_initialized = true;
143
144}
145
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 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.
@ c_checkCyclic
Check for cyclic dependencies.
@ c_setDecayInfo
Set decay time and vertex.
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
double m_EGVETO
minimum energy to veto(etron/gamma config with hard rad corr)
double m_TEVETO
maximum theta of e+ in final state (in radians)
DBObjPtr< BeamParameters > m_beamParams
BeamParameter.
bool m_initialized
True if generator has been initialized.
double m_EEVETO
minimum energy to veto(gamma config with hard rad corr)
virtual void initialize() override
Initializes the module.
double m_cmsEnergy
CMS energy.
double m_WGHTMX
maximum weight for the trial events
virtual void event() override
Method is called for each event.
virtual ~TeeggInputModule()
Destructor.
double m_EGMIN
minimum energy of the gamma (egamma & gamma configurations)
int m_UNWGHT
logical variable.
virtual void terminate() override
Method is called at the end of the event processing.
std::string m_sMATRIX
specifies which eeg matrix element (BK BKM2 TCHAN or EPA)
double m_WGHT1M
maximum weight for generation of QP0, cos(theta QP)
double m_PHVETO
minimum phi sep to veto(etron/gamma config with hard rad corr
Teegg m_generator
Variables.
std::string m_sCONFIG
specifies the event configuration (EGAMMA GAMMA or ETRON)
std::string m_sMTRXGG
specifies which eegg matrix element (EPADC BEEGG or MEEGG)
MCParticleGraph m_mcGraph
The MCParticle graph object.
double m_TGVETO
maximum angle between the gamma and -z axis(etron conf.
std::string m_sRADCOR
specifies radiative correction (NONE SOFT or HARD)
InitialParticleGeneration m_initial
initial particle used by BeamParameter class
double m_EEMIN
minimum energy of the e- (egamma & etron configurations)
double m_CUTOFF
cutoff energy for radiative corrections (in CM frame)
double m_TGMIN
minimum angle between the gamma and -z axis
std::string m_sVACPOL
Module parameters.
double m_TEMIN
minimum angle between the e- and -z axis (egamma conf.
double m_FRAPHI
fraction of time phi_ks is generated with peak(hard rad corr)
void initializeGenerator()
Method is called to initialize the generator.
double m_PEGMIN
minimum phi sep of e-gamma (egamma config with hard rad corr)
void init()
Initialize generator.
Definition: Teegg.cc:153
void generateEvent(MCParticleGraph &mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
Generates one single event.
Definition: Teegg.cc:159
void setTGMIN(double tgmin=666.66)
set minimum angle between the gamma and -z axis
Definition: Teegg.h:57
void setMTRXGG(const std::string &mtrxgg="NONE")
specifies which eegg matrix element (EPADC BEEGG or MEEGG)
Definition: Teegg.h:142
void setPEGMIN(double pegmin=666.66)
set minimum phi sep of e-gamma (egamma config with hard rad corr)
Definition: Teegg.h:77
void setEPSPHI(double epsphi=666.66)
set param.
Definition: Teegg.h:112
void setEEMIN(double eemin=666.66)
set minimum energy of the e- (egamma & etron configurations)
Definition: Teegg.h:67
void setWGHTMX(double wghtmx=666.66)
set maximum weight for the trial events
Definition: Teegg.h:122
void setEGVETO(double egveto=666.66)
set minimum energy to veto(etron/gamma config with hard rad corr)
Definition: Teegg.h:87
void setCMSEnergy(double cmsEnergy)
Sets the CMS energy.
Definition: Teegg.h:152
void term()
Terminates the generator.
Definition: Teegg.cc:197
void setFRAPHI(double fraphi=666.66)
set fraction of time phi_ks is generated with peak(hard rad corr)
Definition: Teegg.h:107
void setTGVETO(double tgveto=666.66)
set maximum angle between the gamma and -z axis(etron conf.
Definition: Teegg.h:62
void setCONFIG(const std::string &config="NONE")
specifies the event configuration (EGAMMA GAMMA or ETRON)
Definition: Teegg.h:132
void setRADCOR(const std::string &radcor="NONE")
specifies radiative correction (NONE SOFT or HARD)
Definition: Teegg.h:127
void setPHVETO(double phveto=666.66)
set minimum phi sep to veto(etron/gamma config with hard rad corr)
Definition: Teegg.h:92
void setVACPOL(const std::string &vacpol="HLMNT")
specifies which vacuum polarization code (NOT IMPLEMENTED YET)
Definition: Teegg.h:42
void setWGHT1M(double wght1m=666.66)
set maximum weight for generation of QP0, cos(theta QP)
Definition: Teegg.h:117
void setEGMIN(double egmin=666.66)
set minimum energy of the gamma (egamma & gamma configurations)
Definition: Teegg.h:72
void setMATRIX(const std::string &matrix="NONE")
specifies which eeg matrix element (BK BKM2 TCHAN or EPA)
Definition: Teegg.h:137
void setTEMIN(double temin=666.66)
set minimum angle between the e- and -z axis (egamma conf.
Definition: Teegg.h:52
void setUNWGHT(int unwght=1)
set logical variable.
Definition: Teegg.h:147
void initExtraInfo()
Initializes the extra info.
Definition: Teegg.cc:147
void setTEVETO(double teveto=666.66)
set maximum theta of e+ in final state (in radians)
Definition: Teegg.h:47
void setEEVETO(double eeveto=666.66)
set minimum energy to veto(gamma config with hard rad corr)
Definition: Teegg.h:82
void setCUTOFF(double cutoff=666.66)
set cutoff energy for radiative corrections (in CM frame)
Definition: Teegg.h:97
void setEPS(double eps=666.66)
set param.
Definition: Teegg.h:102
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
void initialize()
function to be executed on initialize()
MCInitialParticles & generate()
Generate a new event.
void clear()
Reset particles and decay information to make the class reusable.
Abstract base class for different kinds of events.
STL namespace.