EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
src
EvtGenExternal
EvtExternalGenList.cpp
Go to the documentation of this file.
1
2
/***********************************************************************
3
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4
* *
5
* This file is part of EvtGen. *
6
* *
7
* EvtGen is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* EvtGen is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19
***********************************************************************/
20
21
#include "
EvtGenExternal/EvtExternalGenList.hh
"
22
23
#include "
EvtGenModels/EvtNoRadCorr.hh
"
24
25
#include "
EvtGenExternal/EvtExternalGenFactory.hh
"
26
#include "
EvtGenExternal/EvtPHOTOS.hh
"
27
#include "
EvtGenExternal/EvtPythia.hh
"
28
#include "
EvtGenExternal/EvtSherpaPhotons.hh
"
29
#include "
EvtGenExternal/EvtTauola.hh
"
30
31
EvtExternalGenList::EvtExternalGenList
(
bool
convertPythiaCodes,
32
std::string pythiaXmlDir,
33
std::string photonType,
34
bool
useEvtGenRandom,
35
bool
seedTauolaFortran ) :
36
m_photonType
{ photonType },
m_useEvtGenRandom
{ useEvtGenRandom }
37
{
38
// Instantiate the external generator factory
39
EvtExternalGenFactory
& extFactory =
EvtExternalGenFactory::getInstance
();
40
41
if
( pythiaXmlDir.size() < 1 ) {
42
// If we have no string defined, check the value of the
43
// PYTHIA8DATA environment variable which should be set to the
44
// xmldoc Pythia directory
45
char
* pythiaDataDir = getenv(
"PYTHIA8DATA"
);
46
if
( pythiaDataDir !=
nullptr
) {
47
pythiaXmlDir = pythiaDataDir;
48
}
49
}
50
51
extFactory.
definePythiaGenerator
( pythiaXmlDir, convertPythiaCodes,
52
useEvtGenRandom );
53
54
extFactory.
defineTauolaGenerator
( useEvtGenRandom, seedTauolaFortran );
55
}
56
57
EvtExternalGenList::~EvtExternalGenList
()
58
{
59
}
60
61
#ifdef EVTGEN_PHOTOS
62
EvtAbsRadCorr
*
EvtExternalGenList::getPhotosModel
(
const
double
infraredCutOff,
63
const
double
maxWtInterference )
64
{
65
// Define the Photos model, which uses the EvtPHOTOS class.
66
EvtPHOTOS
* photosModel =
new
EvtPHOTOS
(
m_photonType
,
m_useEvtGenRandom
,
67
infraredCutOff, maxWtInterference );
68
return
photosModel;
69
}
70
#else
71
EvtAbsRadCorr
*
EvtExternalGenList::getPhotosModel
(
72
const
double
/*infraredCutOff*/
,
const
double
/*maxWtInterference*/
)
73
{
74
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
75
<<
" PHOTOS generator has been called for FSR simulation, but it was not switched on during compilation."
76
<< std::endl;
77
78
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
79
<<
" The simulation will be generated without FSR."
<< std::endl;
80
81
return
new
EvtNoRadCorr
{};
82
}
83
#endif
84
85
#ifdef EVTGEN_SHERPA
86
EvtAbsRadCorr
*
EvtExternalGenList::getSherpaPhotonsModel
(
87
const
double
infraredCutOff,
const
int
mode,
const
int
useME )
88
{
89
// Define the Photos model, which uses the EvtSherpaPhotonsEngine class.
90
EvtSherpaPhotons
* sherpaPhotonsModel =
91
new
EvtSherpaPhotons
(
m_useEvtGenRandom
, infraredCutOff, mode, useME );
92
return
sherpaPhotonsModel;
93
}
94
#else
95
EvtAbsRadCorr
*
EvtExternalGenList::getSherpaPhotonsModel
(
96
const
double
/*infraredCutOff*/
,
const
int
/*mode*/
,
const
int
/*useME*/
)
97
{
98
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
99
<<
" Sherpa's PHOTONS++ generator has been called for FSR simulation, but Sherpa was not switched on during compilation."
100
<< std::endl;
101
102
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
103
<<
" The simulation will be generated without FSR."
<< std::endl;
104
105
return
new
EvtNoRadCorr
{};
106
}
107
#endif
108
109
std::list<EvtDecayBase*>
EvtExternalGenList::getListOfModels
()
110
{
111
// Create the Pythia and Tauola models, which use their own engine classes.
112
EvtPythia
* pythiaModel =
new
EvtPythia
();
113
EvtTauola
* tauolaModel =
new
EvtTauola
();
114
115
std::list<EvtDecayBase*> extraModels;
116
extraModels.push_back( pythiaModel );
117
extraModels.push_back( tauolaModel );
118
119
// Return the list of models
120
return
extraModels;
121
}
EvtExternalGenFactory.hh
EvtExternalGenList.hh
EvtNoRadCorr.hh
EvtPHOTOS.hh
EvtPythia.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_ERROR
@ EVTGEN_ERROR
Definition
EvtReport.hh:49
EvtSherpaPhotons.hh
EvtTauola.hh
EvtAbsRadCorr
Definition
EvtAbsRadCorr.hh:28
EvtExternalGenFactory
Definition
EvtExternalGenFactory.hh:32
EvtExternalGenFactory::getInstance
static EvtExternalGenFactory & getInstance()
Definition
EvtExternalGenFactory.cpp:36
EvtExternalGenFactory::defineTauolaGenerator
void defineTauolaGenerator(bool useEvtGenRandom=true, bool seedTauolaFortran=true)
Definition
EvtExternalGenFactory.cpp:75
EvtExternalGenFactory::definePythiaGenerator
void definePythiaGenerator(std::string xmlDir, bool convertPhysCodes, bool useEvtGenRandom=true)
Definition
EvtExternalGenFactory.cpp:45
EvtExternalGenList::EvtExternalGenList
EvtExternalGenList(bool convertPythiaCodes=false, std::string pythiaXmlDir="", std::string photonType="gamma", bool useEvtGenRandom=true, bool seedTauolaFortran=true)
Definition
EvtExternalGenList.cpp:31
EvtExternalGenList::getPhotosModel
EvtAbsRadCorr * getPhotosModel(const double infraredCutOff=1.0e-7, const double maxWtInterference=64.0)
Definition
EvtExternalGenList.cpp:62
EvtExternalGenList::~EvtExternalGenList
virtual ~EvtExternalGenList()
Definition
EvtExternalGenList.cpp:57
EvtExternalGenList::getSherpaPhotonsModel
EvtAbsRadCorr * getSherpaPhotonsModel(const double infraredCutOff=1.0e-7, const int mode=2, const int useME=0)
Definition
EvtExternalGenList.cpp:86
EvtExternalGenList::m_photonType
std::string m_photonType
Definition
EvtExternalGenList.hh:53
EvtExternalGenList::m_useEvtGenRandom
bool m_useEvtGenRandom
Definition
EvtExternalGenList.hh:55
EvtExternalGenList::getListOfModels
std::list< EvtDecayBase * > getListOfModels()
Definition
EvtExternalGenList.cpp:109
EvtNoRadCorr
Definition
EvtNoRadCorr.hh:34
EvtPHOTOS
Definition
EvtPHOTOS.hh:53
EvtPythia
Definition
EvtPythia.hh:37
EvtSherpaPhotons
Definition
EvtSherpaPhotons.hh:41
EvtTauola
Definition
EvtTauola.hh:32
Generated by
1.17.0