10 #ifndef Pythia8_BeamParticle_H
11 #define Pythia8_BeamParticle_H
15 #include "FragmentationFlavZpT.h"
17 #include "ParticleData.h"
18 #include "PartonDistributions.h"
19 #include "PythiaStdlib.h"
43 int companionIn = -1) : iPosRes(iPosIn), idRes(idIn), xRes(xIn),
44 companionRes(companionIn), xqCompRes(0.), mRes(0.), factorRes(1.),
45 colRes(0), acolRes(0) { }
48 void iPos(
int iPosIn) {iPosRes = iPosIn;}
49 void id(
int idIn) {idRes = idIn;}
50 void x(
double xIn) {xRes = xIn;}
51 void update(
int iPosIn,
int idIn,
double xIn) {iPosRes = iPosIn;
52 idRes = idIn; xRes = xIn;}
53 void companion(
int companionIn) {companionRes = companionIn;}
54 void xqCompanion(
double xqCompIn) {xqCompRes = xqCompIn;}
55 void p(
Vec4 pIn) {pRes = pIn;}
56 void px(
double pxIn) {pRes.px(pxIn);}
57 void py(
double pyIn) {pRes.py(pyIn);}
58 void pz(
double pzIn) {pRes.pz(pzIn);}
59 void e(
double eIn) {pRes.e(eIn);}
60 void m(
double mIn) {mRes = mIn;}
61 void col(
int colIn) {colRes = colIn;}
62 void acol(
int acolIn) {acolRes = acolIn;}
63 void cols(
int colIn = 0,
int acolIn = 0)
64 {colRes = colIn; acolRes = acolIn;}
65 void scalePT(
double factorIn) {pRes.px(factorIn * pRes.px());
66 pRes.py(factorIn * pRes.py()); factorRes *= factorIn;}
67 void scaleX(
double factorIn) {xRes *= factorIn;}
70 int iPos()
const {
return iPosRes;}
71 int id()
const {
return idRes;}
72 double x()
const {
return xRes;}
73 int companion()
const {
return companionRes;}
74 bool isValence()
const {
return (companionRes == -3);}
75 bool isUnmatched()
const {
return (companionRes == -2);}
76 bool isCompanion()
const {
return (companionRes >= 0);}
77 bool isFromBeam()
const {
return (companionRes > -10);}
78 double xqCompanion()
const {
return xqCompRes;}
79 Vec4 p()
const {
return pRes;}
80 double px()
const {
return pRes.px();}
81 double py()
const {
return pRes.py();}
82 double pz()
const {
return pRes.pz();}
83 double e()
const {
return pRes.e();}
84 double m()
const {
return mRes;}
85 double pT()
const {
return pRes.pT();}
86 double mT2()
const {
return (mRes >= 0.)
87 ? mRes*mRes + pRes.pT2() : - mRes*mRes + pRes.pT2();}
88 double pPos()
const {
return pRes.e() + pRes.pz();}
89 double pNeg()
const {
return pRes.e() - pRes.pz();}
90 int col()
const {
return colRes;}
91 int acol()
const {
return acolRes;}
92 double pTfactor()
const {
return factorRes;}
104 double mRes, factorRes;
120 BeamParticle() : nInit(0) {resolved.resize(0); Q2ValFracSav = -1.;}
123 void init(
int idIn,
double pzIn,
double eIn,
double mIn,
125 Rndm* rndmPtrIn,
PDF* pdfInPtr,
PDF* pdfHardInPtr,
bool isUnresolvedIn,
129 void newValenceContent();
132 void newPzE(
double pzIn,
double eIn) {pBeam =
Vec4( 0., 0., pzIn, eIn);}
135 int id()
const {
return idBeam;}
136 Vec4 p()
const {
return pBeam;}
137 double px()
const {
return pBeam.px();}
138 double py()
const {
return pBeam.py();}
139 double pz()
const {
return pBeam.pz();}
140 double e()
const {
return pBeam.e();}
141 double m()
const {
return mBeam;}
142 bool isLepton()
const {
return isLeptonBeam;}
143 bool isUnresolved()
const {
return isUnresolvedBeam;}
145 bool isHadron()
const {
return isHadronBeam;}
146 bool isMeson()
const {
return isMesonBeam;}
147 bool isBaryon()
const {
return isBaryonBeam;}
150 double xMax(
int iSkip = -1);
153 double xfHard(
int idIn,
double x,
double Q2)
154 {
return pdfHardBeamPtr->xf(idIn, x, Q2);}
157 double xf(
int idIn,
double x,
double Q2)
158 {
return pdfBeamPtr->xf(idIn, x, Q2);}
161 double xfVal(
int idIn,
double x,
double Q2)
162 {
return pdfBeamPtr->xfVal(idIn, x, Q2);}
163 double xfSea(
int idIn,
double x,
double Q2)
164 {
return pdfBeamPtr->xfSea(idIn, x, Q2);}
168 double xfMPI(
int idIn,
double x,
double Q2)
169 {
return xfModified(-1, idIn, x, Q2);}
170 double xfISR(
int indexMPI,
int idIn,
double x,
double Q2)
171 {
return xfModified( indexMPI, idIn, x, Q2);}
174 int pickValSeaComp();
183 int size()
const {
return resolved.size();}
184 int sizeInit()
const {
return nInit;}
187 void clear() {resolved.resize(0); nInit = 0;}
190 int append(
int iPos,
int idIn,
double x,
int companion = -1)
192 return resolved.size() - 1;}
195 void list(ostream& os = cout)
const;
198 int nValenceKinds()
const {
return nValKinds;}
199 int nValence(
int idIn)
const {
for (
int i = 0; i < nValKinds; ++i)
200 if (idIn == idVal[i])
return nVal[i];
return 0;}
203 bool isUnresolvedLepton();
206 bool remnantFlavours(
Event& event);
209 bool remnantColours(
Event& event, vector<int>& colFrom,
213 double xRemnant(
int i);
216 bool hasJunction()
const {
return hasJunctionBeam;}
217 int junctionCol(
int i)
const {
return junCol[i];}
218 void junctionCol(
int i,
int col) {junCol[i] = col;}
221 bool pickGluon(
double mDiff);
225 int pickRemnant()
const {
return idVal2;}
229 double zShare(
double mDiff,
double m1,
double m2);
230 double pxShare()
const {
return pxRel;}
231 double pyShare()
const {
return pyRel;}
236 static const double XMINUNRESOLVED;
256 int maxValQuark, companionPower;
257 double valencePowerMeson, valencePowerUinP, valencePowerDinP,
258 valenceDiqEnhance, pickQuarkNorm, pickQuarkPower,
259 diffPrimKTwidth, diffLargeMassSuppress;
262 int idBeam, idBeamAbs;
266 bool isUnresolvedBeam, isLeptonBeam, isHadronBeam, isMesonBeam,
268 int nValKinds, idVal[3], nVal[3];
271 int idSave, iSkipSave, nValLeft[3];
272 double xqgTot, xqVal, xqgSea, xqCompSum;
275 vector<ResolvedParton> resolved;
279 bool hasJunctionBeam;
283 double xfModified(
int iSkip,
int idIn,
double x,
double Q2);
286 double xValFrac(
int j,
double Q2);
287 double Q2ValFracSav, uValInt, dValInt;
290 double xCompFrac(
double xs);
293 double xCompDist(
double xc,
double xs);
296 int idVal1, idVal2, idVal3;
297 double zRel, pxRel, pyRel;
305 #endif // Pythia8_BeamParticle_H