Analysis

class vega.analysis.Analysis(minimizer, main_config, mc_config=None)[source]

Vega analysis class.

  • Compute parameter scan
  • Create Monte Carlo realizations of the data
  • Run FastMC analysis
Parameters:
  • minimizer (Minimizer) – Minimizer object initialized from the same vega instance
  • main_config (ConfigParser) – Main config file
  • mc_config (dict, optional) – Monte Carlo config with the model and sample parameters, by default None
chi2_scan()[source]

Compute a chi^2 scan over one or two parameters.

Returns:Scan results
Return type:List
class vega.minimizer.Minimizer(chi2_func, sample_params)[source]

Class for handling the interface to the minimizer.

Parameters:
  • chi2_func (function) – Function that takes dictionary of params and returns a chi^2 value
  • sample_params (dict) – Dictionary with the sample params config
chi2(*pars)[source]

Wrapper of chi2 function for iminuit.

Returns:chi^2
Return type:float
minimize(params=None)[source]

Minimize the chi2.

Parameters:params (dict, optional) – Dictionary of sample parameters, used to change starting value and/or fix parameters, by default None
class vega.output.Output(config, data, corr_items, analysis=None)[source]

Class for handling the Vega output, and reading/writing output files.

Parameters:
  • config (ConfigParser) – Output section of main config file
  • data (dict) – Vega Data objects
  • corr_items (dict) – Vega correlation_item objects
  • analysis (Analysis, optional) – Analysis object, by default None
write_results(corr_funcs, params, minimizer=None, scan_results=None, models=None)[source]

Write results in the fits or hdf format

Parameters:
  • corr_funcs (dict) – Model correlation functions to write to file. This should be the output of vega.compute_model()
  • params (dict) – Parameters to write to file. These should be the parameters vega.compute_model() was called with.
  • minimizer (Minimizer, optional) – Minimizer object after minimization was done, by default None
  • scan_results (list, optional) – List of scan results, by default None
  • models (dict, optional) – Dictionary with the Vega Model objects, by default None
write_results_fits(corr_funcs, params, minimizer=None, scan_results=None, models=None)[source]

Write output in the fits format

Parameters:
  • corr_funcs (dict) – Model correlation functions to write to file. This should be the output of vega.compute_model()
  • params (dict) – Parameters to write to file. These should be the parameters vega.compute_model() was called with.
  • minimizer (Minimizer, optional) – Minimizer object after minimization was done, by default None
  • scan_results (list, optional) – List of scan results, by default None
  • models (dict, optional) – Dictionary with the Vega Model objects, by default None
write_results_hdf(minimizer, scan_results=None)[source]

Write Vega analysis results, including the bestfit and chi2 scan results if they exist.

Parameters:
  • minimizer (Minimizer) – Minimizer object after minimization was done
  • scan_results (list, optional) – List of scan results, by default None