PYTHIA  8.313
FragmentationModel.h
1 // FragmentationModel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2025 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for the classes involved in the modelling of
7 // fragmentation. A FragmentationModel has one main methd, fragment,
8 // which takes the color subsystem, color configuration, and
9 // event. Optional flags can be passed if the event is diffractive and
10 // if system recoil should be used in some cases. The class hold
11 // pointers to flavor, pT, and z generators, although these do not
12 // need to be used by the model. The LundFragmentation model is
13 // defined in StringFragmentation, and provides the standard Pythia
14 // fragmentation.
15 
16 #ifndef Pythia8_FragmentationModel_H
17 #define Pythia8_FragmentationModel_H
18 
19 #include "Pythia8/PhysicsBase.h"
20 #include "Pythia8/FragmentationSystems.h"
21 
22 namespace Pythia8 {
23 
24 //==========================================================================
25 
26 // FragmentationModel is the base class for handling fragmentation algorithms.
27 
29 
30 public:
31 
32  // Empty constructor.
33  FragmentationModel() = default;
34 
35  // Empty virtual destructor.
36  virtual ~FragmentationModel() {}
37 
38  // Initialize and save pointers.
39  virtual bool init(StringFlav* flavSelPtrIn = nullptr,
40  StringPT* pTSelPtrIn = nullptr, StringZ* zSelPtrIn = nullptr,
41  FragModPtr fragModPtrIn = nullptr) = 0;
42 
43  // Do the fragmentation: driver routine.
44  virtual bool fragment(int iSub, ColConfig& colConfig, Event& event,
45  bool isDiff = false, bool systemRecoil = true) = 0;
46 
47 protected:
48 
49  // Pointers to classes for flavour, pT and z generation.
51  StringPT* pTSelPtr{};
52  StringZ* zSelPtr{};
53 
54 };
55 
56 //==========================================================================
57 
58 // Forward reference to StringFragmentation and
59 // MiniStringFragmentation classes; needed in LundFragmentation class.
62 
63 //--------------------------------------------------------------------------
64 
65 // The LundFragmentation class handles the default Pythia fragmentation,
66 // using both the StringFragmentation and MiniStringFragmentation classes.
67 
69 
70 public:
71 
72  // Constructor (creates string and mini-string pointers, needed for
73  // forward declaration and factorization).
75 
76  // Destructor (deletes string and mini-string pointers).
77  ~LundFragmentation() override;
78 
79  // Initialize and save pointers.
80  bool init(StringFlav* flavSelPtrIn = nullptr,
81  StringPT* pTSelPtrIn = nullptr, StringZ* zSelPtrIn = nullptr,
82  FragModPtr fragModPtrIn = nullptr) override;
83 
84  // Do the fragmentation: driver routine.
85  bool fragment(int iSub, ColConfig& colConfig, Event& event,
86  bool isDiff = false, bool systemRecoil = true) override;
87 
88  // Internal StringFragmentation and MiniStringFragmentation objects.
89  StringFragmentation* stringFragPtr{};
90  MiniStringFragmentation* ministringFragPtr{};
91 
92 private:
93 
94  // Parameters controlling the fragmentation.
95  double mStringMin{};
96  bool tryMiniAfterFailedFrag{};
97 
98 };
99 
100 //==========================================================================
101 
102 } // end namespace Pythia8
103 
104 #endif // Pythia8_FragmentationModel_H
Definition: PhysicsBase.h:27
The Event class holds all info on the generated event.
Definition: Event.h:408
The StringPT class is used to select select transverse momenta.
Definition: FragmentationFlavZpT.h:326
Definition: StringFragmentation.h:105
The StringZ class is used to sample the fragmentation function f(z).
Definition: FragmentationFlavZpT.h:265
virtual bool fragment(int iSub, ColConfig &colConfig, Event &event, bool isDiff=false, bool systemRecoil=true)=0
Do the fragmentation: driver routine.
Definition: FragmentationModel.h:68
The ColConfig class describes the colour configuration of the whole event.
Definition: FragmentationSystems.h:60
FragmentationModel is the base class for handling fragmentation algorithms.
Definition: FragmentationModel.h:28
StringFlav * flavSelPtr
Pointers to classes for flavour, pT and z generation.
Definition: FragmentationModel.h:50
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The StringFlav class is used to select quark and hadron flavours.
Definition: FragmentationFlavZpT.h:84
Definition: MiniStringFragmentation.h:22
virtual ~FragmentationModel()
Empty virtual destructor.
Definition: FragmentationModel.h:36
FragmentationModel()=default
Empty constructor.
virtual bool init(StringFlav *flavSelPtrIn=nullptr, StringPT *pTSelPtrIn=nullptr, StringZ *zSelPtrIn=nullptr, FragModPtr fragModPtrIn=nullptr)=0
Initialize and save pointers.