tools package

Submodules

tools.asciiGraph module

asciidraw(element, labels=True, html=False, border=False)[source]

Draw a simple ASCII graph on the screen.

tools.externalNllFast module

class ExternalNllFast(sqrts, nllfastVersion, testParams, testCondition)[source]

Bases: smodels.tools.externalTool.ExternalTool

An instance of this class represents the installation of nllfast.

checkInstallation()[source]

Checks if installation of tool is valid by looking for executable and executing it.

compile()[source]

Try to compile nllfast.

fetch()[source]

Fetch and unpack tarball.

run(process, pdf, squarkmass, gluinomass)[source]

Execute nllfast.

Params process:which process: st, sb, gg, gdcpl, sdcpl, ss, sg, tot
Params pdf:cteq=cteq6, mstw2008
Params squarkmass:
 squarkmass, None if squark decoupled
Params gluinomass:
 gluinomass, None if gluino decoupled
Returns:stdout and stderr, or error message
run_(params)[source]

Execute nllfast7.

Params params:parameters used (e.g. gg cteq5 .... )
Returns:stdout and stderr, or error message

Remove inputFile.out

class ExternalNllFast7[source]

Bases: tools.externalNllFast.ExternalNllFast

An instance of this class represents the installation of nllfast 7.

class ExternalNllFast8[source]

Bases: tools.externalNllFast.ExternalNllFast

An instance of this class represents the installation of nllfast 8.

tools.externalPythia6 module

class ExternalPythia6(configFile='<install>/etc/pythia.card', executablePath='<install>/lib/pythia6/pythia_lhe', srcPath='<install>/lib/pythia6/')[source]

Bases: smodels.tools.externalTool.ExternalTool

An instance of this class represents the installation of pythia6.

checkFileExists(inputFile)[source]

Check if file exists, raise an IOError if it does not.

Returns:absolute file name if file exists.
checkInstallation(fix=False)[source]

Check if installation of tool is correct by looking for executable and running it.

Parameters:compile – should it try to fix the situation, if something is wrong?
Returns:True, if everything is ok
chmod()[source]

chmod 755 on pythia executable, if it exists. Do nothing, if it doesnt exist.

compile()[source]

Compile pythia_lhe.

complain()[source]
fetch()[source]

Fetch and unpack tarball.

replaceInCfgFile(replacements={'SQRTS': 8000, 'NEVENTS': 10000})[source]

Replace strings in the config file by other strings, similar to setParameter.

This is introduced as a simple mechanism to make changes to the parameter file.

Parameters:replacements – dictionary of strings and values; the strings will be replaced with the values; the dictionary keys must be strings present in the config file
reset()[source]

Copy the original config file again.

run(slhaFile, cfgfile=None, do_unlink=True, do_compile=False, do_check=True)[source]

Run Pythia.

Parameters:
  • slhaFile – SLHA file
  • cfgfile – optionally supply a new config file; if not supplied, use the one supplied at construction time; this config file will not be touched or copied; it will be taken as is
  • do_unlink – clean up temporary files after run?
  • do_compile – if true, we try to compile binary if it isnt installed.
Returns:

stdout and stderr, or error message

setParameter(param='MSTP(163)', value=6)[source]

Modifies the config file, similar to .replaceInCfgFile.

It will set param to value, overwriting possible old values.

tempDirectory()[source]

Return the temporary directory name.

Remove temporary files.

Parameters:unlinkdir – remove temp directory completely

tools.externalPythonTools module

class ExternalPythonTool(importname)[source]

Bases: object

An instance of this class represents the installation of unum. As it is python-only, we need this only for installation, not for running (contrary to nllfast or pythia).

checkInstallation()[source]

The check is basically done in the constructor

installDirectory()[source]

Just returns the pythonPath variable

pathOfExecutable()[source]

Just returns the pythonPath variable

tools.externalTool module

class ExternalTool[source]

Bases: object

An instance of this class represents the installation of an external tool.

An external tool encapsulates a tool that is executed via commands.getoutput. It defines how the tool is tested for proper installation and how the tool is executed.

absPath(path)[source]

Get the absolute path of <path>, replacing <install> with the installation directory.

basePath()[source]

Get the base installation path.

installDirectory()[source]
Returns:the installation directory of the tool
pathOfExecutable()[source]
Returns:path of executable
ok(b)[source]
Returns:‘ok’ if b is True, else, return ‘error’.

tools.ioObjects module

class FileStatus[source]

Bases: smodels.theory.printer.Printer

Object to run several checks on the input file. It holds an LheStatus (SlhaStatus) object if inputType = lhe (slha)

Variables:
  • inputType – specify input type as SLHA or LHE
  • inputFile – path to input file
  • sigmacut – sigmacut in fb
checkFile(inputType, inputFile, sigmacut=None)[source]
class LheStatus(filename)[source]

Bases: smodels.theory.printer.Printer

Object to check if input lhe file contains errors.

Variables:filename – path to input LHE file
evaluateStatus()[source]

run status check

class OutputStatus(status, inputFile, parameters, databaseVersion, outputfile)[source]

Bases: smodels.theory.printer.Printer

Object that holds all status information and has a predefined printout.

Variables:
  • status – status of input file
  • inputFile – input file name
  • parameters – input parameters
  • databaseVersion – database version (string)
  • outputfile – path to outputfile
addWarning(warning)[source]

Append warning to warnings.

Parameters:warning – warning to be appended
checkStatus()[source]

Printout negative status.

formatData(outputLevel)[source]

Access printout format.

Parameters:outputLevel – general control for the output depth to be printed (0 = no output, 1 = basic output, 2 = detailed output,...
updateSLHAStatus(status)[source]

Update SLHA status.

Parameters:status – new SLHA status flag
updateStatus(status)[source]

Update status.

Parameters:status – new status flag
class Qnumbers(pid)[source]

An instance of this class represents quantum numbers.

Get quantum numbers (spin*2, electrical charge*3, color dimension) from qNumbers.

class ResultList(outputarray=, []bestresultonly=None, describeTopo=None)[source]

Bases: smodels.theory.printer.Printer

Class that collects experimental constraints and has a predefined printout.

Variables:
  • outputarray – list of theorypredictions
  • bestresultonly – if True, printout will print only the best result
  • describeTopo – if True, printout will print the constraints
addResult(res, maxcond)[source]

Add a result to the outputarry, unless it violates maxcond.

Parameters:
  • res – theoryprediction to be added to ResultList
  • maxcond – maximum condition violation
formatData(outputLevel)[source]

Access printout format.

Parameters:outputLevel – general control for the output depth to be printed (0 = no output, 1 = basic output, 2 = detailed output,...
getBestResult()[source]

Return best result.

getR(res)[source]

Calculate R value.

Parameters:res – theoryprediction
Returns:R value = weight / upper limit
isEmpty()[source]

Check if outputarray is empty.

sort()[source]

Reverse sort outputarray by R value.

class SlhaStatus(filename, maxDisplacement=0.01, sigmacut=1.00E-02 [fb], checkLSP=True, findMissingDecayBlocks=True, findIllegalDecays=False, checkXsec=True, findLonglived=True)[source]

Bases: smodels.theory.printer.Printer

An instance of this class represents the status of an SLHA file. The output status is: = 0 : the file is not checked, = 1: the check is ok = -1: case of a physical problem, e.g. charged LSP, = -2: case of formal problems, e.g. no cross sections

Variables:
  • filename – path to input SLHA file
  • maxDisplacement – maximum c*tau for promt decays in meters
  • sigmacut – sigmacut in fb
  • checkLSP – if True check if LSP is neutral
  • findMissingDecayBlocks – if True add a warning for missing decay blocks
  • findIllegalDecays – if True check if all decays are kinematically allowed
  • checkXsec – if True check if SLHA file contains cross sections
  • findLonglived – if True find stable charged particles and displaced vertices
degenerateChi()[source]

Check if chi01 is lsp and chipm1 is NLSP. If so, check mass splitting. This function is not used, the limit is arbitrary.

deltaMass(pid1, pid2)[source]

Calculate mass splitting between particles with pid1 and pid2.

Returns:mass difference
emptyDecay(pid)[source]

Check if any decay is listed for the particle with pid

Parameters:pid – PID number of particle to be checked
Returns:True if the decay block is missing or if it is empty, None otherwise
evaluateStatus()[source]

Get status summary from all performed checks.

Returns:a status flag and a message for explanation
findIllegalDecay(findIllegal)[source]

Find decays for which the sum of daughter masses excels the mother mass

Parameters:findIllegal – True if check should be run
Returns:status flag and message
findLSP(returnmass=None)[source]

Find lightest particle (not in rEven).

Returns:pid, mass of the lsp, if returnmass == True
findLonglivedParticles(findLonglived)[source]

Find meta-stable particles that decay to visible particles and stable charged particles.

Returns:status flag, message
findMissingDecayBlocks(findMissingBlocks)[source]

For all non-rEven particles listed in mass block, check if decay block is written

Returns:status flag and message
findNLSP(returnmass=None)[source]

Find second lightest particle (not in rEven).

Returns:pid ,mass of the NLSP, if returnmass == True
getDecayWidth(pid)[source]

Get the decay-width for particle with pid, if it exists.

getDecayWidths()[source]

Get all decay-widths as a dictionary {pid: width}.

getLifetime(pid, ctau=False)[source]

Compute lifetime from decay-width for a particle with pid.

Parameters:
  • pid – PID of particle
  • ctau – set True to multiply lifetime by c
Returns:

lifetime

hasXsec(checkXsec)[source]

Check if XSECTION table is present in the slha file.

Parameters:checkXsec – set True to run the check
Returns:status flag, message
massDiffLSPandNLSP()[source]

Get the mass difference between the lsp and the nlsp.

read()[source]

Get pyslha output object.

sumBR(pid)[source]

Calculate the sum of all branching ratios for particle with pid.

Parameters:pid – PID of particle
Returns:sum of branching ratios as given in the decay table for pid
testLSP(checkLSP)[source]

Check if LSP is charged.

Parameters:checkLSP – set True to run the check
Returns:status flag, message
visible(pid, decay=None)[source]

Check if pid is detectable. If pid is not known, consider it as visible. If pid not SM particle and decay = True, check if particle or decay products are visible.

tools.lheChecks module

main(args)[source]

tools.missingTopologies module

class MissingTopo(topo, weights)[source]

Object to describe one missing topology result :ivar topo: topology description :ivar weights: weights dictionary

class MissingTopoList(sqrts)[source]

Bases: smodels.theory.printer.Printer

Object to find and collect MissingTopo objects, plus printout functionality :ivar sqrts: center of mass energy for which missing topologies should be evaluated

addToTopos(el, sumL=None)[source]

adds an element to the list of missing topologies if the element contributes to a missing topology that is already in the list, add weight to topology :parameter el: element to be added

findMissingTopos(smstoplist, listOfAnalyses, minmassgap, doCompress, doInvisible, sumL=None)[source]

Loops over all the elements in smstoplist and checks if the elements are tested by any of the analysis in listOfAnalysis.

Parameters:
  • smstoplist – list of topologies (TopologyLis object)
  • listOfAnlysis – a list of ULanalysis objects
  • minmassgap – the parameter for mass compression (Unum object)
  • doCompress – if set to True will ignore elements which can be mass compressed (True/Fals)
  • doInvisible – if set to True will ignore elements which can be invisibly compressed (True/False)
  • sumL – if True, missing topologies will not distinguish e and mu
formatData(outputLevel)[source]
generalName(instr, sumL=None)[source]

generalize by summing over charges e, mu are combined to l :parameter instr: element as string :returns: string of generalized element

orderbranches(instr)[source]

unique ordering of branches :parameter instr: element as string :returns: string of ordered element

tools.modpyslha module

A simple but flexible handler of the SUSY Les Houches Accord (SLHA) data format.

pyslha is a parser/writer module for particle physics SUSY Les Houches Accord (SLHA) supersymmetric spectrum/decay files, and a collection of scripts which use the interface, e.g. for conversion to and from the legacy ISAWIG format, or to plot the mass spectrum and decay chains.

The current release supports SLHA version 1, and as far as I’m aware is also fully compatible with SLHA2: the block structures are read and accessed generically. If you have any problems, please provide an example input file and I’ll happily investigate. SLHA3 is not yet supported (or standardised) but in recent releases the new structures will not crash the parser. Support will be added once the format is standardised (and in response to demand!)

The plotting script provides output in PDF, EPS and PNG via LaTeX and the TikZ graphics package, and as LaTeX/TikZ source for direct embedding into documents or user-tweaking of the generated output.

Users of version 1.x should note that the interface has changed a little in version 2.0.0 and onward, in particular in the interface of the Block objects, which are now more dict-like: entries can be added and accessed via the usual square-brackets indexing operators, including for multiple indices as is common for mixing matrices e.g. NMIX[1,2] as opposed to the old NMIX.entries[1][2] way. This does break backward compatibility but is a big improvement both for internal code sanity and usability. The Block interface also now supplies dict-like has_key(), keys(), and items() methods, as well as more specialist value(), set_value() and is_single_valued() methods for improved access to ALPHA and any other unindexed blocks.

If you use PySLHA, for either model data handling or spectrum visualisation, please cite the paper: http://arxiv.org/abs/1305.4194

TODOs:

For 3.0.x:
  • Add handling of XSECTION if/when standardised.
  • In set_value, if first item is non-int, treat as None-indexed.
  • Refine value string heuristic for strings with ints in them?
  • Use Doc to handle document-level header comments.
  • Add block and decay summary comments to the OrderedDict (wrap OrderedDict as DataStore?)
For 3.1.x:
  • Preserve inline comments from read -> write (needs full-line/inline comment separation). Can use separate comment dicts in Block and Decay, and attach a multiline .comment attr to the returned/written dicts.
Later/maybe:
  • Add Sphinx docs.
  • Identify HERWIG decay matrix element to use in ISAWIG.
  • Handle RPV SUSY in ISAWIG.
exception AccessError(errmsg)[source]

Bases: exceptions.Exception

Exception object to be raised when a SLHA block is accessed in an invalid way

class Block(name, q=None, entries=None)[source]

Bases: object

Object representation of any BLOCK elements read from an SLHA file.

Blocks have a name, may have an associated Q value, and contain a collection of data entries, each indexed by one or more keys. Entries in the dictionary are stored as numeric types (int or float) when a cast from the string in the file has been possible.

Block is closely related to a Python dict (and, in fact, is implemented via an OrderedDict when possible). The preferred methods of entry access use the dict-like [] operator for getting and setting, and the keys() and items() methods for iteration. Purely iterating over the object behaves like keys(), as for an ordinary dict.

Multiple (integer) indices are possible, especially for entries in mixing matrix blocks. These are now implemented in the natural way, e.g. for access to the (1,2) element of a mixing matrix block, use bmix[1,2] = 0.123 and print bmix[1,2]. The value() and set_value() functions behave similarly. Multi-element values are also permitted.

It is possible, although not usual, to store unindexed values in a block. This is only supported when that entry is the only one in the block, and it is stored in the normal fashion but with None as the lookup key. The value() method may be used without a key argument to retrieve this value, if the is_single_valued() method returns True, and similarly the set_value() method may be used to set it if only one argument is supplied and the object is compatible.

add_entry(args)[source]

Add an entry to the block from an iterable (i.e. list or tuple) of strings, or from a whitespace-separated string.

This method is just for convenience: it splits the single string argument if necessary and converts the list of strings into numeric types when possible. For the treatment of the resulting iterable see the set_value method.

get(key=None, default=1)

Get a value from the block with the supplied key.

If no key is given, then the block must contain only one non-indexed value otherwise an AccessError exception will be raised.

has_key(key)[source]

Does the block have the given key?

is_single_valued()[source]

Return true if there is only one entry, and it has no index: the ‘value()’ attribute may be used in that case without an argument.

items(key=None)[source]

Access the block items as (key,value) tuples.

Note: The Python 3 dict attribute ‘items()’ is used rather than the ‘old’ Python 2 ‘iteritems()’ name for forward-looking compatibility.

keys()[source]

Access the block item keys.

set(*args)

Set a value in the block via supplied key/value arguments.

Indexing is determined automatically: any leading integers will be treated as a multi-dimensional index, with the remaining entries being a (potentially multi-dimensional) value. If all N args are ints, then the first N-1 are treated as the index and the Nth as the value.

If there is only one arg it will be treated as the value of a single-valued block. In this case the block must already contain at most one non-indexed value otherwise an AccessError exception will be raised.

set_value(*args)[source]

Set a value in the block via supplied key/value arguments.

Indexing is determined automatically: any leading integers will be treated as a multi-dimensional index, with the remaining entries being a (potentially multi-dimensional) value. If all N args are ints, then the first N-1 are treated as the index and the Nth as the value.

If there is only one arg it will be treated as the value of a single-valued block. In this case the block must already contain at most one non-indexed value otherwise an AccessError exception will be raised.

value(key=None, default=1)[source]

Get a value from the block with the supplied key.

If no key is given, then the block must contain only one non-indexed value otherwise an AccessError exception will be raised.

values()[source]

Access the block item values.

class Decay(br, nda, ids, parentid=None)[source]

Bases: object

Object representing a decay entry on a particle decribed by the SLHA file. ‘Decay’ objects are not a direct representation of a DECAY block in an SLHA file... that role, somewhat confusingly, is taken by the Particle class.

Decay objects have three properties: a branching ratio, br, an nda number (number of daughters == len(ids)), and a tuple of PDG PIDs to which the decay occurs. The PDG ID of the particle whose decay this represents may also be stored, but this is normally known via the Particle in which the decay is stored.

class Doc(blocks, decays=None, xsections=None)[source]

Bases: object

Top level container for everything in an SLHA record

write(filename=None, ignorenobr=False, precision=8)[source]

Convenient method for converting an SLHA Doc object to SLHA format, either returned as a string or written to a file depending on whether the filename variable is None.

exception ParseError(errmsg)[source]

Bases: exceptions.Exception

Exception object to be raised when a spectrum file/string is malformed

class Particle(pid, totalwidth=None, mass=None)[source]

Bases: object

Representation of a single, specific particle, decay block from an SLHA file. These objects are not themselves called ‘Decay’, since that concept applies more naturally to the various decays found inside this object. Particle classes store the PDG ID (pid) of the particle being represented, and optionally the mass (mass) and total decay width (totalwidth) of that particle in the SLHA scenario. Masses may also be found via the MASS block, from which the Particle.mass property is filled, if at all. They also store a list of Decay objects (decays) which are probably the item of most interest.

add_decay(br, nda, ids)[source]

Adds the decay entry to the Particle object.

herwigid2pdgid(hwid)[source]

Convert a particle ID code in the HERWIG internal IDHW format (as used by ISAWIG) into its equivalent in the standard PDG ID code definition.

pdgid2herwigid(pdgid)[source]

Convert a particle ID code in the standard PDG ID code definition into its equivalent in the HERWIG internal IDHW format (as used by ISAWIG).

read(spcfile, **kwargs)[source]

Read an SLHA or ISAWIG file (or stdin).

spcfile may either be a string filename or a file object. If a s string, the assumed file format is based from the filename; if a file it is assumed to be SLHA format.

Other keyword parameters are passed to readSLHA/readISAWIG.

readISAWIG(isastr, ignorenobr=False)[source]

Read a spectrum definition from a string in the ISAWIG format, returning dictionaries of blocks and decays. While this is not an SLHA format, it is informally supported as a useful mechanism for converting ISAWIG spectra to SLHA.

ISAWIG parsing based on the HERWIG SUSY specification format, from http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html

If the ignorenobr parameter is True, do not store decay entries with a branching ratio of zero.

readISAWIGFile(isafile, **kwargs)[source]

Read a spectrum definition from a file in the ISAWIG format, returning dictionaries of blocks and decays. While this is not an SLHA format, it is informally supported as a useful mechanism for converting ISAWIG spectra to SLHA.

isafile may either be a string filename or a file object.

Other keyword parameters are passed to readISAWIG.

readSLHA(spcstr, ignorenobr=False, ignorenomass=False, ignoreblocks=[])[source]

Read an SLHA definition from a string, returning dictionaries of blocks and decays.

If the ignorenobr parameter is True, do not store decay entries with a branching ratio of zero.

If the ignorenomass parameter is True, parse file even if mass block is absent in the file (default is to raise a ParseError).

readSLHAFile(spcfile, **kwargs)[source]

Read an SLHA file, returning dictionaries of blocks and decays.

Other keyword parameters are passed to readSLHA.

write(spcfile, doc, **kwargs)[source]

Write to an SLHA or ISAWIG file (or stdout).

spcfile may either be a string filename or a file object. If a s string, the assumed file format is based from the filename; if a file it is assumed to be SLHA format.

Other keyword parameters are passed to writeSLHA/writeISAWIG.

writeISAWIG(doc, ignorenobr=False, precision=8)[source]

Return a SUSY spectrum definition in the format produced by ISAWIG for inut to HERWIG as a string, from the supplied SLHA blocks and decays dicts.

ISAWIG parsing based on the HERWIG SUSY specification format, from http://www.hep.phy.cam.ac.uk/~richardn/HERWIG/ISAWIG/file.html

If the ignorenobr parameter is True, do not write decay entries with a branching ratio of zero.

writeISAWIGFile(isafile, doc, **kwargs)[source]

Write an ISAWIG file from the supplied blocks and decays dicts.

isafile may either be a string filename or a file object.

Other keyword parameters are passed to writeISAWIG.

writeSLHA(doc, ignorenobr=False, precision=8)[source]

Return an SLHA definition as a string, from the supplied blocks and decays dicts.

writeSLHABlocks(blocks, precision=8)[source]

Return an SLHA definition as a string, from the supplied blocks dict.

writeSLHADecays(decays, ignorenobr=False, precision=8)[source]

Return an SLHA decay definition as a string, from the supplied decays dict.

writeSLHAFile(spcfile, doc, **kwargs)[source]

Write an SLHA file from the supplied blocks and decays dicts.

Other keyword parameters are passed to writeSLHA.

tools.nllFast module

getDecoupledKfactors(nllpath, process, energy, pdf, mass)[source]

Compute k-factors in the decoupled (squark or gluino) regime for the process. If a decoupled grid does not exist for the process, return None

getKfactorsFor(pIDs, sqrts, slhafile, pdf='cteq')[source]

Read the NLLfast grid and returns a pair of k-factors (NLO and NLL) for the pair.

Returns:k-factors = None, if NLLfast does not contain the process; uses the slhafile to obtain the SUSY spectrum.
getKfactorsFrom(output)[source]

Read NLLfast output and return the k-factors.

getProcessName(pIDs)[source]

Return the process name (in NLLfast notation) for the pair production of pIDs.

Returns:None, if the particle ID pair is not contained in NLLfast
interpolateKfactors(kFacsVector, xval)[source]

Interpolate a list of k-factor values from kFacsVector = [[x0,[k1,k2,..]], [x1,[k1,k2,..],...].

Returns:list of interpolated k-factor values at x-value xval
runNLLfast(nll_run, nllpath)[source]

Execute NLLfast with command nll_run at nllpath.

Returns:NLLfast output as a string

tools.physicsUnits module

tools.slhaChecks module

main(args)[source]

tools.summaryReader module

class Output(l)[source]
class Summary(filename)[source]

Class to access the output given in the summary.txt

read(infile)[source]

tools.toolBox module

class ToolBox[source]

Bases: object

A singleton-like class that keeps track of all external tools. Intended to make installation and deployment easier.

add(instance)[source]

Adds a tool by passing an instance to this method.

checkInstallation(colors=True, make=False, printit=True)[source]

Checks if all tools listed are installed properly, returns True if everything is ok, False otherwise.

compile()[source]

Tries to compile and install tools that are not yet marked as ‘installed’.

get(tool, verbose=True)[source]

Gets instance of tool from the toolbox.

initSingleton()[source]

Initializes singleton instance (done only once for the entire class).

installationOk(ok, colors)[source]

Returns color coded string to signal installation issues.

listOfTools()[source]

Returns a simple list with the tool names.

tools.uniqueLogFilter module

class UniqueFilter(name='')[source]

Bases: logging.Filter

Messages are allowed through just once. The ‘message’ includes substitutions, but is not formatted by the handler. If it were, then practically all messages would be unique! stolen from: http://code.activestate.com/recipes/412552-using-the-logging-module/

filter(rec)[source]

logging.Filter.filter performs an extra filter on the name.

reset()[source]

Act as if nothing has happened.

tools.xsecComputer module

addXSecToFile(xsecs, slhafile, comment=None, complain=True)[source]

Write cross-sections to an SLHA file.

Parameters:
  • xsecs – a XSectionList object containing the cross-sections
  • slhafile – target file for writing the cross-sections in SLHA format
  • comment – optional comment to be added to each cross-section block
  • complain – complain if there are already cross sections in file
computeXSec(sqrts, maxOrder, nevts, slhafile, lhefile=None, unlink=True, loFromSlha=None)[source]

Run pythia and compute SUSY cross-sections for the input SLHA file.

Parameters:
  • sqrts – sqrt{s} to run Pythia, given as a unum (e.g. 7.*TeV)
  • maxOrder – maximum order to compute the cross-section, given as an integer if maxOrder == 0, compute only LO pythia xsecs if maxOrder == 1, apply NLO K-factors from NLLfast (if available) if maxOrder == 2, apply NLO+NLL K-factors from NLLfast (if available)
  • nevts – number of events for pythia run
  • slhafile – SLHA file
  • lhefile – LHE file. If None, do not write pythia output to file. If file does not exist, write pythia output to this file name. If file exists, read LO xsecs from this file (does not run pythia).
  • unlink – Clean up temp directory after running pythia
  • loFromSlha – If True, uses the LO xsecs from the SLHA file to compute the higher order xsecs
Returns:

XSectionList object

main(args)[source]
runPythia(slhafile, nevts, sqrts, lhefile=None, unlink=True)[source]

Execute pythia_lhe with n events, at sqrt(s)=sqrts.

Parameters:
  • slhafile – input SLHA file
  • nevts – number of events to be generated
  • sqrts – center of mass sqrt{s} (in TeV)
  • lhefile – option to write LHE output to file; ff None, do not write output to disk.
  • unlink – Clean up temp directory after running pythia
Returns:

file object with the LHE events

xsecToBlock(xsec, inPDGs=(2212, 2212), comment=None, xsecUnit=1.00E+00 [pb])[source]

Generate a string for a XSECTION block in the SLHA format from a XSection object.

Parameters:
  • inPDGs – defines the PDGs of the incoming states (default = 2212,2212)
  • comment – is added at the end of the header as a comment
  • xsecUnit – unit of cross-sections to be written (default is pb). Must be a Unum unit.

Module contents