16 for (Pythia8::UserHooks *hook :
hooks_) {
17 hook->initPtr(infoPtr, settingsPtr,
18 particleDataPtr, rndmPtr,
20 beamPomAPtr, beamPomBPtr,
21 coupSMPtr, partonSystemsPtr,
23 test &= hook->initAfterBeams();
30 int nCanVetoMPIStep = 0;
31 int nCanSetResonanceScale = 0;
33 for (Pythia8::UserHooks *hook : hooks_) {
34 if (hook->canVetoPT()) ++nCanVetoPT;
35 if (hook->canVetoStep()) ++nCanVetoStep;
36 if (hook->canVetoMPIStep()) ++nCanVetoMPIStep;
37 if (hook->canSetResonanceScale()) ++nCanSetResonanceScale;
38 if (hook->canEnhanceEmission() || hook->canEnhanceTrial()) ++nCanEnhance;
42 infoPtr->errorMsg(
"Error in MultiUserHook::initAfterBeams "
43 "multiple UserHooks with canVetoPT() not allowed");
47 infoPtr->errorMsg(
"Error in MultiUserHook::initAfterBeams "
48 "multiple UserHooks with canVetoStep() not allowed");
51 if (nCanVetoMPIStep>1) {
52 infoPtr->errorMsg(
"Error in MultiUserHook::initAfterBeams "
53 "multiple UserHooks with canVetoMPIStep() not allowed");
56 if (nCanSetResonanceScale>1) {
57 infoPtr->errorMsg(
"Error in MultiUserHook::initAfterBeams "
58 "multiple UserHooks with canSetResonanceScale() not allowed");
62 infoPtr->errorMsg(
"Error in MultiUserHook::initAfterBeams "
63 "multiple UserHooks with canEnhanceEmission() or canEnhanceTrial() not allowed");
73 for (Pythia8::UserHooks *hook :
hooks_) {
74 test |= hook->canModifySigma();
81 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override {
83 for (Pythia8::UserHooks *hook :
hooks_) {
84 if (hook->canModifySigma()) factor *= hook->multiplySigmaBy(sigmaProcessPtr,phaseSpacePtr,inEvent);
92 for (Pythia8::UserHooks *hook :
hooks_) {
93 test |= hook->canBiasSelection();
100 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override {
102 for (Pythia8::UserHooks *hook :
hooks_) {
103 if (hook->canBiasSelection()) factor *= hook->biasSelectionBy(sigmaProcessPtr,phaseSpacePtr,inEvent);
111 for (Pythia8::UserHooks *hook :
hooks_) {
112 if (hook->canBiasSelection()) factor *= hook->biasedSelectionWeight();
120 for (Pythia8::UserHooks *hook :
hooks_) {
121 test |= hook->canVetoProcessLevel();
130 for (Pythia8::UserHooks *hook :
hooks_) {
131 if (hook->canVetoProcessLevel()) test |= hook->doVetoProcessLevel(event);
139 for (Pythia8::UserHooks *hook :
hooks_) {
140 test |= hook->canVetoResonanceDecays();
149 for (Pythia8::UserHooks *hook :
hooks_) {
150 if (hook->canVetoResonanceDecays()) test |= hook->doVetoResonanceDecays(event);
159 for (Pythia8::UserHooks *hook :
hooks_) {
160 test |= hook->canVetoPT();
167 for (Pythia8::UserHooks *hook :
hooks_) {
168 if (hook->canVetoPT())
return hook->scaleVetoPT();
178 for (Pythia8::UserHooks *hook :
hooks_) {
179 if (hook->canVetoPT())
return hook->doVetoPT(iPos,event);
188 for (Pythia8::UserHooks *hook :
hooks_) {
189 test |= hook->canVetoStep();
196 for (Pythia8::UserHooks *hook :
hooks_) {
197 if (hook->canVetoStep())
return hook->numberVetoStep();
205 bool doVetoStep(
int iPos,
int nISR,
int nFSR,
const Pythia8::Event&
event)
override {
206 for (Pythia8::UserHooks *hook :
hooks_) {
207 if (hook->canVetoStep())
return hook->doVetoStep(iPos,nISR,nFSR,event);
216 for (Pythia8::UserHooks *hook :
hooks_) {
217 test |= hook->canVetoMPIStep();
224 for (Pythia8::UserHooks *hook :
hooks_) {
225 if (hook->canVetoMPIStep())
return hook->numberVetoMPIStep();
233 for (Pythia8::UserHooks *hook :
hooks_) {
234 if (hook->canVetoMPIStep())
return hook->doVetoMPIStep(nMPI,event);
243 for (Pythia8::UserHooks *hook :
hooks_) {
244 test |= hook->canVetoPartonLevelEarly();
253 for (Pythia8::UserHooks *hook :
hooks_) {
254 if (hook->canVetoPartonLevelEarly()) test |= hook->doVetoPartonLevelEarly(event);
264 for (Pythia8::UserHooks *hook :
hooks_) {
265 test |= hook->retryPartonLevel();
273 for (Pythia8::UserHooks *hook :
hooks_) {
274 test |= hook->canVetoPartonLevel();
283 for (Pythia8::UserHooks *hook :
hooks_) {
284 if (hook->canVetoPartonLevel()) test |= hook->doVetoPartonLevel(event);
292 for (Pythia8::UserHooks *hook :
hooks_) {
293 test |= hook->canSetResonanceScale();
303 for (Pythia8::UserHooks *hook :
hooks_) {
304 if (hook->canSetResonanceScale())
return hook->scaleResonance(iRes,event);
312 for (Pythia8::UserHooks *hook :
hooks_) {
313 test |= hook->canVetoISREmission();
324 for (Pythia8::UserHooks *hook :
hooks_) {
325 if (hook->canVetoISREmission()) test |= hook->doVetoISREmission(sizeOld,event,iSys);
333 for (Pythia8::UserHooks *hook :
hooks_) {
334 test |= hook->canVetoFSREmission();
347 for (Pythia8::UserHooks *hook :
hooks_) {
348 if (hook->canVetoFSREmission()) test |= hook->doVetoFSREmission(sizeOld,event,iSys,inResonance);
356 for (Pythia8::UserHooks *hook :
hooks_) {
357 test |= hook->canVetoMPIEmission();
367 for (Pythia8::UserHooks *hook :
hooks_) {
368 if (hook->canVetoMPIEmission()) test |= hook->doVetoMPIEmission(sizeOld,event);
376 for (Pythia8::UserHooks *hook :
hooks_) {
377 test |= hook->canReconnectResonanceSystems();
389 for (Pythia8::UserHooks *hook :
hooks_) {
390 if (hook->canReconnectResonanceSystems()) test &= hook->doReconnectResonanceSystems(oldSizeEvt,event);
398 for (Pythia8::UserHooks *hook :
hooks_) {
399 test |= hook->canEnhanceEmission();
408 for (Pythia8::UserHooks *hook :
hooks_) {
409 test |= hook->canEnhanceTrial();
415 for (Pythia8::UserHooks *hook :
hooks_) {
416 if (hook->canEnhanceEmission() || hook->canEnhanceTrial())
return hook->enhanceFactor(str);
422 for (Pythia8::UserHooks *hook :
hooks_) {
423 if (hook->canEnhanceEmission() || hook->canEnhanceTrial())
return hook->vetoProbability(str);
431 for (Pythia8::UserHooks *hook :
hooks_) {
432 test |= hook->canChangeFragPar();
439 bool doChangeFragPar( Pythia8::StringFlav* flavPtr, Pythia8::StringZ* zPtr, Pythia8::StringPT* pTPtr,
int idEnd,
440 double m2Had, std::vector<int> iParton)
override {
442 for (Pythia8::UserHooks *hook :
hooks_) {
443 if (hook->canChangeFragPar()) test &= hook->doChangeFragPar(flavPtr, zPtr, pTPtr, idEnd, m2Had, iParton);
451 for (Pythia8::UserHooks *hook :
hooks_) {
452 if (hook->canChangeFragPar()) test |= hook->doVetoFragmentation(part);
double vetoProbability(std::string str) override
bool doVetoPartonLevel(const Pythia8::Event &event) override
bool doVetoFSREmission(int sizeOld, const Pythia8::Event &event, int iSys, bool inResonance=false) override
std::vector< Pythia8::UserHooks * > hooks_
double scaleResonance(int iRes, const Pythia8::Event &event) override
double biasedSelectionWeight() override
bool canVetoMPIStep() override
void addHook(Pythia8::UserHooks *hook)
bool initAfterBeams() override
bool doVetoStep(int iPos, int nISR, int nFSR, const Pythia8::Event &event) override
bool doVetoFragmentation(Pythia8::Particle part) override
bool canVetoISREmission() override
bool canVetoPT() override
bool canVetoMPIEmission()
bool canEnhanceTrial() override
bool canSetResonanceScale() override
bool canVetoFSREmission() override
bool doVetoPT(int iPos, const Pythia8::Event &event) override
bool canVetoPartonLevel() override
bool canVetoPartonLevelEarly() override
bool canVetoProcessLevel() override
bool doChangeFragPar(Pythia8::StringFlav *flavPtr, Pythia8::StringZ *zPtr, Pythia8::StringPT *pTPtr, int idEnd, double m2Had, std::vector< int > iParton) override
bool canModifySigma() override
bool canVetoResonanceDecays() override
bool doVetoProcessLevel(Pythia8::Event &event) override
bool doVetoMPIStep(int nMPI, const Pythia8::Event &event) override
bool doVetoISREmission(int sizeOld, const Pythia8::Event &event, int iSys) override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool canChangeFragPar() override
double enhanceFactor(std::string str) override
double scaleVetoPT() override
int numberVetoMPIStep() override
double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
bool canVetoStep() override
bool doReconnectResonanceSystems(int oldSizeEvt, Pythia8::Event &event) override
bool canReconnectResonanceSystems() override
bool doVetoMPIEmission(int sizeOld, const Pythia8::Event &event) override
bool doVetoResonanceDecays(Pythia8::Event &event) override
int numberVetoStep() override
unsigned int nHooks() const
bool retryPartonLevel() override
bool canBiasSelection() override
bool canEnhanceEmission() override
double multiplySigmaBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
bool doVetoPartonLevelEarly(const Pythia8::Event &event) override