9 #include "Pythia8/PhaseSpace.h"
10 #include "Pythia8/UserHooks.h"
27 double UserHooks::multiplySigmaBy(
const SigmaProcess* sigmaProcessPtr,
28 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
63 return ((inEvent && sigmaProcessPtr->code() == 0
64 && phaseSpacePtr->sHat() < 0.) ? 0. : 1.);
79 double UserHooks::biasSelectionBy(
const SigmaProcess* sigmaProcessPtr,
80 const PhaseSpace* phaseSpacePtr,
bool inEvent) {
124 return ((inEvent && sigmaProcessPtr->code() == 0
125 && phaseSpacePtr->sHat() < 0.) ? 0. : 1.);
132 void UserHooks::omitResonanceDecays(
const Event& process,
bool finalOnly) {
138 for (
int i = 0; i < process.size(); ++i) {
140 bool isFinal =
false;
141 if (i < 3) doCopy =
true;
145 int iMother = process[i].mother1();
146 if (iMother == 1 || iMother == 2) doCopy =
true;
149 else if (iMother > 2) {
150 int iGrandMother = process[iMother].mother1();
151 if (iGrandMother == 1 || iGrandMother == 2) {
159 if (finalOnly && !isFinal) doCopy =
false;
163 int iNew = workEvent.append( process[i]);
165 workEvent[iNew].statusPos();
166 workEvent[iNew].daughters( 0, 0);
169 workEvent[iNew].mothers( 0, 0);
170 workEvent[iNew].daughters( i, i);
182 void UserHooks::subEvent(
const Event& event,
bool isHardest) {
188 if (partonSystemsPtr->sizeSys() > 0) {
192 if (!isHardest) iSys = partonSystemsPtr->sizeSys() - 1;
195 for (
int i = 0; i < partonSystemsPtr->sizeOut(iSys); ++i) {
196 int iOld = partonSystemsPtr->getOut( iSys, i);
199 int iNew = workEvent.append( event[iOld]);
202 workEvent[iNew].mothers( 0, 0);
203 workEvent[iNew].daughters( iOld, iOld);
210 for (
int iOld = 0; iOld <
event.size(); ++iOld)
211 if (event[iOld].isFinal()) {
212 int iNew = workEvent.append( event[iOld]);
215 workEvent[iNew].mothers( 0, 0);
216 workEvent[iNew].daughters( iOld, iOld);
230 double SuppressSmallPT::multiplySigmaBy(
const SigmaProcess* sigmaProcessPtr,
231 const PhaseSpace* phaseSpacePtr,
bool ) {
238 double eCM = phaseSpacePtr->ecm();
239 double pT0Ref = settingsPtr->parm(
"MultipartonInteractions:pT0Ref");
240 double ecmRef = settingsPtr->parm(
"MultipartonInteractions:ecmRef");
241 double ecmPow = settingsPtr->parm(
"MultipartonInteractions:ecmPow");
242 double pT0 = pT0timesMPI * pT0Ref * pow(eCM / ecmRef, ecmPow);
249 int alphaSnfmax = settingsPtr->mode(
"StandardModel:alphaSnfmax");
250 if (useSameAlphaSasMPI) {
251 alphaSvalue = settingsPtr->parm(
"MultipartonInteractions:alphaSvalue");
252 alphaSorder = settingsPtr->mode(
"MultipartonInteractions:alphaSorder");
254 alphaSvalue = settingsPtr->parm(
"SigmaProcess:alphaSvalue");
255 alphaSorder = settingsPtr->mode(
"SigmaProcess:alphaSorder");
257 alphaS.init( alphaSvalue, alphaSorder, alphaSnfmax,
false);
264 int nFinal = sigmaProcessPtr->nFinal();
265 if (nFinal != 2)
return 1.;
268 double pTHat = phaseSpacePtr->pTHat();
269 double pT2 = pTHat * pTHat;
270 double wt = pow2( pT2 / (pT20 + pT2) );
272 if (numberAlphaS > 0) {
274 double Q2RenOld = sigmaProcessPtr->Q2Ren();
275 double alphaSOld = sigmaProcessPtr->alphaSRen();
278 double Q2RenNew = pT20 + Q2RenOld;
279 double alphaSNew = alphaS.alphaS(Q2RenNew);
280 wt *= pow( alphaSNew / alphaSOld, numberAlphaS);