File indexing completed on 2025-01-18 10:06:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Pythia8_MiniStringFragmentation_H
0010 #define Pythia8_MiniStringFragmentation_H
0011
0012 #include "Pythia8/Basics.h"
0013 #include "Pythia8/Event.h"
0014 #include "Pythia8/FragmentationFlavZpT.h"
0015 #include "Pythia8/FragmentationSystems.h"
0016 #include "Pythia8/Info.h"
0017 #include "Pythia8/ParticleData.h"
0018 #include "Pythia8/PythiaStdlib.h"
0019 #include "Pythia8/PhysicsBase.h"
0020 #include "Pythia8/Settings.h"
0021
0022 namespace Pythia8 {
0023
0024
0025
0026
0027
0028
0029
0030 class MiniStringFragmentation : public PhysicsBase {
0031
0032 public:
0033
0034
0035 MiniStringFragmentation() : flavSelPtr(), pTSelPtr(), zSelPtr(),
0036 setVertices(), constantTau(), smearOn(), nTryMass(), hadronVertex(),
0037 bLund(), xySmear(), kappaVtx(), mc(), mb(), isClosed(), mSum(), m2Sum() {}
0038
0039
0040 void init(StringFlav* flavSelPtrIn, StringPT* pTSelPtrIn,
0041 StringZ* zSelPtrIn);
0042
0043
0044 bool fragment( int iSub, ColConfig& colConfig, Event& event,
0045 bool isDiff = false, bool systemRecoil = true);
0046
0047 private:
0048
0049
0050 static const int NTRYDIFFRACTIVE, NTRYLASTRESORT, NTRYFLAV;
0051
0052
0053 StringFlav* flavSelPtr;
0054 StringPT* pTSelPtr;
0055 StringZ* zSelPtr;
0056
0057
0058 bool setVertices, constantTau, smearOn;
0059 int nTryMass, hadronVertex;
0060 double bLund, xySmear, kappaVtx, mc, mb;
0061
0062
0063 bool isClosed, isJunctionSystem;
0064 double mSum, m2Sum;
0065 Vec4 pSum;
0066 vector<int> iParton;
0067 FlavContainer flav1, flav2, flavj3;
0068
0069
0070 vector<StringVertex> ministringVertices;
0071
0072
0073 bool reduce2SimpleJunction(Event& event);
0074
0075
0076 void reduce2SimpleString(Event& event);
0077
0078
0079 bool minijunction2two(int nTry, Event& event);
0080
0081
0082 bool ministring2two( int nTry, Event& event, bool findLowMass = false);
0083
0084
0085 bool ministring2one( int iSub, ColConfig& colConfig, Event& event,
0086 bool findLowMass = false, bool systemRecoil = true);
0087
0088
0089 void setHadronVertices(Event& event, StringRegion& region,
0090 int iFirst, int iLast);
0091
0092
0093
0094
0095 struct SaveJunctionState {
0096
0097
0098 SaveJunctionState(MiniStringFragmentation& msfIn, Event& eventIn)
0099 : msf(msfIn), iParton(msfIn.iParton), event(eventIn),
0100 oldSize(eventIn.size()) {}
0101
0102 void saveMomenta() {
0103 for (int i = 1; i < int(iParton.size()); ++i) {
0104
0105 if (iParton[i] < 0) {
0106 savedMomenta[iParton[i-1]] = event[iParton[i-1]].p();
0107 }
0108 }
0109
0110 savedMomenta[iParton[iParton.size()-1]] =
0111 event[iParton[iParton.size()-1]].p();
0112 }
0113
0114
0115 ~SaveJunctionState() {
0116 if ( savedMomenta.empty() || event.size() <= oldSize ) return;
0117
0118
0119 for ( auto & mom : savedMomenta ) event[mom.first].p(mom.second);
0120 int iFirst = oldSize;
0121 int iLast = event.size() - 1;
0122 int imother = iParton.size() -1;
0123
0124 for (int ip : iParton ) {
0125 if (ip >= 0) {
0126 event[ip].statusNeg();
0127 event[ip].daughters(iFirst, iLast);
0128 }
0129 }
0130 event[iFirst].mothers(iParton[1], iParton[imother]);
0131 event[iLast].mothers(iParton[1], iParton[imother]);
0132 }
0133
0134 MiniStringFragmentation & msf;
0135 vector<int> iParton;
0136 Event & event;
0137 int np{}, oldSize{};
0138 map<int,Vec4> savedMomenta{};
0139
0140 };
0141
0142 };
0143
0144
0145
0146 }
0147
0148 #endif