benchmark/code/dataset/preprocess.py
def make_dictionary(tree, content, mass, pt, charge=None, abs_charge=None, muon=None):
    """Create a dictionary with all the jet tree info (topology, constituents
    features: eta, phi, pT, E, muon label). Keep only the leading jet.
    """
    jet = {}
    jet["root_id"] = 0
    # Labels for the jet constituents in the tree
    jet["tree"] = tree[0]
    # Use this format if using Pytorch
    jet["content"] = np.reshape(content[0],(-1,4))
    jet["mass"] = mass
    jet["pt"] = pt
    jet["energy"] = content[0][0, 3]
    # The jet is the first entry of content. And then we have (px,py,pz,E)
    px = content[0][0, 0]
    py = content[0][0, 1]
    pz = content[0][0, 2]
    p = (content[0][0, 0:3] ** 2).sum() ** 0.5
     # pseudorapidity eta
    eta = 0.5 * (np.log(p + pz) - np.log(p - pz))
    phi = np.arctan2(py, px)
    jet["eta"] = eta
    jet["phi"] = phi
    if charge:
        jet["charge"]=charge[0]
        jet["abs_charge"]=abs_charge[0]
    if muon:
        jet["muon"]=muon[0]
    return jet
Create a dictionary with all the jet tree info (topology, constituents
    features: eta, phi, pT, E, muon label). Keep only the leading jet.
    
Create a dictionary with all the jet tree info (topology, constituents
features: eta, phi, pT, E, muon label). Keep only the leading jet.
Create a dictionary with all the jet tree info ( topology constituents features : eta phi pT E muon label ) . Keep only the leading jet .
def make_dictionary(tree, content, mass, pt, charge=None, abs_charge=None, muon=None):
    jet = {}
    jet["root_id"] = 0
    jet["tree"] = tree[0]
    jet["content"] = np.reshape(content[0],(-1,4))
    jet["mass"] = mass
    jet["pt"] = pt
    jet["energy"] = content[0][0, 3]
    px = content[0][0, 0]
    py = content[0][0, 1]
    pz = content[0][0, 2]
    p = (content[0][0, 0:3] ** 2).sum() ** 0.5
    eta = 0.5 * (np.log(p + pz) - np.log(p - pz))
    phi = np.arctan2(py, px)
    jet["eta"] = eta
    jet["phi"] = phi
    if charge:
        jet["charge"]=charge[0]
        jet["abs_charge"]=abs_charge[0]
    if muon:
        jet["muon"]=muon[0]
    return jet
def make_dictionary ( tree , content , mass , pt , charge = None , abs_charge = None , muon = None ) : jet = { } jet [ "root_id" ] = 0 jet [ "tree" ] = tree [ 0 ] jet [ "content" ] = np . reshape ( content [ 0 ] , ( - 1 , 4 ) ) jet [ "mass" ] = mass jet [ "pt" ] = pt jet [ "energy" ] = content [ 0 ] [ 0 , 3 ] px = content [ 0 ] [ 0 , 0 ] py = content [ 0 ] [ 0 , 1 ] pz = content [ 0 ] [ 0 , 2 ] p = ( content [ 0 ] [ 0 , 0 : 3 ] ** 2 ) . sum ( ) ** 0.5 eta = 0.5 * ( np . log ( p + pz ) - np . log ( p - pz ) ) phi = np . arctan2 ( py , px ) jet [ "eta" ] = eta jet [ "phi" ] = phi if charge : jet [ "charge" ] = charge [ 0 ] jet [ "abs_charge" ] = abs_charge [ 0 ] if muon : jet [ "muon" ] = muon [ 0 ] return jet
Create a dictionary with all the jet tree info (topology, constituents
features: eta, phi, pT, E, muon label).
Create a dictionary with all the jet tree info ( topology constituents features : eta phi pT E muon label ) .
"""Create a dictionary with all the jet tree info (topology, constituents
    features: eta, phi, pT, E, muon label). Keep only the leading jet.
    """ # Labels for the jet constituents in the tree # Use this format if using Pytorch # The jet is the first entry of content. And then we have (px,py,pz,E) # pseudorapidity eta
tree
content
mass
pt
charge
abs_charge
muon