File indexing completed on 2025-09-18 09:25:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Pythia8_HadronLevel_H
0010 #define Pythia8_HadronLevel_H
0011
0012 #include "Pythia8/Basics.h"
0013 #include "Pythia8/BoseEinstein.h"
0014 #include "Pythia8/ColourTracing.h"
0015 #include "Pythia8/DeuteronProduction.h"
0016 #include "Pythia8/Event.h"
0017 #include "Pythia8/FragmentationFlavZpT.h"
0018 #include "Pythia8/FragmentationSystems.h"
0019 #include "Pythia8/HadronWidths.h"
0020 #include "Pythia8/HiddenValleyFragmentation.h"
0021 #include "Pythia8/Info.h"
0022 #include "Pythia8/JunctionSplitting.h"
0023 #include "Pythia8/LowEnergyProcess.h"
0024 #include "Pythia8/SigmaLowEnergy.h"
0025 #include "Pythia8/NucleonExcitations.h"
0026 #include "Pythia8/ParticleData.h"
0027 #include "Pythia8/ParticleDecays.h"
0028 #include "Pythia8/PartonVertex.h"
0029 #include "Pythia8/PhysicsBase.h"
0030 #include "Pythia8/PythiaStdlib.h"
0031 #include "Pythia8/RHadrons.h"
0032 #include "Pythia8/Settings.h"
0033 #include "Pythia8/StringFragmentation.h"
0034 #include "Pythia8/TimeShower.h"
0035 #include "Pythia8/UserHooks.h"
0036
0037 namespace Pythia8 {
0038
0039
0040
0041
0042
0043
0044 class HadronLevel : public PhysicsBase {
0045
0046 public:
0047
0048
0049 HadronLevel() = default;
0050
0051
0052 bool init( TimeShowerPtr timesDecPtrIn, RHadronsPtr rHadronsPtrIn,
0053 LundFragmentationPtr fragPtrIn, vector<FragmentationModelPtr>* fragPtrsIn,
0054 DecayHandlerPtr decayHandlePtr, vector<int> handledParticles,
0055 StringIntPtr stringInteractionsPtrIn, PartonVertexPtr partonVertexPtrIn,
0056 SigmaLowEnergy& sigmaLowEnergyIn,
0057 NucleonExcitations& nucleonExcitationsIn);
0058
0059
0060 StringFlav* getStringFlavPtr() {return &flavSel;}
0061
0062
0063 bool next(Event& event);
0064
0065
0066 bool decay( int iDec, Event& event) { return
0067 (event[iDec].isFinal() && event[iDec].canDecay() && event[iDec].mayDecay())
0068 ? decays.decay( iDec, event) : true;}
0069
0070
0071 bool moreDecays(Event& event);
0072
0073
0074 bool rescatter(Event& event);
0075
0076
0077 bool initLowEnergyProcesses();
0078 int pickLowEnergyProcess(int idA, int idB, double eCM, double mA, double mB);
0079
0080
0081 bool doLowEnergyProcess(int i1, int i2, int procTypeIn, Event& event) {
0082 if (!lowEnergyProcess.collide( i1, i2, procTypeIn, event)) {
0083 loggerPtr->ERROR_MSG("low energy collision failed");
0084 return false;
0085 }
0086 return true;
0087 }
0088
0089
0090 bool hasVetoedHadronize() const {return doHadronizeVeto; }
0091
0092 protected:
0093
0094 virtual void onInitInfoPtr() override{
0095 registerSubObject(flavSel);
0096 registerSubObject(pTSel);
0097 registerSubObject(zSel);
0098 registerSubObject(decays);
0099 registerSubObject(lowEnergyProcess);
0100 registerSubObject(boseEinstein);
0101 registerSubObject(junctionSplitting);
0102 registerSubObject(deuteronProd);
0103 }
0104
0105 private:
0106
0107
0108 static const double MTINY;
0109
0110
0111 bool doHadronize{}, doDecay{}, doPartonVertex{}, doBoseEinstein{},
0112 doDeuteronProd{}, allowRH{}, closePacking{}, doNonPertAll{},
0113 doQED;
0114 double pNormJunction{}, widthSepBE{}, widthSepRescatter{};
0115 vector<int> nonPertProc{};
0116
0117
0118 ColConfig colConfig;
0119
0120
0121 vector<int> iParton{}, iJunLegA{}, iJunLegB{}, iJunLegC{},
0122 iAntiLegA{}, iAntiLegB{}, iAntiLegC{}, iGluLeg{};
0123 vector<double> m2Pair{};
0124
0125
0126 ParticleDecays decays;
0127
0128
0129 TimeShowerPtr timesDecPtr;
0130
0131
0132 BoseEinstein boseEinstein;
0133
0134
0135 DeuteronProduction deuteronProd;
0136
0137
0138 StringFlav flavSel;
0139 StringPT pTSel;
0140 StringZ zSel;
0141
0142
0143 ColourTracing colTrace;
0144
0145
0146 JunctionSplitting junctionSplitting;
0147
0148
0149 RHadronsPtr rHadronsPtr{};
0150
0151
0152
0153 LundFragmentationPtr fragPtr{};
0154
0155
0156
0157 vector<FragmentationModelPtr>* fragPtrs{};
0158
0159
0160 bool decayOctetOnia(Event& event);
0161
0162
0163
0164 bool findSinglets(Event& event, bool keepJunctions = false);
0165
0166
0167 PartonVertexPtr partonVertexPtr;
0168
0169
0170 class PriorityNode;
0171 bool doRescatter{}, scatterManyTimes{}, scatterQuickCheck{},
0172 scatterNeighbours{}, delayRegeneration{};
0173 double b2Max, tauRegeneration{};
0174 void queueDecResc(Event& event, int iStart,
0175 priority_queue<HadronLevel::PriorityNode>& queue);
0176 int boostDir;
0177 double boost;
0178 bool doBoost;
0179 bool useVelocityFrame;
0180
0181
0182 bool doHadronizeVeto;
0183
0184
0185 LowEnergyProcess lowEnergyProcess;
0186 int impactModel{};
0187 double impactOpacity{};
0188
0189
0190 SigmaLowEnergy* sigmaLowEnergyPtr = {};
0191
0192
0193 NucleonExcitations* nucleonExcitationsPtr = {};
0194
0195
0196 StringRepPtr stringRepulsionPtr;
0197 FragModPtr fragmentationModifierPtr;
0198
0199
0200 vector< vector< pair<double,double> > > rapidityPairs(Event& event);
0201
0202
0203 double yMax(Particle pIn, double mTiny) {
0204 double temp = log( ( pIn.e() + abs(pIn.pz()) ) / max( mTiny, pIn.mT()) );
0205 return (pIn.pz() > 0) ? temp : -temp; }
0206 double yMax(Vec4 pIn, double mTiny) {
0207 double mTemp = pIn.m2Calc() + pIn.pT2();
0208 mTemp = (mTemp >= 0.) ? sqrt(mTemp) : -sqrt(-mTemp);
0209 double temp = log( ( pIn.e() + abs(pIn.pz()) ) / max( mTiny, mTemp) );
0210 return (pIn.pz() > 0) ? temp : -temp; }
0211
0212
0213 WeightsFragmentation* wgtsPtr{};
0214
0215 };
0216
0217
0218
0219 }
0220
0221 #endif