/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 //-------------------------------------------------------------------------- 00002 #ifndef PYTHIA_WRAPPER_H 00003 #define PYTHIA_WRAPPER_H 00004 00006 // Matt.Dobbs@Cern.CH, November 2000 00007 // Version 6.200 update October 2001 00008 // Wrapper for FORTRAN version of Pythia 00009 // This wrapper is NOT intended as a part of HepMC - it is only supplied 00010 // for your convenience. 00012 // 00013 // A simple example of calling Pythia from C++ using this header file is 00014 // given in test/test_PythiaWrapper.cxx 00015 // 00016 // Note the pyhepc routine is used by Pythia to fill 00017 // the HEPEVT common block uses double precision and 4000 entries. 00018 // 00019 00020 #include <ctype.h> 00021 #include <cstring> 00022 00023 //-------------------------------------------------------------------------- 00024 // Initialization routine 00025 00026 00027 extern "C" { 00028 void initpydata(void); 00029 } 00030 #define initpydata initpydata_ 00031 00032 //-------------------------------------------------------------------------- 00033 // PYTHIA Common Block Declarations 00034 00035 const int pyjets_maxn =4000; 00036 extern "C" { 00037 extern struct { 00038 int n, npad, k[5][pyjets_maxn]; 00039 double p[5][pyjets_maxn], v[5][pyjets_maxn]; 00040 } pyjets_; 00041 } 00042 #define pyjets pyjets_ 00043 00044 extern "C" { 00045 extern struct { 00046 int mstu[200]; 00047 double paru[200]; 00048 int mstj[200]; 00049 double parj[200]; 00050 } pydat1_; 00051 } 00052 #define pydat1 pydat1_ 00053 00054 extern "C" { 00055 extern struct { 00056 int kchg[4][500]; 00057 double pmas[4][500], parf[2000], vckm[4][4]; 00058 } pydat2_; 00059 } 00060 #define pydat2 pydat2_ 00061 00062 extern "C" { 00063 extern struct { 00064 int mdcy[3][500], mdme[2][8000]; 00065 double brat[8000]; 00066 int kfdp[5][8000]; 00067 } pydat3_; 00068 } 00069 #define pydat3 pydat3_ 00070 00071 extern "C" { 00072 extern struct { 00073 int mrpy[6]; 00074 double rrpy[100]; 00075 } pydatr_; 00076 } 00077 #define pydatr pydatr_ 00078 00079 extern "C" { 00080 extern struct { 00081 int msel, mselpd, msub[500], kfin[81][2]; 00082 double ckin[200]; 00083 } pysubs_; 00084 } 00085 #define pysubs pysubs_ 00086 00087 extern "C" { 00088 extern struct { 00089 int mstp[200]; 00090 double parp[200]; 00091 int msti[200]; 00092 double pari[200]; 00093 } pypars_; 00094 } 00095 #define pypars pypars_ 00096 00097 extern "C" { 00098 extern struct { 00099 int mint[400]; 00100 double vint[400]; 00101 } pyint1_; 00102 } 00103 #define pyint1 pyint1_ 00104 00105 extern "C" { 00106 extern struct { 00107 int iset[500], kfpr[2][500]; 00108 double coef[20][500]; 00109 int icol[2][4][40]; // was [320] was [40][4][2] 00110 } pyint2_; 00111 } 00112 #define pyint2 pyint2_ 00113 00114 extern "C" { 00115 extern struct { 00116 int ngenpd, ngen[3][501]; 00117 double xsec[3][501]; 00118 } pyint5_; 00119 } 00120 #define pyint5 pyint5_ 00121 00122 //-------------------------------------------------------------------------- 00123 // PYTHIA routines declaration 00124 00125 #define pyhepc pyhepc_ 00126 #define pyinit pyinit_ 00127 #define pylist pylist_ 00128 #define pystat pystat_ 00129 #define pyevnt pyevnt_ 00130 #define upinit upinit_ 00131 #define upevnt upevnt_ 00132 extern "C" { 00133 void pyhepc(int*); 00134 void pyinit(const char*,const char*,const char*,double*,int,int,int); 00135 void pylist(int*); 00136 void pystat(int*); 00137 void pyevnt(); 00138 void upinit(); 00139 void upevnt(); 00140 } 00141 00142 // define methods to hide the subtle syntax necessary to call fortran from C++ 00143 inline void call_pyhepc( int mode ){ pyhepc( &mode ); } 00144 inline void call_pyinit( const char* frame, const char* beam, const char* target, 00145 double win ) 00146 { pyinit( frame,beam,target,&win,strlen(frame),strlen(beam),strlen(target) ); } 00147 inline void call_pylist( int mode ){ pylist( &mode ); } 00148 inline void call_pystat( int mode ){ pystat( &mode ); } 00149 inline void call_pyevnt(){ pyevnt(); } 00150 00151 00152 //-------------------------------------------------------------------------- 00153 // PYTHIA block data 00154 // ( with gcc it works to initialize the block data by calling 00155 // "pydata();" at beginning, but this fails for f77, so the fortran routine 00156 // initpydata.f is supplied ... call it instead for platform independent 00157 // behaviour ) 00158 00159 #define pydata pydata_ 00160 extern "C" { 00161 void pydata(void); 00162 } 00163 00164 #endif // PYTHIA_WRAPPER_H 00165 //--------------------------------------------------------------------------