3 #include "Pythia8/UserHooks.h"
4 #include "Pythia8/StringFragmentation.h"
17 for (Pythia8::UserHooks *hook :
hooks_) {
18 hook->initPtr(infoPtr,
29 test &= hook->initAfterBeams();
36 int nCanVetoMPIStep = 0;
37 int nCanSetResonanceScale = 0;
39 for (Pythia8::UserHooks *hook :
hooks_) {
40 if (hook->canVetoPT())
42 if (hook->canVetoStep())
44 if (hook->canVetoMPIStep())
46 if (hook->canSetResonanceScale())
47 ++nCanSetResonanceScale;
48 if (hook->canEnhanceEmission() || hook->canEnhanceTrial())
54 "Error in MultiUserHook::initAfterBeams "
55 "multiple UserHooks with canVetoPT() not allowed");
58 if (nCanVetoStep > 1) {
60 "Error in MultiUserHook::initAfterBeams "
61 "multiple UserHooks with canVetoStep() not allowed");
64 if (nCanVetoMPIStep > 1) {
66 "Error in MultiUserHook::initAfterBeams "
67 "multiple UserHooks with canVetoMPIStep() not allowed");
70 if (nCanSetResonanceScale > 1) {
72 "Error in MultiUserHook::initAfterBeams "
73 "multiple UserHooks with canSetResonanceScale() not allowed");
76 if (nCanEnhance > 1) {
78 "Error in MultiUserHook::initAfterBeams "
79 "multiple UserHooks with canEnhanceEmission() or canEnhanceTrial() not allowed");
89 for (Pythia8::UserHooks *hook :
hooks_) {
90 test |= hook->canModifySigma();
97 const Pythia8::PhaseSpace *phaseSpacePtr,
98 bool inEvent)
override {
100 for (Pythia8::UserHooks *hook :
hooks_) {
101 if (hook->canModifySigma())
102 factor *= hook->multiplySigmaBy(sigmaProcessPtr, phaseSpacePtr, inEvent);
110 for (Pythia8::UserHooks *hook :
hooks_) {
111 test |= hook->canBiasSelection();
118 const Pythia8::PhaseSpace *phaseSpacePtr,
119 bool inEvent)
override {
121 for (Pythia8::UserHooks *hook :
hooks_) {
122 if (hook->canBiasSelection())
123 factor *= hook->biasSelectionBy(sigmaProcessPtr, phaseSpacePtr, inEvent);
131 for (Pythia8::UserHooks *hook :
hooks_) {
132 if (hook->canBiasSelection())
133 factor *= hook->biasedSelectionWeight();
141 for (Pythia8::UserHooks *hook :
hooks_) {
142 test |= hook->canVetoProcessLevel();
151 for (Pythia8::UserHooks *hook :
hooks_) {
152 if (hook->canVetoProcessLevel())
161 for (Pythia8::UserHooks *hook :
hooks_) {
162 test |= hook->canVetoResonanceDecays();
171 for (Pythia8::UserHooks *hook :
hooks_) {
172 if (hook->canVetoResonanceDecays())
173 test |= hook->doVetoResonanceDecays(
event);
182 for (Pythia8::UserHooks *hook :
hooks_) {
183 test |= hook->canVetoPT();
190 for (Pythia8::UserHooks *hook :
hooks_) {
191 if (hook->canVetoPT())
192 return hook->scaleVetoPT();
202 for (Pythia8::UserHooks *hook :
hooks_) {
203 if (hook->canVetoPT())
204 return hook->doVetoPT(iPos,
event);
213 for (Pythia8::UserHooks *hook :
hooks_) {
214 test |= hook->canVetoStep();
221 for (Pythia8::UserHooks *hook :
hooks_) {
222 if (hook->canVetoStep())
223 return hook->numberVetoStep();
232 for (Pythia8::UserHooks *hook :
hooks_) {
233 if (hook->canVetoStep())
234 return hook->doVetoStep(iPos, nISR, nFSR,
event);
243 for (Pythia8::UserHooks *hook :
hooks_) {
244 test |= hook->canVetoMPIStep();
251 for (Pythia8::UserHooks *hook :
hooks_) {
252 if (hook->canVetoMPIStep())
253 return hook->numberVetoMPIStep();
261 for (Pythia8::UserHooks *hook :
hooks_) {
262 if (hook->canVetoMPIStep())
263 return hook->doVetoMPIStep(nMPI,
event);
272 for (Pythia8::UserHooks *hook :
hooks_) {
273 test |= hook->canVetoPartonLevelEarly();
282 for (Pythia8::UserHooks *hook :
hooks_) {
283 if (hook->canVetoPartonLevelEarly())
284 test |= hook->doVetoPartonLevelEarly(
event);
294 for (Pythia8::UserHooks *hook :
hooks_) {
295 test |= hook->retryPartonLevel();
303 for (Pythia8::UserHooks *hook :
hooks_) {
304 test |= hook->canVetoPartonLevel();
313 for (Pythia8::UserHooks *hook :
hooks_) {
314 if (hook->canVetoPartonLevel())
323 for (Pythia8::UserHooks *hook :
hooks_) {
324 test |= hook->canSetResonanceScale();
334 for (Pythia8::UserHooks *hook :
hooks_) {
335 if (hook->canSetResonanceScale())
336 return hook->scaleResonance(iRes,
event);
344 for (Pythia8::UserHooks *hook :
hooks_) {
345 test |= hook->canVetoISREmission();
356 for (Pythia8::UserHooks *hook :
hooks_) {
357 if (hook->canVetoISREmission())
358 test |= hook->doVetoISREmission(sizeOld,
event, iSys);
366 for (Pythia8::UserHooks *hook :
hooks_) {
367 test |= hook->canVetoFSREmission();
380 for (Pythia8::UserHooks *hook :
hooks_) {
381 if (hook->canVetoFSREmission())
382 test |= hook->doVetoFSREmission(sizeOld,
event, iSys, inResonance);
390 for (Pythia8::UserHooks *hook :
hooks_) {
391 test |= hook->canVetoMPIEmission();
401 for (Pythia8::UserHooks *hook :
hooks_) {
402 if (hook->canVetoMPIEmission())
403 test |= hook->doVetoMPIEmission(sizeOld,
event);
411 for (Pythia8::UserHooks *hook :
hooks_) {
412 test |= hook->canReconnectResonanceSystems();
424 for (Pythia8::UserHooks *hook :
hooks_) {
425 if (hook->canReconnectResonanceSystems())
426 test &= hook->doReconnectResonanceSystems(oldSizeEvt,
event);
434 for (Pythia8::UserHooks *hook :
hooks_) {
435 test |= hook->canEnhanceEmission();
444 for (Pythia8::UserHooks *hook :
hooks_) {
445 test |= hook->canEnhanceTrial();
451 for (Pythia8::UserHooks *hook :
hooks_) {
452 if (hook->canEnhanceEmission() || hook->canEnhanceTrial())
453 return hook->enhanceFactor(
str);
459 for (Pythia8::UserHooks *hook :
hooks_) {
460 if (hook->canEnhanceEmission() || hook->canEnhanceTrial())
461 return hook->vetoProbability(
str);
469 for (Pythia8::UserHooks *hook :
hooks_) {
470 test |= hook->canChangeFragPar();
478 Pythia8::StringZ *zPtr,
479 Pythia8::StringPT *pTPtr,
482 std::vector<int> iParton,
483 const Pythia8::StringEnd *SE)
override {
485 for (Pythia8::UserHooks *hook :
hooks_) {
486 if (hook->canChangeFragPar())
487 test &= hook->doChangeFragPar(flavPtr, zPtr, pTPtr, idEnd, m2Had, iParton, SE);
495 for (Pythia8::UserHooks *hook :
hooks_) {
496 if (hook->canChangeFragPar())
497 test |= hook->doVetoFragmentation(
part, SE);
505 std::vector<Pythia8::UserHooks *>
hooks_;