Commits

Sebastien Binet  committed af1f8e4

harmonize libraries names + setters for RMASS, NRN and MAXER

  • Participants
  • Parent commits c5908c5

Comments (0)

Files changed (2)

File pkg/herwig.go

 
  #include "c-herwig/herwig.h"
 
- #cgo LDFLAGS: -lc_herwig
+ #cgo LDFLAGS: -lc-herwig -lherwig65
 */
 import "C"
 import "unsafe"
 var Hwevnt hwevnt
 // FIXME: getters/setters
 
+func (h *hwevnt) SetMaxer(nevts int) {
+	C.hwevnt.MAXER = C.int(nevts)
+}
+
+func (h *hwevnt) Maxer() int {
+	return int(C.hwevnt.MAXER)
+}
+
 func (h *hwevnt) SetMaxpr(nevts int) {
 	C.hwevnt.MAXPR = C.int(nevts)
 }
 	return int(C.hwevnt.MAXPR)
 }
 
+func (h *hwevnt) SetNrn(idx, seed int) {
+	C.hwevnt.NRN[C.int(idx)] = C.int(seed)
+}
+
+func (h *hwevnt) Nrn(idx int) int {
+	return int(C.hwevnt.NRN[C.int(idx)])
+}
+
 type hwpram int
 // placeholder for:
 //  C Basic parameters (and quantities derived from them)
 var Hwpram hwpram
 // FIXME: getters/setters
 
+type hwprop int
+// placeholder for:
+// C Arrays for particle properties (NMXRES = max no of particles defined)
+//       PARAMETER(NMXRES=500)
+//       COMMON/HWPROP/RLTIM(0:NMXRES),RMASS(0:NMXRES),RSPIN(0:NMXRES),
+//      & ICHRG(0:NMXRES),IDPDG(0:NMXRES),IFLAV(0:NMXRES),NRES,
+//      & VTOCDK(0:NMXRES),VTORDK(0:NMXRES),
+//      & QORQQB(0:NMXRES),QBORQQ(0:NMXRES)
+var Hwprop hwprop
+
+func (h *hwprop) SetRmass(idx int, val float64) {
+	C.hwprop.RMASS[C.int(idx)] = C.double(val)
+}
+
+func (h *hwprop) Rmass(idx int) float64 {
+	return float64(C.hwprop.RMASS[C.int(idx)])
+}
+// FIXME: more getter/setter
+
 // herwig rountines ----------------------------------------------------------
 
 // initialise other common blocks
         name='go-herwig',
         source='pkg/herwig.go',
         target='herwig',
-        use=['herwig65','c_hepevt','c_herwig'],
+        use=['herwig65','c-hepevt','c-herwig'],
         )