Ejemplo n.º 1
0
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,
                                              cat=channel,
                                              printOn=False)
        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=False)
                    GF.printEvent(entry)
                    GF.printMC(entry)
                    maxPrint -= 1
            continue
    elif channel == 'et':
        bestTauPair = tauFun.getBestETauPair(entry, cat=channel, printOn=False)
        if len(bestTauPair) < 1:
            if args.unique == 'FSA_only' and entry.event in FSA_only:
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
        #iMu = bestTauPair[0]
        #bestTauPair[0] = tauFun.getTauPointer(entry,entry.Muon_eta[iMu],entry.Muon_phi[iMu])
    elif channel == 'et':
        bestTauPair = tauFun.getBestETauPair(entry)
        if len(bestTauPair) < 1:
Ejemplo n.º 3
0
            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 len(bestTauPair) < 1:
                if False and maxPrint > 0 and (tauMode == GF.eventID(e)[2:4]):
                    maxPrint -= 1
                    print("Failed tau-pair cut")
                    print("Event ID={0:s} cat={1:s}".format(
                        GF.eventID(e), cat))
                    print(
                        "goodMuonList={0:s} goodElectronList={1:s} Mll={3:.1f} bestTauPair={4:s}"
                        .format(str(goodMuonList), str(goodElectronList),