Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cut acceptance plotting #135

Merged
merged 11 commits into from
May 7, 2024
Merged

Fix cut acceptance plotting #135

merged 11 commits into from
May 7, 2024

Conversation

ghusheng
Copy link
Collaborator

@ghusheng ghusheng commented May 6, 2024

Fix the n_minus_1 plotting option in the get_cut_eff

@ghusheng ghusheng closed this May 6, 2024
@ghusheng ghusheng reopened this May 6, 2024
@ghusheng ghusheng requested a review from FaroutYLq May 6, 2024 20:41
Copy link
Collaborator

@FaroutYLq FaroutYLq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ghusheng for catching this. but I feel like we can just keep using cut_func as before to make the codes concise. I made a commit. Can you please check if it makes sense to you?

for cut_oi in all_cut_list:
selected_events_cut_oi = selected_events[apply_single_cut(selected_events, cut_oi)]
selected_events_cut_oi = selected_events[cut_func(selected_events, cut_oi)]
# Efficiency curves with Clopper-Pearson uncertainty estimation
interval = binomtest(len(selected_events_cut_oi), len(selected_events)).proportion_ci()
result_dict[cut_oi][i] = len(selected_events_cut_oi) / len(selected_events)
Copy link
Collaborator Author

@ghusheng ghusheng May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lanqing! If we still keep the code like this, I am not sure the N-1 cut acceptance is correct. should be len(selected_events_all_cut) / len(selected_events_cut_oi)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks for the sanity check now I wake up. Is it better now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, the thing is that if you change in this way then it won't work for the single cut acceptance. These two need to be treated differently :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I buy it. Let me revert.

Copy link
Collaborator

@FaroutYLq FaroutYLq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @ghusheng for capturing this important bug. Now it should be fixed.

@FaroutYLq FaroutYLq merged commit ff38c93 into main May 7, 2024
1 of 2 checks passed
@ghusheng
Copy link
Collaborator Author

ghusheng commented May 7, 2024

Thanks again @ghusheng for capturing this important bug. Now it should be fixed.

np

@FaroutYLq FaroutYLq deleted the fix_cut_acc branch November 29, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants