Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Environment:
4 : // This software is part of the EvtGen package. If you use all or part
5 : // of it, please give an appropriate acknowledgement.
6 : //
7 : // Copyright Information: See EvtGen/COPYRIGHT
8 : // Copyright (C) 2012 University of Warwick, UK
9 : //
10 : // Module: EvtExternalGenFactory
11 : //
12 : // Description: A factory type method to create engines for external physics
13 : // generators like Pythia.
14 : //
15 : // Modification history:
16 : //
17 : // John Back Sept 2012 Module created
18 : //
19 : //------------------------------------------------------------------------------
20 : //
21 : #include <TSystem.h>
22 : #include "EvtGenExternal/EvtExternalGenList.hh"
23 :
24 : #include "EvtGenExternal/EvtExternalGenFactory.hh"
25 : #include "EvtGenExternal/EvtPHOTOS.hh"
26 : #include "EvtGenExternal/EvtPythia.hh"
27 : #include "EvtGenExternal/EvtTauola.hh"
28 :
29 : EvtExternalGenList::EvtExternalGenList(bool convertPythiaCodes, std::string pythiaXmlDir,
30 0 : std::string photonType, bool useEvtGenRandom) {
31 :
32 : // Instantiate the external generator factory
33 0 : EvtExternalGenFactory* extFactory = EvtExternalGenFactory::getInstance();
34 :
35 : // Define the external generator "engines" here
36 0 : extFactory->definePhotosGenerator(photonType, useEvtGenRandom);
37 :
38 0 : if (pythiaXmlDir.size() < 1) {
39 : // If we have no string defined, check the value of the
40 : // PYTHIA8DATA environment variable which should be set to the
41 : // xmldoc Pythia directory
42 0 : char* pythiaDataDir = getenv("PYTHIA8DATA");
43 0 : if (pythiaDataDir != 0) {pythiaXmlDir = pythiaDataDir;}
44 0 : }
45 :
46 0 : extFactory->definePythiaGenerator(pythiaXmlDir, convertPythiaCodes,
47 : useEvtGenRandom);
48 :
49 0 : extFactory->defineTauolaGenerator(useEvtGenRandom);
50 :
51 0 : }
52 :
53 0 : EvtExternalGenList::~EvtExternalGenList() {
54 0 : }
55 :
56 : EvtAbsRadCorr* EvtExternalGenList::getPhotosModel() {
57 :
58 : // Define the Photos model, which uses the EvtPhotosEngine class.
59 0 : EvtPHOTOS* photosModel = new EvtPHOTOS();
60 0 : return photosModel;
61 :
62 0 : }
63 :
64 : std::list<EvtDecayBase*> EvtExternalGenList::getListOfModels() {
65 :
66 : // Create the Pythia and Tauola models, which use their own engine classes.
67 0 : EvtPythia* pythiaModel = new EvtPythia();
68 0 : EvtTauola* tauolaModel = new EvtTauola();
69 :
70 0 : std::list<EvtDecayBase*> extraModels;
71 0 : extraModels.push_back(pythiaModel);
72 0 : extraModels.push_back(tauolaModel);
73 :
74 : // Return the list of models
75 : return extraModels;
76 :
77 0 : }
|