hepmc - Blame information for rev 104

Subversion Repositories:
Rev:
Rev Author Line No. Line
2 garren 1 //--------------------------------------------------------------------------
2 #ifdef  _WIN32  // This version is for Windows MS Visual C++ only.
3 #ifndef PYTHIA_WRAPPER_H
4 #define PYTHIA_WRAPPER_H
5  
6 //////////////////////////////////////////////////////////////////////////
7 // Matt.Dobbs@Cern.CH, November 2000
8 // Wrapper for FORTRAN version 6.152 of Pythia
9 // (which is the version in CERNlib 2001)
10 // The _WIN32 version is provided by Witold Pokorski
11 //       <Witold.Pokorski@Cern.CH>, 2002-01-22, and is the version
12 //       which should be used when compiling on Windows MS Visual C++.
13 // This wrapper is NOT intended as a part of HepMC - it is only supplied
14 // for your convenience.
15 //////////////////////////////////////////////////////////////////////////
16 //
17 // A simple example of calling Pythia from C++ using this header file is
18 // given in test/test_PythiaWrapper.cxx
19 //
20 // Note the pyhepc routine is used by Pythia to fill
21 // the HEPEVT common block uses double precision and 4000 entries.
22 //
23  
24 #include <ctype.h>
25  
26 //--------------------------------------------------------------------------
27 // Initialization routine
28  
29     extern "C" {
30         void INITPYDATA(void);
31     }
32 #define initpydata INITPYDATA
33  
34 //--------------------------------------------------------------------------
35 // PYTHIA Common Block Declarations
36  
37 const int pyjets_maxn =4000;
38  
39 struct PYSUBS_DEF {
40         int msel, mselpd, msub[500], kfin[81][2];
41         double ckin[200];
42 };
43  
44 struct PYJETS_DEF {
45         int n, npad, k[5][pyjets_maxn];
46         double p[5][pyjets_maxn], v[5][pyjets_maxn];
47     };
48  
49 struct PYDAT1_DEF {
50         int mstu[200];
51         double paru[200];
52         int mstj[200];
53         double parj[200];
54     };
55  
56 struct PYDAT2_DEF {
57         int kchg[4][500];
58         double pmas[4][500], parf[2000], vckm[4][4];  
59    };
60  
61 struct PYPARS_DEF{
62         int mstp[200];
63         double parp[200];
64         int msti[200];
65         double pari[200];
66     };
67  
68 struct PYDATR_DEF{
69         int mrpy[6];
70         double rrpy[100];
71     };
72  
73 struct PYDAT3_DEF{
74         int mdcy[3][500], mdme[2][4000];
75         double brat[4000];
76         int kfdp[5][4000];
77     };
78  
79  
80 struct PYINT1_DEF{
81         int mint[400];
82         double vint[400];
83     };
84  
85 struct PYINT2_DEF{
86         int iset[500], kfpr[2][500];
87         double coef[20][500];
88         int icol[2][4][40];       // was [320] was [40][4][2]
89     };
90  
91 struct PYINT5_DEF{
92         int ngenpd, ngen[3][501];
93         double xsec[3][501];
94     };
95  
96  
97 extern "C" PYSUBS_DEF PYSUBS;
98 extern "C" PYJETS_DEF PYJETS;
99 extern "C" PYDAT1_DEF PYDAT1;
100 extern "C" PYDAT2_DEF PYDAT2;
101 extern "C" PYPARS_DEF PYPARS;
102 extern "C" PYDATR_DEF PYDATR;
103 extern "C" PYDAT3_DEF PYDAT3;
104 extern "C" PYINT1_DEF PYINT1;
105 extern "C" PYINT2_DEF PYINT2;
106 extern "C" PYINT5_DEF PYINT5;
107  
108  
109 #define pysubs PYSUBS
110 #define pyjets PYJETS
111 #define pydat1 PYDAT1
112 #define pydat2 PYDAT2
113 #define pypars PYPARS
114 #define pydatr PYDATR
115 #define pydat3 PYDAT3
116 #define pyint1 PYINT1
117 #define pyint2 PYINT2
118 #define pyint5 PYINT5
119  
120  
121  
122 //--------------------------------------------------------------------------
123 // PYTHIA routines declaration
124  
125  
126 extern "C" {
127   void __stdcall PYSTAT(int*);
128   void __stdcall PYHEPC(int*);
129   void __stdcall PYLIST(int*);
130   void __stdcall PYEVNT(void);
131  
132 //--------------------------------------------------------------------------
133 // PYTHIA block data
134 // ( with gcc it works to initialize the block data by calling
135 //   "pydata();" at beginning, but this fails for f77, so the fortran routine
136 //   initpydata.f is supplied ... call it instead for platform independent
137 //   behaviour )
138   void __stdcall PYDATA(void);
139  
140   void __stdcall PYINIT(const char*, int, const char*, int, const char*, int, double*);
141 }
142  
143  
144  
145  
146 // define methods to hide the subtle syntax necessary to call fortran from C++
147  
77 garren 148 inline void call_pyhepc( int mode ){ PYHEPC( &mode ); }
149 inline void call_pyinit( const char* frame, const char* beam, const char* target,
2 garren 150                   double win )
151 { PYINIT( frame,strlen(frame),beam,strlen(beam),target,strlen(target),&win); }
77 garren 152 inline void call_pylist( int mode ){ PYLIST( &mode ); }
153 inline void call_pystat( int mode ){ PYSTAT( &mode ); }
154 inline void call_pyevnt(){ PYEVNT(); }
2 garren 155  
156  
157 #endif  // PYTHIA_WRAPPER_H
158 #endif  // _WIN32
159 //--------------------------------------------------------------------------