icecube / pisa

Monte Carlo-based data analysis
http://icecube.github.io/pisa/
Apache License 2.0
18 stars 47 forks source link

Derived Parameters in CFG files #729

Closed BenSmithers closed 1 year ago

BenSmithers commented 1 year ago

Summary

These commits will allow DerivedParams to be defined in the cfg files directly. Much of this is relevant to additions in pull request #715

This is very handy if you have a basis change for your nuisance parameters, and don't need as many parameters in the new basis to span the space of all output shapes accessible.

Additions

Edits here are pretty minor. I just added some lines to the config_parser to make the DerivedParams and configure them appropriately. I also made a minor change to the Stage class so it doesn't raise exceptions when a bunch of extra parameters are there. I removed a print statement too.

Usage

For a DerivedParam, a list of parameter names the DerivedParam is derived from needs to be provided, separated by spaces; this is assigned to depends_names.

It should also be passed a function_file, which is a pisa-path (or full path) pointing to a json-serialized utils.callable.Funct whose relevant Vars refer to those Param names the DerivedParam depends on.

Ex:

param.ddm_ortho_0 = 0.00+/-1.83
param.ddm_ortho_0.range = [-9.17, 9.17] * units.dimensionless
param.ddm_ortho_0.fixed = True

param.ddm_ortho_1 = 0.00+/-1.49
param.ddm_ortho_1.range = [-7.45, 7.45] * units.dimensionless
param.ddm_ortho_1.fixed = True

param.le_piminus = 0.0000
param.le_piminus.depends_names = ddm_ortho_0 ddm_ortho_1 
param.le_piminus.function_file = /data/user/bsmithers/wg-oscillations-fridge/analysis/meows_sterile/nuisance/daemon/function_files/le_piminus_function.json

param.he_Kplus = 0.0000
param.he_Kplus.depends_names = ddm_ortho_0 ddm_ortho_1 
param.he_Kplus.function_file = /data/user/bsmithers/wg-oscillations-fridge/analysis/meows_sterile/nuisance/daemon/function_files/he_Kplus_function.json

So, for example, you could have Params theta_34 and theta_24, and DerivedParams for U_mu4 and U_tau4 which load function files telling it how to calculate the unitary mixing matrix elements from the mixing angles themselves (or you could do the exact opposite).

LeanderFischer commented 1 year ago

Same comment as for #733: Please pull/merge the current changes from master, which are fixing the test runs. I'll look at the changed code in more detail, later!

LeanderFischer commented 1 year ago

Sorry for leaving this PR sit idle...I'm fine with the propose changes and it can be merged

It still needs to be brought up to speed with master, so the tests won't fail, though.