CMS 3D CMS Logo

PythiaWrapper6_2.h

Go to the documentation of this file.
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 extern "C" {
00033 extern struct {
00034     int iprocess;
00035 } process_;
00036 }
00037 #define process process_   // This common is for ATLfast.
00038 
00039 //--------------------------------------------------------------------------
00040 // PYTHIA Common Block Declarations
00041 
00042 const int pyjets_maxn =4000;
00043 extern "C" {
00044     extern struct {
00045         int n, npad, k[5][pyjets_maxn];
00046         double p[5][pyjets_maxn], v[5][pyjets_maxn];
00047     } pyjets_;
00048 }
00049 #define pyjets pyjets_
00050 
00051 extern "C" {
00052     extern struct {
00053         int mstu[200];
00054         double paru[200];
00055         int mstj[200];
00056         double parj[200];
00057     } pydat1_;
00058 }
00059 #define pydat1 pydat1_
00060 
00061 extern "C" {
00062     extern struct {
00063         int kchg[4][500];
00064         double pmas[4][500], parf[2000], vckm[4][4];  
00065     } pydat2_;
00066 }
00067 #define pydat2 pydat2_
00068 
00069 extern "C" {
00070     extern struct {
00071         int mdcy[3][500], mdme[2][8000];
00072         double brat[8000];
00073         int kfdp[5][8000];
00074     } pydat3_;
00075 }
00076 #define pydat3 pydat3_
00077 
00078 extern "C" {
00079     extern struct {
00080         int mrpy[6];
00081         double rrpy[100];
00082     } pydatr_;
00083 }
00084 #define pydatr pydatr_
00085 
00086 extern "C" {
00087     extern struct {
00088         int msel, mselpd, msub[500], kfin[81][2];
00089         double ckin[200];
00090     } pysubs_;
00091 }
00092 #define pysubs pysubs_
00093 
00094 extern "C" {
00095     extern struct {
00096         int mstp[200];
00097         double parp[200];
00098         int msti[200];
00099         double pari[200];
00100     } pypars_;
00101 }
00102 #define pypars pypars_
00103 
00104 extern "C" {
00105     extern struct {
00106         int mint[400];
00107         double vint[400];
00108     } pyint1_;
00109 }
00110 #define pyint1 pyint1_
00111 
00112 extern "C" {
00113     extern struct {
00114         int iset[500], kfpr[2][500];
00115         double coef[20][500];
00116         int icol[2][4][40];       // was [320] was [40][4][2]
00117     } pyint2_;
00118 }
00119 #define pyint2 pyint2_
00120 
00121 extern "C" {
00122     extern struct {
00123         int ngenpd, ngen[3][501];
00124         double xsec[3][501];
00125     } pyint5_;
00126 }
00127 #define pyint5 pyint5_
00128 
00129 //--------------------------------------------------------------------------
00130 // PYTHIA routines declaration
00131 
00132 #define pyhepc pyhepc_ 
00133 #define pyinit pyinit_
00134 #define pylist pylist_
00135 #define pystat pystat_
00136 #define pyevnt pyevnt_
00137 #define upinit upinit_
00138 #define upevnt upevnt_
00139     extern "C" {
00140         void pyhepc(int*);
00141         void pyinit(const char*,const char*,const char*,double*,int,int,int);
00142         void pylist(int*);
00143         void pystat(int*);
00144         void pyevnt();
00145         void upinit();
00146         void upevnt();
00147     }
00148 
00149 // define methods to hide the subtle syntax necessary to call fortran from C++
00150 void inline call_pyhepc( int mode ){ pyhepc( &mode ); }
00151 void inline call_pyinit( const char* frame, const char* beam, const char* target,
00152                          double win ) 
00153 { pyinit( frame,beam,target,&win,strlen(frame),strlen(beam),strlen(target) ); }
00154 void inline call_pylist( int mode ){ pylist( &mode ); }
00155 void inline call_pystat( int mode ){ pystat( &mode ); }
00156 void inline call_pyevnt(){ pyevnt(); }
00157 
00158 
00159 //--------------------------------------------------------------------------
00160 // PYTHIA block data
00161 // ( with gcc it works to initialize the block data by calling 
00162 //   "pydata();" at beginning, but this fails for f77, so the fortran routine
00163 //   initpydata.f is supplied ... call it instead for platform independent
00164 //   behaviour )
00165 
00166 #define pydata pydata_
00167 extern "C" {
00168     void pydata(void);
00169 }
00170 
00171 #endif  // PYTHIA_WRAPPER_H
00172 //--------------------------------------------------------------------------

Generated on Tue Jun 9 17:37:09 2009 for CMSSW by  doxygen 1.5.4