PYTHIA  8.312
LesHouches.h
1 // LesHouches.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for Les Houches Accord user process information.
7 // LHAProcess: stores a single process; used by the other classes.
8 // LHAParticle: stores a single particle; used by the other classes.
9 // LHAup: base class for initialization and event information.
10 // LHAupLHEF: derived class for reading from an Les Houches Event File.
11 // Code for interfacing with Fortran commonblocks is found in LHAFortran.h.
12 
13 #ifndef Pythia8_LesHouches_H
14 #define Pythia8_LesHouches_H
15 
16 #include "Pythia8/Event.h"
17 #include "Pythia8/Info.h"
18 #include "Pythia8/PythiaStdlib.h"
19 #include "Pythia8/Settings.h"
20 #include "Pythia8/Streams.h"
21 
22 namespace Pythia8 {
23 
24 //==========================================================================
25 
26 // A class for the processes stored in LHAup.
27 
28 class LHAProcess {
29 
30 public:
31 
32  // Constructors.
33  LHAProcess() : idProc(0), xSecProc(0.), xErrProc(0.), xMaxProc(0.) { }
34  LHAProcess(int idProcIn, double xSecIn, double xErrIn, double xMaxIn) :
35  idProc(idProcIn), xSecProc(xSecIn), xErrProc(xErrIn),
36  xMaxProc(xMaxIn) { }
37 
38  // Process properties.
39  int idProc;
40  double xSecProc, xErrProc, xMaxProc;
41 
42 } ;
43 
44 //==========================================================================
45 
46 // A class for the particles stored in LHAup.
47 
48 class LHAParticle {
49 
50 public:
51 
52  // Constructors.
53  LHAParticle() : idPart(0), statusPart(0), mother1Part(0),
54  mother2Part(0), col1Part(0), col2Part(0), pxPart(0.), pyPart(0.),
55  pzPart(0.), ePart(0.), mPart(0.), tauPart(0.), spinPart(9.),
56  scalePart(-1.) { }
57  LHAParticle(int idIn, int statusIn, int mother1In, int mother2In,
58  int col1In, int col2In, double pxIn, double pyIn, double pzIn,
59  double eIn, double mIn, double tauIn, double spinIn,
60  double scaleIn) :
61  idPart(idIn), statusPart(statusIn), mother1Part(mother1In),
62  mother2Part(mother2In), col1Part(col1In), col2Part(col2In),
63  pxPart(pxIn), pyPart(pyIn), pzPart(pzIn), ePart(eIn), mPart(mIn),
64  tauPart(tauIn), spinPart(spinIn), scalePart(scaleIn) { }
65 
66  // Particle properties.
67  int idPart, statusPart, mother1Part, mother2Part, col1Part, col2Part;
68  double pxPart, pyPart, pzPart, ePart, mPart, tauPart, spinPart,
69  scalePart;
70 
71 } ;
72 
73 //==========================================================================
74 
75 // LHAup is base class for initialization and event information
76 // from an external parton-level generator.
77 
78 class LHAup {
79 
80 public:
81 
82  // Destructor.
83  virtual ~LHAup() {}
84 
85  // Set pointers.
86  void setPtr(Info* infoPtrIn) {infoPtr = infoPtrIn;
87  loggerPtr = infoPtrIn->loggerPtr;}
88 
89  // Method to be used for LHAupLHEF derived class.
90  virtual void newEventFile(const char*) {}
91  virtual bool fileFound() {return true;}
92  virtual bool useExternal() {return false;}
93 
94  // A pure virtual method setInit, wherein all initialization information
95  // is supposed to be set in the derived class. Can do this by reading a
96  // file or some other way, as desired. Returns false if it did not work.
97  virtual bool setInit() = 0;
98 
99  // Give back info on beams.
100  int idBeamA() const {return idBeamASave;}
101  int idBeamB() const {return idBeamBSave;}
102  double eBeamA() const {return eBeamASave;}
103  double eBeamB() const {return eBeamBSave;}
104  int pdfGroupBeamA() const {return pdfGroupBeamASave;}
105  int pdfGroupBeamB() const {return pdfGroupBeamBSave;}
106  int pdfSetBeamA() const {return pdfSetBeamASave;}
107  int pdfSetBeamB() const {return pdfSetBeamBSave;}
108 
109  // Give back weight strategy.
110  int strategy() const {return strategySave;}
111 
112  // Give back info on processes.
113  int sizeProc() const {return processes.size();}
114  int idProcess(int proc) const {return processes[proc].idProc;}
115  double xSec(int proc) const {return processes[proc].xSecProc;}
116  double xErr(int proc) const {return processes[proc].xErrProc;}
117  double xMax(int proc) const {return processes[proc].xMaxProc;}
118  double xSecSum() const {return xSecSumSave;}
119  double xErrSum() const {return xErrSumSave;}
120 
121  // Print the initialization info; useful to check that setting it worked.
122  void listInit();
123 
124  // A pure virtual method setEvent, wherein information on the next event
125  // is supposed to be set in the derived class.
126  // Strategies +-1 and +-2: idProcIn is the process type, selected by PYTHIA.
127  // Strategies +-3 and +-4: idProcIn is dummy; process choice is made locally.
128  // The method can find the next event by a runtime interface to another
129  // program, or by reading a file, as desired.
130  // The method should return false if it did not work.
131  virtual bool setEvent(int idProcIn = 0) = 0;
132 
133  // Give back process number, weight, scale, alpha_em, alpha_s.
134  int idProcess() const {return idProc;}
135  double weight() const {return weightProc;}
136  double scale() const {return scaleProc;}
137  double alphaQED() const {return alphaQEDProc;}
138  double alphaQCD() const {return alphaQCDProc;}
139 
140  // Give back info on separate particle.
141  int sizePart() const {return particles.size();}
142  int id(int part) const {return particles[part].idPart;}
143  int status(int part) const {return particles[part].statusPart;}
144  int mother1(int part) const {return particles[part].mother1Part;}
145  int mother2(int part) const {return particles[part].mother2Part;}
146  int col1(int part) const {return particles[part].col1Part;}
147  int col2(int part) const {return particles[part].col2Part;}
148  double px(int part) const {return particles[part].pxPart;}
149  double py(int part) const {return particles[part].pyPart;}
150  double pz(int part) const {return particles[part].pzPart;}
151  double e(int part) const {return particles[part].ePart;}
152  double m(int part) const {return particles[part].mPart;}
153  double tau(int part) const {return particles[part].tauPart;}
154  double spin(int part) const {return particles[part].spinPart;}
155  double scale(int part) const {return particles[part].scalePart;}
156 
157  // Give back info on flavour and x values of hard-process initiators.
158  int id1() const {return id1Save;}
159  int id2() const {return id2Save;}
160  double x1() const {return x1Save;}
161  double x2() const {return x2Save;}
162 
163  // Optional: give back info on parton density values of event.
164  bool pdfIsSet() const {return pdfIsSetSave;}
165  int id1pdf() const {return id1pdfSave;}
166  int id2pdf() const {return id2pdfSave;}
167  double x1pdf() const {return x1pdfSave;}
168  double x2pdf() const {return x2pdfSave;}
169  double scalePDF() const {return scalePDFSave;}
170  double pdf1() const {return pdf1Save;}
171  double pdf2() const {return pdf2Save;}
172 
173  // Optional: give back info on parton shower scales.
174  bool scaleShowersIsSet() const {return scaleShowersIsSetSave;}
175  double scaleShowers(int i) const {return scaleShowersSave[i];}
176 
177  // Print the info; useful to check that reading an event worked.
178  void listEvent();
179 
180  // Skip ahead a number of events, which are not considered further.
181  // Mainly intended for debug when using the LHAupLHEF class.
182  virtual bool skipEvent(int nSkip) {
183  for (int iSkip = 0; iSkip < nSkip; ++iSkip) if (!setEvent()) return false;
184  return true;}
185 
186  // Four routines to write a Les Houches Event file in steps.
187  virtual bool openLHEF(string fileNameIn);
188  virtual bool closeLHEF(bool updateInit = false);
189  bool initLHEF();
190  bool eventLHEF(bool verbose = true);
191 
192  // Get access to the Les Houches Event file name.
193  string getFileName() const {return fileName;}
194 
195 protected:
196 
197  // Constructor. Sets default to be that events come with unit weight.
198  LHAup(int strategyIn = 3) : infoPtr(), nupSave(), idprupSave(),
199  xwgtupSave(), scalupSave(), aqedupSave(), aqcdupSave(), xSecSumSave(),
200  xErrSumSave(), getPDFSave(), getScale(), getScaleShowers(),
201  id1InSave(), id2InSave(), id1pdfInSave(), id2pdfInSave(), x1InSave(),
202  x2InSave(), x1pdfInSave(), x2pdfInSave(), scalePDFInSave(),
203  pdf1InSave(), pdf2InSave(), scaleShowersInSave(), fileName("void"),
204  dateNow(), timeNow(), strategySave(strategyIn), idBeamASave(),
205  idBeamBSave(), eBeamASave(), eBeamBSave(), pdfGroupBeamASave(),
206  pdfGroupBeamBSave(), pdfSetBeamASave(), pdfSetBeamBSave(), idProc(),
207  weightProc(), scaleProc(), alphaQEDProc(), alphaQCDProc(),
208  pdfIsSetSave(), scaleShowersIsSetSave(false), id1Save(),
209  id2Save(), id1pdfSave(), id2pdfSave(), x1Save(), x2Save(), x1pdfSave(),
210  x2pdfSave(), scalePDFSave(), pdf1Save(), pdf2Save(), scaleShowersSave() {
211  processes.reserve(10); particles.reserve(20);
212  setBeamA( 0, 0., 0, 0); setBeamB( 0, 0., 0, 0); }
213 
214  // Allow conversion from mb to pb.
215  static const double CONVERTMB2PB;
216 
217  // Pointer to various information on the generation.
219  Logger* loggerPtr;
220 
221  // Input beam info.
222  void setBeamA(int idIn, double eIn, int pdfGroupIn = 0, int pdfSetIn = 0)
223  { idBeamASave = idIn; eBeamASave = eIn; pdfGroupBeamASave = pdfGroupIn;
224  pdfSetBeamASave = pdfSetIn;}
225  void setBeamB(int idIn, double eIn, int pdfGroupIn = 0, int pdfSetIn = 0)
226  { idBeamBSave = idIn; eBeamBSave = eIn; pdfGroupBeamBSave = pdfGroupIn;
227  pdfSetBeamBSave = pdfSetIn;}
228 
229  // Input process weight strategy.
230  void setStrategy(int strategyIn) {strategySave = strategyIn;}
231 
232  // Input process info.
233  void addProcess(int idProcIn, double xSecIn = 1., double xErrIn = 0.,
234  double xMaxIn = 1.) { processes.push_back( LHAProcess( idProcIn,
235  xSecIn, xErrIn, xMaxIn)); }
236 
237  // Possibility to update some cross section info at end of run.
238  void setXSec(int iP, double xSecIn) {processes[iP].xSecProc = xSecIn;}
239  void setXErr(int iP, double xErrIn) {processes[iP].xErrProc = xErrIn;}
240  void setXMax(int iP, double xMaxIn) {processes[iP].xMaxProc = xMaxIn;}
241 
242  // Input info on the selected process.
243  void setProcess(int idProcIn = 0, double weightIn = 1., double
244  scaleIn = 0., double alphaQEDIn = 0.0073, double alphaQCDIn = 0.12) {
245  idProc = idProcIn; weightProc = weightIn; scaleProc = scaleIn;
246  alphaQEDProc = alphaQEDIn; alphaQCDProc = alphaQCDIn;
247  // Clear particle list. Add empty zeroth particle for correct indices.
248  particles.clear(); addParticle(0); pdfIsSetSave = false;
249  scaleShowersIsSetSave = false;}
250 
251  // Input particle info, one particle at the time.
252  void addParticle(LHAParticle particleIn) {
253  particles.push_back(particleIn);}
254  void addParticle(int idIn, int statusIn = 0, int mother1In = 0,
255  int mother2In = 0, int col1In = 0, int col2In = 0, double pxIn = 0.,
256  double pyIn = 0., double pzIn = 0., double eIn = 0., double mIn = 0.,
257  double tauIn = 0., double spinIn = 9., double scaleIn = -1.) {
258  particles.push_back( LHAParticle( idIn, statusIn, mother1In, mother2In,
259  col1In, col2In, pxIn, pyIn, pzIn, eIn, mIn, tauIn, spinIn,
260  scaleIn) ); }
261 
262  // Input info on flavour and x values of hard-process initiators.
263  void setIdX(int id1In, int id2In, double x1In, double x2In)
264  { id1Save = id1In; id2Save = id2In; x1Save = x1In; x2Save = x2In;}
265 
266  // Optionally input info on parton density values of event.
267  void setPdf(int id1pdfIn, int id2pdfIn, double x1pdfIn, double x2pdfIn,
268  double scalePDFIn, double pdf1In, double pdf2In, bool pdfIsSetIn)
269  { id1pdfSave = id1pdfIn; id2pdfSave = id2pdfIn; x1pdfSave = x1pdfIn;
270  x2pdfSave = x2pdfIn; scalePDFSave = scalePDFIn; pdf1Save = pdf1In;
271  pdf2Save = pdf2In; pdfIsSetSave = pdfIsSetIn;}
272 
273  // Optionally input info on parton shower starting scale; two for DPS.
274  void setScaleShowers( double scaleIn1, double scaleIn2 = 0.)
275  { scaleShowersSave[0] = scaleIn1; scaleShowersSave[1] = scaleIn2;
276  scaleShowersIsSetSave = true;}
277 
278  // Three routines for LHEF files, but put here for flexibility.
279  bool setInitLHEF(istream& is, bool readHeaders = false);
280  bool setNewEventLHEF(istream& is);
281  bool setOldEventLHEF();
282 
283  // Helper routines to open and close a file handling GZIP:
284  // ifstream ifs;
285  // istream *is = openFile("myFile.txt", ifs);
286  // -- Process file using is --
287  // closeFile(is, ifs);
288  istream* openFile(const char *fn, ifstream &ifs);
289  void closeFile(istream *&is, ifstream &ifs);
290 
291  // LHAup is a friend class to infoPtr, but derived classes
292  // are not. This wrapper function can be used by derived classes
293  // to set headers in the Info class.
294  void setInfoHeader(const string &key, const string &val) {
295  infoPtr->setHeader(key, val); }
296 
297  // Event properties from LHEF files, for repeated use.
298  int nupSave, idprupSave;
299  double xwgtupSave, scalupSave, aqedupSave, aqcdupSave, xSecSumSave,
300  xErrSumSave;
301  vector<LHAParticle> particlesSave;
302  bool getPDFSave, getScale, getScaleShowers;
303  int id1InSave, id2InSave, id1pdfInSave, id2pdfInSave;
304  double x1InSave, x2InSave, x1pdfInSave, x2pdfInSave, scalePDFInSave,
305  pdf1InSave, pdf2InSave, scaleShowersInSave[2];
306 
307  // File to which to write Les Houches Event File information.
308  string fileName;
309  fstream osLHEF;
310  char dateNow[12];
311  char timeNow[9];
312 
313 private:
314 
315  // Event weighting and mixing strategy.
316  int strategySave;
317 
318  // Beam particle properties.
319  int idBeamASave, idBeamBSave;
320  double eBeamASave, eBeamBSave;
321  int pdfGroupBeamASave, pdfGroupBeamBSave, pdfSetBeamASave,
322  pdfSetBeamBSave;
323 
324  // The process list, stored as a vector of processes.
325  vector<LHAProcess> processes;
326 
327  // Store info on the selected process.
328  int idProc;
329  double weightProc, scaleProc, alphaQEDProc, alphaQCDProc;
330 
331  // The particle list, stored as a vector of particles.
332  vector<LHAParticle> particles;
333 
334  // Info on initiators and optionally on parton density values of event.
335  bool pdfIsSetSave, scaleShowersIsSetSave;
336  int id1Save, id2Save, id1pdfSave, id2pdfSave;
337  double x1Save, x2Save, x1pdfSave, x2pdfSave, scalePDFSave, pdf1Save,
338  pdf2Save, scaleShowersSave[2];
339 
340 };
341 
342 //==========================================================================
343 
344 // A derived class with information read from a Les Houches Event File.
345 
346 class LHAupLHEF : public LHAup {
347 
348 public:
349 
350  // Constructor.
351  LHAupLHEF(Pythia8::Info* infoPtrIn, istream* isIn, istream* isHeadIn,
352  bool readHeadersIn = false, bool setScalesFromLHEFIn = false ) :
353  filename(""), headerfile(""),
354  is(isIn), is_gz(nullptr), isHead(isHeadIn), isHead_gz(nullptr),
355  readHeaders(readHeadersIn), reader(is),
356  setScalesFromLHEF(setScalesFromLHEFIn), hasExtFileStream(true),
357  hasExtHeaderStream(true) {setPtr(infoPtrIn);}
358 
359  LHAupLHEF(Pythia8::Info* infoPtrIn, const char* filenameIn,
360  const char* headerIn = nullptr, bool readHeadersIn = false,
361  bool setScalesFromLHEFIn = false ) :
362  filename(filenameIn), headerfile(headerIn),
363  is(nullptr), is_gz(nullptr), isHead(nullptr), isHead_gz(nullptr),
364  readHeaders(readHeadersIn), reader(filenameIn),
365  setScalesFromLHEF(setScalesFromLHEFIn), hasExtFileStream(false),
366  hasExtHeaderStream(false) {
367  setPtr(infoPtrIn);
368  is = (openFile(filenameIn, ifs));
369  isHead = (headerfile == nullptr) ? is : openFile(headerfile, ifsHead);
370  is_gz = new igzstream(filename);
371  isHead_gz = (headerfile == nullptr) ? is_gz : new igzstream(headerfile);
372  }
373 
374  // Destructor.
376  // Close files
377  closeAllFiles();
378  }
379 
380  // Helper routine to correctly close files.
381  void closeAllFiles() {
382 
383  if (!hasExtHeaderStream && isHead_gz != is_gz) isHead_gz->close();
384  if (isHead_gz != is_gz) delete isHead_gz;
385  if (is_gz) is_gz->close();
386  if (is_gz) delete is_gz;
387 
388  // Close header file if separate, and close main file.
389  if (!hasExtHeaderStream && isHead != is) closeFile(isHead, ifsHead);
390  if (!hasExtFileStream) closeFile(is, ifs);
391  }
392 
393  // Want to use new file with events, but without reinitialization.
394  void newEventFile(const char* filenameIn) {
395  // Close files and then open new file.
396  closeAllFiles();
397  is = (openFile(filenameIn, ifs));
398  is_gz = new igzstream(filenameIn);
399  // Re-initialise Les Houches file reader.
400  reader.setup(filenameIn);
401  // Set isHead to is to keep expected behaviour in
402  // fileFound() and closeAllFiles().
403  isHead = is;
404  isHead_gz = is_gz;
405  }
406 
407  // Confirm that file was found and opened as expected.
408  bool fileFound() {return (useExternal() || (isHead->good() && is->good()));}
409  bool useExternal() {return (hasExtHeaderStream && hasExtFileStream);}
410 
411  // Routine for doing the job of reading and setting initialization info.
412  bool setInit() {
413  return setInitLHEF(*isHead, readHeaders);
414  }
415 
416  // Routine for doing the job of reading and setting initialization info.
417  bool setInitLHEF( istream & isIn, bool readHead);
418 
419  // Routine for doing the job of reading and setting info on next event.
420  bool setEvent(int = 0) {
421  if (!setNewEventLHEF()) return false;
422  return setOldEventLHEF();
423  }
424 
425  // Skip ahead a number of events, which are not considered further.
426  bool skipEvent(int nSkip) {
427  for (int iSkip = 0; iSkip < nSkip; ++iSkip)
428  if (!setNewEventLHEF()) return false;
429  return true;
430  }
431 
432  // Routine for doing the job of reading and setting info on next event.
433  bool setNewEventLHEF();
434 
435  // Update cross-section information at the end of the run.
436  bool updateSigma() {return true;}
437 
438 protected:
439 
440  // Used internally to read a single line from the stream.
441  bool getLine(string & line, bool header = true) {
442 #ifdef GZIP
443  if ( isHead_gz && header && !getline(*isHead_gz, line)) return false;
444  else if ( is_gz && !header && !getline(*is_gz, line)) return false;
445  if (header && !getline(*isHead, line)) return false;
446  else if (!header && !getline(*is, line)) return false;
447 #else
448  if (header && !getline(*isHead, line)) return false;
449  else if (!header && !getline(*is, line)) return false;
450 #endif
451  // Replace single by double quotes
452  replace(line.begin(),line.end(),'\'','\"');
453  return true;
454  }
455 
456 private:
457 
458  const char* filename;
459  const char* headerfile;
460 
461  // File from which to read (or a stringstream).
462  // Optionally also a file from which to read the LHEF header.
463  istream *is;
464  igzstream *is_gz;
465  ifstream ifs;
466  istream *isHead;
467  igzstream *isHead_gz;
468  ifstream ifsHead;
469 
470  // Flag to read headers or not
471  bool readHeaders;
472 
473  Reader reader;
474 
475  // Flag to set particle production scales or not.
476  bool setScalesFromLHEF, hasExtFileStream, hasExtHeaderStream;
477 
478 };
479 
480 //==========================================================================
481 
482 // A derived class with information read from PYTHIA 8 itself, for output.
483 
484 class LHAupFromPYTHIA8 : public LHAup {
485 
486 public:
487 
488  // Constructor.
489  LHAupFromPYTHIA8(Event* processPtrIn, const Info* infoPtrIn) {
490  processPtr = processPtrIn; infoPtr = infoPtrIn;}
491 
492  // Destructor.
494 
495  // Routine for doing the job of reading and setting initialization info.
496  bool setInit();
497 
498  // Routine for doing the job of reading and setting info on next event.
499  bool setEvent(int = 0);
500 
501  // Update cross-section information at the end of the run.
502  bool updateSigma();
503 
504 private:
505 
506  // Pointer to process event record.
507  Event* processPtr;
508 
509  // Constant info pointer, explicitly overwrites member from LHAup base class.
510  const Info* infoPtr;
511 
512 };
513 
514 //==========================================================================
515 
516 // A derived class with LHEF 3.0 information read from PYTHIA 8 itself, for
517 // output.
518 
519 class LHEF3FromPythia8 : public LHAup {
520 
521 public:
522 
523  // Constructor.
524  LHEF3FromPythia8(Event* eventPtrIn, const Info* infoPtrIn,
525  int pDigitsIn = 15, bool writeToFileIn = true) :
526  eventPtr(eventPtrIn),infoPtr(infoPtrIn),
527  particleDataPtr(infoPtrIn->particleDataPtr),
528  settingsPtr(infoPtrIn->settingsPtr), writer(osLHEF),
529  pDigits(pDigitsIn), writeToFile(writeToFileIn) {}
530 
531  // Routine for reading, setting and printing the initialisation info.
532  bool setInit();
533 
534  // Routine for reading, setting and printing the next event.
535  void setEventPtr(Event* evPtr) { eventPtr = evPtr; }
536  bool setEvent(int = 0);
537  string getEventString() { return writer.getEventString(&hepeup); }
538 
539  // Function to open the output file.
540  bool openLHEF(string fileNameIn);
541 
542  // Function to close (and possibly update) the output file.
543  bool closeLHEF(bool updateInit = false);
544 
545  // Some init and event block objects for convenience.
547  HEPEUP hepeup;
548 
549  // Pointer to event that should be printed.
551 
552  // Constant info pointer, explicitly overwrites member from LHAup base class.
553  const Info* infoPtr;
554 
555  ParticleData* particleDataPtr;
556 
557 private:
558 
559  // Pointer to settings and info objects.
560  Settings* settingsPtr;
561 
562  // LHEF3 writer
563  Writer writer;
564 
565  // Number of digits to set width of double write out
566  int pDigits;
567  bool writeToFile;
568 
569 };
570 
571 //==========================================================================
572 
573 } // end namespace Pythia8
574 
575 #endif // Pythia8_LesHouches_H
string getFileName() const
Get access to the Les Houches Event file name.
Definition: LesHouches.h:193
void setBeamA(int idIn, double eIn, int pdfGroupIn=0, int pdfSetIn=0)
Input beam info.
Definition: LesHouches.h:222
void addProcess(int idProcIn, double xSecIn=1., double xErrIn=0., double xMaxIn=1.)
Input process info.
Definition: LesHouches.h:233
static const double CONVERTMB2PB
Allow conversion from mb to pb.
Definition: LesHouches.h:215
void setPtr(Info *infoPtrIn)
Set pointers.
Definition: LesHouches.h:86
LHAProcess()
Constructors.
Definition: LesHouches.h:33
bool fileFound()
Confirm that file was found and opened as expected.
Definition: LesHouches.h:408
Definition: LHEF3.h:814
Definition: Info.h:45
void setStrategy(int strategyIn)
Input process weight strategy.
Definition: LesHouches.h:230
~LHAupFromPYTHIA8()
Destructor.
Definition: LesHouches.h:493
The Event class holds all info on the generated event.
Definition: Event.h:453
Definition: LHEF3.h:998
Logger * loggerPtr
Pointer to the logger.
Definition: Info.h:86
LHAup(int strategyIn=3)
Constructor. Sets default to be that events come with unit weight.
Definition: LesHouches.h:198
void setIdX(int id1In, int id2In, double x1In, double x2In)
Input info on flavour and x values of hard-process initiators.
Definition: LesHouches.h:263
A class for the particles stored in LHAup.
Definition: LesHouches.h:48
A class for the processes stored in LHAup.
Definition: LesHouches.h:28
A derived class with information read from PYTHIA 8 itself, for output.
Definition: LesHouches.h:484
HEPRUP heprup
Some init and event block objects for convenience.
Definition: LesHouches.h:546
void setScaleShowers(double scaleIn1, double scaleIn2=0.)
Optionally input info on parton shower starting scale; two for DPS.
Definition: LesHouches.h:274
bool scaleShowersIsSet() const
Optional: give back info on parton shower scales.
Definition: LesHouches.h:174
int id1() const
Give back info on flavour and x values of hard-process initiators.
Definition: LesHouches.h:158
Definition: Logger.h:23
virtual ~LHAup()
Destructor.
Definition: LesHouches.h:83
const Info * infoPtr
Constant info pointer, explicitly overwrites member from LHAup base class.
Definition: LesHouches.h:553
bool updateSigma()
Update cross-section information at the end of the run.
Definition: LesHouches.h:436
virtual bool skipEvent(int nSkip)
Definition: LesHouches.h:182
LHAupFromPYTHIA8(Event *processPtrIn, const Info *infoPtrIn)
Constructor.
Definition: LesHouches.h:489
void setEventPtr(Event *evPtr)
Routine for reading, setting and printing the next event.
Definition: LesHouches.h:535
Definition: LesHouches.h:78
int idBeamA() const
Give back info on beams.
Definition: LesHouches.h:100
void addParticle(LHAParticle particleIn)
Input particle info, one particle at the time.
Definition: LesHouches.h:252
void setProcess(int idProcIn=0, double weightIn=1., double scaleIn=0., double alphaQEDIn=0.0073, double alphaQCDIn=0.12)
Input info on the selected process.
Definition: LesHouches.h:243
Definition: LesHouches.h:519
virtual void newEventFile(const char *)
Method to be used for LHAupLHEF derived class.
Definition: LesHouches.h:90
A derived class with information read from a Les Houches Event File.
Definition: LesHouches.h:346
int idPart
Particle properties.
Definition: LesHouches.h:67
Event * eventPtr
Pointer to event that should be printed.
Definition: LesHouches.h:550
void setPdf(int id1pdfIn, int id2pdfIn, double x1pdfIn, double x2pdfIn, double scalePDFIn, double pdf1In, double pdf2In, bool pdfIsSetIn)
Optionally input info on parton density values of event.
Definition: LesHouches.h:267
bool getLine(string &line, bool header=true)
Used internally to read a single line from the stream.
Definition: LesHouches.h:441
int nupSave
Event properties from LHEF files, for repeated use.
Definition: LesHouches.h:298
int sizePart() const
Give back info on separate particle.
Definition: LesHouches.h:141
int idProc
Process properties.
Definition: LesHouches.h:39
string fileName
File to which to write Les Houches Event File information.
Definition: LesHouches.h:308
LHAupLHEF(Pythia8::Info *infoPtrIn, istream *isIn, istream *isHeadIn, bool readHeadersIn=false, bool setScalesFromLHEFIn=false)
Constructor.
Definition: LesHouches.h:351
LHAParticle()
Constructors.
Definition: LesHouches.h:53
bool skipEvent(int nSkip)
Skip ahead a number of events, which are not considered further.
Definition: LesHouches.h:426
int sizeProc() const
Give back info on processes.
Definition: LesHouches.h:113
bool pdfIsSet() const
Optional: give back info on parton density values of event.
Definition: LesHouches.h:164
void newEventFile(const char *filenameIn)
Want to use new file with events, but without reinitialization.
Definition: LesHouches.h:394
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
double m(const Vec4 &v1)
Invariant mass and its square.
Definition: Basics.cc:595
bool setEvent(int=0)
Routine for doing the job of reading and setting info on next event.
Definition: LesHouches.h:420
void setInfoHeader(const string &key, const string &val)
Definition: LesHouches.h:294
bool setInit()
Routine for doing the job of reading and setting initialization info.
Definition: LesHouches.h:412
Definition: LHEF3.h:671
Info * infoPtr
Pointer to various information on the generation.
Definition: LesHouches.h:218
int strategy() const
Give back weight strategy.
Definition: LesHouches.h:110
~LHAupLHEF()
Destructor.
Definition: LesHouches.h:375
Definition: LHEF3.h:562
LHEF3FromPythia8(Event *eventPtrIn, const Info *infoPtrIn, int pDigitsIn=15, bool writeToFileIn=true)
Constructor.
Definition: LesHouches.h:524
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
void setHeader(const string &key, const string &val)
Set LHEF headers.
Definition: Info.h:476
int idProcess() const
Give back process number, weight, scale, alpha_em, alpha_s.
Definition: LesHouches.h:134
void setXSec(int iP, double xSecIn)
Possibility to update some cross section info at end of run.
Definition: LesHouches.h:238
Definition: Settings.h:195
void closeAllFiles()
Helper routine to correctly close files.
Definition: LesHouches.h:381