Repository navigation
mg7 1 -> N processes: decaying mass without parameter_dict, decay-aware observables, no histograms in MadSpin, 1->3 CI test - #228
Merged
Conversation
…decay-aware observables Two bugs behind the [histograms] defaults of a 1 -> N process (81e9a13), both hit by MadSpin's mg7 decay generator (spinmode none, madspace built): - RunCardMG7._decaying_mass read model.get('parameter_dict'), which only a ModelReader has. A LoopModel raised PhysicsObjectError (not caught, so `output` crashed) and a plain Model silently gave 0. The mass is now evaluated from the default values of the external parameters, in a scratch namespace (internal masses such as MW in sm-full included), leaving the model untouched. - madspace's Observable takes the first two momenta to be the beams, so for a decay the first decay product was dropped from every selection: `z > mu+ mu-` asked for lepton_2 and the launcher died with "absolute value of order index must be smaller or equal to number of selected PIDs" (no events.npy). build_observable() now runs the selection over all momenta with the incoming pid zeroed when there is one incoming particle (cuts, integration and event histograms). sqrt_s, whose kernel adds two beams, is no longer a default histogram of a decay. Fixes test_hepmc_decay and test_lhe_none_decay with madspace built.
…n CI - generate_events_mg7 drops [histograms] from the decay run card (as `set histograms OFF`): nobody looks at the plots of a decay pool and they cost an observable evaluation per event. - test_decay_1to3_mg7: t > b e+ ve through output mg7, the width pinned to madevent (0.1636 GeV), and the default histograms checked (no sqrt_s, every momentum histogram holding the full width in range, e+ ve pair mass peaking at MW). On origin/main it fails: bottom-pt has everything at 0 (the b dropped from the selection) and sqrt_s is in overflow. Added to acceptancetest_mg7_bundle_1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With madspace built, MadSpin (
spinmode none) generates its decays throughoutput mg7, andtest_hepmc_decay/test_lhe_none_decayfailed (no*_decayed.lhe.gz). Without madspace they take the madevent fallback, which is why nobody noticed. Two bugs, both in the default[histograms]of a 1 -> N process (81e9a13):RunCardMG7._decaying_massreadmodel.get('parameter_dict'), and only aModelReaderhas that property. ALoopModelraisedPhysicsObjectError, which theexceptdidn't catch, sooutputcrashed. A plainModelraisedKeyErrorand silently gave mass 0.Observableassumes two beams (ignore_incomingdrops the first 2 momenta, and thesqrt_skernel isp[0]+p[1]). For a decay, the first decay product dropped out of every selection.z > mu+ mu-asked forlepton_2and the launcher died with "absolute value of order index must be smaller or equal to number of selected PIDs". Int > b e+ ve, every b histogram sat at 0. This happens with plainoutput mg7of any decay, not only under MadSpin.Fix
_parameter_value: if the model has aparameter_dict, use it. Otherwise evaluate from the default external parameter values in a scratch namespace (internal masses such asmdl_MWin sm-full included). The model's own parameters are not touched.build_observablein the mg7 launcher: with one incoming particle, the selection runs over all momenta (ignore_incoming=False) and the incoming pid is set to 0, which belongs to no group. Used for cuts, integration histograms and event histograms.sqrt_shistogram for a decay: madspace's kernel adds two beams, and for a decay the value would be a constant anyway.[histograms]altogether (likeset histograms OFF). Nobody looks at the plots of a decay pool, and each one costs an observable evaluation per event.Tests
test_decay_1to3_mg7(added toacceptancetest_mg7_bundle_1): runst > b e+ vethrough mg7 and pins the width to madevent (0.1636 ± 0.0002 GeV). It also checks the default histograms: nosqrt_s, every momentum histogram holds the full width in range, and thee+ vepair mass peaks in the bin containing MW. On origin/main it fails:bottom-pthas everything in its first bin andsqrt_sis all overflow.test_decaying_mass_without_parameter_dict(plainModelandLoopModelbuilt from sm-full, where MW is internal).test_decay_process_uses_the_decaying_massis updated for the droppedsqrt_s.test_hepmc_decay,test_lhe_none_decay,test_decay_1to3_mg7,test_w_production_with_ms_decay_mg7,test_madspin_mixed_flavor_decay_log_summary_mg7: Ran 5, OK. On origin/main the first two fail with thePhysicsObjectErrorabove.test_banner.py+test_mg7_launch.pyclasses: Ran 157, OK.z > mu+ mu-decay histograms, before histograms were switched off there: the pair mass falls in the [90, 92] GeV bin, and the muon pT edge is at m_Z/2.🤖 Generated with Claude Code