EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
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
22
24
30
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
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
60
61#ifdef EVTGEN_PHOTOS
63 const double maxWtInterference )
64{
65 // Define the Photos model, which uses the EvtPHOTOS class.
67 infraredCutOff, maxWtInterference );
68 return photosModel;
69}
70#else
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
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
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
109std::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}
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_ERROR
Definition EvtReport.hh:49
static EvtExternalGenFactory & getInstance()
void defineTauolaGenerator(bool useEvtGenRandom=true, bool seedTauolaFortran=true)
void definePythiaGenerator(std::string xmlDir, bool convertPhysCodes, bool useEvtGenRandom=true)
EvtExternalGenList(bool convertPythiaCodes=false, std::string pythiaXmlDir="", std::string photonType="gamma", bool useEvtGenRandom=true, bool seedTauolaFortran=true)
EvtAbsRadCorr * getPhotosModel(const double infraredCutOff=1.0e-7, const double maxWtInterference=64.0)
EvtAbsRadCorr * getSherpaPhotonsModel(const double infraredCutOff=1.0e-7, const int mode=2, const int useME=0)
std::list< EvtDecayBase * > getListOfModels()