Ejemplo n.º 1
0
def main():

    if options.save and options.outdir != None and not os.path.isdir(
            options.outdir):
        log.info('Make directory: %s' % options.outdir)
        os.makedirs(options.outdir)

    if len(args) == 0:
        raise Exception('main - need at least one argument: %s' % (args))

    rfiles = []

    for arg in args:
        if not os.path.isfile(arg):
            raise Exception('main - invalid input file: %s' % (arg))

        rfiles += [ROOT.TFile(arg, 'READ')]

    Config.loadPhysicsProjectLib(ROOT, options)

    regions = getListOfRegions(rfiles[0])

    can = makeCanvas('c')

    for r in regions:

        hists = getAllHistNames(rfiles[0], r)

        for h in hists:
            if h.startswith('MatchedTauW/'):
                plot1d(rfiles, can, '%s/plotTruthTau/%s' % (r, h))
Ejemplo n.º 2
0
def main():

    if options.save and options.outdir != None and not os.path.isdir(
            options.outdir):
        log.info('Make directory: %s' % options.outdir)
        os.makedirs(options.outdir)

    if len(args) == 0:
        raise Exception('main - need at least one argument: %s' % (args))

    rfiles = []

    for arg in args:
        if not os.path.isfile(arg):
            raise Exception('main - invalid input file: %s' % (arg))

        rfiles += [ROOT.TFile(arg, 'READ')]

    Config.loadPhysicsProjectLib(ROOT, options)

    regions = getListOfRegions(rfiles[0])

    can = makeCanvas('c')

    for r in regions:

        hists = getAllHistNames(rfiles[0], r)

        for h in hists:
            if 'W1' in h:
                plotIntegralRatio(rfiles, can, '%s/plotRecoLep/%s' % (r, h))

            elif h == 'RecTauOLElec1/Pt':
                plotIntegralRatio(rfiles, can, '%s/plotRecoLep/%s' % (r, h))
Ejemplo n.º 3
0
def main():

    if options.save and options.outdir != None and not os.path.isdir(
            options.outdir):
        log.info('Make directory: %s' % options.outdir)
        os.makedirs(options.outdir)

    if len(args) == 0:
        raise Exception('main - need at least one argument: %s' % (args))

    rfiles = []

    for arg in args:
        if not os.path.isfile(arg):
            raise Exception('main - invalid input file: %s' % (arg))

        rfiles += [ROOT.TFile(arg, 'READ')]

    Config.loadPhysicsProjectLib(ROOT, options)

    can = makeCanvas('c')

    hists = getAllHistNames(rfiles[0], 'data')

    for h in hists:
        if 'ElecLoose' in h or 'MuonLoose' in h or 'TauLoose' in h or 'BJet' in h:
            plot1d(rfiles, can, 'data/no_cut/plotRecoLep/%s' % (h))
        else:
            plot1d(rfiles, can, 'data/%s' % (h))
Ejemplo n.º 4
0
def main():

    if options.save and options.outdir != None and not os.path.isdir(
            options.outdir):
        log.info('Make directory: %s' % options.outdir)
        os.makedirs(options.outdir)

    if len(args) == 0:
        raise Exception('main - need at least one argument: %s' % (args))

    rfiles = []

    for arg in args:
        if not os.path.isfile(arg):
            raise Exception('main - invalid input file: %s' % (arg))

        rfiles += [ROOT.TFile(arg, 'READ')]

    Config.loadPhysicsProjectLib(ROOT, options)

    #regions = getListOfRegions(rfiles[0])
    regions = ['plot_prepCand_1lep_1tau_2bjet']
    regions += ['plot_prepCand_1lep_2bjet']
    regions += ['plot_prepCand_nocut']

    can = makeCanvas('c')

    for r in regions:

        hists = getAllHistNames(rfiles[0], r)

        for h in hists:
            if "/TruthMatch_" in h:
                plot2d(rfiles, can, '%s/%s' % (r, h))