]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THerwig/HCommon.h
Different access to common blocks. Works now also on 64 bit.
[u/mrichter/AliRoot.git] / THerwig / HCommon.h
index f92fe5614dc9af22ba1eede1a73982802fac7a17..a64fdcdada642dd6fb8b2ee3e357c38e573a8e96 100644 (file)
@@ -1,3 +1,11 @@
+#ifndef HerwigCommon
+#define HerwigCommon
+
+#ifndef __CFORTRAN_LOADED
+#include <cfortran.h>
+#endif
+
+extern "C" {
 // Translation of Fortran commons from the Herwig6
 // f77 program into c++ structures to be used in ROOT
 // and declaration of Fortran functions as extern
@@ -7,9 +15,9 @@
 
 struct dcpx {double dr,di;};
 
-int const NMXHEP = 2000;
+int const NMXHEP = 4000;
 
-struct Hepevt_t {
+typedef struct {
   int NEVHEP;
   int NHEP;
   int ISTHEP[NMXHEP];
@@ -18,28 +26,43 @@ struct Hepevt_t {
   int JDAHEP[NMXHEP][2];
   double PHEP[NMXHEP][5];
   double VHEP[NMXHEP][4];
-};
+} HepevtCommon;
+
+#define HEPEVT COMMON_BLOCK(HEPEVT, hepevt)
+  COMMON_BLOCK_DEF(HepevtCommon, HEPEVT);
 
-struct Hwbeam_t {
+
+typedef struct {
   int IPART1;
   int IPART2;
-};
+} HwbeamCommon;
+
+#define HWBEAM COMMON_BLOCK(HWBEAM, hwbeam)
+  COMMON_BLOCK_DEF(HwbeamCommon, HWBEAM);
 
-struct Hwbmch_t {
+typedef struct {
   char PART1[8];
   char PART2[8];
-};
+} HwbmchCommon;
+
+#define HWBMCH COMMON_BLOCK(HWBMCH, hwbmch)
+  COMMON_BLOCK_DEF(HwbmchCommon, HWBMCH);
 
-struct Hwproc_t {
+
+typedef struct {
   double EBEAM1;
   double EBEAM2;
   double PBEAM1;
   double PBEAM2;
   int    IPROC;
   int    MAXEV;
-};
+} HwprocCommon;
+
+#define HWPROC COMMON_BLOCK(HWPROC, hwproc)
+  COMMON_BLOCK_DEF(HwprocCommon, HWPROC);
+
 
-struct Hwpram_t {
+typedef struct {
   double AFCH[2][16];
   double ALPHEM;
   double B1LIM;
@@ -123,16 +146,22 @@ struct Hwpram_t {
   int PRNDEF;
   int PRNTEX;
   int PRNWEB;
-};
+} HwpramCommon;
 
-struct Hwprch_t {
+#define HWPRAM COMMON_BLOCK(HWPRAM, hwpram)
+  COMMON_BLOCK_DEF(HwpramCommon, HWPRAM);
+
+typedef struct {
   char AUTPDF[2][20];
   char BDECAY[4];
-};
+} HwprchCommon;
+
+#define HWPRCH COMMON_BLOCK(HWPRCH, hwprch)
+  COMMON_BLOCK_DEF(HwprchCommon, HWPRCH);
 
 int const NMXPAR = 500;
 
-struct Hwpart_t {
+typedef struct {
   int  NEVPAR;
   int  NPAR;
   int  ISTPAR[NMXPAR];
@@ -141,18 +170,24 @@ struct Hwpart_t {
   int  JDAPAR[NMXPAR][2];
   double  PPAR[NMXPAR][5];
   double  VPAR[NMXPAR][4];
-};
+} HwpartCommon;
+
+#define HWPART COMMON_BLOCK(HWPART, hwpart)
+  COMMON_BLOCK_DEF(HwpartCommon, HWPART);
 
-struct Hwparp_t {
+typedef struct {
   double DECPAR[NMXPAR][2];
   double PHIPAR[NMXPAR][2];
   double RHOPAR[NMXPAR][2];
   int TMPAR[NMXPAR];
-};
+} HwparpCommon;
+
+#define HWPARP COMMON_BLOCK(HWPARP, hwparp)
+  COMMON_BLOCK_DEF(HwparpCommon, HWPARP);
 
 int const MODMAX = 5;
 
-struct Hwbosc_t {
+typedef struct {
   double  ALPFAC;
   double  BRHIG[12];
   double  ENHANC[12];
@@ -160,13 +195,19 @@ struct Hwbosc_t {
   double  RHOHEP[NMXHEP][3];
   int     IOPHIG;
   int     MODBOS[MODMAX];
-};
+} HwboscCommon;
+
+#define HWBOSC COMMON_BLOCK(HWBOSC, hwbosc)
+  COMMON_BLOCK_DEF(HwboscCommon, HWBOSC);
 
-struct Hwparc_t {
+typedef struct {
   int     JCOPAR[NMXPAR][4];
-};
+} HwparcCommon;
 
-struct Hwbrch_t {
+#define HWPARC COMMON_BLOCK(HWPARC, hwparc)
+  COMMON_BLOCK_DEF(HwparcCommon, HWPARC);
+
+typedef struct {
   double ANOMSC[2][2];
   double HARDST;
   double PTINT[2][3];
@@ -178,9 +219,12 @@ struct Hwbrch_t {
   int    BREIT;
   int    FROST;
   int    USECMF;
-};
+} HwbrchCommon;
+
+#define HWBRCH COMMON_BLOCK(HWBRCH, hwbrch)
+  COMMON_BLOCK_DEF(HwbrchCommon, HWBRCH);
 
-struct Hwevnt_t {
+typedef struct {
   double AVWGT;
   double EVWGT;
   double GAMWT;
@@ -201,9 +245,12 @@ struct Hwevnt_t {
   int    NUMERU;
   int    NWGTS;
   int    GENSOF;
-};
+} HwevntCommon;
 
-struct Hwhard_t {
+#define HWEVNT COMMON_BLOCK(HWEVNT, hwevnt)
+  COMMON_BLOCK_DEF(HwevntCommon, HWEVNT);
+
+typedef struct {
   double ASFIXD;
   double CLQ[6][7];
   double COSS;
@@ -267,11 +314,14 @@ struct Hwhard_t {
   int    HVFCEN;
   int    TPOL;
   int     DURHAM;
-};
+} HwhardCommon;
+
+#define HWHARD COMMON_BLOCK(HWHARD, hwhard)
+  COMMON_BLOCK_DEF(HwhardCommon, HWHARD);
 
 int const NMXRES = 500;
 
-struct Hwprop_t {
+typedef struct {
   double RLTIM[NMXRES+1];
   double RMASS[NMXRES+1];
   double RSPIN[NMXRES+1];
@@ -283,17 +333,23 @@ struct Hwprop_t {
   int    VTORDK[NMXRES+1];
   int    QORQQB[NMXRES+1];
   int    QBORQQ[NMXRES+1];
-};
+} HwpropCommon;
+
+#define HWPROP COMMON_BLOCK(HWPROP, hwprop)
+  COMMON_BLOCK_DEF(HwpropCommon, HWPROP);
 
-struct Hwunam_t {
+typedef struct {
   char RNAME[NMXRES+1][8];
   char TXNAME[NMXRES+1][2][37];
-};
+} HwunamCommon;
+
+#define HWUNAM COMMON_BLOCK(HWUNAM, hwunam)
+  COMMON_BLOCK_DEF(HwunamCommon, HWUNAM);
 
 int const NMXDKS = 4000;
 int const NMXMOD = 200;
 
-struct Hwupdt_t {
+typedef struct {
   double BRFRAC[NMXDKS];
   double CMMOM[NMXDKS];
   double DKLTM[NMXRES];
@@ -307,20 +363,28 @@ struct Hwupdt_t {
   int    NPRODS[NMXDKS];
   int    DKPSET;
   int    RSTAB[NMXRES+1];
-};
+} HwupdtCommon;
+
+#define HWUPDT COMMON_BLOCK(HWUPDT, hwupdt)
+  COMMON_BLOCK_DEF(HwupdtCommon, HWUPDT);
+
 
-struct Hwuwts_t {
+typedef struct {
   double REPWT[5][4][4];
   double SNGWT;
   double DECWT;
   double QWT[3];
   double PWT[12];
   double SWTEF[NMXRES];
-};
+} HwuwtsCommon;
+
+#define HWUWTS COMMON_BLOCK(HWUWTS, hwuwts)
+  COMMON_BLOCK_DEF(HwuwtsCommon, HWUWTS);
+
 
 int const NMXCDK = 4000;
 
-struct Hwuclu_t {
+typedef struct {
   double CLDKWT[NMXCDK];
   double CTHRPW[12][12];
   double PRECO;
@@ -330,9 +394,13 @@ struct Hwuclu_t {
   int    NCLDK[NMXCDK];
   int    NRECO;
   int    CLRECO;
-};
+} HwucluCommon;
+
+#define HWUCLU COMMON_BLOCK(HWUCLU, hwuclu)
+  COMMON_BLOCK_DEF(HwucluCommon, HWUCLU);
 
-struct Hwdist_t {
+
+typedef struct {
   double EXAG;
   double GEV2MM;
   double HBAR;
@@ -347,20 +415,26 @@ struct Hwdist_t {
   int    MAXDKL;
   int    MIXING;
   int    PIPSMR;
-};
+} HwdistCommon;
+
+#define HWDIST COMMON_BLOCK(HWDIST, hwdist)
+  COMMON_BLOCK_DEF(HwdistCommon, HWDIST);
 
 int const NMXQDK=20;
 
-struct Hwqdks_t {
+typedef struct {
   double VTXQDK[NMXQDK][4];
   int    IMQDK[NMXQDK];
   int    LOCQ[NMXQDK];
   int    NQDK;
-};
+} HwqdksCommon;
+
+#define HWQDKS COMMON_BLOCK(HWQDKS, hwqdks)
+  COMMON_BLOCK_DEF(HwqdksCommon, HWQDKS);
 
 int const NMXSUD = 1024;
 
-struct Hwusud_t {
+typedef struct {
   double ACCUR;
   double QEV[6][NMXSUD];
   double SUD[6][NMXSUD];
@@ -368,9 +442,12 @@ struct Hwusud_t {
   int    NQEV;
   int    NSUD;
   int    SUDORD;
-};
+} HwusudCommon;
+
+#define HWUSUD COMMON_BLOCK(HWUSUD, hwusud)
+  COMMON_BLOCK_DEF(HwusudCommon, HWUSUD);
 
-struct Hwsusy_t {
+typedef struct {
   double TANB;
   double ALPHAH;
   double COSBPA;
@@ -414,18 +491,24 @@ struct Hwsusy_t {
   double SENHNC[24];
   double SSPARITY;
   int    SUSYIN;
-};
+} HwsusyCommon;
 
-struct Hwrpar_t {
+#define HWSUSY COMMON_BLOCK(HWSUSY, hwsusy)
+  COMMON_BLOCK_DEF(HwsusyCommon, HWSUSY);
+
+typedef struct {
   double LAMDA1[3][3][3];
   double LAMDA2[3][3][3];
   double LAMDA3[3][3][3];
   int    HRDCOL[5][2];
   int    RPARTY;
   int    COLUPD;
-};
+} HwrparCommon;
+
+#define HWRPAR COMMON_BLOCK(HWRPAR, hwrpar)
+  COMMON_BLOCK_DEF(HwrparCommon, HWRPAR);
 
-struct Hwminb_t {
+typedef struct {
   double PMBN1;
   double PMBN2;
   double PMBN3;
@@ -436,25 +519,34 @@ struct Hwminb_t {
   double PMBP1;
   double PMBP2;
   double PMBP3;
-};
+} HwminbCommon;
+
+#define HWMINB COMMON_BLOCK(HWMINB, hwminb)
+  COMMON_BLOCK_DEF(HwminbCommon, HWMINB);
 
 int const NMXCL = 500;
 
-struct Hwclus_t {
+typedef struct {
   double PPCL[NMXCL][5];
   int    IDCL[NMXCL];
   int    NCL;
-};
+} HwclusCommon;
+
+#define HWCLUS COMMON_BLOCK(HWCLUS, hwclus)
+  COMMON_BLOCK_DEF(HwclusCommon, HWCLUS);
 
 // herwig 6.507
 
-struct Hwgrav_t {
+typedef struct Hwgrav_t {
   double GRVLAM;
   double EMGRV;
   double GAMGRV;
-};
+} HwgravCommon;
+
+#define HWGRAV COMMON_BLOCK(HWGRAV, hwgrav)
+  COMMON_BLOCK_DEF(HwgravCommon, HWGRAV);
 
-struct Hw6202_t {
+typedef struct {
   double VIPWID[3];
   double DXRCYL;
   double DXZMAX;
@@ -465,44 +557,58 @@ struct Hw6202_t {
   int    IHIGGS;
   int    PARITY;
   int    LRSUSY;
-};
+} Hw6202Common;
+
+#define HW6202 COMMON_BLOCK(HW6202, hw6202)
+  COMMON_BLOCK_DEF(Hw6202Common, HW6202);
 
-struct Hw6203_t {
+typedef struct {
   double ABWGT;
   double ABWSUM;
   double AVABW;
   int    NNEGWT;
   int    NNEGEV;
   int    NEGWTS;
-};
+} Hw6203Common;
+
+#define HW6203 COMMON_BLOCK(HW6203, hw6203)
+  COMMON_BLOCK_DEF(Hw6203Common, HW6203);
 
 int const IMAXCH = 20;
 
-struct Hw6300_t {
+typedef struct {
   double MJJMIN;
   double CHNPRB[IMAXCH];
   int    IOPSTP;
   int    IOPSH;
   int    OPTM;
   int    CHON[IMAXCH];
-};
+} Hw6300Common;
 
+#define HW6300 COMMON_BLOCK(HW6300, hw6300)
+  COMMON_BLOCK_DEF(Hw6300Common, HW6300);
 
 int const NXMRS = 49;
 int const NQMRS = 37;
 int const NPMRS = 8;
 
-struct Hwpmrs_t {
+typedef struct {
   double FMRS[NQMRS+1][NXMRS][NPMRS][3];
-};
+} HwpmrsCommon;
+
+#define HWPMRS COMMON_BLOCK(HWPMRS, hwpmrs)
+  COMMON_BLOCK_DEF(HwpmrsCommon, HWPMRS);
 
-struct Hwcirc_t {
+typedef struct {
   int    CIRCOP;
   int    CIRCAC;
   int    CIRCVR;
   int    CIRCRV;
   int    CIRCCH;
-};
+} HwcircCommon;
+
+#define HWCIRC COMMON_BLOCK(HWCIRC, hwcirc)
+  COMMON_BLOCK_DEF(HwcircCommon, HWCIRC);
 
 int const NCFMAX = 3;
 int const NMODE2 = 500;
@@ -511,7 +617,7 @@ int const NDIAGR = 8;
 int const NMODEB = 50;
 int const NMODE4 = 4;
 
-struct Hwdspb_t {
+typedef struct {
   double ABMODE[NMODEB][2];
   double BBMODE[NMODEB][12][2];
   double PBMODE[NMODEB][12];
@@ -520,18 +626,24 @@ struct Hwdspb_t {
   int    IBDRTP[NMODEB];
   int    IBMODE[NMODEB];
   int    NBMODE;
-};
+} HwdspbCommon;
 
-struct Hwdsp2_t {
+#define HWDSPB COMMON_BLOCK(HWDSPB, hwdspb)
+  COMMON_BLOCK_DEF(HwdspbCommon, HWDSPB);
+
+typedef struct {
   double A2MODE[NMODE2][2];
   double P2MODE[NMODE2];
   double WT2MAX[NMODE2];
   int    ID2PRT[NMODE2];
   int    I2DRTP[NMODE2];
   int    N2MODE;
-};
+} Hwdsp2Common;
+
+#define HWDSP2 COMMON_BLOCK(HWDSP2, hwdsp2)
+  COMMON_BLOCK_DEF(Hwdsp2Common, HWDSP2);
 
-struct Hwdsp3_t {
+typedef struct {
   double A3MODE[NMODE3][NDIAGR][2];
   double B3MODE[NMODE3][NDIAGR][2];
   double P3MODE[NMODE3];
@@ -544,9 +656,12 @@ struct Hwdsp3_t {
   int    NDI3BY[NMODE3];
   int    N3NCFL[NMODE3];
   int    I3DRCF[NMODE3][NDIAGR];
-};
+} Hwdsp3Common;
+
+#define HWDSP3 COMMON_BLOCK(HWDSP3, hwdsp3)
+  COMMON_BLOCK_DEF(Hwdsp3Common, HWDSP3);
 
-struct Hwdsp4_t {
+typedef struct {
   double A4MODE[NMODE4][12][2];
   double B4MODE[NMODE4][12][2];
   double P4MODE[NMODE4][12][12];
@@ -554,9 +669,12 @@ struct Hwdsp4_t {
   int    ID4PRT[NMODE4];
   int    I4MODE[NMODE4][2];
   int    N4MODE;
-};
+} Hwdsp4Common;
 
-struct Hwdspn_t {
+#define HWDSP4 COMMON_BLOCK(HWDSP4, hwdsp4)
+  COMMON_BLOCK_DEF(Hwdsp4Common, HWDSP4);
+
+typedef struct {
   int    NDECSY;
   int    NSEARCH;
   int    LRDEC;
@@ -565,11 +683,14 @@ struct Hwdspn_t {
   int    THREEB;
   int    FOURB;
   char   TAUDEC[6];
-};
+} HwdspnCommon;
+
+#define HWDSPN COMMON_BLOCK(HWDSPN, hwdspn)
+  COMMON_BLOCK_DEF(HwdspnCommon, HWDSPN);
 
 int const NMXSPN = 50;
 
-struct Hwspin_t {
+typedef struct {
   dcpx   MESPN[NMXSPN][NCFMAX][2][2][2][2];
   dcpx   RHOSPN[NMXSPN][2][2];
   double SPNCFC[NMXSPN][NCFMAX][NCFMAX];
@@ -582,18 +703,24 @@ struct Hwspin_t {
   int    DECSPN[NMXSPN];
   int    NCFL[NMXSPN];
   int    SPCOPT;
-};
+} HwspinCommon;
+
+#define HWSPIN COMMON_BLOCK(HWSPIN, hwspin)
+  COMMON_BLOCK_DEF(HwspinCommon, HWSPIN);
 
-struct Hwstau_t {
+typedef struct {
   int    JAK1;
   int    JAK2;
   int    ITDKRC;
   int    IFPHOT;
-};
+} HwstauCommon;
+
+#define HWSTAU COMMON_BLOCK(HWSTAU, hwstau)
+  COMMON_BLOCK_DEF(HwstauCommon, HWSTAU);
 
 int const MAXHRP = 100;
 
-struct Hwgupr_t {
+typedef struct {
   double LHWGT[MAXHRP];
   double LHWGTS[MAXHRP];
   double LHXSCT[MAXHRP];
@@ -605,39 +732,53 @@ struct Hwgupr_t {
   int    ITYPLH;
   int    LHSOFT;
   int    LHGLSF;    
-};
+} HwguprCommon;
+
+#define HWGUPR COMMON_BLOCK(HWGUPR, hwgupr)
+  COMMON_BLOCK_DEF(HwguprCommon, HWGUPR);
 
-struct Hw6500_t {
+typedef struct {
   int    PRESPL;
-};
+} Hw6500Common;
+
+#define HW6500 COMMON_BLOCK(HW6500, hw6500)
+  COMMON_BLOCK_DEF(Hw6500Common, HW6500);
 
-struct Hw6504_t {
+typedef struct {
   int    ITOPRD;
-};
+} Hw6504Common;
 
-struct Hw6506_t {
+#define HW6504 COMMON_BLOCK(HW6504, hw6504)
+  COMMON_BLOCK_DEF(Hw6504Common, HW6504);
+
+typedef struct {
   double PDFX0;
   double PDFPOW;
-};
+} Hw6506Common;
 
+#define HW6506 COMMON_BLOCK(HW6506, hw6506)
+  COMMON_BLOCK_DEF(Hw6506Common, HW6506);
 
+}
 
 extern "C" {
-  void  hwigin_();
-  void  hwuinc_();
-  void  hwusta_(char * name, int);
-  void  hweini_();
-  void  hwuine_();
-  void  hwepro_();
-  void  hwbgen_();
-  void  hwdhob_();
-  void  hwcfor_();
-  void  hwcdec_();
-  void  hwdhad_();
-  void  hwdhvy_();
-  void  hwmevt_();
-  void  hwufne_();
-  void  hwefin_();
+    void  hwuepr_();
+    void  hwigin_();
+    void  hwuinc_();
+    void  hweini_();
+    void  hwuine_();
+    void  hwepro_();
+    void  hwbgen_();
+    void  hwdhob_();
+    void  hwcfor_();
+    void  hwcdec_();
+    void  hwdhad_();
+    void  hwdhvy_();
+    void  hwmevt_();
+    void  hwufne_();
+    void  hwefin_();
+    void  hwusta_(const char * name, int);
+    void  hwiodk_(int);
 }
 
 // subroutines to be call by JIMMY
@@ -648,7 +789,7 @@ extern "C" {
   void  jmefin_();
 }
 
-
+#endif