Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:00:42

0001 //#include "Pythia.h"
0002 //using namespace Pythia8; 
0003 
0004 //==========================================================================
0005 
0006 // Declare the Fortran subroutines that may be used.
0007 // This code section is generic.
0008 
0009 #include <string>
0010 
0011 extern "C" {
0012   extern void pyinit_(const char*, const char*, const char*, double&, int, int, int);
0013   extern void pyevnt_();
0014   extern void pygive_(const char*, int);
0015   extern void pyfram_(int&);
0016   extern void pylist_(int&);
0017   extern void pystat_(int&);
0018   extern int pycomp_(int&);
0019   
0020   extern struct
0021         {
0022       int n;
0023       int npad;
0024       int k[5][4000];
0025       double p[5][4000];
0026       double v[5][4000];
0027         } pyjets_;
0028     extern struct
0029     {
0030       int mdcy[3][500];
0031       int mdme[2][8000];
0032       double brat[8000];
0033       int kfpd[5][8000];
0034     } pydat3_;
0035 }
0036 
0037 
0038 class pythiaInterface {
0039 
0040 public:
0041 
0042   // Give in a command to change a setting.
0043   static void pygive(const std::string cmnd) { 
0044     const char* cstring = cmnd.c_str(); int len = cmnd.length(); 
0045     pygive_(cstring, len);
0046   }
0047 
0048   // Initialize the generation for the given beam confiuration.
0049   static void pyinit(const std::string frame, const std::string beam, 
0050     const std::string target, double wIn) { 
0051     const char* cframe = frame.c_str(); int lenframe = frame.length();
0052     const char* cbeam = beam.c_str(); int lenbeam = beam.length();
0053     const char* ctarget = target.c_str(); int lentarget = target.length();
0054     pyinit_(cframe, cbeam, ctarget, wIn, lenframe, lenbeam, lentarget); 
0055   }
0056   
0057   static void pyevnt() {pyevnt_();}
0058   
0059   static void pyfram(int frame) { pyfram_(frame); }
0060   
0061   // List the event at the process level.
0062   static void pylist(int mode) {pylist_(mode);}
0063 
0064   // Print statistics on the event generation process.
0065   static void pystat(int mode) {pystat_(mode);}
0066 
0067   // Get compressed code (KC) from PDG code
0068   static int pycomp(int pdg) { return pycomp_(pdg);}
0069 
0070   
0071 };