2 //using namespace Pythia8;
4 //==========================================================================
6 // Declare the Fortran subroutines that may be used.
7 // This code section is generic.
12 extern void pyinit_(const char*, const char*, const char*, double&, int, int, int);
13 extern void pyevnt_();
14 extern void pygive_(const char*, int);
15 extern void pyfram_(int&);
16 extern void pylist_(int&);
17 extern void pystat_(int&);
18 extern int pycomp_(int&);
38 class pythiaInterface {
42 // Give in a command to change a setting.
43 static void pygive(const std::string cmnd) {
44 const char* cstring = cmnd.c_str(); int len = cmnd.length();
45 pygive_(cstring, len);
48 // Initialize the generation for the given beam confiuration.
49 static void pyinit(const std::string frame, const std::string beam,
50 const std::string target, double wIn) {
51 const char* cframe = frame.c_str(); int lenframe = frame.length();
52 const char* cbeam = beam.c_str(); int lenbeam = beam.length();
53 const char* ctarget = target.c_str(); int lentarget = target.length();
54 pyinit_(cframe, cbeam, ctarget, wIn, lenframe, lenbeam, lentarget);
57 static void pyevnt() {pyevnt_();}
59 static void pyfram(int frame) { pyfram_(frame); }
61 // List the event at the process level.
62 static void pylist(int mode) {pylist_(mode);}
64 // Print statistics on the event generation process.
65 static void pystat(int mode) {pystat_(mode);}
67 // Get compressed code (KC) from PDG code
68 static int pycomp(int pdg) { return pycomp_(pdg);}