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

[Discussion] Argument to parametrize MG nevents #454

Open
Sinclert opened this issue Feb 19, 2021 · 0 comments
Open

[Discussion] Argument to parametrize MG nevents #454

Sinclert opened this issue Feb 19, 2021 · 0 comments

Comments

@Sinclert
Copy link
Member

Sinclert commented Feb 19, 2021

This issue is mean to hold the discussion of whether adding a way to parametrize the argument nevents that MadGraph run cards contain, is something worth implementing.

Context

On recent days, a way to determine the number of events of a given madminer-workflow run has come into discussion (see issue madminer-tool/madminer-workflow#39), because of the crucial value this parameter has when scaling up an experiment.

Problem

With the current containerization of workflows, there is no easy way to tune this parameter given a built Docker image, requiring users to re-build the Docker image for each change on the MadGraph run-cards.

Disclaimer: If there is any other way to specify nevents to MadGraph, it should be considered.

Proposal

My initial approach would have involved modifying the workflow run_card_background.dat and run_card_signal.dat to make the nevents value Python-formatted. Something like:

{madgraph_num_events} = nevents ! Number of unweighted events requested

So that we could read this file and format it with the desired number of events just before running MadGraph / Pythia8. Following this StackOverflow answer, something like:

with open("code/cards/run_card_signal.dat", "r+") as run_card_file:
    run_card_spec = run_card_file.read()
    run_card_spec.format(madgraph_num_events=10000) # For example
    run_card_file.seek(0)
    run_card_file.write(run_card_spec)
    run_card_file.truncate()

But, then I thought that this functionality of parametrizing MadGraph cards could be useful within the MadMiner library itself, instead of being something specific for the madminer-workflow project.

Discussion

  1. Do you think it would be useful to have the described functionality within the library itself?
  2. If you do, what do you think should be the way to proceed?
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

No branches or pull requests

1 participant