예제 #1
0
def analyzeTree(enumfChunk):
    ich, fChunk = enumfChunk
    print("Processing chunk number %i" % (ich))
    tchain = ROOT.TChain(args.ttree)
    for filename in fChunk:
        tchain.Add(filename)
    print('Total number of events: ' + str(tchain.GetEntries()))
    myAnalyzer = BsPhiLLTupleTree(tchain)
    myAnalyzer.Loop(
        outpath + '/' + args.outputfile + '_subset' + str(ich) + '.root', -1,
        args.mvacut, True)
예제 #2
0
def makeTraining(inputArgs):
    ich, fChunk, maxevents = inputArgs
    print("Processing chunk number %i" % (ich))
    tchain = ROOT.TChain(args.ttree)
    for filename in fChunk:
        tchain.Add(filename)
    print('Total number of events: ' + str(tchain.GetEntries()))
    #myAnalyzer = loadAnalyzer(tchain, "MVATrainingSet_muon_nontrigger_background")
    myAnalyzer = BsPhiLLTupleTree(tchain)
    oppCharge = False
    if args.oppcharge: oppCharge = True
    myAnalyzer.Loop(
        outpath + '/' + args.outputfile + '_subset' + str(ich) + '.root',
        maxevents, 0.0, oppCharge)
예제 #3
0
        args.mvacut, True)


if not args.runparallel:
    tchain = ROOT.TChain(args.ttree)
    with open(args.inputfiles) as filenames:
        for filename in filenames:
            tchain.Add(filename.rstrip('\n'))
            break
    #tchain.Add('ggtree_data.root')
    print('Total number of events: ' + str(tchain.GetEntries()))
    #analyzer = "MVAEvaluation_electron"
    analyzer = "CutBasedFillTree_electron"
    ROOT.gSystem.CompileMacro("analyzer_class/%s.C" % (analyzer))
    from ROOT import BsPhiLLTupleTree
    myAnalyzer = BsPhiLLTupleTree(tchain)
    myAnalyzer.Loop(args.outputfile, args.maxevents, args.mvacut, True)

else:

    outputBase = "/eos/uscms/store/user/klau/BsPhiLL_output/LowPtElectrons"
    outputFolder = "BsPhiEE_CutBasedEvaluation"
    outpath = "%s/%s" % (outputBase, outputFolder)
    if not os.path.exists(outpath):
        exec_me("mkdir -p %s" % (outpath), False)

    with open(args.inputfiles) as filenames:
        fileList = [f.rstrip('\n') for f in filenames]
    group = 100
    # stplie files in to n(group) of chunks
    fChunks = list(chunks(fileList, group))
예제 #4
0

if not args.runparallel:
    tchain = ROOT.TChain(args.ttree)
    with open(args.inputfiles) as filenames:
        for filename in filenames:
            tchain.Add(filename.rstrip('\n'))
            break
    #tchain.Add('ggtree_data.root')
    print('Total number of events: ' + str(tchain.GetEntries()))
    #analyzer = "MVATrainingSet_muon_nontrigger_background"
    analyzer = "MVATrainingSet_electron_background"
    #ROOT.gROOT.ProcessLine(".L analyzer_class/%s.C+"%(analyzer))
    ROOT.gSystem.CompileMacro("analyzer_class/%s.C" % (analyzer))
    from ROOT import BsPhiLLTupleTree
    myAnalyzer = BsPhiLLTupleTree(tchain)
    myAnalyzer.Loop(args.outputfile, args.maxevents, 0.0, args.oppcharge)

else:

    outputBase = "/eos/uscms/store/user/klau/BsPhiLL_output"
    outputFolder = "BsPhiEE_MVATraining"
    outpath = "%s/%s" % (outputBase, outputFolder)
    if not os.path.exists(outpath):
        exec_me("mkdir -p %s" % (outpath), False)

    with open(args.inputfiles) as filenames:
        fileList = [f.rstrip('\n') for f in filenames]
    group = 200
    # stplie files in to n(group) of chunks
    fChunks = list(chunks(fileList, group))