#bestTauPair[0] = tauFun.getTauPointer(entry,entry.Electron_eta[iE],entry.Electron_phi[iE])
    if len(bestTauPair) < 1: continue
    cutCounter.count("TauPair")
    if bestTauPair[0] < 0: continue
    cutCounter.count("GoodTauPair")

    #if False and len(args.unique) > 0  and (not ((entry.event in Dan_only) or (entry.event in FSA_only))) and maxPrint > 0 :
    if args.unique == 'Dan_only' and (entry.event
                                      in Dan_only) and maxPrint > 0:
        print(
            "\n** GOOD EVENT in Dan only sample *** Count={0:d}".format(count))
        print("bestTauPair = {0:s}".format(str(bestTauPair)))
        GF.printEvent(entry)
        maxPrint -= 1

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

    SVFit = True
    LepP, LepM = TLorentzVector(), TLorentzVector()
    outTuple.Fill(entry, SVFit, channel, jt1, jt2, LepP, LepM)

dT = time.time() - tStart
print("Run time={0:.2f} s  time/event={1:.1f} us".format(
    dT, 1000000. * dT / count))

outTuple.writeTree()
cutCounter.printSummary()
Example #2
0
                jt1, jt2 = bestTauPair[0], bestTauPair[1]
            else:
                continue

            if MC:
                outTuple.setWeight(PU.getWeight(e.Pileup_nPU))
            else:
                isInJSON = CJ.checkJSON(e.luminosityBlock, e.run)
                if not isInJSON:
                    print("Event not in JSON: Run:{0:d} LS:{1:d}".format(
                        e.run, e.luminosityBlock))
                    continue
                cutCounter[cat].count("InJSON")

            SVFit = True
            outTuple.Fill(e, SVFit, cat, jt1, jt2, LepP, LepM)

            if maxPrint > 0:
                maxPrint -= 1
                print("\n\nGood Event={0:d} cat={1:s}  MCcat={2:s}".format(
                    e.event, cat, GF.eventID(e)))
                print(
                    "goodMuonList={0:s} goodElectronList={1:s} Mll={2:.1f} bestTauPair={3:s}"
                    .format(str(goodMuonList), str(goodElectronList), M,
                            str(bestTauPair)))
                print("Lep1.pt() = {0:.1f} Lep2.pt={1:.1f}".format(
                    pairList[0].Pt(), pairList[1].Pt()))
                GF.printEvent(e)
                print("Event ID={0:s} cat={1:s}".format(GF.eventID(e), cat))

dT = time.time() - tStart
Example #3
0
#print  lepList[0], lepList[1], bestTauPair[0],bestTauPair[1],cat

            if MC:
                outTuple.setWeight(PU.getWeight(e.Pileup_nPU))
            else:
                isInJSON = CJ.checkJSON(e.luminosityBlock, e.run)
                if not isInJSON:
                    print("Event not in JSON: Run:{0:d} LS:{1:d}".format(
                        e.run, e.luminosityBlock))
                    continue
                cutCounter[cat].count("InJSON")

            SVFit = True

            if not MC: isMC = False
            outTuple.Fill(e, SVFit, cat, jt1, jt2, LepP, LepM, lepList, isMC,
                          era)

            if maxPrint > 0:
                maxPrint -= 1
                print("\n\nGood Event={0:d} cat={1:s}  MCcat={2:s}".format(
                    e.event, cat, GF.eventID(e)))
                print(
                    "goodMuonList={0:s} goodElectronList={1:s} Mll={2:.1f} bestTauPair={3:s}"
                    .format(str(goodMuonList), str(goodElectronList), M,
                            str(bestTauPair)))
                print("Lep1.pt() = {0:.1f} Lep2.pt={1:.1f}".format(
                    pairList[0].Pt(), pairList[1].Pt()))
                GF.printEvent(e)
                print("Event ID={0:s} cat={1:s}".format(GF.eventID(e), cat))

dT = time.time() - tStart
Example #4
0
    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:
        continue
    cutCounter.count('DR')

    SVFit = True
    outTuple.Fill(entry, SVFit, cat[-2:], jt1, jt2, LepP, LepM)

    if maxPrint > 0:
        maxPrint -= 1
        print("Good Event")
        print(
            "goodMuonList={0:s} goodElectronList={1:s} Mll={2:.1f} tauList={3:s} bestTauPair={4:s}"
            .format(str(goodMuonList), str(goodElectronList), M, str(tauList),
                    str(bestTauPair)))
        GF.printEvent(entry)

dT = time.time() - tStart
print("Run time={0:.2f} s  time/event={1:.1f} us".format(
    dT, 1000000. * dT / count))

outTuple.writeTree()