9 #ifndef Pythia8_PartonLevel_H
10 #define Pythia8_PartonLevel_H
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BeamParticle.h"
14 #include "Pythia8/BeamRemnants.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/HardDiffraction.h"
17 #include "Pythia8/Info.h"
18 #include "Pythia8/JunctionSplitting.h"
19 #include "Pythia8/MergingHooks.h"
20 #include "Pythia8/MultipartonInteractions.h"
21 #include "Pythia8/ParticleData.h"
22 #include "Pythia8/PartonSystems.h"
23 #include "Pythia8/PartonVertex.h"
24 #include "Pythia8/PhysicsBase.h"
25 #include "Pythia8/PythiaStdlib.h"
26 #include "Pythia8/ResonanceDecays.h"
27 #include "Pythia8/RHadrons.h"
28 #include "Pythia8/Settings.h"
29 #include "Pythia8/Settings.h"
30 #include "Pythia8/SharedPointers.h"
31 #include "Pythia8/SigmaTotal.h"
32 #include "Pythia8/SpaceShower.h"
33 #include "Pythia8/StandardModel.h"
34 #include "Pythia8/StringLength.h"
35 #include "Pythia8/TimeShower.h"
36 #include "Pythia8/UserHooks.h"
45 class PartonLevel :
public PhysicsBase {
50 PartonLevel() =
default;
53 bool init( TimeShowerPtr timesDecPtrIn, TimeShowerPtr timesPtrIn,
54 SpaceShowerPtr spacePtrIn, RHadrons* rHadronsPtrIn,
55 MergingHooksPtr mergingHooksPtr, PartonVertexPtr partonVertexPtrIn,
56 StringIntPtr stringInteractionPtrIn,
63 void setupShowerSys(
Event& process,
Event& event);
64 bool resonanceShowers(
Event& process,
Event& event,
bool skipForR);
67 bool wzDecayShowers(
Event& event);
70 bool hasVetoed()
const {
return doVeto;}
71 bool hasVetoedDiff()
const {
return doDiffVeto;}
74 void accumulate() {
if (isResolved && !isDiff) multiPtr->accumulate();}
75 void statistics(
bool reset =
false) {
76 if (doMPI) multiMB.statistics(reset);}
77 void resetStatistics() {
if (doMPI) multiMB.resetStatistics(); }
82 double pTLastInShower() {
return pTLastBranch; }
84 int typeLastInShower() {
return typeLastBranch; }
87 bool canEnhanceTrial() {
88 if (userHooksPtr)
return userHooksPtr->canEnhanceTrial();
92 double getEnhancedTrialPT() {
93 if (canEnhanceTrial())
return userHooksPtr->getEnhancedTrialPT();
97 double getEnhancedTrialWeight() {
98 if (canEnhanceTrial())
return userHooksPtr->getEnhancedTrialWeight();
103 BeamParticle* beamHadAPtr{};
104 BeamParticle* beamHadBPtr{};
107 TimeShowerPtr timesDecPtr{};
108 TimeShowerPtr timesPtr{};
111 SpaceShowerPtr spacePtr{};
115 virtual void onInitInfoPtr()
override {
116 registerSubObject(multiMB);
117 registerSubObject(multiSDA);
118 registerSubObject(multiSDB);
119 registerSubObject(multiCD);
120 registerSubObject(multiGmGm);
121 registerSubObject(remnants);
122 registerSubObject(resonanceDecays);
123 registerSubObject(junctionSplitting);
124 registerSubObject(hardDiffraction);
130 static const int NTRY;
133 bool doNonDiff{}, doDiffraction{}, doMPI{}, doMPIMB{}, doMPISDA{},
134 doMPISDB{}, doMPICD{}, doMPIinit{}, doISR{}, doFSRduringProcess{},
135 doFSRafterProcess{}, doFSRinResonances{}, doRemnants{},
136 doSecondHard{}, hasOneLeptonBeam{}, hasTwoLeptonBeams{},
137 hasPointLeptons{}, canVetoPT{}, canVetoStep{}, canVetoMPIStep{},
138 canVetoEarly{}, canSetScale{}, allowRH{}, earlyResDec{},
139 vetoWeakJets{}, canReconResSys{}, doReconnect{}, doHardDiff{},
140 forceResonanceCR{}, doNDgamma{}, doMPIgmgm{}, showUnresGamma{};
142 double mMinDiff{}, mWidthDiff{}, pMaxDiff{}, vetoWeakDeltaR2{};
146 int nMPI{}, nISR{}, nFSRinProc{}, nFSRinRes{}, nISRhard{}, nFSRhard{},
147 typeLatest{}, nVetoStep{}, typeVetoStep{}, nVetoMPIStep{}, iSysNow{},
148 reconnectMode{}, hardDiffSide{}, sampleTypeDiff{};
149 double pTsaveMPI{}, pTsaveISR{}, pTsaveFSR{}, pTvetoPT{};
152 bool isNonDiff{}, isDiffA{}, isDiffB{}, isDiffC{}, isDiff{},
153 isSingleDiff{}, isDoubleDiff{}, isCentralDiff{},
154 isResolved{}, isResolvedA{}, isResolvedB{}, isResolvedC{},
155 isHardDiffA{}, isHardDiffB{}, isHardDiff{}, doDiffVeto{},
156 hardDiffSet{}, isElastic{}, twoHard{};
157 int sizeProcess{}, sizeEvent{}, nHardDone{}, nHardDoneRHad{}, iDS{};
159 vector<bool> inRHadDecay;
160 vector<int> iPosBefShow;
163 bool hasGammaA{}, hasGammaB{}, beamHasGamma{}, beamAisGamma{},
164 beamBisGamma{}, beamAhasGamma{}, beamBhasGamma{}, beamAhasResGamma{},
165 beamBhasResGamma{}, beamHasResGamma{}, isGammaHadronDir{},
167 int gammaMode{}, gammaModeEvent{}, gammaOffset{};
168 double eCMsaveGamma{};
171 PartonVertexPtr partonVertexPtr{};
174 MultipartonInteractions multiMB;
175 MultipartonInteractions multiSDA;
176 MultipartonInteractions multiSDB;
177 MultipartonInteractions multiCD;
178 MultipartonInteractions* multiPtr{};
179 MultipartonInteractions multiGmGm;
182 BeamRemnants remnants;
185 RHadrons* rHadronsPtr{};
188 ResonanceDecays resonanceDecays;
191 ColRecPtr colourReconnectionPtr{};
194 JunctionSplitting junctionSplitting;
197 HardDiffraction hardDiffraction;
200 int decideResolvedDiff(
Event& process);
203 bool setupUnresolvedSys(
Event& process,
Event& event);
206 void setupHardSys(
Event& process,
Event& event);
209 void setupResolvedDiff(
Event& process);
212 void leaveResolvedDiff(
int iHardLoop,
Event& process,
Event& event);
215 void setupHardDiff(
Event& process);
218 void leaveHardDiff(
Event& process,
Event& event,
bool physical =
true);
221 bool setupResolvedLeptonGamma(
Event& process);
225 void leaveResolvedLeptonGamma(
Event& process,
Event& event,
226 bool physical =
true);
229 void cleanEventFromGamma(
Event& event);
232 MergingHooksPtr mergingHooksPtr{};
235 int nTrialEmissions{};
237 double pTLastBranch{};
238 int typeLastBranch{};
240 bool canRemoveEvent{}, canRemoveEmission{};
248 #endif // Pythia8_PartonLevel_H