]>
Commit | Line | Data |
---|---|---|
da32329d AM |
1 | //#include "Pythia.h" |
2 | //using namespace Pythia8; | |
3 | ||
4 | //========================================================================== | |
5 | ||
6 | // Declare the Fortran subroutines that may be used. | |
7 | // This code section is generic. | |
8 | ||
9 | #include <string> | |
10 | ||
11 | extern "C" { | |
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&); | |
19 | ||
20 | extern struct | |
21 | { | |
22 | int n; | |
23 | int npad; | |
24 | int k[5][4000]; | |
25 | double p[5][4000]; | |
26 | double v[5][4000]; | |
27 | } pyjets_; | |
28 | extern struct | |
29 | { | |
30 | int mdcy[3][500]; | |
31 | int mdme[2][8000]; | |
32 | double brat[8000]; | |
33 | int kfpd[5][8000]; | |
34 | } pydat3_; | |
35 | } | |
36 | ||
37 | ||
38 | class pythiaInterface { | |
39 | ||
40 | public: | |
41 | ||
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); | |
46 | } | |
47 | ||
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); | |
55 | } | |
56 | ||
57 | static void pyevnt() {pyevnt_();} | |
58 | ||
59 | static void pyfram(int frame) { pyfram_(frame); } | |
60 | ||
61 | // List the event at the process level. | |
62 | static void pylist(int mode) {pylist_(mode);} | |
63 | ||
64 | // Print statistics on the event generation process. | |
65 | static void pystat(int mode) {pystat_(mode);} | |
66 | ||
67 | // Get compressed code (KC) from PDG code | |
68 | static int pycomp(int pdg) { return pycomp_(pdg);} | |
69 | ||
70 | ||
71 | }; |