-
Notifications
You must be signed in to change notification settings - Fork 44
Description
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
- Do you think it would be useful to have the described functionality within the library itself?
- If you do, what do you think should be the way to proceed?
- A) Add a
num_eventsparameter to MadMiner.run_multiple method. - B) Define a completely different class (maybe within utils/interfaces/mg.py? or within utils/interfaces/mg_cards.py?) to parametrize run cards completely independent of whether or not they will be immediately used.
- C) ...
- A) Add a