![]() |
HepMC Reference DocumentationHepMC |
00001 //-------------------------------------------------------------------------- 00002 #ifdef _WIN32 // This version is for Windows MS Visual C++ only. 00003 #ifndef PYTHIA_WRAPPER_H 00004 #define PYTHIA_WRAPPER_H 00005 00007 // Matt.Dobbs@Cern.CH, November 2000 00008 // Version 6.200 update October 2001 00009 // Wrapper for FORTRAN version of Pythia 00010 // The _WIN32 version is provided by Witold Pokorski 00011 // <Witold.Pokorski@Cern.CH>, 2002-01-22, and is the version 00012 // which should be used when compiling on Windows MS Visual C++. 00013 // This wrapper is NOT intended as a part of HepMC - it is only supplied 00014 // for your convenience. 00016 // 00017 // A simple example of calling Pythia from C++ using this header file is 00018 // given in test/test_PythiaWrapper.cxx 00019 // 00020 // Note the pyhepc routine is used by Pythia to fill 00021 // the HEPEVT common block uses double precision and 4000 entries. 00022 // 00023 00024 #include <ctype.h> 00025 00026 //-------------------------------------------------------------------------- 00027 // Initialization routine 00028 00029 00030 extern "C" { 00031 void INITPYDATA(void); 00032 } 00033 #define initpydata INITPYDATA 00034 00035 00036 //-------------------------------------------------------------------------- 00037 // PYTHIA Common Block Declarations 00038 00039 const int pyjets_maxn =4000; 00040 struct PYJETS_DEF { 00041 int n, npad, k[5][pyjets_maxn]; 00042 double p[5][pyjets_maxn], v[5][pyjets_maxn]; 00043 }; 00044 00045 struct PYDAT1_DEF{ 00046 int mstu[200]; 00047 double paru[200]; 00048 int mstj[200]; 00049 double parj[200]; 00050 }; 00051 00052 struct PYDAT2_DEF{ 00053 int kchg[4][500]; 00054 double pmas[4][500], parf[2000], vckm[4][4]; 00055 }; 00056 00057 struct PYDAT3_DEF{ 00058 int mdcy[3][500], mdme[2][8000]; 00059 double brat[8000]; 00060 int kfdp[5][8000]; 00061 }; 00062 00063 struct PYDATR_DEF{ 00064 int mrpy[6]; 00065 double rrpy[100]; 00066 }; 00067 00068 struct PYSUBS_DEF{ 00069 int msel, mselpd, msub[500], kfin[81][2]; 00070 double ckin[200]; 00071 }; 00072 00073 struct PYPARS_DEF{ 00074 int mstp[200]; 00075 double parp[200]; 00076 int msti[200]; 00077 double pari[200]; 00078 }; 00079 00080 struct PYINT1_DEF{ 00081 int mint[400]; 00082 double vint[400]; 00083 }; 00084 00085 struct PYINT2_DEF{ 00086 int iset[500], kfpr[2][500]; 00087 double coef[20][500]; 00088 int icol[2][4][40]; // was [320] was [40][4][2] 00089 }; 00090 00091 struct PYINT5_DEF{ 00092 int ngenpd, ngen[3][501]; 00093 double xsec[3][501]; 00094 }; 00095 00096 00097 extern "C" PYSUBS_DEF PYSUBS; 00098 extern "C" PYJETS_DEF PYJETS; 00099 extern "C" PYDAT1_DEF PYDAT1; 00100 extern "C" PYDAT2_DEF PYDAT2; 00101 extern "C" PYPARS_DEF PYPARS; 00102 extern "C" PYDATR_DEF PYDATR; 00103 extern "C" PYDAT3_DEF PYDAT3; 00104 extern "C" PYINT1_DEF PYINT1; 00105 extern "C" PYINT2_DEF PYINT2; 00106 extern "C" PYINT5_DEF PYINT5; 00107 00108 00109 #define pysubs PYSUBS 00110 #define pyjets PYJETS 00111 #define pydat1 PYDAT1 00112 #define pydat2 PYDAT2 00113 #define pypars PYPARS 00114 #define pydatr PYDATR 00115 #define pydat3 PYDAT3 00116 #define pyint1 PYINT1 00117 #define pyint2 PYINT2 00118 #define pyint5 PYINT5 00119 00120 00121 00122 //-------------------------------------------------------------------------- 00123 // PYTHIA routines declaration 00124 00125 00126 extern "C" { 00127 void __stdcall PYHEPC(int*); 00128 void __stdcall PYINIT(const char*,int,const char*,int,const char*,int,double*); 00129 void __stdcall PYLIST(int*); 00130 void __stdcall PYSTAT(int*); 00131 void __stdcall PYEVNT(); 00132 void __stdcall UPINIT(); 00133 void __stdcall UPEVNT(); 00134 } 00135 00136 //-------------------------------------------------------------------------- 00137 // PYTHIA block data 00138 // ( with gcc it works to initialize the block data by calling 00139 // "pydata();" at beginning, but this fails for f77, so the fortran routine 00140 // initpydata.f is supplied ... call it instead for platform independent 00141 // behaviour ) 00142 00143 00144 extern "C" { 00145 void __stdcall PYDATA(void); 00146 } 00147 00148 inline void call_pyhepc( int mode ){ PYHEPC( &mode ); } 00149 inline void call_pyinit( const char* frame, const char* beam, const char* target, 00150 double win ) 00151 { PYINIT( frame,strlen(frame),beam,strlen(beam),target,strlen(target),&win); } 00152 inline void call_pylist( int mode ){ PYLIST( &mode ); } 00153 inline void call_pystat( int mode ){ PYSTAT( &mode ); } 00154 inline void call_pyevnt(){ PYEVNT(); } 00155 inline void call_upinit(){ UPINIT(); } 00156 inline void call_upevnt(){ UPEVNT(); } 00157 00158 00159 00160 00161 #endif // PYTHIA_WRAPPER_H 00162 #endif // _WIN32 00163 //--------------------------------------------------------------------------