11 #ifndef Pythia8_PhaseSpace_H
12 #define Pythia8_PhaseSpace_H
15 #include "BeamParticle.h"
17 #include "LesHouches.h"
18 #include "MultipartonInteractions.h"
19 #include "ParticleData.h"
20 #include "PartonDistributions.h"
21 #include "PythiaStdlib.h"
22 #include "SigmaProcess.h"
23 #include "SigmaTotal.h"
25 #include "StandardModel.h"
26 #include "UserHooks.h"
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];
151 bool useBreitWigners, doEnergySpread, showSearch, showViolation,
154 double mHatGlobalMin, mHatGlobalMax, pTHatGlobalMin, pTHatGlobalMax,
155 pTHatMinDiverge, minWidthBreitWigners;
159 double mA, mB, eCM, s;
160 bool hasLeptonBeams, hasPointLeptons;
163 bool newSigmaMx, canModifySigma, canBiasSelection;
165 double wtBW, sigmaNw, sigmaMx, sigmaPos, sigmaNeg, biasWt;
168 double mHatMin, mHatMax, sHatMin, sHatMax, pTHatMin, pTHatMax,
169 pT2HatMin, pT2HatMax;
172 double x1H, x2H, m3, m4, m5, s3, s4, s5, mHat, sH, tH, uH, pAbs, p2Abs,
173 pTH, theta, phi, betaZ;
178 void decayKinematicsStep(
Event& process,
int iRes);
184 bool setupSampling123(
bool is2,
bool is3, ostream& os = cout);
187 bool trialKin123(
bool is2,
bool is3,
bool inEvent =
true,
192 double mResA, mResB, GammaResA, GammaResB, tauResA, tauResB, widResA,
197 bool useMirrorWeight;
198 double tau, y, z, tauMin, tauMax, yMax, zMin, zMax, ratio34, unity34,
199 zNeg, zPos, wtTau, wtY, wtZ, wt3Body, runBW3H, runBW4H, runBW5H,
200 intTau0, intTau1, intTau2, intTau3, intTau4, intTau5, intTau6,
201 intY0, intY12, intY34, intY56, mTchan1, sTchan1, mTchan2, sTchan2,
202 frac3Flat, frac3Pow1, frac3Pow2;
203 Vec4 p3cm, p4cm, p5cm;
207 double tauCoef[8], yCoef[8], zCoef[8], tauCoefSum[8], yCoefSum[8],
211 bool limitTau(
bool is2,
bool is3);
216 void selectTau(
int iTau,
double tauVal,
bool is2);
217 void selectY(
int iY,
double yVal);
218 void selectZ(
int iZ,
double zVal);
222 void solveSys(
int n,
int bin[8],
double vec[8],
double mat[8][8],
223 double coef[8], ostream& os = cout);
228 double mPeak[6], sPeak[6], mWidth[6], mMin[6], mMax[6], mw[6], wmRat[6],
229 mLower[6], mUpper[6], sLower[6], sUpper[6], fracFlat[6], fracInv[6],
230 fracInv2[6], atanLower[6], atanUpper[6], intBW[6], intFlat[6],
231 intInv[6], intInv2[6];
234 void setupMass1(
int iM);
235 void setupMass2(
int iM,
double distToThresh);
238 void trialMass(
int iM);
239 double weightMass(
int iM);
255 virtual bool setupSampling() {
if (!setupMass())
return false;
256 return setupSampling123(
false,
false);}
259 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {wtBW = 1.;
260 return trialKin123(
false,
false, inEvent);}
263 virtual bool finalKin();
284 virtual bool setupSampling() {
if (!setupMasses())
return false;
285 return setupSampling123(
true,
false);}
288 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {
289 if (!trialMasses())
return false;
290 return trialKin123(
true,
false, inEvent);}
293 virtual bool finalKin();
304 bool constrainedM3M4();
305 bool constrainedM3();
306 bool constrainedM4();
322 virtual bool setupSampling();
323 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
324 virtual bool finalKin();
327 virtual bool isResolved()
const {
return false;}
332 static const double EXPMAX, CONVERTEL;
336 double s1, s2, bSlope, lambda12S, tLow, tUpp, tAux, sigmaTot, rho,
337 lambda, tAbsMin, phaseCst, alphaEM0, sigmaNuc, sigmaCou, signCou;
354 : isDiffA(isDiffAin), isDiffB(isDiffBin) {}
357 virtual bool setupSampling();
358 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
359 virtual bool finalKin();
362 virtual bool isResolved()
const {
return false;}
367 static const int NTRY;
368 static const double EXPMAX, DIFFMASSMAX;
371 bool isDiffA, isDiffB;
373 double epsilonPF, alphaPrimePF;
376 double m3ElDiff, m4ElDiff, s1, s2, lambda12, lambda34, tLow, tUpp,
377 cRes, sResXB, sResAX, sProton, bMin, bSlope, bSlope1, bSlope2,
378 probSlope1, xIntPF, xtCorPF, mp24DL, coefDL, tAux, tAux1, tAux2;
395 virtual bool setupSampling() {sigmaNw = sigmaProcessPtr->sigmaHat();
396 sigmaMx = sigmaNw;
return true;}
397 virtual bool trialKin(
bool ,
bool =
false) {
return true;}
398 virtual bool finalKin() {
return true;}
417 virtual bool setupSampling() {
if (!setupMasses())
return false;
418 setup3Body();
return setupSampling123(
false,
true);}
421 virtual bool trialKin(
bool inEvent =
true,
bool =
false) {
422 if (!trialMasses())
return false;
423 return trialKin123(
false,
true, inEvent);}
426 virtual bool finalKin();
431 static const int NITERNR;
455 virtual bool setupSampling();
458 virtual bool trialKin(
bool inEvent =
true,
bool =
false);
461 virtual bool finalKin();
466 double pTHat3Min, pTHat3Max, pTHat5Min, pTHat5Max, RsepMin, R2sepMin;
470 double pT3Min, pT3Max, pT5Min, pT5Max, y3Max, y4Max, y5Max,
471 pT3, pT4, pT5, phi3, phi4, phi5, y3, y4, y5, dphi;
488 virtual bool setupSampling();
491 virtual bool trialKin(
bool ,
bool repeatSame =
false);
494 virtual bool finalKin() {sigmaProcessPtr->setScale();
return true;}
497 virtual double sigmaSumSigned()
const {
return sigmaSgn;}
502 static const double CONVERTPB2MB;
505 int strategy, stratAbs, nProc, idProcSave;
506 double xMaxAbsSum, xSecSgnSum, sigmaSgn;
508 vector<double> xMaxAbsProc;
516 #endif // Pythia8_PhaseSpace_H