Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d3cff95
started implementing mlm clustering
theoheimel Jun 15, 2026
2d0b02a
progress on mlm
theoheimel Jun 17, 2026
043ccf6
Merge branch 'main' into feat-mlm
theoheimel Jun 17, 2026
db9e910
Merge branch 'main' into feat-mlm
theoheimel Jun 25, 2026
04f43eb
initial slop version of the mlm clustering scale
theoheimel Jun 25, 2026
85c81d4
begin desloppification
theoheimel Jun 25, 2026
306950c
more progress on mlm
theoheimel Jun 25, 2026
350bde8
some more cleaning up in mlm
theoheimel Jun 28, 2026
55432b7
Merge branch 'main' into feat-mlm
theoheimel Jun 28, 2026
3661af9
output clustering scale for external particles
theoheimel Jun 29, 2026
b075f6d
mlm compiling and running, no reasonable output yet
theoheimel Jul 3, 2026
bed3016
mlm scale computation bugfixes
theoheimel Jul 3, 2026
e186dfb
Merge branch 'main' into feat-mlm
theoheimel Jul 6, 2026
f5060f1
add mlm as option for dynamical scale
theoheimel Jul 6, 2026
bde606d
cluster scales in lhe output
theoheimel Jul 6, 2026
a0a0069
pass mlm output to event file and matrix element
theoheimel Jul 6, 2026
f0b922d
Merge branch 'main' into feat-mlm
oliviermattelaer Sep 5, 2026
42b0edd
Fix the MLM clustering, populate its vertex metadata, and test it
oliviermattelaer Sep 5, 2026
1159b6c
Document the comparison against the madevent MLM
oliviermattelaer Sep 5, 2026
e56c6e0
Report unclustered outgoing legs at sqrt(s) instead of zero
oliviermattelaer Sep 5, 2026
ee88221
Add beam.jet_scale_scheme to pick madevent's jet-scale assignment
oliviermattelaer Sep 6, 2026
e606346
Point at the DJR validation tooling from the status notes
oliviermattelaer Sep 6, 2026
abd73b4
Merge pull request #100 from MadGraphTeam/claude/mlm-merge-main
oliviermattelaer Sep 6, 2026
5de1dbd
Pin the external-mass ordering with a case that can tell it apart
oliviermattelaer Sep 6, 2026
4ea4e79
Add phasespace.xqcut, the generation-level merging cut
oliviermattelaer Sep 6, 2026
68d7764
Write mu_R and mu_F into the LHE <scales> tag
oliviermattelaer Sep 7, 2026
9665417
Add beam.scale_scheme with madevent's mu_R / mu_F definition
oliviermattelaer Sep 6, 2026
c0c87c0
Add beam.min_scale, a floor on mu_R and mu_F for any scale choice
oliviermattelaer Sep 7, 2026
e913eb8
Bound the scales to the PDF grid's Q range, not just from below
oliviermattelaer Sep 7, 2026
f91409e
Keep the per-beam factorisation scales in the event record
oliviermattelaer Sep 7, 2026
7b5f370
Follow setclscales faithfully in the madevent scale scheme
oliviermattelaer Sep 7, 2026
0a29429
Add beam.parton_line_scheme, madevent's goodjet bookkeeping
oliviermattelaer Sep 7, 2026
0beba6a
Add phasespace.auto_ptj_mjj, madevent's merging-cut cut adjustment
oliviermattelaer Sep 8, 2026
555d6a2
Merge branch 'claude/madspace-invariant-mass-cut' into claude/madspac…
oliviermattelaer Sep 9, 2026
f5bcf89
Complete auto_ptj_mjj with the mjj half, now that a pair cut exists
oliviermattelaer Sep 9, 2026
b1feff3
Do not replay a starved channel's buffer when combining events
oliviermattelaer Sep 9, 2026
70f5b6f
Revert "Do not replay a starved channel's buffer when combining events"
oliviermattelaer Sep 9, 2026
ed840da
Merge remote-tracking branch 'origin/main' into claude/madspace-madev…
oliviermattelaer Sep 9, 2026
89e14fa
Merge remote-tracking branch 'origin/fix-combine-sampling' into claud…
oliviermattelaer Sep 9, 2026
3550905
Merge pull request #98 from MadGraphTeam/claude/mlm-clustering-algorithm
oliviermattelaer Sep 9, 2026
34df1f4
Merge pull request #99 from MadGraphTeam/claude/madspace-xqcut
oliviermattelaer Sep 9, 2026
5e2bade
Keep run_all() to the outputs it documents
oliviermattelaer Sep 10, 2026
0eff5a7
Reweight alpha_s per clustering vertex in a merged sample
oliviermattelaer Sep 10, 2026
0c3e67b
Add beam.alphas_reweighting to pick the alpha_s scheme
oliviermattelaer Sep 10, 2026
408185e
Write the mg7 run-card parameters banner.py declares
oliviermattelaer Sep 10, 2026
c4c2cb8
Reweight the beam densities along the clustering ladder
oliviermattelaer Sep 10, 2026
75ae904
Write phasespace.auto_ptj_mjj to the run card too
oliviermattelaer Sep 10, 2026
5c80cb5
Only apply the merging cut at a vertex that made a jet
oliviermattelaer Sep 10, 2026
faea625
Decide which legs are merging jets the way madevent does
oliviermattelaer Sep 11, 2026
1755ade
Reweight alpha_s at the scale setclscales left behind
oliviermattelaer Sep 11, 2026
57f50f1
Use mt2last at an s-channel QCD root, as setclscales does
oliviermattelaer Sep 14, 2026
d228b23
Give each end of a t-channel chain its own flavour and mass
oliviermattelaer Sep 14, 2026
0f54d5f
Measure the MLM root in the frame cluster.f leaves it in
oliviermattelaer Sep 14, 2026
87c4967
Add a switch for the MLM clustering measure: FxFx or madevent's DJ
oliviermattelaer Sep 15, 2026
f045a68
Merge origin/main into feat-mlm
oliviermattelaer Sep 15, 2026
18fc3e7
Merge origin/main into claude/madspace-madevent-scales
oliviermattelaer Sep 15, 2026
8a1b37c
Merge the updated feat-mlm into claude/madspace-madevent-scales
oliviermattelaer Sep 15, 2026
62897e4
auto_ptj_mjj: ask for the jet pair mass by its current name
oliviermattelaer Sep 15, 2026
c52e841
Compile one MLM clustering state machine per diagram
oliviermattelaer Sep 15, 2026
d93c0ef
Pick the MLM clustering history per event from the diagram weights
oliviermattelaer Sep 15, 2026
692fe92
Add beam.clustering_history to the mg7 run card
oliviermattelaer Sep 15, 2026
2dc49ed
Write madevent's ptclus for the MLM jet scales under scale_scheme mad…
oliviermattelaer Sep 15, 2026
6b9778d
Test that auto_ptj_mjj names cuts madspace can build
oliviermattelaer Sep 16, 2026
761a43d
Run the mg7 launcher cut-name tests in the mg7 acceptance workflow
oliviermattelaer Sep 16, 2026
46b609b
Fix the MLM scale floor, diagram input, merged subprocesses and decays
oliviermattelaer Oct 6, 2026
317a05f
Fix MLM clustering through flavour-forbidden merged graphs
oliviermattelaer Oct 7, 2026
03c532a
madspace MLM: do not cluster through flavour-forbidden merged graphs
oliviermattelaer Oct 7, 2026
970a87f
Merge pull request #231 from MadGraphTeam/claude/code-review-5eb764
oliviermattelaer Oct 8, 2026
4ac8005
Merge pull request #157 from MadGraphTeam/claude/mlm-diagram-history
oliviermattelaer Oct 16, 2026
798d5dd
Merge pull request #156 from MadGraphTeam/claude/madspace-madevent-sc…
oliviermattelaer Oct 16, 2026
71f1cf3
Merge origin/main into feat-mlm
oliviermattelaer Oct 25, 2026
2c33720
MG7AutoPtjMjjCutNamesTest: give the stand-in process is_decay
oliviermattelaer Oct 25, 2026
da64785
mg7 MLM: build external_pdg_ids where the clustering is built
oliviermattelaer Oct 25, 2026
7fd19fa
MLM pdf reweighting: drop the event when the density divided by is un…
oliviermattelaer Oct 25, 2026
9c0f114
MLM clustering: support 2 -> 1 processes (0-jet sample of p p > z + j…
oliviermattelaer Oct 25, 2026
977529f
madspace MLM: drop dead PDF-ratio work and the repeated madevent walk
oliviermattelaer Oct 25, 2026
0a80c1b
MLM: beam.jet_radius defaults to 1.0, madevent's run_card d
oliviermattelaer Oct 26, 2026
40cfe37
Merge pull request #327 from MadGraphTeam/claude/mlm-review-fixes
oliviermattelaer Oct 26, 2026
6691b14
Merge remote-tracking branch 'origin/feat-mlm' into claude/mlm-bitide…
oliviermattelaer Oct 26, 2026
845d3ac
Merge pull request #328 from MadGraphTeam/claude/mlm-bitidentical-spe…
oliviermattelaer Oct 26, 2026
e080c80
MLM pdf reweighting: no ladder-scale PDF product for the systematics
oliviermattelaer Oct 26, 2026
d256e39
MLM pdf reweighting: a NaN density divided by drops the event too
oliviermattelaer Oct 26, 2026
d0e3388
mg7 MLM: hand the merging settings to the post-processing tools
oliviermattelaer Oct 26, 2026
461b00e
Native systematics: vary MLM alpha_s vertices as madevent does
oliviermattelaer Oct 26, 2026
f1c150d
Native systematics: vary the MLM pdf ladder with alpsfact and mu_F
oliviermattelaer Oct 26, 2026
35bd96e
MLM systematics: rebuild the pdf ladder as madevent's systematics.py …
oliviermattelaer Oct 26, 2026
8fe112e
Merge pull request #332 from MadGraphTeam/claude/mlm-postprocessing-w…
oliviermattelaer Oct 27, 2026
0717a42
reweight.f: book the event's flavours as leading <pdfrwt> entry under…
oliviermattelaer Oct 27, 2026
31029d1
reweight.f: set the event's flavours on the clustered graph once, aft…
oliviermattelaer Oct 27, 2026
c392eaa
Merge remote-tracking branch 'origin/main' into claude/mlm-pdfrwt-fla…
oliviermattelaer Oct 27, 2026
f39ddde
reweight.f/cluster.f: second review follow-ups
oliviermattelaer Oct 27, 2026
caec510
MLM per-diagram history: rescale the first matrix element, don't re-e…
oliviermattelaer Oct 27, 2026
341151f
MLM: optional pdf ladder under scale_scheme = clustering_mean
oliviermattelaer Oct 28, 2026
cf7fdca
MLM: walk the pdf ladder under clustering_mean by default
oliviermattelaer Oct 28, 2026
90d384f
MLM: settle equal clustering candidates in cluster.f's loop order
oliviermattelaer Oct 28, 2026
7f68327
Merge pull request #357 from MadGraphTeam/claude/mlm-madevent-mu-f-in…
oliviermattelaer Oct 28, 2026
8e27238
Merge pull request #355 from MadGraphTeam/claude/mlm-clustering-mean-…
oliviermattelaer Oct 28, 2026
7d5d612
Merge remote-tracking branch 'origin/main' into feat-mlm
oliviermattelaer Oct 28, 2026
8df3d32
Merge pull request #346 from MadGraphTeam/claude/mlm-pdfrwt-flavour
oliviermattelaer Oct 28, 2026
be8cd17
Merge remote-tracking branch 'origin/main' into feat-mlm
oliviermattelaer Oct 28, 2026
765796b
Merge remote-tracking branch 'origin/main' into feat-mlm
oliviermattelaer Oct 28, 2026
cbb229b
Integrand: keep weight_after_cuts when it carries the MLM weights
oliviermattelaer Oct 28, 2026
b839980
MLM review follow-ups: hidden run-card options, one weight_after_cuts…
oliviermattelaer Oct 28, 2026
c3ffd68
MLM kernel: gate the madevent-only writes instead of snapshot/restore
oliviermattelaer Oct 28, 2026
5a3edaa
MLM automatic for a human user: merging on by default, DJR plots afte…
oliviermattelaer Oct 29, 2026
c3c0334
DJR reader: per-jet-sample histograms and bin errors from main164
oliviermattelaer Oct 29, 2026
1b6ef99
Pythia8 main164: DJRs per jet sample, patched by MadGraph7 until Pyth…
oliviermattelaer Oct 29, 2026
95c77cf
MLM clustering measure: numerically stable for nearly collinear pairs
oliviermattelaer Oct 29, 2026
90a5f5a
Merge branch 'claude/mlm-review-followups' into claude/mlm-automatic
oliviermattelaer Oct 29, 2026
ff78829
main164 jet samples: follow the change proposed to Pythia8
oliviermattelaer Oct 29, 2026
2b29edb
TEST_pythia8_main164: drop the test that needs an installed Pythia8
oliviermattelaer Oct 29, 2026
1d6f75e
Merge pull request #359 from MadGraphTeam/claude/mlm-review-followups
oliviermattelaer Oct 29, 2026
9ab2cdc
Merge pull request #360 from MadGraphTeam/claude/mlm-automatic
oliviermattelaer Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/acceptancetest_madevent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
cd $GITHUB_WORKSPACE
./tests/test_manager.py test_group_subprocess -pA -t0 -l INFO
./tests/test_manager.py test_group_subprocess_permuted_scale -pA -t0 -l INFO
./tests/test_manager.py test_mlm_pdfrwt_flavour -pA -t0 -l INFO

# ---- acceptancetest_contur ----
- name: "acceptancetest_contur: run the test"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/acceptancetest_mg7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,23 @@ jobs:
# LHAPDF_DATA_PATH (install_lhapdf_pdfset) holds only NNPDF23: unset, these
# tests find NNPDF40_lo_as_01180 in the heptools data dir via lhapdf-config
env -u LHAPDF_DATA_PATH ./tests/test_manager.py test_output_mg7_decay_run_card_has_no_cuts test_output_mg7_decay_subprocess_metadata test_color_flow_consistency_mg7 test_systematics_mg7_legacy test_systematics_mixed_order_mg7 test_mg7_reweighting_at_generation test_delphes_mg7 -pA -t0 -l INFO

acceptancetest_mg7_launcher_cut_names:
needs: build_madspace
# Unit tests, but they belong here rather than in unittest.yml: they need a
# compiled madspace to check that the cut names the mg7 launcher writes are
# ones ms.Observable accepts, and the unit jobs have none (they would skip).
# No LHAPDF or model files: nothing is generated, the launcher's cut helpers
# are called on a stand-in run card. Hence no heptools restore, and no -pA:
# these live in the default tests/unit_tests path.
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/checkout_mg5
- uses: ./.github/actions/install_madspace
- uses: ./.github/actions/restore-pip-cache
- name: test the mg7 launcher writes cut names madspace can build
run: |
cd $GITHUB_WORKSPACE
./tests/test_manager.py test_every_cut_it_writes_builds_an_observable test_it_tightens_the_jet_pt_and_pair_mass_to_xqcut test_it_drops_the_jet_cone_cuts test_with_the_option_off_it_only_zeroes_cuts_above_xqcut test_it_leaves_an_unmerged_run_alone -t0 -l INFO
14 changes: 10 additions & 4 deletions Template/LO/SubProcesses/cluster.f
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,20 @@ logical function cluster(p, flavor, ivec)
enddo
mt2last=0
minpt2ij=1.0d37
c Map merged flavor particles (PDG=81) to their actual quark flavors
c Map the quark legs (and merged 81 legs) to the representative of the
c coupling class of this event: FLAVOR(i) is the position of that
c representative in the merged quark group, which is its pdg since the
c quarks are always merged in pdg order (1,2,...). It is NOT the flavour
c of the event (s s~ > z gives 1, c c~ > z gives 2): the flavour
c combination (IPSEL) is only drawn after the scales are set, and rewgt
c sets the external identities to it after clustering.
do i=1,nexternal
if(flavor(i).ge.1.and.flavor(i).le.5)then
if(flavor(i).ge.1.and.flavor(i).le.6)then
do igraph=1,n_max_cg
tmppdg=ipdgcl(ishft(1,i-1),igraph,iproc)
if(tmppdg.eq.81.or.(tmppdg.gt.0.and.tmppdg.le.5)) then
if(tmppdg.eq.81.or.(tmppdg.gt.0.and.tmppdg.le.6)) then
ipdgcl(ishft(1,i-1),igraph,iproc)=flavor(i)
else if(tmppdg.eq.-81.or.(tmppdg.lt.0.and.tmppdg.ge.-5))then
else if(tmppdg.eq.-81.or.(tmppdg.lt.0.and.tmppdg.ge.-6))then
ipdgcl(ishft(1,i-1),igraph,iproc)=-flavor(i)
endif
enddo
Expand Down
55 changes: 27 additions & 28 deletions Template/LO/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -1504,28 +1504,26 @@ double precision function rewgt(p, flavor, ivec)
rewgt = 0d0
return
endif
c Set incoming particle identities
ipdgcl(1,igraphs(1),iproc)=idup(1,ipsel,iproc)
ipdgcl(2,igraphs(1),iproc)=idup(2,ipsel,iproc)
if (btest(mlevel,2)) then
write(*,*) 'Set particle identities: ',
$ 1,ipdgcl(1,igraphs(1),iproc),
$ ' and ',
$ 2,ipdgcl(2,igraphs(1),iproc)

endif

c The flavours of this event are those of row IPSEL of leshouche.inc,
c as in DSIG. The rows always carry physical pdg codes (merged legs such
c as 81 are expanded per flavour), while FLAVOR(:) only holds the
c position of the coupling-class representative (see cluster).
do j=1,2
if(abs(idup(j,ipsel,iproc)).ge.81.and.
$ abs(idup(j,ipsel,iproc)).le.83)then
write(*,*) 'Error: rewgt: merged particle ',idup(j,ipsel,iproc),
$ ' in leshouche.inc (row ',ipsel,'): no physical pdg for',
$ ' the PDF of beam ',j
stop 1
endif
enddo

if(ickkw.le.0)then
c Store pdf information for systematics studies (initial)
if(use_syst)then
do j=1,2
n_pdfrw(j,ivec)=1
if(abs(ipdgcl(j,igraphs(1),iproc)).eq.81) then
i_pdgpdf(1,j,ivec)=abs(flavor(j))*sign(1,ipdgcl(j,igraphs(1),iproc))
else
i_pdgpdf(1,j,ivec)=ipdgcl(j,igraphs(1),iproc)
endif
i_pdgpdf(1,j,ivec)=idup(j,ipsel,iproc)
s_xpdf(1,j,ivec)=xbk(ib(j))
s_qpdf(1,j,ivec)=sqrt(q2fact(j))
enddo
Expand All @@ -1545,6 +1543,19 @@ double precision function rewgt(p, flavor, ivec)
endif
vec_igraph(ivec) = igraphs(1) ! save MLM-matched graph for this event

c Set the identities of the incoming partons and of the jets of the
c clustered graph to the flavours of this event: setclscales leaves there
c the representative of the coupling class of a grouped subprocess (e.g.
c d for s s~ > z, u for c c~ > z), which would otherwise enter the PDF
c ratios, the Sudakov factors and the pdfrwt information below. Other
c legs are left as set by cluster (nothing below reads their flavour).
do i=1,nexternal
if(i.le.2.or.isjet(idup(i,ipsel,iproc)))
$ ipdgcl(ishft(1,i-1),igraphs(1),iproc)=idup(i,ipsel,iproc)
if (btest(mlevel,2))
$ write(*,*) 'Set particle identities: ',
$ i,ipdgcl(ishft(1,i-1),igraphs(1),iproc)
enddo

c Store pdf information for systematics studies (initial)
c need to be done after setclscales since that one clean the syscalc value
Expand Down Expand Up @@ -1608,12 +1619,6 @@ double precision function rewgt(p, flavor, ivec)
c Prepare checking for parton vertices
do i=1,nexternal
j=ishft(1,i-1)
c Set jet identities according to chosen subprocess
if(isjet(idup(i,ipsel,iproc)))
$ ipdgcl(j,igraphs(1),iproc)=idup(i,ipsel,iproc)
if (btest(mlevel,2))
$ write(*,*) 'Set particle identities: ',
$ i,ipdgcl(j,igraphs(1),iproc)
if(i.le.2)then
goodjet(j)=isparton(ipdgcl(j,igraphs(1),iproc))
elseif(iqjets(i).gt.0) then
Expand Down Expand Up @@ -1883,15 +1888,9 @@ double precision function rewgt(p, flavor, ivec)
c factor in front of matrix element
do i=1,2
if (lpp(IB(i)).ne.0) then
if( abs(i_pdgpdf(1,i,ivec)).ne.81)then
s_rwfact(ivec)=s_rwfact(ivec)*pdg2pdf(abs(lpp(IB(i))),
$ i_pdgpdf(1,i,ivec)*sign(1,lpp(IB(i))),IB(i),
$ s_xpdf(1,i,ivec),s_qpdf(1,i,ivec))
else
s_rwfact(ivec)=s_rwfact(ivec)*pdg2pdf(abs(lpp(IB(i))),
$ abs(flavor(i))*sign(1, i_pdgpdf(1,i,ivec))*sign(1,lpp(IB(i))),IB(i),
$ s_xpdf(1,i,ivec),s_qpdf(1,i,ivec))
endif
endif
enddo
if (asref.gt.0d0.and.n_qcd(ivec).le.nexternal)then
Expand Down
4 changes: 4 additions & 0 deletions UpdateNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ANNOUNCEMENT:
A new LTS (based on the current 3.5.X) is starting now and will act as the stable release for the coming years.

0.3.0 (XX/XX/XX):
OM: madevent MLM (ickkw=1) with use_syst: the <pdfrwt> entry of the incoming partons
used the flavour class of the grouped subprocess instead of the event's flavour
(pdg 1 for s s~, 2 for c c~), so the systematics (PDF and mu_F variations) of every
s/c-initiated event were computed with the d/u PDF (up to 9% for mu_F=2 on p p > z).
OM: madevent LO vector mode (vector_size>1): the good-helicity scan saw a single
beam orientation per warp, so up to half of p p > z was dropped. With helicity
recycling, the madevent_forhel scan now runs event by event. Without it
Expand Down
Loading
Loading