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;}
285 bool useSameAlphaSasMPIIn =
true) : pT20(0.) {isInit =
false;
286 pT0timesMPI = pT0timesMPIIn; numberAlphaS = numberAlphaSIn;
287 useSameAlphaSasMPI = useSameAlphaSasMPIIn;}
300 bool isInit, useSameAlphaSasMPI;
302 double pT0timesMPI, pT20;
328 int nCanSetResonanceScale = 0;
329 int nCanChangeFragPar = 0;
330 int nCanSetImpactParameter = 0;
331 for (
int i = 0, N = hooks.size(); i < N; ++i ) {
338 if (nCanSetResonanceScale > 1) {
340 "multiple UserHooks with canSetResonanceScale() not allowed");
343 if (nCanChangeFragPar > 1) {
345 "multiple UserHooks with canChangeFragPar() not allowed");
348 if (nCanSetImpactParameter > 1) {
350 "multiple UserHooks with canSetImpactParameter() not allowed");
358 for (
int i = 0, N = hooks.size(); i < N; ++i )
365 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
367 for (
int i = 0, N = hooks.size(); i < N; ++i )
369 f *= hooks[i]->
multiplySigmaBy(sigmaProcessPtr, phaseSpacePtr,inEvent);
375 for (
int i = 0, N = hooks.size(); i < N; ++i )
382 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
384 for (
int i = 0, N = hooks.size(); i < N; ++i )
394 for (
int i = 0, N = hooks.size(); i < N; ++i )
402 for (
int i = 0, N = hooks.size(); i < N; ++i )
410 for (
int i = 0, N = hooks.size(); i < N; ++i )
412 hooks[i]->doVetoProcessLevel(e) )
return true;
418 for (
int i = 0, N = hooks.size(); i < N; ++i )
426 for (
int i = 0, N = hooks.size(); i < N; ++i )
428 hooks[i]->doVetoResonanceDecays(e) )
return true;
435 for (
int i = 0, N = hooks.size(); i < N; ++i )
436 if ( hooks[i]->
canVetoPT() )
return true;
443 for (
int i = 0, N = hooks.size(); i < N; ++i )
453 for (
int i = 0, N = hooks.size(); i < N; ++i )
454 if ( hooks[i]->
canVetoPT() && hooks[i]->doVetoPT(iPos, e) )
return true;
461 for (
int i = 0, N = hooks.size(); i < N; ++i )
469 for (
int i = 0, N = hooks.size(); i < N; ++i )
478 for (
int i = 0, N = hooks.size(); i < N; ++i )
480 && hooks[i]->doVetoStep(iPos, nISR, nFSR, e) )
return true;
487 for (
int i = 0, N = hooks.size(); i < N; ++i )
495 for (
int i = 0, N = hooks.size(); i < N; ++i )
504 for (
int i = 0, N = hooks.size(); i < N; ++i )
505 if ( hooks[i]->
canVetoMPIStep() && hooks[i]->doVetoMPIStep(nMPI, e) )
513 for (
int i = 0, N = hooks.size(); i < N; ++i )
521 for (
int i = 0, N = hooks.size(); i < N; ++i )
523 && hooks[i]->doVetoPartonLevelEarly(e) )
return true;
531 for (
int i = 0, N = hooks.size(); i < N; ++i )
538 for (
int i = 0, N = hooks.size(); i < N; ++i )
546 for (
int i = 0, N = hooks.size(); i < N; ++i )
548 && hooks[i]->doVetoPartonLevel(e) )
return true;
554 for (
int i = 0, N = hooks.size(); i < N; ++i )
564 for (
int i = 0, N = hooks.size(); i < N; ++i )
572 for (
int i = 0, N = hooks.size(); i < N; ++i )
582 for (
int i = 0, N = hooks.size(); i < N; ++i )
584 && hooks[i]->doVetoISREmission(sizeOld, e, iSys) )
return true;
590 for (
int i = 0, N = hooks.size(); i < N; ++i )
602 int iSys,
bool inResonance =
false ) {
603 for (
int i = 0, N = hooks.size(); i < N; ++i )
605 && hooks[i]->doVetoFSREmission(sizeOld, e, iSys, inResonance) )
612 for (
int i = 0, N = hooks.size(); i < N; ++i )
621 for (
int i = 0, N = hooks.size(); i < N; ++i )
623 && hooks[i]->doVetoMPIEmission(sizeOld, e) )
630 for (
int i = 0, N = hooks.size(); i < N; ++i )
641 for (
int i = 0, N = hooks.size(); i < N; ++i )
643 && hooks[i]->doReconnectResonanceSystems(j, e) )
return true;
649 for (
int i = 0, N = hooks.size(); i < N; ++i )
659 for (
int i = 0, N = hooks.size(); i < N; ++i )
667 StringPT* ptIn,
int idIn,
double mIn, vector<int> parIn,
669 for (
int i = 0, N = hooks.size(); i < N; ++i )
671 && hooks[i]->doChangeFragPar(sfIn, zIn, ptIn, idIn,
672 mIn, parIn, endIn) )
return true;
677 for (
int i = 0, N = hooks.size(); i < N; ++i )
683 for (
int i = 0, N = hooks.size(); i < N; ++i )
685 && hooks[i]->doVetoFragmentation(p, nowEnd) )
return true;
691 for (
int i = 0, N = hooks.size(); i < N; ++i )
693 && hooks[i]->doVetoFragmentation(p1, p2, e1, e2) )
return true;
699 for (
int i = 0, N = hooks.size(); i < N; ++i )
701 && hooks[i]->doVetoFinalTwo(p1, p2, e1, e2) )
return true;
709 for (
int i = 0, N = hooks.size(); i < N; ++i )
716 for (
int i = 0, N = hooks.size(); i < N; ++i )
718 && hooks[i]->doVetoAfterHadronization(e) )
return true;
724 for (
int i = 0, N = hooks.size(); i < N; ++i )
731 for (
int i = 0, N = hooks.size(); i < N; ++i )
738 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:467
virtual double scaleVetoPT()
Transverse-momentum scale for veto test.
Definition: UserHooks.h:87
virtual bool doVetoFinalTwo(Particle p1, Particle p2, const StringEnd *e1, const StringEnd *e2)
Definition: UserHooks.h:697
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:434
virtual double scaleVetoPT()
Transverse-momentum scale for veto test.
Definition: UserHooks.h:441
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:319
Definition: PhysicsBase.h:27
virtual bool canModifySigma()
Possibility to modify cross section of process.
Definition: UserHooks.h:290
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:730
The Event class holds all info on the generated event.
Definition: Event.h:408
UserHooks()
Constructor.
Definition: UserHooks.h:246
virtual bool doVetoISREmission(int sizeOld, const Event &e, int iSys)
Definition: UserHooks.h:581
virtual bool retryPartonLevel()
Definition: UserHooks.h:129
virtual bool onEndHadronLevel(HadronLevel &, Event &)
Custom processing at the end of HadronLevel::next.
Definition: UserHooks.h:241
SigmaProcess is the base class for cross section calculations.
Definition: SigmaProcess.h:86
virtual bool doVetoPT(int iPos, const Event &e)
Definition: UserHooks.h:452
virtual bool doVetoPartonLevel(const Event &e)
Definition: UserHooks.h:545
virtual bool doVetoMPIStep(int nMPI, const Event &e)
Definition: UserHooks.h:503
virtual double biasedSelectionWeight()
Event weight to compensate for selection weight above.
Definition: UserHooks.h:392
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:401
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:326
virtual bool canVetoMPIEmission()
Possibility to veto an MPI.
Definition: UserHooks.h:611
virtual bool doVetoStep(int iPos, int nISR, int nFSR, const Event &e)
Definition: UserHooks.h:477
virtual bool canVetoStep()
Definition: UserHooks.h:460
virtual bool canVetoAfterHadronization()
Definition: UserHooks.h:708
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:657
virtual bool doVetoFSREmission(int sizeOld, const Event &e, int iSys, bool inResonance=false)
Definition: UserHooks.h:601
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:666
virtual bool doVetoResonanceDecays(Event &e)
Definition: UserHooks.h:425
Definition: UserHooks.h:279
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:715
virtual bool initAfterBeams()
Definition: UserHooks.h:327
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:265
virtual bool canVetoResonanceDecays()
Possibility to veto resonance decay chain.
Definition: UserHooks.h:417
virtual double scaleResonance(int, const Event &)
Definition: UserHooks.h:144
virtual bool canVetoPartonLevel()
Possibility to veto event after parton-level selection.
Definition: UserHooks.h:537
Definition: HadronLevel.h:44
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:249
virtual bool doVetoFragmentation(Particle, const StringEnd *)
Definition: UserHooks.h:206
virtual bool canVetoResonanceDecays()
Possibility to veto resonance decay chain.
Definition: UserHooks.h:76
virtual bool doVetoProcessLevel(Event &e)
Definition: UserHooks.h:409
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:553
virtual bool doVetoPartonLevelEarly(const Event &e)
Definition: UserHooks.h:520
virtual bool canChangeFragPar()
Can change fragmentation parameters.
Definition: UserHooks.h:186
Definition: StringFragmentation.h:23
double selBias
User-imposed selection bias.
Definition: UserHooks.h:265
virtual bool doVetoFinalTwo(Particle, Particle, const StringEnd *, const StringEnd *)
Definition: UserHooks.h:222
virtual bool canVetoFragmentation()
Can veto hadrons in the fragmentation.
Definition: UserHooks.h:201
virtual bool canModifySigma()
Possibility to modify cross section of process.
Definition: UserHooks.h:357
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:682
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:493
SuppressSmallPT(double pT0timesMPIIn=1., int numberAlphaSIn=0, bool useSameAlphaSasMPIIn=true)
Constructor.
Definition: UserHooks.h:284
virtual bool doVetoFragmentation(Particle, Particle, const StringEnd *, const StringEnd *)
Definition: UserHooks.h:214
virtual bool canBiasSelection()
Possibility to bias selection of events, compensated by a weight.
Definition: UserHooks.h:374
virtual bool doReconnectResonanceSystems(int j, Event &e)
Definition: UserHooks.h:640
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:323
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:620
virtual bool canSetImpactParameter() const
Can set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:235
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:648
double enhancedEventWeight
Bookkept quantities for boosted event weights.
Definition: UserHooks.h:268
virtual bool canVetoMPIStep()
Definition: UserHooks.h:486
virtual bool canVetoFSREmission()
Possibility to veto an emission in the FSR machinery.
Definition: UserHooks.h:589
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:530
virtual bool canSetImpactParameter() const
Can set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:723
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:229
Event workEvent
Have one event object around as work area.
Definition: UserHooks.h:262
UserHooksVector implements a vector of UserHooks and is itself a UserHooks.
Definition: UserHooks.h:313
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:422
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:381
virtual double multiplySigmaBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool inEvent)
Multiplicative factor modifying the cross section of a hard process.
Definition: UserHooks.h:364
virtual bool canReconnectResonanceSystems()
Possibility to reconnect colours from resonance decay systems.
Definition: UserHooks.h:629
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 canVetoFragmentation()
Can veto hadrons in the fragmentation.
Definition: UserHooks.h:676
virtual bool canVetoPartonLevelEarly()
Definition: UserHooks.h:512
virtual bool doVetoFragmentation(Particle p1, Particle p2, const StringEnd *e1, const StringEnd *e2)
Definition: UserHooks.h:689
virtual bool doVetoAfterHadronization(const Event &)
Do the actual veto after hadronization.
Definition: UserHooks.h:232
virtual bool canVetoISREmission()
Possibility to veto an emission in the ISR machinery.
Definition: UserHooks.h:571
virtual double scaleResonance(int iRes, const Event &e)
Definition: UserHooks.h:562
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:238