10 #ifndef Pythia8_UserHooks_H
11 #define Pythia8_UserHooks_H
13 #include "Pythia8/Event.h"
14 #include "Pythia8/PartonSystems.h"
15 #include "Pythia8/PythiaStdlib.h"
16 #include "Pythia8/SigmaProcess.h"
34 virtual ~UserHooks() {}
37 void initPtr( Info* infoPtrIn, Settings* settingsPtrIn,
38 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
39 BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
40 BeamParticle* beamPomAPtrIn, BeamParticle* beamPomBPtrIn,
41 CoupSM* coupSMPtrIn, PartonSystems* partonSystemsPtrIn,
42 SigmaTotal* sigmaTotPtrIn) { infoPtr = infoPtrIn;
43 settingsPtr = settingsPtrIn; particleDataPtr = particleDataPtrIn;
44 rndmPtr = rndmPtrIn; beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
45 beamPomAPtr = beamPomAPtrIn; beamPomBPtr = beamPomBPtrIn;
46 coupSMPtr = coupSMPtrIn; partonSystemsPtr = partonSystemsPtrIn;
47 sigmaTotPtr = sigmaTotPtrIn;
48 workEvent.init(
"(work event)", particleDataPtr);}
51 virtual bool initAfterBeams() {
return true; }
54 virtual bool canModifySigma() {
return false;}
57 virtual double multiplySigmaBy(
const SigmaProcess* sigmaProcessPtr,
58 const PhaseSpace* phaseSpacePtr,
bool inEvent);
61 virtual bool canBiasSelection() {
return false;}
64 virtual double biasSelectionBy(
const SigmaProcess* sigmaProcessPtr,
65 const PhaseSpace* phaseSpacePtr,
bool inEvent);
68 virtual double biasedSelectionWeight() {
return 1./selBias;}
71 virtual bool canVetoProcessLevel() {
return false;}
75 virtual bool doVetoProcessLevel(
Event& ) {
return false;}
78 virtual bool canVetoResonanceDecays() {
return false;}
82 virtual bool doVetoResonanceDecays(
Event& ) {
return false;}
86 virtual bool canVetoPT() {
return false;}
89 virtual double scaleVetoPT() {
return 0.;}
95 virtual bool doVetoPT(
int ,
const Event& ) {
return false;}
99 virtual bool canVetoStep() {
return false;}
102 virtual int numberVetoStep() {
return 1;}
107 virtual bool doVetoStep(
int ,
int ,
int ,
const Event& ) {
return false;}
111 virtual bool canVetoMPIStep() {
return false;}
114 virtual int numberVetoMPIStep() {
return 1;}
118 virtual bool doVetoMPIStep(
int ,
const Event& ) {
return false;}
122 virtual bool canVetoPartonLevelEarly() {
return false;}
126 virtual bool doVetoPartonLevelEarly(
const Event& ) {
return false;}
131 virtual bool retryPartonLevel() {
return false;}
134 virtual bool canVetoPartonLevel() {
return false;}
138 virtual bool doVetoPartonLevel(
const Event& ) {
return false;}
141 virtual bool canSetResonanceScale() {
return false;}
146 virtual double scaleResonance(
int,
const Event& ) {
return 0.;}
149 virtual bool canVetoISREmission() {
return false;}
155 virtual bool doVetoISREmission(
int,
const Event&,
int ) {
return false;}
158 virtual bool canVetoFSREmission() {
return false;}
166 virtual bool doVetoFSREmission(
int,
const Event&,
int,
bool =
false )
170 virtual bool canVetoMPIEmission() {
return false; }
175 virtual bool doVetoMPIEmission(
int,
const Event &) {
return false; }
178 virtual bool canReconnectResonanceSystems() {
return false; }
185 virtual bool doReconnectResonanceSystems(
int,
Event &) {
return true;}
190 UserHooks() : infoPtr(0), settingsPtr(0), particleDataPtr(0), rndmPtr(0),
191 beamAPtr(0), beamBPtr(0), beamPomAPtr(0), beamPomBPtr(0), coupSMPtr(0),
192 partonSystemsPtr(0), sigmaTotPtr(0), selBias(1.) {}
198 Settings* settingsPtr;
201 ParticleData* particleDataPtr;
207 BeamParticle* beamAPtr;
208 BeamParticle* beamBPtr;
209 BeamParticle* beamPomAPtr;
210 BeamParticle* beamPomBPtr;
216 PartonSystems* partonSystemsPtr;
219 SigmaTotal* sigmaTotPtr;
222 void omitResonanceDecays(
const Event& process,
bool finalOnly =
false);
225 void subEvent(
const Event& event,
bool isHardest =
true);
242 class SuppressSmallPT :
public UserHooks {
247 SuppressSmallPT(
double pT0timesMPIIn = 1.,
int numberAlphaSIn = 0,
248 bool useSameAlphaSasMPIIn =
true) : pT20(0.) {isInit =
false;
249 pT0timesMPI = pT0timesMPIIn; numberAlphaS = numberAlphaSIn;
250 useSameAlphaSasMPI = useSameAlphaSasMPIIn;}
253 virtual bool canModifySigma() {
return true;}
257 virtual double multiplySigmaBy(
const SigmaProcess* sigmaProcessPtr,
258 const PhaseSpace* phaseSpacePtr,
bool );
263 bool isInit, useSameAlphaSasMPI;
265 double pT0timesMPI, pT20;
276 #endif // Pythia8_UserHooks_H