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