Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:10

0001 //--------------------------------------------------------------------------
0002 #ifdef  _WIN32  // This version is for Windows MS Visual C++ only.
0003 #ifndef PYTHIA_WRAPPER_6_H
0004 #define PYTHIA_WRAPPER_6_H
0005 
0006 //////////////////////////////////////////////////////////////////////////
0007 // Matt.Dobbs@Cern.CH, November 2000
0008 // Version 6.200 update October 2001
0009 // Wrapper for FORTRAN version of Pythia 
0010 // The _WIN32 version is provided by Witold Pokorski 
0011 //       <Witold.Pokorski@Cern.CH>, 2002-01-22, and is the version 
0012 //       which should be used when compiling on Windows MS Visual C++.
0013 // This wrapper is NOT intended as a part of HepMC - it is only supplied
0014 // for your convenience.
0015 //////////////////////////////////////////////////////////////////////////
0016 // 
0017 // A simple example of calling Pythia from C++ using this header file is
0018 // given in test/test_PythiaWrapper.cxx
0019 //
0020 // Note the pyhepc routine is used by Pythia to fill
0021 // the HEPEVT common block uses double precision and 4000 entries.
0022 //
0023 
0024 #include <ctype.h>
0025 #include <string.h>
0026 
0027 //--------------------------------------------------------------------------
0028 // Initialization routine
0029 
0030 
0031 extern "C" {
0032     void INITPYDATA(void);
0033 }
0034 #define initpydata INITPYDATA
0035 
0036 
0037 //--------------------------------------------------------------------------
0038 // PYTHIA Common Block Declarations
0039 
0040 const int pyjets_maxn =4000;
0041 struct PYJETS_DEF {
0042     int n, npad, k[5][pyjets_maxn];
0043     double p[5][pyjets_maxn], v[5][pyjets_maxn];
0044 };
0045 
0046 struct PYDAT1_DEF{
0047         int mstu[200];
0048         double paru[200];
0049         int mstj[200];
0050         double parj[200];
0051 };
0052 
0053 struct PYDAT2_DEF{
0054     int kchg[4][500];
0055     double pmas[4][500], parf[2000], vckm[4][4];  
0056 };
0057 
0058 struct PYDAT3_DEF{
0059     int mdcy[3][500], mdme[2][8000];
0060     double brat[8000];
0061     int kfdp[5][8000];
0062 };
0063 
0064 struct PYDATR_DEF{
0065     int mrpy[6];
0066     double rrpy[100];
0067     };
0068 
0069 struct PYSUBS_DEF{
0070     int msel, mselpd, msub[500], kfin[81][2];
0071     double ckin[200];
0072 };
0073 
0074 struct PYPARS_DEF{
0075     int mstp[200];
0076     double parp[200];
0077     int msti[200];
0078     double pari[200];
0079 };
0080 
0081 struct PYINT1_DEF{
0082     int mint[400];
0083     double vint[400];
0084 };
0085 
0086 struct PYINT2_DEF{
0087     int iset[500], kfpr[2][500];
0088     double coef[20][500];
0089     int icol[2][4][40];       // was [320] was [40][4][2]
0090 };
0091 
0092 struct PYINT5_DEF{
0093     int ngenpd, ngen[3][501];
0094     double xsec[3][501];
0095 };
0096 
0097 
0098 extern "C" PYSUBS_DEF PYSUBS;
0099 extern "C" PYJETS_DEF PYJETS;
0100 extern "C" PYDAT1_DEF PYDAT1;
0101 extern "C" PYDAT2_DEF PYDAT2;
0102 extern "C" PYPARS_DEF PYPARS;
0103 extern "C" PYDATR_DEF PYDATR;
0104 extern "C" PYDAT3_DEF PYDAT3;
0105 extern "C" PYINT1_DEF PYINT1;
0106 extern "C" PYINT2_DEF PYINT2;
0107 extern "C" PYINT5_DEF PYINT5;
0108 
0109 
0110 #define pysubs PYSUBS
0111 #define pyjets PYJETS
0112 #define pydat1 PYDAT1
0113 #define pydat2 PYDAT2
0114 #define pypars PYPARS
0115 #define pydatr PYDATR
0116 #define pydat3 PYDAT3
0117 #define pyint1 PYINT1
0118 #define pyint2 PYINT2
0119 #define pyint5 PYINT5
0120 
0121 
0122 
0123 //--------------------------------------------------------------------------
0124 // PYTHIA routines declaration
0125 
0126 
0127 extern "C" {
0128     void __stdcall PYHEPC(int*);
0129     void __stdcall PYINIT(const char*,int,const char*,int,const char*,int,double*);
0130     void __stdcall PYLIST(int*);
0131     void __stdcall PYSTAT(int*);
0132     void __stdcall PYEVNT();
0133     void __stdcall UPINIT();
0134     void __stdcall UPEVNT();
0135 }
0136 
0137 //--------------------------------------------------------------------------
0138 // PYTHIA block data
0139 // ( with gcc it works to initialize the block data by calling 
0140 //   "pydata();" at beginning, but this fails for f77, so the fortran routine
0141 //   initpydata.f is supplied ... call it instead for platform independent
0142 //   behaviour )
0143 
0144 
0145 extern "C" {
0146     void __stdcall PYDATA(void);
0147 }
0148 
0149 inline void call_pyhepc( int mode ){ PYHEPC( &mode ); }
0150 inline void call_pyinit( const char* frame, const char* beam, const char* target,
0151           double win ) 
0152 { PYINIT( frame,strlen(frame),beam,strlen(beam),target,strlen(target),&win); }
0153 inline void call_pylist( int mode ){ PYLIST( &mode ); }
0154 inline void call_pystat( int mode ){ PYSTAT( &mode ); }
0155 inline void call_pyevnt(){ PYEVNT(); }
0156 inline void call_upinit(){ UPINIT(); }
0157 inline void call_upevnt(){ UPEVNT(); }
0158 
0159 
0160 
0161 
0162 #endif  // PYTHIA_WRAPPER_6_H
0163 #endif  // _WIN32
0164 //--------------------------------------------------------------------------