13 #ifndef Pythia8_LesHouches_H
14 #define Pythia8_LesHouches_H
18 #include "PythiaStdlib.h"
32 LHAProcess() : idProc(0), xSecProc(0.), xErrProc(0.), xMaxProc(0.) { }
33 LHAProcess(
int idProcIn,
double xSecIn,
double xErrIn,
double xMaxIn) :
34 idProc(idProcIn), xSecProc(xSecIn), xErrProc(xErrIn),
39 double xSecProc, xErrProc, xMaxProc;
52 LHAParticle() : idPart(0), statusPart(0), mother1Part(0),
53 mother2Part(0), col1Part(0), col2Part(0), pxPart(0.), pyPart(0.),
54 pzPart(0.), ePart(0.), mPart(0.), tauPart(0.), spinPart(9.) { }
55 LHAParticle(
int idIn,
int statusIn,
int mother1In,
int mother2In,
56 int col1In,
int col2In,
double pxIn,
double pyIn,
double pzIn,
57 double eIn,
double mIn,
double tauIn,
double spinIn) :
58 idPart(idIn), statusPart(statusIn), mother1Part(mother1In),
59 mother2Part(mother2In), col1Part(col1In), col2Part(col2In),
60 pxPart(pxIn), pyPart(pyIn), pzPart(pzIn), ePart(eIn), mPart(mIn),
61 tauPart(tauIn), spinPart(spinIn) { }
64 int idPart, statusPart, mother1Part, mother2Part, col1Part, col2Part;
65 double pxPart, pyPart, pzPart, ePart, mPart, tauPart, spinPart;
82 void setPtr(
Info* infoPtrIn) {infoPtr = infoPtrIn;}
85 virtual bool fileFound() {
return true;}
90 virtual bool setInit() = 0;
93 int idBeamA()
const {
return idBeamASave;}
94 int idBeamB()
const {
return idBeamBSave;}
95 double eBeamA()
const {
return eBeamASave;}
96 double eBeamB()
const {
return eBeamBSave;}
97 int pdfGroupBeamA()
const {
return pdfGroupBeamASave;}
98 int pdfGroupBeamB()
const {
return pdfGroupBeamBSave;}
99 int pdfSetBeamA()
const {
return pdfSetBeamASave;}
100 int pdfSetBeamB()
const {
return pdfSetBeamBSave;}
103 int strategy()
const {
return strategySave;}
106 int sizeProc()
const {
return processes.size();}
107 int idProcess(
int proc)
const {
return processes[proc].idProc;}
108 double xSec(
int proc)
const {
return processes[proc].xSecProc;}
109 double xErr(
int proc)
const {
return processes[proc].xErrProc;}
110 double xMax(
int proc)
const {
return processes[proc].xMaxProc;}
113 void listInit(ostream& os = cout);
122 virtual bool setEvent(
int idProcIn = 0) = 0;
125 int idProcess()
const {
return idProc;}
126 double weight()
const {
return weightProc;}
127 double scale()
const {
return scaleProc;}
128 double alphaQED()
const {
return alphaQEDProc;}
129 double alphaQCD()
const {
return alphaQCDProc;}
132 int sizePart()
const {
return particles.size();}
133 int id(
int part)
const {
return particles[part].idPart;}
134 int status(
int part)
const {
return particles[part].statusPart;}
135 int mother1(
int part)
const {
return particles[part].mother1Part;}
136 int mother2(
int part)
const {
return particles[part].mother2Part;}
137 int col1(
int part)
const {
return particles[part].col1Part;}
138 int col2(
int part)
const {
return particles[part].col2Part;}
139 double px(
int part)
const {
return particles[part].pxPart;}
140 double py(
int part)
const {
return particles[part].pyPart;}
141 double pz(
int part)
const {
return particles[part].pzPart;}
142 double e(
int part)
const {
return particles[part].ePart;}
143 double m(
int part)
const {
return particles[part].mPart;}
144 double tau(
int part)
const {
return particles[part].tauPart;}
145 double spin(
int part)
const {
return particles[part].spinPart;}
148 bool pdfIsSet()
const {
return pdfIsSetSave;}
149 int id1()
const {
return id1Save;}
150 int id2()
const {
return id2Save;}
151 double x1()
const {
return x1Save;}
152 double x2()
const {
return x2Save;}
153 double scalePDF()
const {
return scalePDFSave;}
154 double xpdf1()
const {
return xpdf1Save;}
155 double xpdf2()
const {
return xpdf2Save;}
158 void listEvent(ostream& os = cout);
162 virtual bool skipEvent(
int nSkip) {
163 for (
int iSkip = 0; iSkip < nSkip; ++iSkip)
164 if (!setEvent())
return false;
return true;}
167 bool openLHEF(
string fileNameIn);
170 bool closeLHEF(
bool updateInit =
false);
175 LHAup(
int strategyIn = 3) : strategySave(strategyIn)
176 { processes.reserve(10); particles.reserve(20); }
179 static const double CONVERTMB2PB;
185 void setBeamA(
int idIn,
double eIn,
int pdfGroupIn = 0,
int pdfSetIn = 0)
186 { idBeamASave = idIn; eBeamASave = eIn; pdfGroupBeamASave = pdfGroupIn;
187 pdfSetBeamASave = pdfSetIn;}
188 void setBeamB(
int idIn,
double eIn,
int pdfGroupIn = 0,
int pdfSetIn = 0)
189 { idBeamBSave = idIn; eBeamBSave = eIn; pdfGroupBeamBSave = pdfGroupIn;
190 pdfSetBeamBSave = pdfSetIn;}
193 void setStrategy(
int strategyIn) {strategySave = strategyIn;}
196 void addProcess(
int idProcIn,
double xSecIn = 1.,
double xErrIn = 0.,
197 double xMaxIn = 1.) { processes.push_back(
LHAProcess( idProcIn,
198 xSecIn, xErrIn, xMaxIn)); }
201 void setXSec(
int iP,
double xSecIn) {processes[iP].xSecProc = xSecIn;}
202 void setXErr(
int iP,
double xErrIn) {processes[iP].xErrProc = xErrIn;}
203 void setXMax(
int iP,
double xMaxIn) {processes[iP].xMaxProc = xMaxIn;}
206 void setProcess(
int idProcIn = 0,
double weightIn = 1.,
double
207 scaleIn = 0.,
double alphaQEDIn = 0.0073,
double alphaQCDIn = 0.12) {
208 idProc = idProcIn; weightProc = weightIn; scaleProc = scaleIn;
209 alphaQEDProc = alphaQEDIn; alphaQCDProc = alphaQCDIn;
211 particles.clear(); addParticle(0); pdfIsSetSave =
false;}
215 particles.push_back(particleIn);}
216 void addParticle(
int idIn,
int statusIn = 0,
int mother1In = 0,
217 int mother2In = 0,
int col1In = 0,
int col2In = 0,
double pxIn = 0.,
218 double pyIn = 0.,
double pzIn = 0.,
double eIn = 0.,
double mIn = 0.,
219 double tauIn = 0.,
double spinIn = 9.) {
220 particles.push_back(
LHAParticle( idIn, statusIn, mother1In, mother2In,
221 col1In, col2In, pxIn, pyIn, pzIn, eIn, mIn, tauIn, spinIn)); }
224 void setPdf(
int id1In,
int id2In,
double x1In,
double x2In,
225 double scalePDFIn,
double xpdf1In,
double xpdf2In,
bool pdfIsSetIn)
226 { id1Save = id1In; id2Save = id2In; x1Save = x1In; x2Save = x2In;
227 scalePDFSave = scalePDFIn; xpdf1Save = xpdf1In; xpdf2Save = xpdf2In;
228 pdfIsSetSave = pdfIsSetIn;}
231 bool setInitLHEF(istream& is);
232 bool setNewEventLHEF(istream& is);
233 bool setOldEventLHEF();
236 int nupSave, idprupSave;
237 double xwgtupSave, scalupSave, aqedupSave, aqcdupSave;
238 vector<LHAParticle> particlesSave;
240 int id1InSave, id2InSave;
241 double x1InSave, x2InSave, scalePDFInSave, xpdf1InSave, xpdf2InSave;
249 int idBeamASave, idBeamBSave;
250 double eBeamASave, eBeamBSave;
251 int pdfGroupBeamASave, pdfGroupBeamBSave, pdfSetBeamASave, pdfSetBeamBSave;
254 vector<LHAProcess> processes;
258 double weightProc, scaleProc, alphaQEDProc, alphaQCDProc;
261 vector<LHAParticle> particles;
265 int id1Save, id2Save;
266 double x1Save, x2Save, scalePDFSave, xpdf1Save, xpdf2Save;
291 bool fileFound() {
return is->good();}
294 bool setInit() {
return setInitLHEF(*is);}
297 bool setEvent(
int = 0) {
if (!setNewEventLHEF(*is))
return false;
298 return setOldEventLHEF();}
301 bool skipEvent(
int nSkip) {
for (
int iSkip = 0; iSkip < nSkip; ++iSkip)
302 if (!setNewEventLHEF(*is))
return false;
return true;}
326 processPtr = processPtrIn; infoPtr = infoPtrIn;}
335 bool setEvent(
int = 0);
352 #endif // Pythia8_LesHouches_H