Skip to content

Fixes for range-operations on N-particle combinations

Pieter David requested to merge piedavid/bamboo:combrangeop into master

Thanks @helfaham for the interesting request!

With the first commit this seems to work (I know the cuts/values don't make much sense, but I wanted some things to pass):

jets = t.Jet["nominal"]
hadWdijets = op.combine(jets, N=2, pred=lambda j1, j2 : op.in_range(50., op.invariant_mass(j1.p4, j2.p4), 100.))
mHvis_ljj = lambda l,jj : op.invariant_mass(l.p4, op.construct("ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<float> >", ((jj[0].p4+jj[1].p4).Pt(), (jj[0].p4+jj[1].p4).Eta(), (jj[0].p4+jj[1].p4).Phi(), 80.4)))
hWWmujj = op.combine((t.Muon, hadWdijets), pred=lambda mu,dijet : op.in_range(50., mHvis_ljj(mu, dijet), 150.))
best_hWWmujj = op.rng_min_element_by(hWWmujj, lambda mujj : op.min(op.deltaR(mujj[0].p4, mujj[1][0].p4), op.deltaR(mujj[0].p4, mujj[1][1].p4)))
hasHwwHadCand = hasTwoMu.refine("hasHwwHadCand", cut=(op.rng_len(hWWmujj) != 0))
plots.append(Plot.make1D("HWW_mujj_mVis", mHvis_ljj(best_hWWmujj[0], best_hWWmujj[1]), hasHwwHadCand, EquidistantBinning(100, 50., 150.), title="Visible mass of H->W(lnu)W(jj)"))

but the second line is a hack that should not be needed (and it is quite inefficient), so I'd add a few optimisations, and ideally some tests for this kind of thing - please signal your urgency, we may break this up into a few parts if it's important to get some fix in quickly.

Edited by Pieter David

Merge request reports