예제 #1
0
                     input_files,
                     tree,
                     'mvis',
                     toString(cuts_est),
                     'weight',
                     global_weights,
                     fakefactor=fakefactor,
                     ffInputs=['l2_pt', 'l2_decayMode', 'mvis'])

    closure.computeCDF('True')
    closure.computeCDF('Est')

    for name, bins in var_bins.items():
        plotClosure(fakeType + '_' + name,
                    closure,
                    bins,
                    doErrors=False,
                    yRange=[0.5, 2.],
                    plotDir=plotDir)

    #for nbins in [100,50,25]:
    #cdf = closure.data['True']['CDFInvert']
    #bins = [cdf.Eval(i/float(nbins)) for i in xrange(nbins+1)]
    #plotClosure(fakeType+'_NBins'+str(nbins), closure, bins)

    plotSummary(fakeType, closure, 0, 600)

    #
    writeNonClosure(closure, output_file,
                    '{FAKETYPE}_Histo_Smooth_Ratio'.format(FAKETYPE=fakeType))

    #canvas.Write()
    global_weights = inputs['Weights']
    tree   = inputs['Tree']
    fakefactor = inputs['FakeFactor']
    cuts_true = inputs['CutsIso']
    cuts_est = inputs['CutsAntiIso']

    closure = Closure()
    closure.fillData('True', input_files, tree, 'mvis', toString(cuts_true), 'weight', global_weights)
    #closure.fillData('Est', input_files, tree, 'mvis', toString(cuts_est), 'weight', global_weights, fakefactor=fakefactor, ffInputs=['l2_pt', 'l2_decayMode', 'mvis'])
    closure.fillData('Est', input_files, tree, 'mvis', toString(cuts_est), 'weight', global_weights, fakefactor=fakefactor, ffInputs=['l2_pt', 'l2_decayMode'])

    closure.computeCDF('True')
    closure.computeCDF('Est')

    for name,bins in var_bins.items():
        plotClosure(fakeType+'_'+name, closure, bins, doErrors=False, yRange=[0.5,2.], plotDir=plotDir)

    #for nbins in [100,50,25]:
        #cdf = closure.data['True']['CDFInvert']
        #bins = [cdf.Eval(i/float(nbins)) for i in xrange(nbins+1)]
        #plotClosure(fakeType+'_NBins'+str(nbins), closure, bins)

    plotSummary(fakeType, closure, 0, 600)

    #
    writeNonClosure(closure, output_file, '{FAKETYPE}_Histo_Smooth_Ratio'.format(FAKETYPE=fakeType))

    #canvas.Write()
    ##cdfTrue.SetName('{FAKETYPE}_CDF_True'.format(FAKETYPE=fakeType))
    ##cdfEst.SetName('{FAKETYPE}_CDF_Est'.format(FAKETYPE=fakeType))
    #histoTrue.SetName('{FAKETYPE}_Histo_True_{H}'.format(FAKETYPE=fakeType,H=binid))
    global_weights = inputs['Weights']
    tree   = inputs['Tree']
    fakefactor = inputs['FakeFactor']
    cuts_true = inputs['CutsIso']
    cuts_est = inputs['CutsAntiIso']

    closure = Closure()
    closure.fillData('True', input_files, tree, 'l1_reliso05', toString(cuts_true), 'weight', global_weights)
    closure.fillData('Est', input_files, tree, 'l1_reliso05', toString(cuts_est), 'weight', global_weights, fakefactor=fakefactor, ffInputs=['l2_pt', 'l2_decayMode', 'mvis'])


    closure.computeCDF('True')
    closure.computeCDF('Est')

    for name,bins in var_bins.items():
        plotClosure(fakeType+'_'+name, closure, bins, doErrors=False, yRange=[0.5,2.], plotDir=plotDir, xTitle='iso(#mu)')

    #for nbins in [100,50,25]:
        #cdf = closure.data['True']['CDFInvert']
        #bins = [cdf.Eval(i/float(nbins)) for i in xrange(nbins+1)]
        #plotClosure(fakeType+'_NBins'+str(nbins), closure, bins)

    plotSummary(fakeType, closure, 0, 600)

    #
    writeNonClosure(closure, output_file, '{FAKETYPE}_Histo_Smooth_Ratio'.format(FAKETYPE=fakeType))

    #canvas.Write()
    ##cdfTrue.SetName('{FAKETYPE}_CDF_True'.format(FAKETYPE=fakeType))
    ##cdfEst.SetName('{FAKETYPE}_CDF_Est'.format(FAKETYPE=fakeType))
    #histoTrue.SetName('{FAKETYPE}_Histo_True_{H}'.format(FAKETYPE=fakeType,H=binid))