sanedecayrescaling.extract_decays module

This module provides functions to extract data from files (source and reference)

sanedecayrescaling.extract_decays.extract_decay_from_lines(lines)

parse lines from a decayfile into decay-daughters, branching fraction, errors

returns:
  • daughters: list of strings
  • branching_fraction: float
  • branching_fraction_error_plus, branching_fraction_error_plus: float
  • 0 errors for limit cases
  • 0 branching fraction for cases of “not seen”

Todo

Expand the section on subdecays to allow a second subdecay

Todo

better handling for the exceptions from subdecay defolding

sanedecayrescaling.extract_decays.extract_decays_from_decay(path_to_decay_file, particle, work_file_name='workfile.tmp')

get the decays from an EvtGen Decay.Dec file and write them to disk

returns:
  • 0 on success
  • Exception otherwise
sanedecayrescaling.extract_decays.extract_decays_from_reference(path_to_reference_file, particle, ref_file_name='workreffile.tmp')

Extracts decay of particle from reference file

The functionality to extract the decay of an anti-particle to a particle in the reference file is not yet implemented.

returns:
  • nothing
creates:
  • file ref_file_name, which defaults to workreffile.tmp
sanedecayrescaling.extract_decays.find_particle_in_reference(particle, ref_file)

find the particle in the pdg ascii file

Parameters:
  • particle (string) – pdg name of the particle
  • ref_file (open file handle) – the file which should be searched
Returns:

  • (int) file position for the begin of the decay
  • (int) linenumber of the first line for the decay of this particle
  • (int) decay length

sanedecayrescaling.extract_decays.make_single_line_snippets(input_lines)

create and return reconstructed snippets

The ascii-refernece file has more or less 3 columns, the first until 40 chars the second column goes to 66, after which comes the last colum, which is irrelevant. The indicator for a multi-line decay is the presence of a ‘’ char, which signals a linebreak for that column. This first column contains the decay products and and sometimes some other characters, the second column contains the branching fraction

returns:
  • first_column: string with the decay products
  • second_column: string with the branching fractions if existent
  • third_column: string with phase space, confidence limit and scale
  • mini_column: flags removed from first column
sanedecayrescaling.extract_decays.remove_flags(column, flag_list)

returns the column without the flags at the end, which have been added to the flag list, which is also returned

returns:
  • column: input column string minus the flags
  • flag_list: input flag_list string with the flags added in front