11 #ifndef Pythia8_PhaseSpace_H
12 #define Pythia8_PhaseSpace_H
14 #include "Pythia8/Basics.h"
15 #include "Pythia8/BeamParticle.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/LesHouches.h"
18 #include "Pythia8/MultipartonInteractions.h"
19 #include "Pythia8/ParticleData.h"
20 #include "Pythia8/PartonDistributions.h"
21 #include "Pythia8/PythiaStdlib.h"
22 #include "Pythia8/SigmaProcess.h"
23 #include "Pythia8/SigmaTotal.h"
24 #include "Pythia8/Settings.h"
25 #include "Pythia8/StandardModel.h"
26 #include "Pythia8/UserHooks.h"
45 virtual ~PhaseSpace() {}
48 void init(
bool isFirst, SigmaProcess* sigmaProcessPtrIn,
49 Info* infoPtrIn, Settings* settingsPtrIn, ParticleData* particleDataPtrIn,
50 Rndm* rndmPtrIn, BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
51 Couplings* couplingsPtrIn, SigmaTotal* sigmaTotPtrIn,
52 UserHooks* userHooksPtrIn);
55 void newECM(
double eCMin) {eCM = eCMin; s = eCM * eCM;}
58 void setLHAPtr(LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;}
62 virtual bool setupSampling() = 0;
66 virtual bool trialKin(
bool inEvent =
true,
bool repeatSame =
false) = 0;
70 virtual bool finalKin() = 0;
73 void decayKinematics(
Event& process);
76 double sigmaNow()
const {
return sigmaNw;}
77 double sigmaMax()
const {
return sigmaMx;}
78 double biasSelectionWeight()
const {
return biasWt;}
79 bool newSigmaMax()
const {
return newSigmaMx;}
80 void setSigmaMax(
double sigmaMaxIn) {sigmaMx = sigmaMaxIn;}
83 virtual double sigmaSumSigned()
const {
return sigmaMx;}
86 Vec4 p(
int i)
const {
return pH[i];}
87 double m(
int i)
const {
return mH[i];}
90 double ecm()
const {
return eCM;}
91 double x1()
const {
return x1H;}
92 double x2()
const {
return x2H;}
93 double sHat()
const {
return sH;}
94 double tHat()
const {
return tH;}
95 double uHat()
const {
return uH;}
96 double pTHat()
const {
return pTH;}
97 double thetaHat()
const {
return theta;}
98 double phiHat()
const {
return phi;}
99 double runBW3()
const {
return runBW3H;}
100 double runBW4()
const {
return runBW4H;}
101 double runBW5()
const {
return runBW5H;}
104 virtual bool isResolved()
const {
return true;}
112 static const int NMAXTRY, NTRY3BODY;
113 static const double SAFETYMARGIN, TINY, EVENFRAC, SAMESIGMA, WIDTHMARGIN,
114 SAMEMASS, MASSMARGIN, EXTRABWWTMAX, THRESHOLDSIZE,
115 THRESHOLDSTEP, YRANGEMARGIN, LEPTONXMIN, LEPTONXMAX,
116 LEPTONXLOGMIN, LEPTONXLOGMAX, LEPTONTAUMIN,
117 SHATMINZ, PT2RATMINZ, WTCORRECTION[11];
120 static const double FFA1, FFA2,FFB1, FFB2;
123 SigmaProcess* sigmaProcessPtr;
129 Settings* settingsPtr;
132 ParticleData* particleDataPtr;
138 BeamParticle* beamAPtr;
139 BeamParticle* beamBPtr;
142 Couplings* couplingsPtr;
145 SigmaTotal* sigmaTotPtr;
148 UserHooks* userHooksPtr;
154 bool useBreitWigners, doEnergySpread, showSearch, showViolation,
157 double mHatGlobalMin, mHatGlobalMax, pTHatGlobalMin, pTHatGlobalMax,
158 pTHatMinDiverge, minWidthBreitWigners, mRecalculate;
162 double mA, mB, eCM, s;
163 bool hasLeptonBeams, hasPointLeptons;
166 bool newSigmaMx, canModifySigma, canBiasSelection, canBias2Sel;
168 double bias2SelPow, bias2SelRef, wtBW, sigmaNw, sigmaMx, sigmaPos,
172 double mHatMin, mHatMax, sHatMin, sHatMax, pTHatMin, pTHatMax,
173 pT2HatMin, pT2HatMax;
176 double x1H, x2H, m3, m4, m5, s3, s4, s5, mHat, sH, tH, uH, pAbs, p2Abs,
177 pTH, theta, phi, betaZ;
182 void decayKinematicsStep(
Event& process,
int iRes);
188 bool setupSampling123(
bool is2,
bool is3, ostream& os = cout);
191 bool trialKin123(
bool is2,
bool is3,
bool inEvent =
true,
196 double mResA, mResB, GammaResA, GammaResB, tauResA, tauResB, widResA,
201 bool useMirrorWeight;
202 double tau, y, z, tauMin, tauMax, yMax, zMin, zMax, ratio34, unity34,
203 zNeg, zPos, wtTau, wtY, wtZ, wt3Body, runBW3H, runBW4H, runBW5H,
204 intTau0, intTau1, intTau2, intTau3, intTau4, intTau5, intTau6,
205 intY0, intY12, intY34, intY56, mTchan1, sTchan1, mTchan2, sTchan2,
206 frac3Flat, frac3Pow1, frac3Pow2;
207 Vec4 p3cm, p4cm, p5cm;
211 double tauCoef[8], yCoef[8], zCoef[8], tauCoefSum[8], yCoefSum[8],
215 bool limitTau(
bool is2,
bool is3);
220 void selectTau(
int iTau,
double tauVal,
bool is2);
221 void selectY(
int iY,
double yVal);
222 void selectZ(
int iZ,
double zVal);
226 void solveSys(
int n,
int bin[8],
double vec[8],
double mat[8][8],
227 double coef[8], ostream& os = cout);
232 double mPeak[6], sPeak[6], mWidth[6], mMin[6], mMax[6], mw[6], wmRat[6],
233 mLower[6], mUpper[6], sLower[6], sUpper[6], fracFlat[6], fracInv[6],
234 fracInv2[6], atanLower[6], atanUpper[6], intBW[6], intFlat[6],
235 intInv[6], intInv2[6];
238 void setupMass1(
int iM);
239 void setupMass2(
int iM,
double distToThresh);
242 void trialMass(
int iM);
243 double weightMass(
int iM);
257 class PhaseSpace2to1tauy :
public PhaseSpace {
262 PhaseSpace2to1tauy() {}
265 virtual bool setupSampling() {
if (!setupMass())
return false;
266 return setupSampling123(
false,
false);}
269 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {wtBW = 1.;
270 return trialKin123(
false,
false, inEvent);}
273 virtual bool finalKin();
286 class PhaseSpace2to2tauyz :
public PhaseSpace {
291 PhaseSpace2to2tauyz() {}
294 virtual bool setupSampling() {
if (!setupMasses())
return false;
295 return setupSampling123(
true,
false);}
298 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {
299 if (!trialMasses())
return false;
300 return trialKin123(
true,
false, inEvent);}
303 virtual bool finalKin();
314 bool constrainedM3M4();
315 bool constrainedM3();
316 bool constrainedM4();
324 class PhaseSpace2to2elastic :
public PhaseSpace {
329 PhaseSpace2to2elastic() {}
332 virtual bool setupSampling();
333 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
334 virtual bool finalKin();
337 virtual bool isResolved()
const {
return false;}
342 static const double EXPMAX, CONVERTEL;
346 double s1, s2, bSlope, lambda12S, tLow, tUpp, tAux, sigmaTot, rho,
347 lambda, tAbsMin, phaseCst, alphaEM0, sigmaNuc, sigmaCou, signCou;
358 class PhaseSpace2to2diffractive :
public PhaseSpace {
363 PhaseSpace2to2diffractive(
bool isDiffAin =
false,
bool isDiffBin =
false)
364 : isDiffA(isDiffAin), isDiffB(isDiffBin) {}
367 virtual bool setupSampling();
368 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
369 virtual bool finalKin();
372 virtual bool isResolved()
const {
return false;}
377 static const int NTRY;
378 static const double EXPMAX, DIFFMASSMARGIN;
381 bool isDiffA, isDiffB;
383 double epsilonPF, alphaPrimePF;
386 double m3ElDiff, m4ElDiff, s1, s2, lambda12, lambda34, tLow, tUpp,
387 cRes, sResXB, sResAX, sProton, bMin, bSlope, bSlope1, bSlope2,
388 probSlope1, xIntPF, xtCorPF, mp24DL, coefDL, tAux, tAux1, tAux2;
391 double sdpmax, ddpmax, dymin0, dymax, amx, am1, am2, t;
392 double eps, alph, alph2, m2min, dyminSD, dyminDD, dyminSigSD, dyminSigDD;
409 virtual bool setupSampling();
410 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
411 virtual bool finalKin();
414 virtual bool isResolved()
const {
return false;}
419 static const int NTRY, NINTEG2;
420 static const double EXPMAX, DIFFMASSMIN, DIFFMASSMARGIN;
424 double epsilonPF, alphaPrimePF, s1, s2, m5min, s5min, tLow[2], tUpp[2],
425 bMin[2], tAux[2], bSlope1, bSlope2, probSlope1[2], tAux1[2],
426 tAux2[2], bSlope, xIntPF, xIntInvPF, xtCorPF, mp24DL, coefDL,
427 epsMBR, alphMBR, m2minMBR, dyminMBR, dyminSigMBR, dyminInvMBR,
429 Vec4 p1, p2, p3, p4, p5;
446 virtual bool setupSampling() {sigmaNw = sigmaProcessPtr->sigmaHat();
447 sigmaMx = sigmaNw;
return true;}
448 virtual bool trialKin(
bool ,
bool =
false) {
return true;}
449 virtual bool finalKin() {
return true;}
468 virtual bool setupSampling() {
if (!setupMasses())
return false;
469 setup3Body();
return setupSampling123(
false,
true);}
472 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {
473 if (!trialMasses())
return false;
474 return trialKin123(
false,
true, inEvent);}
477 virtual bool finalKin();
482 static const int NITERNR;
498 class PhaseSpace2to3yyycyl :
public PhaseSpace {
503 PhaseSpace2to3yyycyl() {}
506 virtual bool setupSampling();
509 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
512 virtual bool finalKin();
517 double pTHat3Min, pTHat3Max, pTHat5Min, pTHat5Max, RsepMin, R2sepMin;
521 double pT3Min, pT3Max, pT5Min, pT5Max, y3Max, y4Max, y5Max,
522 pT3, pT4, pT5, phi3, phi4, phi5, y3, y4, y5, dphi;
531 class PhaseSpaceLHA :
public PhaseSpace {
536 PhaseSpaceLHA() {idProcSave = 0;}
539 virtual bool setupSampling();
542 virtual bool trialKin(
bool ,
bool repeatSame =
false);
545 virtual bool finalKin() {sigmaProcessPtr->setScale();
return true;}
548 virtual double sigmaSumSigned()
const {
return sigmaSgn;}
553 static const double CONVERTPB2MB;
556 int strategy, stratAbs, nProc, idProcSave;
557 double xMaxAbsSum, xSecSgnSum, sigmaSgn;
559 vector<double> xMaxAbsProc;
567 #endif // Pythia8_PhaseSpace_H