def make_LHEparticle(p, id=None): if id != None: fv = TLorentzVector() try: m = p.Mass except AttributeError: m = 0 try: pT = p.PT except AttributeError: pT = p.MET fv.SetPtEtaPhiM(pT, p.Eta, p.Phi, m) try: status = p.Status except AttributeError: status = 1 _dict={'id':id,'status':status,\ 'mother1':0,'mother2':0,'color1':0,'color2':0,\ 'px':fv.Px(),'py':fv.Py(),'pz':fv.Pz(),'e':fv.Energy(),'m':fv.M(),'lifetime':0,'spin':0} lhepart = lhef.LHEParticle(**_dict) return lhepart else: print("id must be specified") pass