How to boost TLorentzVector with uproot

Dear experts,
I am currently trying to exploit TLorentz vectors in uproot, using the awkward and vector libs.
In particular, I am building these vectors:

import uproot
import awkward as ak
import vector
vector.register_awkward()   # any record named "Momentum4D" will be Lorentz

with uproot.open(<file>) as Y:

    vars = ["MC_t_pt", "MC_t_phi", "MC_t_eta", "MC_t_m", "MC_tbar_pt", "MC_tbar_phi", "MC_tbar_eta", "MC_tbar_m"]
    
    mttbar_arrays = Y.arrays(vars)

    t_vec = ak.zip({
        "pt": mttbar_arrays.MC_t_pt,
        "phi": mttbar_arrays.MC_t_phi,
        "eta": mttbar_arrays.MC_t_eta,
        "mass": mttbar_arrays.MC_t_m,
    }, with_name="Momentum4D")

    tbar_vec = ak.zip({
        "pt": mttbar_arrays.MC_tbar_pt,
        "phi": mttbar_arrays.MC_tbar_phi,
        "eta": mttbar_arrays.MC_tbar_eta,
        "mass": mttbar_arrays.MC_tbar_m,
    }, with_name="Momentum4D")

    top_boost = t_vec.BoostVector()
    tbar_boost = tbar_vec.BoostVector()

Then, as an error I get:

AttributeError: no field named 'BoostVector'

Is there a way to call the classic TLorentz vector functions in uproot 4?


uproot version: uproot 4
Platform: lxplus
Compiler: Not Provided


Hello @chiara_iannetta ,

I’m afraid uproot is not maintained by the ROOT team, this question is probably better suited for an uproot support forum.

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.