Example #1
0
                cutCounter[cat].count('LeptonPair')

        LepP, LepM = pairList[0], pairList[1]
        M = (LepM + LepP).M()
        if M < 60. or M > 120.: continue
        if lepMode == 'ee':
            for cat in cats[:4]:
                cutCounter[cat].count('FoundZ')
        if lepMode == 'mm':
            for cat in cats[4:]:
                cutCounter[cat].count('FoundZ')

        for tauMode in ['et', 'mt', 'tt', 'em']:
            cat = lepMode + tauMode
            if tauMode == 'tt':
                tauList = tauFun.getTauList(cat, e, pairList=pairList)
                bestTauPair = tauFun.getBestTauPair(cat, e, tauList)

            elif tauMode == 'et':
                bestTauPair = tauFun.getBestETauPair(e,
                                                     cat=cat,
                                                     pairList=pairList)
            elif tauMode == 'mt':
                bestTauPair = tauFun.getBestMuTauPair(e,
                                                      cat=cat,
                                                      pairList=pairList)
            elif tauMode == 'em':
                bestTauPair = tauFun.getBestEMuTauPair(e,
                                                       cat=cat,
                                                       pairList=pairList)
if args.nEvents > 0: nMax = min(args.nEvents, nentries)

outFileName = GF.getOutFileName(args).replace(".root", ".ntup")
print("Opening {0:s} as output.".format(outFileName))
outTuple = outTuple.outTuple(outFileName)

channel = args.channel
goodEventCounter = 0
tStart = time.time()
for count, entry in enumerate(inTree):
    cutCounter.count('All')
    if count % 1000 == 0: print("Count={0:d}".format(count))
    if count > nMax: break

    if channel == 'tt':
        tauList = tauFun.getTauList(channel, entry)
        if len(tauList) < 2: continue
        cutCounter.count('TwoTaus')
        bestTauPair = tauFun.getBestTauPair(channel, entry, tauList)
    elif channel == 'mt':
        bestTauPair = tauFun.getBestMuTauPair(entry)
        if len(bestTauPair) < 1:
            if args.unique == 'FSA_only' and entry.event in FSA_only:
                if True:
                    print("\n** FSA only event *** Count={0:d}".format(count))
                    print("bestTauPair={0:s}".format(str(bestTauPair)))
                    bestTauPair = tauFun.getBestMuTauPair(entry, printOn=True)
                    GF.printEvent(entry)
                    GF.printMC(entry)
                    maxPrint -= 1
            continue
Example #3
0
        pairList = tauFun.findZ(goodElectronList, [], entry)

    if cat[0:2] == 'mm':
        if len(goodMuonList) < 2:
            continue
        pairList = tauFun.findZ([], goodMuonList, entry)

    if len(pairList) < 1:
        continue
    cutCounter.count('LeptonPair')
    LepP, LepM = pairList[0], pairList[1]
    M = (LepM + LepP).M()
    if M < 60. or M > 120.: continue
    cutCounter.count('FoundZ')

    tauList = tauFun.getTauList(cat, entry)
    if len(tauList) < 2: continue
    cutCounter.count('TwoTaus')

    bestTauPair = tauFun.getBestTauPair(cat, entry, tauList)
    if len(bestTauPair) < 1: continue
    cutCounter.count("GoodTauPair")

    if len(bestTauPair) > 1:
        jt1, jt2 = bestTauPair[0], bestTauPair[1]
    else:
        continue

    # apply DR cuts between leptons and taus
    if DR(LepP, jt1) < 0.5 or DR(LepP, jt2) < 0.5 or DR(LepM, jt1) < 0.5 or DR(
            LepM, jt2) < 0.5: