umami-hep / puma

puma - Plotting UMami Api
Apache License 2.0
4 stars 27 forks source link

Generalise ROC curve ratio grouping #202

Closed samvanstroud closed 1 year ago

samvanstroud commented 1 year ago

See the discussion in https://github.com/umami-hep/puma/pull/200

cc @biemster

Rather than grouping ROCs by rejection flavour to plot ratio panels, it might be nice to define custom groups of ratios.

This would look something like

plot_roc.add_roc(
    Roc(
        sig_eff,
        fastGN1_ujets_rej_r29,
        n_test=n_jets_light_r29,
        rej_class="ujets",
        signal_class="bjets",
        label="fastGN1 r29",
        linestyle="dashed",
    ),
    ratio_group="fastGN1",
    reference=True,
)
plot_roc.add_roc(
    Roc(
        sig_eff,
        fastGN1_ujets_rej_r30,
        n_test=n_jets_light_r30,
        rej_class="ujets",
        signal_class="bjets",
        label="fastGN1 r30",
        linestyle="solid",
    ),
    ratio_group="fastGN1",
)
biemster commented 1 year ago

Seeing this in code now, this is probably a better solution than what I did in #200 , and would fit that use case as well. I'll try to whip up a PR on this after the holidays. If I do this quickly nobody would have gotten used to reference_key I hope..

samvanstroud commented 1 year ago

That sounds great thanks @biemster! Yep I agree I think still fine to change things for a better solution :)

samvanstroud commented 1 year ago

fixed in #207