Belle II Software  release-08-01-10
FragmentationModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/core/Module.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <mdst/dataobjects/MCParticle.h>
14 #include <mdst/dataobjects/MCParticleGraph.h>
15 
16 #include <Pythia8/Pythia.h>
17 #include <generators/modules/fragmentation/EvtGenDecays.h>
18 
19 #include <string>
20 
21 namespace Belle2 {
29  class FragmentationRndm : public Pythia8::RndmEngine {
30 
31  public:
32  // Constructor
34 
35  // in PYTHIA, there is one pure virtual method in RndmEngine,
36  // to generate one random number flat in the range between 0 and 1:
37  double flat();
39  private:
40 
41  };
42 
43 
49  class FragmentationModule : public Module {
50 
51  public:
57 
59  virtual ~FragmentationModule();
60 
61  virtual void event() override;
62  virtual void initialize() override;
63  virtual void terminate() override;
65  protected:
66 
71  void loadEvtGenParticleData(Pythia8::Pythia* pythia);
72 
77  int addParticleToPYTHIA(const MCParticle& mcParticle);
78 
80  Pythia8::Pythia* m_Pythia = nullptr;
81 
83  Pythia8::Event* m_PythiaEvent = nullptr;
84 
88  std::string m_parameterfile;
91  std::string m_DecFile;
92  std::string m_UserDecFile;
97  int nAll;
98  int nGood;
100  int nAdded;
101  int nQuarks;
102  int nVpho;
104  std::string m_particleList;
106  };
107 
109 } // end namespace Belle2
The Fragmentation module.
EvtGenDecays * evtgen
EvtGen decay engine inside PYTHIA8.
int nGood
number of events with successful fragmentation.
void loadEvtGenParticleData(Pythia8::Pythia *pythia)
Load EvtGen particle data.
bool m_coherentMixing
decay the B0-B0bar coherently.
int nVpho
number of virtual exchange particles.
virtual void initialize() override
Initialize the module.
virtual void event() override
Event method (process events)
Pythia8::Pythia * m_Pythia
Pythia generator.
StoreArray< MCParticle > m_mcparticles
store array for the MCParticles
virtual ~FragmentationModule()
Destructor.
virtual void terminate() override
terminate the module
Pythia8::Event * m_PythiaEvent
Pythia event.
int addParticleToPYTHIA(const MCParticle &mcParticle)
Add particle to Pythia event.
std::string m_DecFile
EvtGen decay file.
int m_useEvtGen
use EvtGen for some decays.
int nAll
number of events created.
std::string m_UserDecFile
User EvtGen decay file.
std::string m_particleList
The name of the MCParticle collection.
MCParticleGraph mcParticleGraph
An instance of the MCParticle graph.
std::string m_parameterfile
Module parameters.
int nAdded
number of added particles.
int m_listEvent
list event generated by PYTHIA.
Minimal class for external random generator to be used in PYTHIA.
double flat()
flat random generator.
Class to build, validate and sort a particle decay chain.
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Base class for Modules.
Definition: Module.h:72
A class to perform decays via the external EvtGen decay program, see http://evtgen....
Definition: EvtGenDecays.h:88
Abstract base class for different kinds of events.