if i % 1000 == 0: print(i, nentries) if i > 100000000: break output = "Event: %d\n" % (i) #output = "" tree.GetEntry(i) nvals = 0 #beam = np.array([tree.eeE, tree.eePx, tree.eePy, tree.eePz, 0, 0]) beamp4 = np.array([tree.eeE, tree.eePx, tree.eePy, tree.eePz]) beammass = invmass([beamp4]) beam = np.array([beammass, 0.0, 0.0, 0.0, 0, 0]) matchIdx = -1 LUNDTOMATCH = 211 nmc = tree.mcLen #print("MC ----{0}----".format(nmc)) bidx = [] for j in range(nmc): #print(tree.mcLund[j], tree.mothIdx[j], tree.dauLen[j], tree.dauIdx[j]) pid = abs(tree.mcLund[j]) mothIdx = tree.mothIdx[j] if pid == 511: bidx.append(j) if mothIdx in bidx: #print("B child: ",pid, j)
for i in range(nentries): if i % 1000 == 0: print(i, nentries) if i > 100000000: break tree.GetEntry(i) nvals = 0 #beam = np.array([tree.eeE, tree.eePx, tree.eePy, tree.eePz, 0, 0]) beamp4 = np.array([tree.beame, tree.beampx, tree.beampy, tree.beampz]) beammass = invmass([beamp4]) beam = np.array([beammass, 0.0, 0.0, 0.0, 0, 0]) #print(beammass) r2 = tree.r2 r2all = tree.r2all thrustmag = tree.thrustmag thrustmagall = tree.thrustmagall thrustcosth = tree.thrustcosth thrustcosthall = tree.thrustcosthall sphericityall = tree.sphericityall nphot = tree.ngamma ncharged = tree.npi + tree.nk + tree.nproton + tree.ne + tree.nmu ''' if particle[-1]==11 and pmag>2.25 and pmag<2.8: leptons.append(np.array(particle + [j]))
if i % 1000 == 0: print(i, nentries) if i > 100000000: break #output = "Event: %d\n" % (i) #output = "" tree.GetEntry(i) nvals = 0 #beam = np.array([tree.eeE, tree.eePx, tree.eePy, tree.eePz, 0, 0]) beamp4 = np.array([tree.eeE, tree.eePx, tree.eePy, tree.eePz]) beammass = invmass([beamp4]) beam = np.array([beammass, 0.0, 0.0, 0.0, 0, 0]) #print("BEAM: ",beam) beame[0] = tree.eeE beampx[0] = tree.eePx beampy[0] = tree.eePy beampz[0] = tree.eePz beamvtxx[0] = tree.xPrimaryVtx beamvtxy[0] = tree.yPrimaryVtx beamvtxz[0] = tree.zPrimaryVtx r2[0] = tree.R2 r2all[0] = tree.R2All thrustmag[0] = tree.thrustMag thrustmagall[0] = tree.thrustMagAll