Exemplo n.º 1
0
cut3 = cut2.Filter("(Jpsi_M > 3020) && (Jpsi_M < 3170)", "jpsi_mass_cut")
cut4 = cut3.Filter("(Phi_M > 980) && (Phi_M < 1050)", "phi_mass_cut")
cut5 = cut4.Filter("(muplus_PT > 500) && (mumin_PT > 500)", "mu_pt_cut")
cut6 = cut5.Filter("(Bs_ENDVERTEX_CHI2/Bs_ENDVERTEX_NDOF) < 20", "b_vtx_cut")
cut7 = cut6.Filter("(Jpsi_ENDVERTEX_CHI2/Jpsi_ENDVERTEX_NDOF < 16)",
                   "jpsi_vtx_cut")
cut8 = cut7.Filter("(Phi_ENDVERTEX_CHI2/Phi_ENDVERTEX_NDOF < 25)",
                   "phi_vtx_cut")
cut9 = cut8.Filter("mumin_PIDmu > 0 && muplus_PIDmu > 0", "mu_id_cut")
cut10 = cut9.Filter("Kmin_PIDK > 0 && Kplus_PIDK > 0", "k_id_cut")

#print("Mumin eff: ")
#mumincut = cut9.Report()
#mumincut.Print()
print("All stats: ")
cutsreport = dataframe.Report()
cutsreport.Print()

#c1 = TCanvas()
#h = dataframe_with_truep.Histo1D("Bs_momentum")
#num_bins = 10
#from ostap.histos import *
#edges = h.equal_edges(num_bins)
#print(edges)
#h1 = h1_axis(edges, "")
#h1.Draw()
#h2 = df_cuts1.Histo1D("Bs_momentum")
#h2.Draw()
#h3 = h1.Clone()
#h3.Divide(h1, h2)
#h3.Draw
        description='find retention rates for various trigger paths.')

    parser.add_argument('ntp', help='specify ntuple path.')

    parser.add_argument('tree', help='specify tree name.')

    parser.add_argument('-t',
                        '--trigger-paths',
                        nargs='+',
                        help='specify trigger paths.')

    return parser.parse_args()


########
# Main #
########

if __name__ == '__main__':
    args = parse_input()

    frame = RDataFrame(args.tree, args.ntp)
    cuts = []
    for tp in args.trigger_paths:
        c = frame.Filter(
            tp, tp)  # This is to avoid garbage collector to delete our pointer
        cuts.append(c)

    report = frame.Report()
    report.Print()