pyslha.py

changeset 120
bffefe12df80
parent 118
5ab517422296
child 123
c85e29bc13c4
equal deleted inserted replaced
119:6b918f65b962 120:bffefe12df80
21 * Handle SLHA2 21 * Handle SLHA2
22 * Handle RPV SUSY in ISAWIG 22 * Handle RPV SUSY in ISAWIG
23 """ 23 """
24 24
25 __author__ = "Andy Buckley <andy.buckley@cern.ch" 25 __author__ = "Andy Buckley <andy.buckley@cern.ch"
26 __version__ = "1.0.7" 26 __version__ = "1.0.8"
27 27
28 28
29 def _autotype(var): 29 def _autotype(var):
30 """Automatically convert strings to numerical types if possible.""" 30 """Automatically convert strings to numerical types if possible."""
31 if type(var) is not str: 31 if type(var) is not str:
250 rtn = readISAWIG(f.read(), kwargs) 250 rtn = readISAWIG(f.read(), kwargs)
251 f.close() 251 f.close()
252 return rtn 252 return rtn
253 253
254 254
255
255 def readISAWIG(isastr, ignorenobr=False): 256 def readISAWIG(isastr, ignorenobr=False):
256 """ 257 """
257 Read a spectrum definition from a string in the ISAWIG format, returning 258 Read a spectrum definition from a string in the ISAWIG format, returning
258 dictionaries of blocks and decays. While this is not an SLHA format, it is 259 dictionaries of blocks and decays. While this is not an SLHA format, it is
259 informally supported as a useful mechanism for converting ISAWIG spectra to 260 informally supported as a useful mechanism for converting ISAWIG spectra to
264 265
265 If the ignorenobr parameter is True, do not store decay entries with a 266 If the ignorenobr parameter is True, do not store decay entries with a
266 branching ratio of zero. 267 branching ratio of zero.
267 """ 268 """
268 269
269 ## PDG MC ID codes mapped to HERWIG SUSY ID codes, based on 270 ## PDG MC ID codes mapped to HERWIG IDHW codes, based on
270 ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html 271 ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html
272 ## + the IDPDG array and section 4.13 of the HERWIG manual.
271 HERWIGID2PDGID = {} 273 HERWIGID2PDGID = {}
272 HERWIGID2PDGID[203] = 25 ## HIGGSL0 274 HERWIGID2PDGID[7] = -1
275 HERWIGID2PDGID[8] = -2
276 HERWIGID2PDGID[9] = -3
277 HERWIGID2PDGID[10] = -4
278 HERWIGID2PDGID[11] = -5
279 HERWIGID2PDGID[12] = -6
280 HERWIGID2PDGID[13] = 21
281 HERWIGID2PDGID[59] = 22
282 HERWIGID2PDGID[121] = 11
283 HERWIGID2PDGID[122] = 12
284 HERWIGID2PDGID[123] = 13
285 HERWIGID2PDGID[124] = 14
286 HERWIGID2PDGID[125] = 15
287 HERWIGID2PDGID[126] = 16
288 HERWIGID2PDGID[127] = -11
289 HERWIGID2PDGID[128] = -12
290 HERWIGID2PDGID[129] = -13
291 HERWIGID2PDGID[130] = -14
292 HERWIGID2PDGID[131] = -15
293 HERWIGID2PDGID[132] = -16
294 HERWIGID2PDGID[203] = 25 ## HIGGSL0 (== PDG standard in this direction)
273 HERWIGID2PDGID[204] = 35 ## HIGGSH0 295 HERWIGID2PDGID[204] = 35 ## HIGGSH0
274 HERWIGID2PDGID[205] = 36 ## HIGGSA0 296 HERWIGID2PDGID[205] = 36 ## HIGGSA0
275 HERWIGID2PDGID[206] = 37 ## HIGGS+ 297 HERWIGID2PDGID[206] = 37 ## HIGGS+
276 HERWIGID2PDGID[207] = -37 ## HIGGS- 298 HERWIGID2PDGID[207] = -37 ## HIGGS-
277 HERWIGID2PDGID[401] = 1000001 ## SSDLBR 299 HERWIGID2PDGID[401] = 1000001 ## SSDLBR
515 http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html 537 http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html
516 538
517 If the ignorenobr parameter is True, do not write decay entries with a 539 If the ignorenobr parameter is True, do not write decay entries with a
518 branching ratio of zero. 540 branching ratio of zero.
519 """ 541 """
520 ## PDG MC ID codes mapped to HERWIG SUSY ID codes, based on 542 ## PDG MC ID codes mapped to HERWIG IDHW codes, based on
521 ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html 543 ## http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/susycodes.html
544 ## + the IDPDG array and section 4.13 of the HERWIG manual.
522 PDGID2HERWIGID = {} 545 PDGID2HERWIGID = {}
523 PDGID2HERWIGID[ 25] = 203 ## HIGGSL0 (ADDED) 546 PDGID2HERWIGID[ -1] = 7
547 PDGID2HERWIGID[ -2] = 8
548 PDGID2HERWIGID[ -3] = 9
549 PDGID2HERWIGID[ -4] = 10
550 PDGID2HERWIGID[ -5] = 11
551 PDGID2HERWIGID[ -6] = 12
552 PDGID2HERWIGID[ 21] = 13
553 PDGID2HERWIGID[ 22] = 59
554 PDGID2HERWIGID[ 11] = 121
555 PDGID2HERWIGID[ 12] = 122
556 PDGID2HERWIGID[ 13] = 123
557 PDGID2HERWIGID[ 14] = 124
558 PDGID2HERWIGID[ 15] = 125
559 PDGID2HERWIGID[ 16] = 126
560 PDGID2HERWIGID[ -11] = 127
561 PDGID2HERWIGID[ -12] = 128
562 PDGID2HERWIGID[ -13] = 129
563 PDGID2HERWIGID[ -14] = 130
564 PDGID2HERWIGID[ -15] = 131
565 PDGID2HERWIGID[ -16] = 132
566 PDGID2HERWIGID[ 25] = 203 ## HIGGSL0 (added for PDG standard -> HERWIG IDHW)
524 PDGID2HERWIGID[ 26] = 203 ## HIGGSL0 567 PDGID2HERWIGID[ 26] = 203 ## HIGGSL0
525 PDGID2HERWIGID[ 35] = 204 ## HIGGSH0 568 PDGID2HERWIGID[ 35] = 204 ## HIGGSH0
526 PDGID2HERWIGID[ 36] = 205 ## HIGGSA0 569 PDGID2HERWIGID[ 36] = 205 ## HIGGSA0
527 PDGID2HERWIGID[ 37] = 206 ## HIGGS+ 570 PDGID2HERWIGID[ 37] = 206 ## HIGGS+
528 PDGID2HERWIGID[ -37] = 207 ## HIGGS- 571 PDGID2HERWIGID[ -37] = 207 ## HIGGS-

mercurial