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

Add a conditions generator #60

Merged
merged 3 commits into from
Sep 17, 2020
Merged

Add a conditions generator #60

merged 3 commits into from
Sep 17, 2020

Conversation

scarlehoff
Copy link
Member

@scarlehoff scarlehoff commented Sep 16, 2020

This adds an auxiliary function that can be used to generate cuts: generate_condition_function

For instance, the following code will create a function f_cond that upon being called with three conditions returns a boolean mask of the three conditions (as requested by the keyword condition) and the indices in which these are True which is often useful.

from vegasflow.utils import generate_condition_function
f_cond = generate_condition_function(3, condition = ['and', 'or'])
t_1 = pt_jet1 > 15
t_2 = pt_jet2 > 15
t_3 = rapidity_jet_1 < 4
full_mask, indices = f_cond(t_1, t_2, t_3)

This PR is pointing to PR #56

I'll add the docs directly in #58 though

@scarlehoff scarlehoff mentioned this pull request Sep 16, 2020
6 tasks
@scarrazza
Copy link
Contributor

Thanks, seems to work well, and the numbers I get for the pineappl example are similar to the plain MC python example.

@scarlehoff
Copy link
Member Author

Good, merge to the main pineappl branch then when you want.

@scarrazza scarrazza merged commit 20e6c7c into pineappl Sep 17, 2020
@scarrazza scarrazza deleted the add_cuts branch September 17, 2020 12:09
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.

None yet

2 participants