array_PH = np.array([ tree.PH1, tree.PH2, tree.PH3, tree.PH4, tree.PH5, tree.PH6, tree.PH7, tree.PH8, tree.PH9, tree.PH10, tree.PH11, tree.PH12, tree.PH13, tree.PH14, tree.PH15, tree.PH16, tree.PH17, tree.PH18, tree.PH19, tree.PH20, tree.PH21, tree.PH22, tree.PH23, tree.PH24, tree.PH25, tree.PH26, tree.PH27, tree.PH28, tree.PH29, tree.PH30, tree.PH31, tree.PH32, tree.PH33, tree.PH34, tree.PH35, tree.PH36, tree.PH37, tree.PH38, tree.PH39, tree.PH40, tree.PH41, tree.PH42, tree.PH43, tree.PH44, tree.PH45, tree.PH46, tree.PH47, tree.PH48, tree.PH49 ]) for i in range(49): if array_PH[i] > 9.279: Xray_PH += array_PH[i] count += 1 print 'count = %s' % count my.Arg = tree.Arg my.Frame = tree.Frame my.Event_th = tree.Event_th my.Split_th = 9.279 my.X = tree.X my.Y = tree.Y my.Xray = Xray_PH my.count = count tr.Fill() array_PH = np.array([]) f.Write() f.Close()
tree = root.Get('tree%s' %i) entry = tree.GetEntries() for j in range(entry) : tree.GetEntry(j) print 'entry = %s' %j if tree.PH17 < 9.279 and tree.PH18 < 9.279 and tree.PH19 < 9.279 and tree.PH24 < 9.279 \ and tree.PH26 < 9.279 and tree.PH31 < 9.279 and tree.PH32 < 9.279 and tree.PH33 < 9.279 : my.Arg = tree.Arg my.Frame = tree.Frame my.Event_th = tree.Event_th my.Split_th = 9.279 my.X = tree.X my.Y = tree.Y my.Xray = tree.PH25 my.PH17 = tree.PH17 my.PH18 = tree.PH18 my.PH19 = tree.PH19 my.PH24 = tree.PH24 my.PH25 = tree.PH25 my.PH26 = tree.PH26 my.PH31 = tree.PH31 my.PH32 = tree.PH32 my.PH33 = tree.PH33 tr.Fill() f.Write() f.Close()
and tree.PH38 < 9.279 and tree.PH39 < 9.279 and tree.PH40 < 9.279 and tree.PH41 < 9.279 : #grade2 if tree.PH32 > 9.279 and tree.PH17 < 9.279 and tree.PH18 < 9.279 and tree.PH19 < 9.279 and tree.PH24 < 9.279 and tree.PH26 < 9.279 and tree.PH31 < 9.279 and tree.PH33 < 9.279 \ and tree.PH38 < 9.279 and tree.PH39 < 9.279 and tree.PH40 < 9.279 : Xray2 = tree.PH25 + tree.PH32 if Xray2 > 3400: print "(Arg,frame,x,y,Xray) = (%s,%s,%s,%s,%s)" % ( tree.Arg, tree.Frame, tree.X, tree.Y, Xray2) my2.Arg = tree.Arg my2.Frame = tree.Frame my2.Event_th = tree.Event_th my2.Split_th = 9.279 my2.X = tree.X my2.Y = tree.Y my2.Xray = Xray2 my2.PH17 = tree.PH17 my2.PH18 = tree.PH18 my2.PH19 = tree.PH19 my2.PH24 = tree.PH24 my2.PH25 = tree.PH25 my2.PH26 = tree.PH26 my2.PH31 = tree.PH31 my2.PH32 = tree.PH32 my2.PH33 = tree.PH33 tr2.Fill() elif tree.PH18 > 9.279 and tree.PH17 < 9.279 and tree.PH19 < 9.279 and tree.PH24 < 9.279 and tree.PH26 < 9.279 and tree.PH31 < 9.279 and tree.PH32 < 9.279 and tree.PH33 < 9.279 \ and tree.PH10 < 9.279 and tree.PH11 < 9.279 and tree.PH12 < 9.279 : Xray2 = tree.PH25 + tree.PH18