Restructuring the module a bit, and starting work on writing the ISAJET output format (as opposed to the ISAWIG output format) via two new writeISAJET and writeISAJETFile functions.

Thu, 13 Oct 2011 17:10:35 +0200

author
Andy Buckley <andy@insectnation.org>
date
Thu, 13 Oct 2011 17:10:35 +0200
changeset 161
9306d1ad087f
parent 160
8acc44158b3f
child 162
e5b76d1917c0

Restructuring the module a bit, and starting work on writing the ISAJET output format (as opposed to the ISAWIG output format) via two new writeISAJET and writeISAJETFile functions.

pyslha.py file | annotate | diff | comparison | revisions
     1.1 --- a/pyslha.py	Thu Oct 13 01:11:47 2011 +0200
     1.2 +++ b/pyslha.py	Thu Oct 13 17:10:35 2011 +0200
     1.3 @@ -161,16 +161,6 @@
     1.4  
     1.5  
     1.6  
     1.7 -def readSLHAFile(spcfilename, **kwargs):
     1.8 -    """
     1.9 -    Read an SLHA file, returning dictionaries of blocks and decays.
    1.10 -
    1.11 -    Other keyword parameters are passed to readSLHA.
    1.12 -    """
    1.13 -    f = open(spcfilename, "r")
    1.14 -    rtn = readSLHA(f.read(), kwargs)
    1.15 -    f.close()
    1.16 -    return rtn
    1.17  
    1.18  
    1.19  def readSLHA(spcstr, ignorenobr=False):
    1.20 @@ -248,30 +238,6 @@
    1.21      return blocks, decays
    1.22  
    1.23  
    1.24 -def readISAWIGFile(isafilename, **kwargs):
    1.25 -    """
    1.26 -    Read a spectrum definition from a file in the ISAWIG format, returning
    1.27 -    dictionaries of blocks and decays. While this is not an SLHA format, it is
    1.28 -    informally supported as a useful mechanism for converting ISAWIG spectra to
    1.29 -    SLHA.
    1.30 -
    1.31 -    Other keyword parameters are passed to readSLHA.
    1.32 -    """
    1.33 -    f = open(isafilename, "r")
    1.34 -    rtn = readISAWIG(f.read(), kwargs)
    1.35 -    f.close()
    1.36 -    return rtn
    1.37 -
    1.38 -
    1.39 -def writeSLHAFile(spcfilename, blocks, decays, **kwargs):
    1.40 -    """
    1.41 -    Write an SLHA file from the supplied blocks and decays dicts.
    1.42 -
    1.43 -    Other keyword parameters are passed to writeSLHA.
    1.44 -    """
    1.45 -    f = open(spcfilename, "w")
    1.46 -    f.write(writeSLHA(blocks, decays, kwargs))
    1.47 -    f.close()
    1.48  
    1.49  
    1.50  # TODO: Split writeSLHA into writeSLHA{Blocks,Decays}
    1.51 @@ -314,7 +280,7 @@
    1.52  
    1.53  
    1.54  ###############################################################################
    1.55 -## ISAWIG handling
    1.56 +## PDG <-> HERWIG particle ID code translations for ISAWIG handling
    1.57  
    1.58  ## Static array of HERWIG IDHW codes mapped to PDG MC ID codes, based on
    1.59  ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html
    1.60 @@ -416,134 +382,6 @@
    1.61      return _HERWIGID2PDGID.get(hwid, hwid)
    1.62  
    1.63  
    1.64 -def readISAWIG(isastr, ignorenobr=False):
    1.65 -    """
    1.66 -    Read a spectrum definition from a string in the ISAWIG format, returning
    1.67 -    dictionaries of blocks and decays. While this is not an SLHA format, it is
    1.68 -    informally supported as a useful mechanism for converting ISAWIG spectra to
    1.69 -    SLHA.
    1.70 -
    1.71 -    ISAWIG parsing based on the HERWIG SUSY specification format, from
    1.72 -    http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html
    1.73 -
    1.74 -    If the ignorenobr parameter is True, do not store decay entries with a
    1.75 -    branching ratio of zero.
    1.76 -    """
    1.77 -
    1.78 -
    1.79 -    blocks = {}
    1.80 -    decays = {}
    1.81 -    LINES = isastr.splitlines()
    1.82 -
    1.83 -    def getnextvalidline():
    1.84 -        while LINES:
    1.85 -            s = LINES.pop(0).strip()
    1.86 -            ## Return None if EOF reached
    1.87 -            if len(s) == 0:
    1.88 -                continue
    1.89 -            ## Strip comments
    1.90 -            if "#" in s:
    1.91 -                s = s[:s.index("#")].strip()
    1.92 -            ## Return if non-empty
    1.93 -            if len(s) > 0:
    1.94 -                return s
    1.95 -
    1.96 -    def getnextvalidlineitems():
    1.97 -        return map(_autotype, getnextvalidline().split())
    1.98 -
    1.99 -    ## Populate MASS block and create decaying particle objects
   1.100 -    masses = Block("MASS")
   1.101 -    numentries = int(getnextvalidline())
   1.102 -    for i in xrange(numentries):
   1.103 -        hwid, mass, lifetime = getnextvalidlineitems()
   1.104 -        width = 1.0/(lifetime * 1.51926778e24) ## width in GeV == hbar/lifetime in seconds
   1.105 -        pdgid = herwigid2pdgid(hwid)
   1.106 -        masses.add_entry((pdgid, mass))
   1.107 -        decays[pdgid] = Particle(pdgid, width, mass)
   1.108 -        #print pdgid, mass, width
   1.109 -    blocks["MASS"] = masses
   1.110 -
   1.111 -    ## Populate decays
   1.112 -    for n in xrange(numentries):
   1.113 -        numdecays = int(getnextvalidline())
   1.114 -        for d in xrange(numdecays):
   1.115 -            #print n, numentries-1, d, numdecays-1
   1.116 -            decayitems = getnextvalidlineitems()
   1.117 -            hwid = decayitems[0]
   1.118 -            pdgid = herwigid2pdgid(hwid)
   1.119 -            br = decayitems[1]
   1.120 -            nme = decayitems[2]
   1.121 -            daughter_hwids = decayitems[3:]
   1.122 -            daughter_pdgids = []
   1.123 -            for hw in daughter_hwids:
   1.124 -                if hw != 0:
   1.125 -                    daughter_pdgids.append(herwigid2pdgid(hw))
   1.126 -            if not decays.has_key(pdgid):
   1.127 -                #print "Decay for unlisted particle %d, %d" % (hwid, pdgid)
   1.128 -                decays[pdgid] = Particle(pdgid)
   1.129 -            decays[pdgid].add_decay(br, len(daughter_pdgids), daughter_pdgids)
   1.130 -
   1.131 -
   1.132 -    ## Now the SUSY parameters
   1.133 -    TANB, ALPHAH = getnextvalidlineitems()
   1.134 -    blocks["MINPAR"] = Block("MINPAR")
   1.135 -    blocks["MINPAR"].add_entry((3, TANB))
   1.136 -    blocks["ALPHA"] = Block("ALPHA")
   1.137 -    blocks["ALPHA"].entries = ALPHAH
   1.138 -    #
   1.139 -    ## Neutralino mixing matrix
   1.140 -    blocks["NMIX"] = Block("NMIX")
   1.141 -    for i in xrange(1, 5):
   1.142 -        nmix_i = getnextvalidlineitems()
   1.143 -        for j, v in enumerate(nmix_i):
   1.144 -            blocks["NMIX"].add_entry((i, j+1, v))
   1.145 -    #
   1.146 -    ## Chargino mixing matrices V and U
   1.147 -    blocks["VMIX"] = Block("VMIX")
   1.148 -    vmix = getnextvalidlineitems()
   1.149 -    blocks["VMIX"].add_entry((1, 1, vmix[0]))
   1.150 -    blocks["VMIX"].add_entry((1, 2, vmix[1]))
   1.151 -    blocks["VMIX"].add_entry((2, 1, vmix[2]))
   1.152 -    blocks["VMIX"].add_entry((2, 2, vmix[3]))
   1.153 -    blocks["UMIX"] = Block("UMIX")
   1.154 -    umix = getnextvalidlineitems()
   1.155 -    blocks["UMIX"].add_entry((1, 1, umix[0]))
   1.156 -    blocks["UMIX"].add_entry((1, 2, umix[1]))
   1.157 -    blocks["UMIX"].add_entry((2, 1, umix[2]))
   1.158 -    blocks["UMIX"].add_entry((2, 2, umix[3]))
   1.159 -    #
   1.160 -    THETAT, THETAB, THETAL = getnextvalidlineitems()
   1.161 -    import math
   1.162 -    blocks["STOPMIX"] = Block("STOPMIX")
   1.163 -    blocks["STOPMIX"].add_entry((1, 1,  math.cos(THETAT)))
   1.164 -    blocks["STOPMIX"].add_entry((1, 2, -math.sin(THETAT)))
   1.165 -    blocks["STOPMIX"].add_entry((2, 1,  math.sin(THETAT)))
   1.166 -    blocks["STOPMIX"].add_entry((2, 2,  math.cos(THETAT)))
   1.167 -    blocks["SBOTMIX"] = Block("SBOTMIX")
   1.168 -    blocks["SBOTMIX"].add_entry((1, 1,  math.cos(THETAB)))
   1.169 -    blocks["SBOTMIX"].add_entry((1, 2, -math.sin(THETAB)))
   1.170 -    blocks["SBOTMIX"].add_entry((2, 1,  math.sin(THETAB)))
   1.171 -    blocks["SBOTMIX"].add_entry((2, 2,  math.cos(THETAB)))
   1.172 -    blocks["STAUMIX"] = Block("STAUMIX")
   1.173 -    blocks["STAUMIX"].add_entry((1, 1,  math.cos(THETAL)))
   1.174 -    blocks["STAUMIX"].add_entry((1, 2, -math.sin(THETAL)))
   1.175 -    blocks["STAUMIX"].add_entry((2, 1,  math.sin(THETAL)))
   1.176 -    blocks["STAUMIX"].add_entry((2, 2,  math.cos(THETAL)))
   1.177 -    #
   1.178 -    ATSS, ABSS, ALSS = getnextvalidlineitems()
   1.179 -    blocks["AU"] = Block("AU")
   1.180 -    blocks["AU"].add_entry((3, 3, ATSS))
   1.181 -    blocks["AD"] = Block("AD")
   1.182 -    blocks["AD"].add_entry((3, 3, ABSS))
   1.183 -    blocks["AE"] = Block("AE")
   1.184 -    blocks["AE"].add_entry((3, 3, ALSS))
   1.185 -    #
   1.186 -    MUSS = getnextvalidlineitems()[0]
   1.187 -    blocks["MINPAR"].add_entry((4, MUSS))
   1.188 -    #
   1.189 -    return blocks, decays
   1.190 -
   1.191 -
   1.192  ## PDG MC ID codes mapped to HERWIG IDHW codes, based on
   1.193  ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html
   1.194  ## + the IDPDG array and section 4.13 of the HERWIG manual.
   1.195 @@ -644,24 +482,196 @@
   1.196      return _PDGID2HERWIGID.get(pdgid, pdgid)
   1.197  
   1.198  
   1.199 +###############################################################################
   1.200 +## ISAWIG format reading/writing
   1.201  
   1.202  
   1.203 -def writeISAWIGFile(isafilename, blocks, decays, **kwargs):
   1.204 +def readISAWIG(isastr, ignorenobr=False):
   1.205      """
   1.206 -    Write an ISAWIG file from the supplied blocks and decays dicts.
   1.207 +    Read a spectrum definition from a string in the ISAWIG format, returning
   1.208 +    dictionaries of blocks and decays. While this is not an SLHA format, it is
   1.209 +    informally supported as a useful mechanism for converting ISAWIG spectra to
   1.210 +    SLHA.
   1.211  
   1.212 -    Other keyword parameters are passed to writeISAWIG.
   1.213 +    ISAWIG parsing based on the HERWIG SUSY specification format, from
   1.214 +    http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html
   1.215  
   1.216 -    TODO: Handle RPV SUSY
   1.217 +    If the ignorenobr parameter is True, do not store decay entries with a
   1.218 +    branching ratio of zero.
   1.219      """
   1.220 -    f = open(isafilename, "w")
   1.221 -    f.write(writeISAWIG(blocks, decays, kwargs))
   1.222 -    f.close()
   1.223 +
   1.224 +    blocks = {}
   1.225 +    decays = {}
   1.226 +    LINES = isastr.splitlines()
   1.227 +
   1.228 +    def getnextvalidline():
   1.229 +        while LINES:
   1.230 +            s = LINES.pop(0).strip()
   1.231 +            ## Return None if EOF reached
   1.232 +            if len(s) == 0:
   1.233 +                continue
   1.234 +            ## Strip comments
   1.235 +            if "#" in s:
   1.236 +                s = s[:s.index("#")].strip()
   1.237 +            ## Return if non-empty
   1.238 +            if len(s) > 0:
   1.239 +                return s
   1.240 +
   1.241 +    def getnextvalidlineitems():
   1.242 +        return map(_autotype, getnextvalidline().split())
   1.243 +
   1.244 +    ## Populate MASS block and create decaying particle objects
   1.245 +    masses = Block("MASS")
   1.246 +    numentries = int(getnextvalidline())
   1.247 +    for i in xrange(numentries):
   1.248 +        hwid, mass, lifetime = getnextvalidlineitems()
   1.249 +        width = 1.0/(lifetime * 1.51926778e24) ## width in GeV == hbar/lifetime in seconds
   1.250 +        pdgid = herwigid2pdgid(hwid)
   1.251 +        masses.add_entry((pdgid, mass))
   1.252 +        decays[pdgid] = Particle(pdgid, width, mass)
   1.253 +        #print pdgid, mass, width
   1.254 +    blocks["MASS"] = masses
   1.255 +
   1.256 +    ## Populate decays
   1.257 +    for n in xrange(numentries):
   1.258 +        numdecays = int(getnextvalidline())
   1.259 +        for d in xrange(numdecays):
   1.260 +            #print n, numentries-1, d, numdecays-1
   1.261 +            decayitems = getnextvalidlineitems()
   1.262 +            hwid = decayitems[0]
   1.263 +            pdgid = herwigid2pdgid(hwid)
   1.264 +            br = decayitems[1]
   1.265 +            nme = decayitems[2]
   1.266 +            daughter_hwids = decayitems[3:]
   1.267 +            daughter_pdgids = []
   1.268 +            for hw in daughter_hwids:
   1.269 +                if hw != 0:
   1.270 +                    daughter_pdgids.append(herwigid2pdgid(hw))
   1.271 +            if not decays.has_key(pdgid):
   1.272 +                #print "Decay for unlisted particle %d, %d" % (hwid, pdgid)
   1.273 +                decays[pdgid] = Particle(pdgid)
   1.274 +            decays[pdgid].add_decay(br, len(daughter_pdgids), daughter_pdgids)
   1.275 +
   1.276 +
   1.277 +    ## Now the SUSY parameters
   1.278 +    TANB, ALPHAH = getnextvalidlineitems()
   1.279 +    blocks["MINPAR"] = Block("MINPAR")
   1.280 +    blocks["MINPAR"].add_entry((3, TANB))
   1.281 +    blocks["ALPHA"] = Block("ALPHA")
   1.282 +    blocks["ALPHA"].entries = ALPHAH
   1.283 +    #
   1.284 +    ## Neutralino mixing matrix
   1.285 +    blocks["NMIX"] = Block("NMIX")
   1.286 +    for i in xrange(1, 5):
   1.287 +        nmix_i = getnextvalidlineitems()
   1.288 +        for j, v in enumerate(nmix_i):
   1.289 +            blocks["NMIX"].add_entry((i, j+1, v))
   1.290 +    #
   1.291 +    ## Chargino mixing matrices V and U
   1.292 +    blocks["VMIX"] = Block("VMIX")
   1.293 +    vmix = getnextvalidlineitems()
   1.294 +    blocks["VMIX"].add_entry((1, 1, vmix[0]))
   1.295 +    blocks["VMIX"].add_entry((1, 2, vmix[1]))
   1.296 +    blocks["VMIX"].add_entry((2, 1, vmix[2]))
   1.297 +    blocks["VMIX"].add_entry((2, 2, vmix[3]))
   1.298 +    blocks["UMIX"] = Block("UMIX")
   1.299 +    umix = getnextvalidlineitems()
   1.300 +    blocks["UMIX"].add_entry((1, 1, umix[0]))
   1.301 +    blocks["UMIX"].add_entry((1, 2, umix[1]))
   1.302 +    blocks["UMIX"].add_entry((2, 1, umix[2]))
   1.303 +    blocks["UMIX"].add_entry((2, 2, umix[3]))
   1.304 +    #
   1.305 +    THETAT, THETAB, THETAL = getnextvalidlineitems()
   1.306 +    import math
   1.307 +    blocks["STOPMIX"] = Block("STOPMIX")
   1.308 +    blocks["STOPMIX"].add_entry((1, 1,  math.cos(THETAT)))
   1.309 +    blocks["STOPMIX"].add_entry((1, 2, -math.sin(THETAT)))
   1.310 +    blocks["STOPMIX"].add_entry((2, 1,  math.sin(THETAT)))
   1.311 +    blocks["STOPMIX"].add_entry((2, 2,  math.cos(THETAT)))
   1.312 +    blocks["SBOTMIX"] = Block("SBOTMIX")
   1.313 +    blocks["SBOTMIX"].add_entry((1, 1,  math.cos(THETAB)))
   1.314 +    blocks["SBOTMIX"].add_entry((1, 2, -math.sin(THETAB)))
   1.315 +    blocks["SBOTMIX"].add_entry((2, 1,  math.sin(THETAB)))
   1.316 +    blocks["SBOTMIX"].add_entry((2, 2,  math.cos(THETAB)))
   1.317 +    blocks["STAUMIX"] = Block("STAUMIX")
   1.318 +    blocks["STAUMIX"].add_entry((1, 1,  math.cos(THETAL)))
   1.319 +    blocks["STAUMIX"].add_entry((1, 2, -math.sin(THETAL)))
   1.320 +    blocks["STAUMIX"].add_entry((2, 1,  math.sin(THETAL)))
   1.321 +    blocks["STAUMIX"].add_entry((2, 2,  math.cos(THETAL)))
   1.322 +    #
   1.323 +    ATSS, ABSS, ALSS = getnextvalidlineitems()
   1.324 +    blocks["AU"] = Block("AU")
   1.325 +    blocks["AU"].add_entry((3, 3, ATSS))
   1.326 +    blocks["AD"] = Block("AD")
   1.327 +    blocks["AD"].add_entry((3, 3, ABSS))
   1.328 +    blocks["AE"] = Block("AE")
   1.329 +    blocks["AE"].add_entry((3, 3, ALSS))
   1.330 +    #
   1.331 +    MUSS = getnextvalidlineitems()[0]
   1.332 +    blocks["MINPAR"].add_entry((4, MUSS))
   1.333 +    #
   1.334 +
   1.335 +    # TODO: Parse RPV boolean and couplings into SLHA2 blocks
   1.336 +
   1.337 +    return blocks, decays
   1.338 +
   1.339 +
   1.340 +def writeISAJET(blocks, decays, outname, ignorenobr=False, precision=8):
   1.341 +    """
   1.342 +    Return a SUSY spectrum definition in the format required for input by ISAJET,
   1.343 +    as a string, from the supplied blocks and decays dicts.
   1.344 +
   1.345 +    The outname parameter specifies the desired output filename from ISAJET: this
   1.346 +    will appear in the first line of the return value.
   1.347 +
   1.348 +    If the ignorenobr parameter is True, do not write decay entries with a
   1.349 +    branching ratio of zero.
   1.350 +    """
   1.351 +    fmte = "%." + str(precision) + "e"
   1.352 +
   1.353 +    masses = blocks["MASS"].entries
   1.354 +
   1.355 +    ## Init output string
   1.356 +    out = ""
   1.357 +
   1.358 +    ## First line is the output name
   1.359 +    out += "'%s'" % outname + "\n"
   1.360 +
   1.361 +    ## Next the top mass
   1.362 +    out += fmte % masses[6] + "\n"
   1.363 +
   1.364 +    ## Next the top mass
   1.365 +    out += fmte % masses[6] + "\n"
   1.366 +
   1.367 +    ## mSUGRA parameters (one line)
   1.368 +    # e.g. 1273.78,713.286,804.721,4.82337
   1.369 +
   1.370 +    ## Masses and trilinear couplings (3 lines)
   1.371 +    # e.g. 1163.14,1114.15,1118.99,374.664,209.593
   1.372 +    # e.g. 1069.54,1112.7,919.908,374.556,209.381,-972.817,-326.745,-406.494
   1.373 +    # e.g. 1163.14,1114.15,1118.99,374.712,210.328
   1.374 +
   1.375 +    ## RPV couplings (?? lines)
   1.376 +    # e.g. 232.615,445.477
   1.377 +
   1.378 +    ## Etc ???!!!
   1.379 +    # e.g. /
   1.380 +    # e.g. n
   1.381 +    # e.g. y
   1.382 +    # e.g. y
   1.383 +    # e.g. 0.047441 3.80202e-23 0 0 0 2.17356e-22 0 0 5.23773e-09
   1.384 +    # e.g. y
   1.385 +    # e.g. 3.35297e-25 0 0 0 7.34125e-24 0 0 0 3.17951e-22 8.07984e-12 0 0 0 1.76906e-10 0 0 0 7.66184e-09 0 0 0 0 0 0 0 0 0
   1.386 +    # e.g. n
   1.387 +    # e.g. 'susy_RPV_stau_BC1scan_m560_tanb05.txt'
   1.388 +
   1.389 +    return out
   1.390  
   1.391  
   1.392  def writeISAWIG(blocks, decays, ignorenobr=False, precision=8):
   1.393      """
   1.394 -    Return an ISAWIG definition as a string, from the supplied blocks and decays dicts.
   1.395 +    Return a SUSY spectrum definition in the format produced by ISAWIG for inut to HERWIG
   1.396 +    as a string, from the supplied SLHA blocks and decays dicts.
   1.397  
   1.398      ISAWIG parsing based on the HERWIG SUSY specification format, from
   1.399      http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html
   1.400 @@ -907,6 +917,74 @@
   1.401      return out
   1.402  
   1.403  
   1.404 +###############################################################################
   1.405 +## File-level functions
   1.406 +
   1.407 +
   1.408 +def readSLHAFile(spcfilename, **kwargs):
   1.409 +    """
   1.410 +    Read an SLHA file, returning dictionaries of blocks and decays.
   1.411 +
   1.412 +    Other keyword parameters are passed to readSLHA.
   1.413 +    """
   1.414 +    f = open(spcfilename, "r")
   1.415 +    rtn = readSLHA(f.read(), kwargs)
   1.416 +    f.close()
   1.417 +    return rtn
   1.418 +
   1.419 +
   1.420 +def writeSLHAFile(spcfilename, blocks, decays, **kwargs):
   1.421 +    """
   1.422 +    Write an SLHA file from the supplied blocks and decays dicts.
   1.423 +
   1.424 +    Other keyword parameters are passed to writeSLHA.
   1.425 +    """
   1.426 +    f = open(spcfilename, "w")
   1.427 +    f.write(writeSLHA(blocks, decays, kwargs))
   1.428 +    f.close()
   1.429 +
   1.430 +
   1.431 +def readISAWIGFile(isafilename, **kwargs):
   1.432 +    """
   1.433 +    Read a spectrum definition from a file in the ISAWIG format, returning
   1.434 +    dictionaries of blocks and decays. While this is not an SLHA format, it is
   1.435 +    informally supported as a useful mechanism for converting ISAWIG spectra to
   1.436 +    SLHA.
   1.437 +
   1.438 +    Other keyword parameters are passed to readSLHA.
   1.439 +    """
   1.440 +    f = open(isafilename, "r")
   1.441 +    rtn = readISAWIG(f.read(), kwargs)
   1.442 +    f.close()
   1.443 +    return rtn
   1.444 +
   1.445 +
   1.446 +def writeISAWIGFile(isafilename, blocks, decays, **kwargs):
   1.447 +    """
   1.448 +    Write an ISAWIG file from the supplied blocks and decays dicts.
   1.449 +
   1.450 +    Other keyword parameters are passed to writeISAWIG.
   1.451 +    """
   1.452 +    f = open(isafilename, "w")
   1.453 +    f.write(writeISAWIG(blocks, decays, kwargs))
   1.454 +    f.close()
   1.455 +
   1.456 +
   1.457 +def writeISAJETFile(isafilename, blocks, decays, **kwargs):
   1.458 +    """
   1.459 +    Write an ISAJET file from the supplied blocks and decays dicts (see writeISAJET).
   1.460 +
   1.461 +    Other keyword parameters are passed to writeISAJET.
   1.462 +    """
   1.463 +    f = open(isafilename, "w")
   1.464 +    f.write(writeISAWIG(blocks, decays, kwargs))
   1.465 +    f.close()
   1.466 +
   1.467 +
   1.468 +
   1.469 +###############################################################################
   1.470 +## Main function for module testing
   1.471 +
   1.472  
   1.473  if __name__ == "__main__":
   1.474      import sys

mercurial