[ "mu7", [] ], [ "mu10", [] ], [ "gsplit", ["--g-split=add_bb"]] ] # # Run s8_monitor_input over QCD, for the input to reweighting (so we don't care about tag # or trigger, only the bin) SYST # preweightMiterSyst = Miter() for systematic in systematicsMCList: for dataset in exports['qcd'].iterMany(): for bin in jet_bins: if systematic[0] == 'gsplit': preweightMiterSyst.add( preweightMiter.getOneValue( bin = bin[0], dataset=dataset[1]['dataset'], ), bin=bin[0], dataset=dataset[1]['dataset'], syst=systematic[0]) continue step_postfix = "-%s-%s-%s-preweight" % (dataset[1]['dataset'],bin[0],systematic[0]) currNode = run_monitor_input_helper( g, jet_pt = bin[1], # tag = operating_, fileKey = dataset[1]['dataset'], # trigger_name = "HLT_BTagMu_DiJet10U", step_postfix = step_postfix, muon_pt = "6..", input_files = dataset[0] )
weightMiterSyst = Miter() #print "data %s mc %s" % (dataForWeights, mcForWeights ) for systematic in systematicsMCList: # Some systematics just borrows data from nominal if systematic[0] in systematicsUsingNominalMC: continue step_key = "-%s" % ( systematic[0] ) step_postfix= step_key collectNode = Node( name = "collect-reweight" + step_postfix ) weightNode = Node( name = "weight" + step_postfix ) reweighNode = Node( name = "reweighed" + step_postfix ) print "what is systematic: %s" % systematic[0] dataNode = dataForWeightsSyst.getOneValue( syst = systematic[0] ) mcNode = mcForWeightsSyst.getOneValue( syst = systematic[0] ) # Usage: root_trigger_weights out.root data_monitor.root mc_monitor.root calcWeightEdge = LocalScriptEdge( name = "calcweight" + step_postfix, command = ["root_trigger_weights", bin[1], #"-3..3", "weight.root", BindPreviousOutput( dataNode ), BindPreviousOutput( mcNode ) ], output = "weight.root", noEmptyFiles = True ) g.addNode( collectNode ) g.addNode( weightNode ) g.addEdge( dataNode, collectNode, NullEdge() )
# weightMiterSyst = Miter() # print "data %s mc %s" % (dataForWeights, mcForWeights ) for systematic in systematicsMCList: # Some systematics just borrows data from nominal if systematic[0] in systematicsUsingNominalMC: continue step_key = "-%s" % (systematic[0]) step_postfix = step_key collectNode = Node(name="collect-reweight" + step_postfix) weightNode = Node(name="weight" + step_postfix) reweighNode = Node(name="reweighed" + step_postfix) print "what is systematic: %s" % systematic[0] dataNode = dataForWeightsSyst.getOneValue(syst=systematic[0]) mcNode = mcForWeightsSyst.getOneValue(syst=systematic[0]) # Usage: root_trigger_weights out.root data_monitor.root mc_monitor.root calcWeightEdge = LocalScriptEdge( name="calcweight" + step_postfix, command=[ "root_trigger_weights", bin[1], # "-3..3", "weight.root", BindPreviousOutput(dataNode), BindPreviousOutput(mcNode), ], output="weight.root", noEmptyFiles=True, )
if not opoint in skiplessS8Monitor: skiplessS8Monitor[opoint] = {} if not bin[0] in skiplessS8Monitor[opoint]: skiplessS8Monitor[opoint][bin[0]] = {} if not trigger[1] in skiplessS8Monitor[opoint][bin[0]]: skiplessS8Monitor[opoint][bin[0]][trigger[1]] = [] currNode = run_monitor_input_helper( g, jet_pt=bin[1], tag=opoint, fileKey=sample[1], trigger_name=trigger[4], step_postfix=step_postfix, muon_pt="6..", input_files=qcdTreeMiter.getOneValue(dataset=sample[1]), simulate_trigger=triggers_to_simulate[trigger[1]], ) skiplessS8Monitor[opoint][bin[0]][trigger[1]].append(currNode) singleMonitorMiter.add( currNode, dataset=sample[1], trigger=trigger[1], bin=bin[0], opoint=opoint, njetpt=True, njeteta=True, privert=True, type="skipless", )
step_postfix = "-%s-%s-%s-%s-noskip" % (sample[1],trigger[1],bin[0],opoint) if not opoint in skiplessS8Monitor: skiplessS8Monitor[ opoint ] = {} if not bin[0] in skiplessS8Monitor[ opoint ]: skiplessS8Monitor[ opoint ][ bin[0] ] = {} if not trigger[1] in skiplessS8Monitor[ opoint ][ bin[0] ]: skiplessS8Monitor[ opoint ][ bin[0] ][ trigger[1] ] = [] currNode = run_monitor_input_helper( g, jet_pt = bin[1], tag = opoint, fileKey = sample[1], trigger_name = trigger[4], step_postfix = step_postfix, muon_pt = "6..", input_files = qcdTreeMiter.getOneValue( dataset = sample[1] ), simulate_trigger = triggers_to_simulate[ trigger[1] ]) skiplessS8Monitor[ opoint ][ bin[0] ][ trigger[1] ].append( currNode ) singleMonitorMiter.add( currNode,dataset = sample[1], trigger = trigger[1], bin = bin[0], opoint = opoint, njetpt = True, njeteta = True, privert = True, type = "skipless" ) skiplessQCDMiter.add( currNode, dataset = sample[1], trigger = trigger[1], bin = bin[0],