Skip to content

[Discussion] Argument to parametrize MG nevents #454

@Sinclert

Description

@Sinclert

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions