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
EvtPythiaEngine.hh
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#ifdef EVTGEN_PYTHIA
22
23#ifndef EVTPYTHIAENGINE_HH
24#define EVTPYTHIAENGINE_HH
25
27#include "EvtGenBase/EvtId.hh"
30
32
34
35#include "Pythia8/ParticleData.h"
36#include "Pythia8/Pythia.h"
37
38#include <map>
39#include <memory>
40#include <string>
41#include <vector>
42
43// Description: Interface to the Pytha 8 external generator
44
46 public:
47 EvtPythiaEngine( std::string xmlDir = "./xmldoc",
48 bool convertPhysCodes = false, bool useEvtGenRandom = true );
49
50 bool doDecay( EvtParticle* theMother ) override;
51
52 void initialise() override;
53
54 protected:
55 private:
58
59 bool validPDGCode( int PDGCode );
60 void createPythiaParticle( Pythia8::Pythia& thePythiaGenerator,
61 EvtId& particleId, int PDGCode );
62 void updatePythiaDecayTable( Pythia8::Pythia& thePythiaGenerator,
63 EvtId& particleId, int aliasInt, int PDGCode );
64 void storeDaughterInfo( Pythia8::Event& theEvent, EvtParticle* theParticle,
65 int startInt );
66
68 void clearPythiaModeMap();
69
70 void createDaughterEvtParticles( EvtParticle* theParent );
71
72 int getModeInt( EvtDecayBase* decayModel );
73
75 // Specify if we are going to use the random number generator (engine) from EvtGen for Pythia 8.
77 bool m_initialised{ false };
78
79 std::unique_ptr<Pythia8::Pythia> m_genericPythiaGen;
80 std::unique_ptr<Pythia8::Pythia> m_aliasPythiaGen;
81
82 std::shared_ptr<EvtPythiaRandom> m_evtgenRandom;
83
84 std::vector<int> m_daugPDGVector;
85 std::vector<EvtVector4R> m_daugP4Vector;
86
87 std::map<int, std::vector<int>> m_pythiaModeMap;
88
89 std::map<int, int> m_addedPDGCodes;
90};
91
92#endif
93
94#endif
Definition EvtId.hh:27
void updatePythiaDecayTable(Pythia8::Pythia &thePythiaGenerator, EvtId &particleId, int aliasInt, int PDGCode)
std::shared_ptr< EvtPythiaRandom > m_evtgenRandom
int getModeInt(EvtDecayBase *decayModel)
EvtPythiaEngine(std::string xmlDir="./xmldoc", bool convertPhysCodes=false, bool useEvtGenRandom=true)
void initialise() override
std::map< int, int > m_addedPDGCodes
std::map< int, std::vector< int > > m_pythiaModeMap
bool validPDGCode(int PDGCode)
std::unique_ptr< Pythia8::Pythia > m_aliasPythiaGen
void createPythiaParticle(Pythia8::Pythia &thePythiaGenerator, EvtId &particleId, int PDGCode)
void createDaughterEvtParticles(EvtParticle *theParent)
std::unique_ptr< Pythia8::Pythia > m_genericPythiaGen
bool doDecay(EvtParticle *theMother) override
std::vector< int > m_daugPDGVector
std::vector< EvtVector4R > m_daugP4Vector
void storeDaughterInfo(Pythia8::Event &theEvent, EvtParticle *theParticle, int startInt)