decaylanguage.decay

decaylanguage.modeling.decay

A general base class representing decays.

class decaylanguage.modeling.decay.ModelDecay(particle, daughters=[], name=None)[source]

This describes a decay very generally, with search and print features. Subclassed for further usage.

list_structure(final_states)[source]

The structure in the form [(0,1,2,3)], where the dual-list is used for permutations for bose symmatrization. So for final_states=[a,b,c,c], [a,c,[c,b]] would be: [(0,2,3,1),(0,3,2,1)]

property structure

The structure of the decay chain, simplified to only final state particles

decaylanguage.modeling.ampgentransform

class decaylanguage.modeling.ampgentransform.AmpGenTransformer(visit_tokens: bool = True)[source]

decaylanguage.modeling.amplitudechain

A class representing a set of decays. Can be subclassed to provide custom converters.

class decaylanguage.modeling.amplitudechain.AmplitudeChain(particle, daughters=[], lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]

This is a chain of decays (a “line”)

expand_lines(linelist)[source]

Take a DecayTree -> list of DecayTrees with each dead-end daughter expanded to every possible combination. (recursive)

classmethod from_matched_line(mat)[source]

This operates on an already-matched line.

Parameters:

mat – The groupdict output of a match

Returns:

A new amplitude chain instance

classmethod read_ampgen(filename=None, text=None, grammar=None, parser='lalr', **kargs)[source]

Read in an ampgen file

Parameters:
  • filename – Filename to read

  • text – Text to read (use instead of filename)

Returns:

array of AmplitudeChains, parameters, constants, event type

class decaylanguage.modeling.amplitudechain.LS(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Line shapes supported (currently)

decaylanguage.modeling.goofit

This is a GooFit adaptor for amplitude chain.

class decaylanguage.modeling.goofit.DecayStructure(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class decaylanguage.modeling.goofit.GooFitChain(particle, daughters=[], lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]

Class to read an AmpGen options file and return GooFit C++ code.

property decay_structure

Determine if decay proceeds via two resonances or cascade decay.

property formfactor

Return form factor based on relative angular momentum L.

make_amplitude(final_states)[source]

Write out the amplitude and push it to a vector.

classmethod make_intro(all_states)[source]

Write out definitions of constant variables and vectors to hold intermediate values.

make_linefactor(final_states)[source]

Write out the line shape and push it to a vector.

make_lineshape(structure, masses)[source]

Write out the line shapes. Each kind of line shape is treated separately.

classmethod make_pars()[source]

Write out the parameters used in the amplitudes.

make_spinfactor(final_states)[source]

Write out the spin factor and push it to a vector.

classmethod read_ampgen(*args, **kargs)[source]

Read in an AmpGen file.

Returns:

Array of AmplitudeChains, event type.

spindetails()[source]

Return string with spin structure.

property spinfactors

Check if the spin structure is known and return it together with the form factor.

to_goofit(final_states)[source]

Write the vectors with the spin factors, line shapes and amplitudes.

class decaylanguage.modeling.goofit.GooFitPyChain(particle, daughters=[], lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]

Class to read an AmpGen options file and return a GooFit Python script.

property decay_structure

Determine if the decay proceeds via two resonances or a cascade decay.

property formfactor

Return the form factor based on relative angular momentum L.

make_amplitude(final_states)[source]

Write out the amplitude and push it to a vector.

classmethod make_intro(all_states)[source]

Write out definitions of constant variables and lists to hold intermediate values.

make_linefactor(final_states)[source]

Write out the line shape and push it to a vector.

make_lineshape(structure, masses)[source]

Write out the line shapes. Each kind of line shape is treated separately.

classmethod make_pars()[source]

Write out the parameters used in the amplitudes.

make_spinfactor(final_states)[source]

Write out the spin factor and push it to a vector.

classmethod read_ampgen(*args, **kargs)[source]

Read in the AmpGen file.

Returns:

Array of AmplitudeChains, event type.

spindetails()[source]

Return string with spin structure.

property spinfactors

Check if the spin structure is known and return it together with the form factor.

to_goofit(final_states)[source]

Write the lists with the spin factors, line shapes and amplitudes.

class decaylanguage.modeling.goofit.SF_4Body(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]