StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HerwigWrapper.h
1 //--------------------------------------------------------------------------
2 #ifndef HERWIG_WRAPPER_H
3 #define HERWIG_WRAPPER_H
4 
6 // Matt.Dobbs@Cern.CH, November 200July 2002
7 // Wrapper for FORTRAN version of Herwig
8 // Wrapper written for Herwig 6.4
10 
11 #include <ctype.h>
12 
13 // This pre-compiler directive is included (2002-01-16) to allow compatibility
14 // with MS Visual C++, which interfaces to fortran in a different manner.
15 // For it to work you need to define the _WIN32 variable when compiling.
16 #ifdef _WIN32 // Platform: Windows MS Visual C++
17 
18 // Sorry, there is NO version currently available for Vusual C++.
19 
20 #else // Generic version, tested on Linux ecgs/gcc
21 
22 //--------------------------------------------------------------------------
23 // HERWIG Common Block Declarations
24 
25 // COMMON/HWPROC/EBEAM1,EBEAM2,PBEAM1,PBEAM2,IPROC,MAXEV
26 extern "C" {
27  extern struct {
28  double EBEAM1,EBEAM2,PBEAM1,PBEAM2;
29  int IPROC,MAXEV;
30  } hwproc_;
31 }
32 #define hwproc hwproc_
33 
34 // COMMON/HWBEAM/IPART1,IPART2
35 extern "C" {
36  extern struct {
37  int IPART1, IPART2;
38  } hwbeam_;
39 }
40 #define hwbeam hwbeam_
41 
42 // CHARACTER*8 PART1,PART2
43 // COMMON/HWBMCH/PART1,PART2
44 extern "C" {
45  extern struct {
46  char PART1[8],PART2[8];
47  } hwbmch_;
48 }
49 #define hwbmch hwbmch_
50 
51 // COMMON/HWEVNT/AVWGT,EVWGT,GAMWT,TLOUT,WBIGST,WGTMAX,WGTSUM,WSQSUM,
52 // & IDHW(NMXHEP),IERROR,ISTAT,LWEVT,MAXER,MAXPR,NOWGT,NRN(2),NUMER,
53 // & NUMERU,NWGTS,GENSOF
54 const int herwig_hepevt_size = 4000;
55 extern "C" {
56  extern struct hwgev {
57  double AVWGT,EVWGT,GAMWT,TLOUT,WBIGST,WGTMAX,WGTSUM,WSQSUM;
58  int IDHW[herwig_hepevt_size],IERROR,ISTAT,LWEVT,MAXER,MAXPR;
59  int NOWGT,NRN[2],NUMER,NUMERU,NWGTS;
60  int GENSOF; //Beware! in F77 this is logical
61  } hwevnt_;
62 }
63 #define hwevnt hwevnt_
64 
65 // C Basic parameters (and quantities derived from them)
66 // COMMON/HWPRAM/AFCH(16,2),ALPHEM,B1LIM,BETAF,BTCLM,CAFAC,CFFAC,
67 // & CLMAX,CLPOW,CLSMR(2),CSPEED,ENSOF,ETAMIX,F0MIX,F1MIX,F2MIX,GAMH,
68 // & GAMW,GAMZ,GAMZP,GEV2NB,H1MIX,PDIQK,PGSMX,PGSPL(4),PHIMIX,PIFAC,
69 // & PRSOF,PSPLT(2),PTRMS,PXRMS,QCDL3,QCDL5,QCDLAM,QDIQK,QFCH(16),QG,
70 // & QSPAC,QV,SCABI,SWEIN,TMTOP,VFCH(16,2),VCKM(3,3),VGCUT,VQCUT,
71 // & VPCUT,ZBINM,EFFMIN,OMHMIX,ET2MIX,PH3MIX,GCUTME,
72 // & IOPREM,IPRINT,ISPAC,LRSUD,LWSUD,MODPDF(2),NBTRY,NCOLO,NCTRY,
73 // & NDTRY,NETRY,NFLAV,NGSPL,NSTRU,NSTRY,NZBIN,IOP4JT(2),NPRFMT,
74 // & AZSOFT,AZSPIN,CLDIR(2),HARDME,NOSPAC,PRNDEC,PRVTX,SOFTME,ZPRIME,
75 // & PRNDEF,PRNTEX,PRNWEB
76 
77 extern "C" {
78  extern struct {
79  double AFCH[2][16],ALPHEM,B1LIM,BETAF,BTCLM,CAFAC,CFFAC,
80  CLMAX,CLPOW,CLSMR[2],CSPEED,ENSOF,ETAMIX,F0MIX,F1MIX,F2MIX,GAMH,
81  GAMW,GAMZ,GAMZP,GEV2NB,H1MIX,PDIQK,PGSMX,PGSPL[4],PHIMIX,PIFAC,
82  PRSOF,PSPLT[2],PTRMS,PXRMS,QCDL3,QCDL5,QCDLAM,QDIQK,QFCH[16],QG,
83  QSPAC,QV,SCABI,SWEIN,TMTOP,VFCH[2][16],VCKM[3][3],VGCUT,VQCUT,
84  VPCUT,ZBINM,EFFMIN,OMHMIX,ET2MIX,PH3MIX,GCUTME;
85  int IOPREM,IPRINT,ISPAC,LRSUD,LWSUD,MODPDF[2],NBTRY,NCOLO,NCTRY,
86  NDTRY,NETRY,NFLAV,NGSPL,NSTRU,NSTRY,NZBIN,IOP4JT[2],NPRFMT;
87  int AZSOFT,AZSPIN,CLDIR[2],HARDME,NOSPAC,PRNDEC,PRVTX,SOFTME,
88  ZPRIME,PRNDEF,PRNTEX,PRNWEB; //Beware! in F77 these are logical
89  } hwpram_;
90 }
91 #define hwpram hwpram_
92 
93 //--------------------------------------------------------------------------
94 // HERWIG routines declaration
95 
96 #define hwigin hwigin_ // initialise other common blocks
97 #define hwigup hwigup_ // initialise HepUP run common block
98 #define hwuinc hwuinc_ // compute parameter-dependent constants
99 #define hwusta hwusta_ // call hwusta to make any particle stable
100 #define hweini hweini_ // initialise elementary process
101 #define hwuine hwuine_ // initialise event
102 #define hwepro hwepro_ // generate HERWIG hard subprocess
103 #define hwupro hwupro_ // read USER hard subprocess from HepUP event common
104 #define hwbgen hwbgen_ // generate parton cascades
105 #define hwdhob hwdhob_ // do heavy object decays
106 #define hwcfor hwcfor_ // do cluster hadronization
107 #define hwcdec hwcdec_ // do cluster decay
108 #define hwdhad hwdhad_ // do unstable particle decays
109 #define hwdhvy hwdhvy_ // do heavy flavour decays
110 #define hwmevt hwmevt_ // add soft underlying event if needed
111 #define hwufne hwufne_ // event generation completed, wrap up event ....
112 #define hwefin hwefin_ // terminate elementary process
113 
114 #define hwudpr hwudpr_ // prints out particle/decay properties
115 #define hwuepr hwuepr_ // prints out event data
116 #define hwupup hwupup_ // prints out HepEUP user common block event data
117 #define hwegup hwegup_ // terminal calculations to replace HWEFIN for HepUP
118  extern "C" {
119  void hwigin(void);
120  void hwigup(void);
121  void hwuinc(void);
122  void hwusta(const char*,int);
123  void hweini(void);
124  void hwuine(void);
125  void hwepro(void);
126  void hwupro(void);
127  void hwbgen(void);
128  void hwdhob(void);
129  void hwcfor(void);
130  void hwcdec(void);
131  void hwdhad(void);
132  void hwdhvy(void);
133  void hwmevt(void);
134  void hwufne(void);
135  void hwefin(void);
136  void hwudpr(void);
137  void hwuepr(void);
138  void hwupup(void);
139  void hwegup(void);
140  }
141 
142 //--------------------------------------------------------------------------
143 // HERWIG block data
144 // ( with gcc it works to initialize the block data by calling
145 // "hwudat();" at beginning. )
146 
147 #define hwudat hwudat_
148 extern "C" {
149  void hwudat(void);
150 }
151 
152 
153 #include "HepMC/GenCrossSection.h"
154 
155 namespace HepMC {
156 
158 GenCrossSection getHerwigCrossSection(int ngen);
159 
160 } // HepMC
161 
162 #endif // Platform
163 
164 #endif // HERWIG_WRAPPER_H
165 
166 //--------------------------------------------------------------------------
GenCrossSection getHerwigCrossSection(int ngen)
calculate the Herwig cross section and statistical error