StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EvtPythiaEngine.hh
1 #ifdef EVTGEN_PYTHIA
2 //--------------------------------------------------------------------------
3 //
4 // Environment:
5 // This software is part of the EvtGen package. If you use all or part
6 // of it, please give an appropriate acknowledgement.
7 //
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 2011 University of Warwick, UK
10 //
11 // Module: EvtPythiaEngine
12 //
13 // Description: Interface to the Pytha 8 external generator
14 //
15 // Modification history:
16 //
17 // John Back April 2011 Module created
18 //
19 //------------------------------------------------------------------------
20 
21 #ifndef EVTPYTHIAENGINE_HH
22 #define EVTPYTHIAENGINE_HH
23 
24 #include "EvtGenModels/EvtAbsExternalGen.hh"
25 #include "EvtGenExternal/EvtPythiaRandom.hh"
26 
27 #include "EvtGenBase/EvtId.hh"
28 #include "EvtGenBase/EvtDecayBase.hh"
29 #include "EvtGenBase/EvtParticle.hh"
30 #include "EvtGenBase/EvtVector4R.hh"
31 
32 #include "Pythia8/Pythia.h"
33 #include "Pythia8/ParticleData.h"
34 
35 #include <string>
36 #include <vector>
37 #include <map>
38 
39 class EvtPythiaEngine : public EvtAbsExternalGen {
40 
41 public:
42 
43  EvtPythiaEngine(std::string xmlDir = "./xmldoc",
44  bool convertPhysCodes = false,
45  bool useEvtGenRandom = true);
46  virtual ~EvtPythiaEngine();
47 
48  virtual bool doDecay(EvtParticle* theMother);
49 
50  virtual void initialise();
51 
52 protected:
53 
54 private:
55 
56  void updateParticleLists();
57  void updatePhysicsParameters();
58 
59  void createPythiaParticle(EvtId& particleId, int PDGCode);
60  void updatePythiaDecayTable(EvtId& particleId, int aliasInt, int PDGCode);
61  void storeDaughterInfo(EvtParticle* theParticle, int startInt);
62 
63  void clearDaughterVectors();
64  void clearPythiaModeMap();
65 
66  void createDaughterEvtParticles(EvtParticle* theParent);
67 
68  int getModeInt(EvtDecayBase* decayModel);
69 
70  Pythia8::Pythia* _genericPythiaGen;
71  Pythia8::Pythia* _aliasPythiaGen;
72  Pythia8::Pythia* _thePythiaGenerator;
73 
74  Pythia8::ParticleData _genericPartData, _aliasPartData;
75  Pythia8::ParticleData _theParticleData;
76 
77  std::vector<int> _daugPDGVector;
78  std::vector<EvtVector4R> _daugP4Vector;
79 
80  typedef std::map<int, std::vector<int> > PythiaModeMap;
81  PythiaModeMap _pythiaModeMap;
82 
83  bool _convertPhysCodes, _initialised, _useEvtGenRandom;
84 
85  EvtPythiaRandom* _evtgenRandom;
86 
87  std::map<int, int> _addedPDGCodes;
88 
89 };
90 
91 #endif
92 
93 #endif
Definition: EvtId.hh:27