evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
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 
27 
28 EvtExternalGenList::EvtExternalGenList( bool convertPythiaCodes,
29  std::string pythiaXmlDir,
30  std::string photonType,
31  bool useEvtGenRandom )
32 {
33  // Instantiate the external generator factory
35 
36  // Define the external generator "engines" here
37  extFactory->definePhotosGenerator( photonType, useEvtGenRandom );
38 
39  if ( pythiaXmlDir.size() < 1 ) {
40  // If we have no string defined, check the value of the
41  // PYTHIA8DATA environment variable which should be set to the
42  // xmldoc Pythia directory
43  char* pythiaDataDir = getenv( "PYTHIA8DATA" );
44  if ( pythiaDataDir != 0 ) {
45  pythiaXmlDir = pythiaDataDir;
46  }
47  }
48 
49  extFactory->definePythiaGenerator( pythiaXmlDir, convertPythiaCodes,
50  useEvtGenRandom );
51 
52  extFactory->defineTauolaGenerator( useEvtGenRandom );
53 }
54 
56 {
57 }
58 
60 {
61  // Define the Photos model, which uses the EvtPhotosEngine class.
62  EvtPHOTOS* photosModel = new EvtPHOTOS();
63  return photosModel;
64 }
65 
66 std::list<EvtDecayBase*> EvtExternalGenList::getListOfModels()
67 {
68  // Create the Pythia and Tauola models, which use their own engine classes.
69  EvtPythia* pythiaModel = new EvtPythia();
70  EvtTauola* tauolaModel = new EvtTauola();
71 
72  std::list<EvtDecayBase*> extraModels;
73  extraModels.push_back( pythiaModel );
74  extraModels.push_back( tauolaModel );
75 
76  // Return the list of models
77  return extraModels;
78 }
static EvtExternalGenFactory * getInstance()
EvtAbsRadCorr * getPhotosModel()
EvtExternalGenList(bool convertPythiaCodes=false, std::string pythiaXmlDir="", std::string photonType="gamma", bool useEvtGenRandom=true)
void definePythiaGenerator(std::string xmlDir, bool convertPhysCodes, bool useEvtGenRandom=true)
void defineTauolaGenerator(bool useEvtGenRandom=true)
std::list< EvtDecayBase * > getListOfModels()
void definePhotosGenerator(std::string photonType="gamma", bool useEvtGenRandom=true)