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

Inconsistent HepMC files in some runs #371

Open
johannbrehmer opened this issue Jul 12, 2019 · 7 comments
Open

Inconsistent HepMC files in some runs #371

johannbrehmer opened this issue Jul 12, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@johannbrehmer
Copy link
Collaborator

Running the particle physics tutorial in the Delphes version with a clean install of MadGraph 2.6.5 and Pythia 8 installed from within MadGraph leads to a strange issue:

The HepMC file for run_01 (the one sampled from the SM) has an inconsistent HepMC file with events beginning with something like this:

E 0 -1 -1.0000000000000000e+00 -1.0000000000000000e+00 -1.0000000000000000e+00 0 0 142 1 2 0 6 9.8323591999999982e-07 5.4039015000000000e-07 1.2517713000000000e-07 1.0361000000000004e-07
N 6 "-247.8_#_ORIG:_MERGING=0.000" "229.0487_#_ORIG:_0.0
SET_PARAM_CARD_DIM6_5_272.0368_#_ORIG:_MERGING=0.000" "247.8_#_ORIG:_MERGING=0.000" "Weight_MERGING=0.000" 
U GEV MM

There should be six weights, as correctly given by N 6. But only four are given. This leads to Delphes not processing the HepMC file (ERROR: invalid event format).

Everything's fine in run_02:

E 0 -1 -1.0000000000000000e+00 -1.0000000000000000e+00 -1.0000000000000000e+00 0 0 561 1 2 0 6 4.3427632999999996e-06 2.2917435000000001e-05 2.3613610000000001e-05 1.3052637000000000e-09 1.2243924000000000e-05 4.0563000000000004e-06
N 6 "-247.8_#_ORIG:_MERGING=0.000" "0.0_#_ORIG:_247.8
SET_PARAM_CARD_DIM6_5_-247.8_#_ORIG:_MERGING=0.000" "0.0_#_ORIG:_247.8
SET_PARAM_CARD_DIM6_5_247.8_#_ORIG:_MERGING=0.000" "0.0_#_ORIG:_MERGING=0.000" "229.0487_#_ORIG:_247.8
SET_PARAM_CARD_DIM6_5_272.0368_#_ORIG:_MERGING=0.000" "Weight_MERGING=0.000" 
U GEV MM

The number of weights is consistent, and Delphes can process this file.

?!

@johannbrehmer
Copy link
Collaborator Author

Some more details:

  • The LHE files seem fine in both cases.
  • Run cards, param cards, and Pythia cards were identical between the two runs.
  • The only difference between the two runs is which benchmark was used for sampling (see the tutorial notebook).

@johannbrehmer johannbrehmer added bug Something isn't working high priority Should be fixed as soon as possible labels Jul 12, 2019
@johannbrehmer
Copy link
Collaborator Author

This was originally reported by Kevin Kwok with the following setup:

My MadGraph is on 2.6.5
My Pythia is just pythia8?
Delphes 3.4.1
I cloned the github repo and also pip install madminer
madminer 0.4.6
I am not using Docker
No custom MG-pythia patch

@johannbrehmer
Copy link
Collaborator Author

The only obvious difference between the LHE files I can find is a consequence of the different sampling benchmarks.

run_01 (sampled from benchmark "sm") has

<initrwgt>
<weightgroup name='mg_reweighting' weight_name_strategy='includeIdInWeightName'>
<weight id='w'>set param_card dim6 2 247.8 # orig: 0.0
</weight>
<weight id='neg_w'>set param_card dim6 2 -247.8 # orig: 0.0
</weight>
<weight id='ww'>set param_card dim6 5 247.8 # orig: 0.0
</weight>
<weight id='neg_ww'>set param_card dim6 5 -247.8 # orig: 0.0
</weight>
<weight id='morphing_basis_vector_5'>set param_card dim6 2 229.0487 # orig: 0.0
set param_card dim6 5 272.0368 # orig: 0.0
</weight>
</weightgroup>
</initrwgt>

On the other hand, run_02 (sampled from "w") has

<initrwgt>
<weightgroup name='mg_reweighting' weight_name_strategy='includeIdInWeightName'>
<weight id='sm'>set param_card dim6 2 0.0 # orig: 247.8
</weight>
<weight id='neg_w'>set param_card dim6 2 -247.8 # orig: 247.8
</weight>
<weight id='ww'>set param_card dim6 2 0.0 # orig: 247.8
set param_card dim6 5 247.8 # orig: 0.0
</weight>
<weight id='neg_ww'>set param_card dim6 2 0.0 # orig: 247.8
set param_card dim6 5 -247.8 # orig: 0.0
</weight>
<weight id='morphing_basis_vector_5'>set param_card dim6 2 229.0487 # orig: 247.8
set param_card dim6 5 272.0368 # orig: 0.0
</weight>
</weightgroup>
</initrwgt>

@johannbrehmer
Copy link
Collaborator Author

Same issue with MG v2.6.6, and also if we just do one run (sampling at the SM) and disable the second one.

@johannbrehmer
Copy link
Collaborator Author

johannbrehmer commented Jul 12, 2019

Surprisingly, the old Delphes tutorial in MadMiner v0.3.0 runs fine., using the same MG + Pythia installation that failed for v0.4.6...

I went through a git diff between the two versions. I could not find any changes in madminer.core that seemed related to this. The run and Pythia cardsare also identical. The param and reweight card are structurally identical, but a different morphing basis means that the basis points are different.

I wonder if there's anything particular about the morphing basis in the 0.4.6 tutorial and sampling from the SM that leads to Pythia having issues...

@cranmer
Copy link
Collaborator

cranmer commented Jul 12, 2019

@alexander-held any chance you might have some time to help here?

@johannbrehmer
Copy link
Collaborator Author

johannbrehmer commented Jul 12, 2019

Okay, I fixed the issue in the strangest way: by changing the morphing basis.

Here's a hypothetical explanation for what might be happening:

  • The reweight card that MadMiner creates sets numerical values for the parameters depending on the morphing basis (benchmark points).
  • MadGraph then writes a header into the LHE file that summarizes the effects of these weights, for instance as <weight id='ww'>set param_card dim6 5 247.8 # orig: 0.0
  • Pythia (or the MG-Pythia interface) uses names for the weights internally that seem like some obfuscated version of what was in the LHE header: "247.8#_ORIG:_0.0 SET_PARAM_CARD_DIM6_5_272.0368_#_ORIG:_MERGING=0.000"
  • When multiple benchmark points have identical values for the parameter points, it seems not too far fetched that these weight names in Pythia become identical, causing some confusion in Pythia
  • And then the HepMC output is off

Sounds ridiculous? Yep. But when I changed the morphing basis from (0,0), (15, 0), (0,15), (-15, 0) etc. to something where no values appeared multiple times, the issue went away...

johannbrehmer added a commit that referenced this issue Jul 12, 2019
@johannbrehmer johannbrehmer removed the high priority Should be fixed as soon as possible label Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants