10 #ifndef Pythia8_UserHooks_H 11 #define Pythia8_UserHooks_H 13 #include "Pythia8/Event.h" 14 #include "Pythia8/PartonSystems.h" 15 #include "Pythia8/PhysicsBase.h" 16 #include "Pythia8/PythiaStdlib.h" 17 #include "Pythia8/SigmaProcess.h" 47 const PhaseSpace* phaseSpacePtr,
bool inEvent);
54 const PhaseSpace* phaseSpacePtr,
bool inEvent);
198 double, vector<int>,
const StringEnd* ) {
return false;}
271 bool useSameAlphaSasMPIIn =
true) : pT20(0.) {isInit =
false;
272 pT0timesMPI = pT0timesMPIIn; numberAlphaS = numberAlphaSIn;
273 useSameAlphaSasMPI = useSameAlphaSasMPIIn;}
286 bool isInit, useSameAlphaSasMPI;
288 double pT0timesMPI, pT20;
314 int nCanSetResonanceScale = 0;
315 int nCanChangeFragPar = 0;
316 int nCanSetImpactParameter = 0;
317 for (
int i = 0, N = hooks.size(); i < N; ++i ) {
324 if (nCanSetResonanceScale > 1) {
326 "multiple UserHooks with canSetResonanceScale() not allowed");
329 if (nCanChangeFragPar > 1) {
331 "multiple UserHooks with canChangeFragPar() not allowed");
334 if (nCanSetImpactParameter > 1) {
336 "multiple UserHooks with canSetImpactParameter() not allowed");
344 for (
int i = 0, N = hooks.size(); i < N; ++i )
351 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
353 for (
int i = 0, N = hooks.size(); i < N; ++i )
355 f *= hooks[i]->
multiplySigmaBy(sigmaProcessPtr, phaseSpacePtr,inEvent);
361 for (
int i = 0, N = hooks.size(); i < N; ++i )
368 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
370 for (
int i = 0, N = hooks.size(); i < N; ++i )
380 for (
int i = 0, N = hooks.size(); i < N; ++i )
388 for (
int i = 0, N = hooks.size(); i < N; ++i )
396 for (
int i = 0, N = hooks.size(); i < N; ++i )
398 hooks[i]->doVetoProcessLevel(e) )
return true;
404 for (
int i = 0, N = hooks.size(); i < N; ++i )
412 for (
int i = 0, N = hooks.size(); i < N; ++i )
414 hooks[i]->doVetoResonanceDecays(e) )
return true;
421 for (
int i = 0, N = hooks.size(); i < N; ++i )
422 if ( hooks[i]->
canVetoPT() )
return true;
429 for (
int i = 0, N = hooks.size(); i < N; ++i )
439 for (
int i = 0, N = hooks.size(); i < N; ++i )
440 if ( hooks[i]->
canVetoPT() && hooks[i]->doVetoPT(iPos, e) )
return true;
447 for (
int i = 0, N = hooks.size(); i < N; ++i )
455 for (
int i = 0, N = hooks.size(); i < N; ++i )
464 for (
int i = 0, N = hooks.size(); i < N; ++i )
466 && hooks[i]->doVetoStep(iPos, nISR, nFSR, e) )
return true;
473 for (
int i = 0, N = hooks.size(); i < N; ++i )
481 for (
int i = 0, N = hooks.size(); i < N; ++i )
490 for (
int i = 0, N = hooks.size(); i < N; ++i )
491 if ( hooks[i]->
canVetoMPIStep() && hooks[i]->doVetoMPIStep(nMPI, e) )
499 for (
int i = 0, N = hooks.size(); i < N; ++i )
507 for (
int i = 0, N = hooks.size(); i < N; ++i )
509 && hooks[i]->doVetoPartonLevelEarly(e) )
return true;
517 for (
int i = 0, N = hooks.size(); i < N; ++i )
524 for (
int i = 0, N = hooks.size(); i < N; ++i )
532 for (
int i = 0, N = hooks.size(); i < N; ++i )
534 && hooks[i]->doVetoPartonLevel(e) )
return true;
540 for (
int i = 0, N = hooks.size(); i < N; ++i )
550 for (
int i = 0, N = hooks.size(); i < N; ++i )
558 for (
int i = 0, N = hooks.size(); i < N; ++i )
568 for (
int i = 0, N = hooks.size(); i < N; ++i )
570 && hooks[i]->doVetoISREmission(sizeOld, e, iSys) )
return true;
576 for (
int i = 0, N = hooks.size(); i < N; ++i )
588 int iSys,
bool inResonance =
false ) {
589 for (
int i = 0, N = hooks.size(); i < N; ++i )
591 && hooks[i]->doVetoFSREmission(sizeOld, e, iSys, inResonance) )
598 for (
int i = 0, N = hooks.size(); i < N; ++i )
607 for (
int i = 0, N = hooks.size(); i < N; ++i )
609 && hooks[i]->doVetoMPIEmission(sizeOld, e) )
616 for (
int i = 0, N = hooks.size(); i < N; ++i )
627 for (
int i = 0, N = hooks.size(); i < N; ++i )
629 && hooks[i]->doReconnectResonanceSystems(j, e) )
return true;
635 for (
int i = 0, N = hooks.size(); i < N; ++i )
645 for (
int i = 0, N = hooks.size(); i < N; ++i )
653 StringPT* ptIn,
int idIn,
double mIn, vector<int> parIn,
655 for (
int i = 0, N = hooks.size(); i < N; ++i )
657 && hooks[i]->doChangeFragPar(sfIn, zIn, ptIn, idIn,
658 mIn, parIn, endIn) )
return true;
663 for (
int i = 0, N = hooks.size(); i < N; ++i )
665 && hooks[i]->doVetoFragmentation(p, nowEnd) )
return true;
671 for (
int i = 0, N = hooks.size(); i < N; ++i )
673 && hooks[i]->doVetoFragmentation(p1, p2, e1, e2) )
return true;
681 for (
int i = 0, N = hooks.size(); i < N; ++i )
688 for (
int i = 0, N = hooks.size(); i < N; ++i )
690 && hooks[i]->doVetoAfterHadronization(e) )
return true;
696 for (
int i = 0, N = hooks.size(); i < N; ++i )
703 for (
int i = 0, N = hooks.size(); i < N; ++i )
710 vector< shared_ptr<UserHooks> > hooks = {};
virtual bool canBiasSelection()
Possibility to bias selection of events, compensated by a weight.
Definition: UserHooks.h:50
virtual int numberVetoStep()
Up to how many ISR + FSR steps of hardest interaction should be checked.
Definition: UserHooks.h:453
virtual double scaleVetoPT()
Transverse-momentum scale for veto test.
Definition: UserHooks.h:87
virtual int numberVetoStep()
Up to how many ISR + FSR steps of hardest interaction should be checked.
Definition: UserHooks.h:100
virtual bool canVetoPT()
Definition: UserHooks.h:420
virtual double scaleVetoPT()
Transverse-momentum scale for veto test.
Definition: UserHooks.h:427
virtual bool canVetoPartonLevelEarly()
Definition: UserHooks.h:120
virtual double multiplySigmaBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent)
Multiplicative factor modifying the cross section of a hard process.
Definition: UserHooks.cc:27
Definition: StandardModel.h:23
UserHooksVector()
Definition: UserHooks.h:305
Definition: PhysicsBase.h:27
virtual bool canModifySigma()
Possibility to modify cross section of process.
Definition: UserHooks.h:276
void registerSubObject(PhysicsBase &pb)
Register a sub object that should have its information in sync with this.
Definition: PhysicsBase.cc:56
virtual double doSetImpactParameter()
Set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:702
The Event class holds all info on the generated event.
Definition: Event.h:453
UserHooks()
Constructor.
Definition: UserHooks.h:232
virtual bool doVetoISREmission(int sizeOld, const Event &e, int iSys)
Definition: UserHooks.h:567
virtual bool retryPartonLevel()
Definition: UserHooks.h:129
virtual bool onEndHadronLevel(HadronLevel &, Event &)
Custom processing at the end of HadronLevel::next.
Definition: UserHooks.h:227
SigmaProcess is the base class for cross section calculations.
Definition: SigmaProcess.h:86
virtual bool doVetoPT(int iPos, const Event &e)
Definition: UserHooks.h:438
virtual bool doVetoPartonLevel(const Event &e)
Definition: UserHooks.h:531
virtual bool doVetoMPIStep(int nMPI, const Event &e)
Definition: UserHooks.h:489
virtual double biasedSelectionWeight()
Event weight to compensate for selection weight above.
Definition: UserHooks.h:378
virtual bool doChangeFragPar(StringFlav *, StringZ *, StringPT *, int, double, vector< int >, const StringEnd *)
Definition: UserHooks.h:197
virtual bool canVetoProcessLevel()
Possibility to veto event after process-level selection.
Definition: UserHooks.h:387
virtual void setStringEnds(const StringEnd *, const StringEnd *, vector< int >)
Definition: UserHooks.h:191
The StringPT class is used to select select transverse momenta.
Definition: FragmentationFlavZpT.h:322
virtual bool canVetoMPIEmission()
Possibility to veto an MPI.
Definition: UserHooks.h:597
virtual bool doVetoStep(int iPos, int nISR, int nFSR, const Event &e)
Definition: UserHooks.h:463
virtual bool canVetoStep()
Definition: UserHooks.h:446
virtual bool canVetoAfterHadronization()
Definition: UserHooks.h:680
virtual bool canSetResonanceScale()
Possibility to set initial scale in TimeShower for resonance decay.
Definition: UserHooks.h:139
virtual bool doVetoMPIStep(int, const Event &)
Definition: UserHooks.h:116
virtual bool doVetoFSREmission(int, const Event &, int, bool=false)
Definition: UserHooks.h:164
virtual bool doVetoPartonLevelEarly(const Event &)
Definition: UserHooks.h:124
virtual ~UserHooks()
Destructor.
Definition: UserHooks.h:37
virtual int numberVetoMPIStep()
Up to how many MPI steps should be checked.
Definition: UserHooks.h:112
virtual void setStringEnds(const StringEnd *pos, const StringEnd *neg, vector< int > iPart)
Definition: UserHooks.h:643
virtual bool doVetoFSREmission(int sizeOld, const Event &e, int iSys, bool inResonance=false)
Definition: UserHooks.h:587
virtual bool doVetoResonanceDecays(Event &)
Definition: UserHooks.h:80
virtual bool doChangeFragPar(StringFlav *sfIn, StringZ *zIn, StringPT *ptIn, int idIn, double mIn, vector< int > parIn, const StringEnd *endIn)
Definition: UserHooks.h:652
virtual bool doVetoResonanceDecays(Event &e)
Definition: UserHooks.h:411
Definition: UserHooks.h:265
virtual double biasedSelectionWeight()
Event weight to compensate for selection weight above.
Definition: UserHooks.h:57
virtual bool doVetoPT(int, const Event &)
Definition: UserHooks.h:93
ParticleData * particleDataPtr
Pointer to the particle data table.
Definition: PhysicsBase.h:84
virtual bool doVetoAfterHadronization(const Event &e)
Do the actual veto after hadronization.
Definition: UserHooks.h:687
virtual bool initAfterBeams()
Definition: UserHooks.h:313
virtual bool canVetoISREmission()
Possibility to veto an emission in the ISR machinery.
Definition: UserHooks.h:147
The StringZ class is used to sample the fragmentation function f(z).
Definition: FragmentationFlavZpT.h:264
virtual bool canVetoResonanceDecays()
Possibility to veto resonance decay chain.
Definition: UserHooks.h:403
virtual double scaleResonance(int, const Event &)
Definition: UserHooks.h:144
virtual bool canVetoPartonLevel()
Possibility to veto event after parton-level selection.
Definition: UserHooks.h:523
Definition: HadronLevel.h:45
virtual bool canVetoMPIEmission()
Possibility to veto an MPI.
Definition: UserHooks.h:168
UserHooksPtr userHooksPtr
Definition: PhysicsBase.h:124
virtual void onInitInfoPtr() override
After initInfoPtr, initialize workEvent.
Definition: UserHooks.h:235
virtual bool doVetoFragmentation(Particle, const StringEnd *)
Definition: UserHooks.h:203
virtual bool canVetoResonanceDecays()
Possibility to veto resonance decay chain.
Definition: UserHooks.h:76
virtual bool doVetoProcessLevel(Event &e)
Definition: UserHooks.h:395
void omitResonanceDecays(const Event &process, bool finalOnly=false)
omitResonanceDecays omits resonance decay chains from process record.
Definition: UserHooks.cc:132
virtual bool canSetResonanceScale()
Possibility to set initial scale in TimeShower for resonance decay.
Definition: UserHooks.h:539
virtual bool doVetoPartonLevelEarly(const Event &e)
Definition: UserHooks.h:506
virtual bool canChangeFragPar()
Can change fragmentation parameters.
Definition: UserHooks.h:186
Definition: StringFragmentation.h:33
double selBias
User-imposed selection bias.
Definition: UserHooks.h:251
virtual bool canModifySigma()
Possibility to modify cross section of process.
Definition: UserHooks.h:343
virtual bool canModifySigma()
Possibility to modify cross section of process.
Definition: UserHooks.h:43
virtual bool doVetoFragmentation(Particle p, const StringEnd *nowEnd)
Do a veto on a hadron just before it is added to the final state.
Definition: UserHooks.h:662
virtual bool canReconnectResonanceSystems()
Possibility to reconnect colours from resonance decay systems.
Definition: UserHooks.h:176
virtual int numberVetoMPIStep()
Up to how many MPI steps should be checked.
Definition: UserHooks.h:479
SuppressSmallPT(double pT0timesMPIIn=1., int numberAlphaSIn=0, bool useSameAlphaSasMPIIn=true)
Constructor.
Definition: UserHooks.h:270
virtual bool doVetoFragmentation(Particle, Particle, const StringEnd *, const StringEnd *)
Definition: UserHooks.h:208
virtual bool canBiasSelection()
Possibility to bias selection of events, compensated by a weight.
Definition: UserHooks.h:360
virtual bool doReconnectResonanceSystems(int j, Event &e)
Definition: UserHooks.h:626
virtual double biasSelectionBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent)
Multiplicative factor in the phase space selection of a hard process.
Definition: UserHooks.cc:79
virtual bool canSetLowEnergySigma(int, int) const
Definition: UserHooks.h:68
virtual ~UserHooksVector()
Destructor.
Definition: UserHooks.h:309
virtual bool canVetoProcessLevel()
Possibility to veto event after process-level selection.
Definition: UserHooks.h:60
virtual bool doVetoMPIEmission(int sizeOld, const Event &e)
Definition: UserHooks.h:606
virtual bool canSetImpactParameter() const
Can set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:221
virtual bool canVetoStep()
Definition: UserHooks.h:97
virtual bool canVetoPartonLevel()
Possibility to veto event after parton-level selection.
Definition: UserHooks.h:132
virtual bool doReconnectResonanceSystems(int, Event &)
Definition: UserHooks.h:183
virtual bool canChangeFragPar()
Can change fragmentation parameters.
Definition: UserHooks.h:634
double enhancedEventWeight
Bookkept quantities for boosted event weights.
Definition: UserHooks.h:254
virtual bool canVetoMPIStep()
Definition: UserHooks.h:472
virtual bool canVetoFSREmission()
Possibility to veto an emission in the FSR machinery.
Definition: UserHooks.h:575
Logger * loggerPtr
Pointer to logger.
Definition: PhysicsBase.h:87
virtual bool doVetoISREmission(int, const Event &, int)
Definition: UserHooks.h:153
virtual bool retryPartonLevel()
Definition: UserHooks.h:516
virtual bool canSetImpactParameter() const
Can set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:695
virtual bool canVetoPT()
Definition: UserHooks.h:84
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:71
virtual bool doVetoMPIEmission(int, const Event &)
Definition: UserHooks.h:173
virtual bool canVetoAfterHadronization()
Definition: UserHooks.h:215
Event workEvent
Have one event object around as work area.
Definition: UserHooks.h:248
UserHooksVector implements a vector of UserHooks and is itself a UserHooks.
Definition: UserHooks.h:299
The StringFlav class is used to select quark and hadron flavours.
Definition: FragmentationFlavZpT.h:84
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
void subEvent(const Event &event, bool isHardest=true)
subEvent extracts currently resolved partons in the hard process.
Definition: UserHooks.cc:182
Definition: PhaseSpace.h:42
virtual bool canVetoFSREmission()
Possibility to veto an emission in the FSR machinery.
Definition: UserHooks.h:156
void init(string headerIn="", ParticleData *particleDataPtrIn=0, int startColTagIn=100)
Initialize header for event listing, particle data table, and colour.
Definition: Event.h:467
virtual bool initAfterBeams()
Initialisation after beams have been set by Pythia::init().
Definition: UserHooks.h:40
virtual double biasSelectionBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent)
Multiplicative factor in the phase space selection of a hard process.
Definition: UserHooks.h:367
virtual double multiplySigmaBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent)
Multiplicative factor modifying the cross section of a hard process.
Definition: UserHooks.h:350
virtual bool canReconnectResonanceSystems()
Possibility to reconnect colours from resonance decay systems.
Definition: UserHooks.h:615
virtual bool doVetoProcessLevel(Event &)
Definition: UserHooks.h:64
virtual bool canVetoMPIStep()
Definition: UserHooks.h:109
virtual bool doVetoStep(int, int, int, const Event &)
Definition: UserHooks.h:105
virtual bool doVetoPartonLevel(const Event &)
Definition: UserHooks.h:136
virtual bool canVetoPartonLevelEarly()
Definition: UserHooks.h:498
virtual bool doVetoFragmentation(Particle p1, Particle p2, const StringEnd *e1, const StringEnd *e2)
Definition: UserHooks.h:669
virtual bool doVetoAfterHadronization(const Event &)
Do the actual veto after hadronization.
Definition: UserHooks.h:218
virtual bool canVetoISREmission()
Possibility to veto an emission in the ISR machinery.
Definition: UserHooks.h:557
virtual double scaleResonance(int iRes, const Event &e)
Definition: UserHooks.h:548
virtual double doSetLowEnergySigma(int, int, double, double, double) const
Definition: UserHooks.h:72
virtual double doSetImpactParameter()
Set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:224