hepi.run.spheno

hepi interface to spheno.

SPheno stands for S(upersymmetric) Pheno(menology) find it here https://spheno.hepforge.org/.

Submodules

Package Contents

Classes

Input

Input for computation and scans.

Runner

SPhenoRunner

Functions

update_slha(i)

Updates dependent parameters in Input i.

Attributes

spheno_default_runner

Default SPheno Runner to provide backward compatibility

run

set_path

get_path

class hepi.run.spheno.Input(order, energy, particle1, particle2, slha, pdf_lo, pdf_nlo, mu_f=1.0, mu_r=1.0, pdfset_lo=0, pdfset_nlo=0, precision=0.001, max_iters=50, invariant_mass='auto', result='total', pt='auto', id='', model='', update=True)[source]

Bases: hepi.util.DictData

Input for computation and scans.

Variables:
  • order (Order) – LO, NLO or NLO+NLL computation.

  • energy (int) – CMS energy in GeV.

  • energyhalf (int) – Halfed energy.

  • particle1 (int) – PDG identifier of the first final state particle.

  • particle2 (int) – PDG identifier of the second final state particle.

  • slha (str) – File path of for the base slha. Modified slha files will be used if a scan requires a change of the input.

  • pdf_lo (str) – LO PDF name.

  • pdf_nlo (str) – NLO PDF name.

  • pdfset_lo (int) – LO PDF member/set id.

  • pdfset_nlo (int) – NLO PDF member/set id.

  • pdf_lo_id (int) – LO PDF first member/set id.

  • pdf_nlo_id (int) – NLO PDF first member/set id.

  • mu (double) – central scale factor.

  • mu_f (double) – Factorization scale factor.

  • mu_r (double) – Renormalization scale factor.

  • precision (double) – Desired numerical relative precision.

  • max_iters (int) – Upper limit on integration iterations.

  • invariant_mass (str) – Invariant mass mode ‘auto = sqrt((p1+p2)^2)’ else value.

  • pt (str) – Transverse Momentum mode ‘auto’ or value.

  • result (str) – Result type ‘total’/’pt’/’ptj’/’m’.

  • id (str) – Set an id of this run.

  • model (str) – Path for MadGraph model.

  • update (bool) – Update dependent mu else set to zero.

Parameters:
  • order (hepi.order.Order) –

  • energy (float) –

  • particle1 (int) –

  • particle2 (int) –

  • slha (str) –

  • pdf_lo (str) –

  • pdf_nlo (str) –

has_gluino()[source]
Return type:

bool

has_neutralino()[source]
Return type:

bool

has_charginos()[source]
Return type:

bool

has_weakino()[source]
Return type:

bool

has_squark()[source]
Return type:

bool

has_slepton()[source]
Return type:

bool

hepi.run.spheno.update_slha(i)[source]

Updates dependent parameters in Input i.

Mainly concerns the mu value used by madgraph.

Parameters:

i (Input) –

class hepi.run.spheno.Runner(path, in_dir=None, out_dir=None, pre=None)[source]
Parameters:
  • path (str) –

  • in_dir (str) –

  • out_dir (str) –

orders()[source]

List of supported Orders in this runner.

Return type:

List[hepi.input.Order]

get_name()[source]

Returns the name of the runner.

Return type:

str

get_version()[source]
Return type:

str

_sub_run(coms)[source]
Parameters:

coms (List[str]) –

Return type:

str

_check_path()[source]

Checks if the passed path is valid.

Return type:

bool

_prepare(p, skip=False, assume_valid=False, **kwargs)[source]
Parameters:

p (hepi.input.Input) –

Return type:

RunParam

_check_input(param, **kwargs)[source]
Parameters:

param (hepi.input.Input) –

Return type:

bool

_prepare_all(params, skip=True, n_jobs=None, **kwargs)[source]

Prepares all parameters for execution.

Parameters:
  • params (List[hepi.Input]) – List of input parameters.

  • skip (bool, optional) – If True, the runner will check if the output file already exists and skip the execution if it does. Defaults to True.

  • n_jobs (int) – Number of parallel jobs. If None, use all available cores.

Return type:

List[RunParam]

run(params, skip=True, parse=True, parallel=True, sleep=0, run=True, ignore_error=False, n_jobs=None, **kwargs)[source]

Run the passed list of parameters.

Parameters:
  • params (list of hepi.Input) – All parameters that should be executed/queued.

  • skip (bool) – True means stored runs will be skipped. Else the are overwritten.

  • parse (bool) – Parse the results. This is not the prefered cluster/parallel mode, as there the function only queues the job.

  • parallel (bool) – Run jobs in parallel.

  • sleep (int) – Sleep seconds after starting job.

  • run (bool) – Actually start/queue runner.

  • ignore_error (bool) – Continue instead of raising Exceptions. Also ignores hash collisions.

  • n_jobs (int) – Number of parallel jobs. If None, use all available cores.

Returns:

combined dataframe of results and parameters. The dataframe is empty if parse is set to False.

Return type:

pd.DataFrame

_run(rps, wait=True, parallel=True, sleep=0, n_jobs=None, **kwargs)[source]

Runs Runner per RunParams.

Parameters:
  • rps (list of RunParams) – Extended run parameters.

  • bar (bool) – Enable info bar.

  • wait (bool) – Wait for parallel runs to finish.

  • sleep (int) – Sleep seconds after starting subprocess.

  • parallel (bool) – Run jobs in parallel.

  • n_jobs (int) – Number of parallel jobs. If None, use all available cores.

Returns:

return codes from jobs if no_parse is False.

Return type:

list of int

_is_valid(file, p, d, **kwargs)[source]

Verifies that a file is a complete output.

Parameters:
  • file (str) – File path to be parsed.

  • p (hepi.Input) – Onput parameters.

  • d (dict) – Param dictionary.

Returns:

True if file could be parsed.

Return type:

bool

parse(outputs, n_jobs=None)[source]

Parses Resummino output files and returns List of Results.

Args:

outputs (list of str): List of the filenames to be parsed.

n_jobs (int): Number of parallel jobs. If None, use all available cores.

Returns:

list of hepi.resummino.result.ResumminoResult

Parameters:

outputs (List[str]) –

Return type:

List[hepi.results.Result]

_parse_file(file)[source]

Extracts results from an output file.

Parameters:

file (str) – File path to be parsed.

Returns:

If a value is not found in the file None is used.

Return type:

Result

get_path()[source]

Get the Runner path.

Returns:

current Runner path.

Return type:

str

get_input_dir()[source]

Get the input directory.

Returns:

in_dir

Return type:

str

get_output_dir()[source]

Get the input directory.

Returns:

out_dir

Return type:

str

get_pre()[source]

Gets the command prefix.

Returns:

pre

Return type:

str

set_path(p)[source]

Set the path to the Runner folder containing the binary in ‘./bin’ or ‘./build/bin’.

Parameters:

p (str) – new path.

set_input_dir(indir)[source]

Sets the input directory.

Parameters:

indir (str) – new input directory.

set_output_dir(outdir, create=True)[source]

Sets the output directory.

Parameters:
  • outdir (str) – new output directory. create (bool): create directory if not existing.

  • create (bool) –

set_pre(ppre)[source]

Sets the command prefix.

Parameters:

ppre (str) – new command prefix.

class hepi.run.spheno.SPhenoRunner(path, in_dir=None, out_dir=None, pre=None)[source]

Bases: hepi.run.Runner

Parameters:
  • path (str) –

  • in_dir (str) –

  • out_dir (str) –

_check_path()[source]

Checks if the passed path is valid.

Return type:

bool

run(slhas, **kwargs)[source]

Run the passed list of parameters for SPheno.

Parameters:

slhas (list of Input) – Input parameters with a SLHA file that can be processed by SPheno.

Returns:

list of Input

Return type:

List[hepi.input.Input]

hepi.run.spheno.spheno_default_runner[source]

Default SPheno Runner to provide backward compatibility

hepi.run.spheno.run[source]
hepi.run.spheno.set_path[source]
hepi.run.spheno.get_path[source]