# ________________________________________________________________________ || var_mZ1_str = "x.massZ1[0]" var_mZ2_str = "x.massZ2[0]" var_m4l_str = "x.mass4l[0]" low_m4l_str = "x.mass4l[0] > 100 and x.mass4l[0] < 118" mid_m4l_str = "x.mass4l[0] > 118 and x.mass4l[0] < 130" high_m4l_str = "x.mass4l[0] > 130 and x.mass4l[0] < 170" # ________________________________________________________________________ || general_plots = [ Plot("mZ1", [ "TH1D", "mZ1", "", ] + mZ1PlotRange, LambdaFunc('x: ' + var_mZ1_str), selFunc=LambdaFunc('x: ' + sel_str)), Plot("mZ2", [ "TH1D", "mZ2", "", ] + mZ2PlotRange, LambdaFunc('x: ' + var_mZ2_str), selFunc=LambdaFunc('x: ' + sel_str)), Plot("m4l", [ "TH1D", "m4l", "", ] + h4lPlotRange,
#componentList = allMCSamples + allSignalSamples + [Data_Run2016B,] #componentList = allMCSamples + [Data_Run2016B,] #componentList = componentDict.values() componentList = skimComponentDict.values() + dataComponentDict.values() for dataset in componentList: if dataset.isMC: #dataset.lumi = 35.9 dataset.lumi = 5.93 for component in dataset.componentList: component.maxEvents = nEvents plots = [] for lepCat in lepCats: plots.extend([ Plot("nJet40" + lepCat, ["TH1D", "nJet40" + lepCat, "", 10, -0.5, 9.5], LambdaFunc('x: x.nJetRA540[0]'), selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"' % lepCat)), #Plot("nJet40JECUp"+lepCat, ["TH1D","nJet40JECUp"+lepCat,"",10,-0.5,9.5], LambdaFunc('x: x.nJetRA540_jecUp[0]') ,selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"'%lepCat)), #Plot("nJet40JECDown"+lepCat, ["TH1D","nJet40JECDown"+lepCat,"",10,-0.5,9.5], LambdaFunc('x: x.nJetRA540_jecDown[0]') ,selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"'%lepCat)), Plot("nJet25" + lepCat, ["TH1D", "nJet25" + lepCat, "", 10, -0.5, 9.5], LambdaFunc('x: x.nJetRA525[0]'), selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"' % lepCat)), Plot("nBJet40" + lepCat, ["TH1D", "nBJet40" + lepCat, "", 7, -0.5, 6.5], LambdaFunc('x: x.nBJetMediumRA540[0]'), selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"' % lepCat)), Plot("nBJet25" + lepCat, ["TH1D", "nBJet25" + lepCat, "", 7, -0.5, 6.5], LambdaFunc('x: x.nBJetMediumRA525[0]'), selFunc=LambdaFunc('x: x.cat.lepCat == \"%s\"' % lepCat)), Plot("nLepTight" + lepCat,
nCores = 1 outputDir = "./test_plot/" nEvents = -1 disableProgressBar = False justEndSequence = False verbose = True componentList = allMCSamples for dataset in componentList: if dataset.isMC: dataset.lumi = 35.9 for component in dataset.componentList: component.maxEvents = nEvents plots = [ Plot("nJet40", ["TH1D", "nJet40", "", 10, -0.5, 9.5], LambdaFunc('x: x.nJetSel[0]')), Plot("nLepTight", ["TH1D", "nLepTight", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLepTight[0]')), Plot("nLepLoose", ["TH1D", "nLepLoose", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLepLoose[0]')), Plot("nLepCleaning", ["TH1D", "nLepCleaning", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLepCleaning[0]')), Plot("nBJet40", ["TH1D", "nBJet40", "", 7, -0.5, 6.5], LambdaFunc('x: x.nBJetMedium40[0]')), Plot("htJet", ["TH1D", "htJet", "", 10, 0., 1000.], LambdaFunc('x: x.htJet40[0]')), Plot("met_pt", ["TH1D", "met_pt", "", 10, 0., 500.], LambdaFunc('x: x.met_pt[0]')), Plot("met_phi", ["TH1D", "met_phi", "", 5, 0., 5.], LambdaFunc('x: x.met_phi[0]')), Plot("mht", ["TH1D", "mht", "", 10, 0., 500.],
verbose = False #componentList = dataComponentDict.values() + componentDict.values() #componentList = [c for c in dataComponentDict.values() if "2016H" not in c.name] + componentDict.values() #componentList = [c for c in dataComponentDict.values() if "2016H" not in c.name] + [c for c in componentDict.values() if "QCD" not in c.name] #componentList = [c for c in skimComponentDict.values() if "2016H" not in c.name and "QCD" not in c.name] componentList = skimComponentDict.values() for dataset in componentList: if dataset.isMC: dataset.lumi = 27.96 for component in dataset.componentList: component.maxEvents = nEvents plots = [] for lepCat in lepCats: plots.extend([ Plot("nJet40" + lepCat, ["TH1D", "nJet40" + lepCat, "", 10, -0.5, 9.5], LambdaFunc('x: x.nJetRA540[0]')), Plot("nJet25" + lepCat, ["TH1D", "nJet25" + lepCat, "", 10, -0.5, 9.5], LambdaFunc('x: x.nJetRA525[0]')), Plot("nBJet40" + lepCat, ["TH1D", "nBJet40" + lepCat, "", 7, -0.5, 6.5], LambdaFunc('x: x.nBJetMediumRA540[0]')), Plot("nBJet25" + lepCat, ["TH1D", "nBJet25" + lepCat, "", 7, -0.5, 6.5], LambdaFunc('x: x.nBJetMediumRA525[0]')), Plot("htJet" + lepCat, ["TH1D", "htJet" + lepCat, "", 20, 0., 1000.], LambdaFunc('x: x.htJet40[0]')), Plot("met_pt" + lepCat, ["TH1D", "met_pt" + lepCat, "", 25, 0., 250.], LambdaFunc('x: x.met_pt[0]')), Plot("met_phi" + lepCat, ["TH1D", "met_phi" + lepCat, "", 10, -5, 5.], LambdaFunc('x: x.met_phi[0]')), #Plot("mtmin"+lepCat, ["TH1D","mtmin"+lepCat,"",20,0., 200.], LambdaFunc('x: x.mtmin') ),
sel_mu_str = "abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11" var_mZ1_str = "x.massZ1[0]" var_mZ2_str = "x.massZ2[0]" var_m4l_str = "x.mass4l[0]" low_m4l_str = "x.mass4l[0] > 100 and x.mass4l[0] < 118" mid_m4l_str = "x.mass4l[0] > 118 and x.mass4l[0] < 130" high_m4l_str = "x.mass4l[0] > 130 and x.mass4l[0] < 170" # ________________________________________________________________________ || general_4e_plots = [ Plot("mZ1_4e", [ "TH1D", "mZ1_4e", "", ] + mZ1PlotRange_el, LambdaFunc('x: ' + var_mZ1_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("mZ2_4e", [ "TH1D", "mZ2_4e", "", ] + mZ2PlotRange_el, LambdaFunc('x: ' + var_mZ2_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("m4l_4e", [ "TH1D", "m4l_4e", "", ] + h4lPlotRange_el,
#h4lPlotRange = [140,60.,200.] phpFile = "index.php" out_path = "DarkPhotonSB/DataMCDistributions/20190130_Run2016_mZd4to60_10percZratio_ahmadTEST/" lumi = 35.9 nCores = 5 #outputDir = "/raid/raid7/lucien/Higgs/HToZdZd/"+out_path outputDir = "/raid/raid7/rosedj1/Higgs/HToZdZd/"+out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + [data2016] justEndSequence = False region_sel_str_whole = "x: True" muon_plots = [ Plot("LeadingLepton_pt", ["TH1D","LeadingLepton_pt","",20,0.,200.], LambdaFunc('x: max([ x.pTL1[0], x.pTL2[0], x.pTL3[0], x.pTL4[0] ])')), Plot("Muon1_Pt", ["TH1D","Muon1_pt","",20,0.,200.], LambdaFunc('x: [x.pTL1[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon2_Pt", ["TH1D","Muon2_pt","",20,0.,100.], LambdaFunc('x: [x.pTL2[0]] if abs(x.idL2[0]) == 13 else []'), isCollection=True), Plot("Muon3_Pt", ["TH1D","Muon3_pt","",20,0.,100.], LambdaFunc('x: [x.pTL3[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon4_Pt", ["TH1D","Muon4_pt","",20,0.,50.], LambdaFunc('x: [x.pTL4[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon1_Eta", ["TH1D","Muon1_eta","",20,-3.,3.], LambdaFunc('x: [x.etaL1[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon2_Eta", ["TH1D","Muon2_eta","",20,-3.,3.], LambdaFunc('x: [x.etaL2[0]] if abs(x.idL2[0]) == 13 else []'), isCollection=True), Plot("Muon3_Eta", ["TH1D","Muon3_eta","",20,-3.,3.], LambdaFunc('x: [x.etaL3[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon4_Eta", ["TH1D","Muon4_eta","",20,-3.,3.], LambdaFunc('x: [x.etaL4[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon1_Phi", ["TH1D","Muon1_phi","",20,-5.,5.], LambdaFunc('x: [x.phiL1[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon2_Phi", ["TH1D","Muon2_phi","",20,-5.,5.], LambdaFunc('x: [x.phiL2[0]] if abs(x.idL2[0]) == 13 else []'), isCollection=True), Plot("Muon3_Phi", ["TH1D","Muon3_phi","",20,-5.,5.], LambdaFunc('x: [x.phiL3[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True), Plot("Muon4_Phi", ["TH1D","Muon4_phi","",20,-5.,5.], LambdaFunc('x: [x.phiL4[0]] if abs(x.idL1[0]) == 13 else []'), isCollection=True),
User = os.environ["USER"] #out_path = "Preselection/DataMCDistributions/2019-03-31_Run2017_test/" out_path = "Preselection/DataMCDistributions/2019-05-27_Run2017_test/" lumi = 41.298 nCores = 5 outputDir = system.getStoragePath() + "/" + User + "/LJMet/B2G/" + out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + dataSamples justEndSequence = False plots = [ #multiplicities: Plot( "Njets", ["TH1D", "Njets", "jet multiplicity", 10, 0, 10], LambdaFunc('x: x.NJets_JetSubCalc[0]'), ), Plot( "AK8Njets", ["TH1D", "AK8Njets", "AK8 jet multiplicity", 10, 0, 10], LambdaFunc('x: x.NJetsAK8_JetSubCalc[0]'), ), Plot( "Nbjets", ["TH1D", "Nbjets", "b tag multiplicity", 10, 0, 10], LambdaFunc('x: x.NJetsCSV_JetSubCalc[0]'), ), Plot( "NbjetsWithSF", ["TH1D", "NbjetsWithSF", "b tag multiplicity", 10, 0, 10],
deltaRPlotRange2 = [40, 0., 4.] deltaRPlotRange = [40, 0., 4.] general_plots = [] for eachCR in ["3p1f", "2p2f"]: if eachCR == "3p1f": region_sel_str = "x.nZXCRFailedLeptons[0] == 1" region_sel_str_whole = "x: x.nZXCRFailedLeptons[0] == 1" else: region_sel_str = "x.nZXCRFailedLeptons[0] == 2" region_sel_str_whole = "x: x.nZXCRFailedLeptons[0] == 2" general_plots.extend([ Plot("Z1_mass_" + eachCR, [ "TH1D", "Z1_mass_" + eachCR, "", ] + mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), selFunc=LambdaFunc(region_sel_str_whole)), Plot("Z2_mass_vs_DeltaR34_" + eachCR, [ "TH2D", "Z2_mass_vs_DeltaR34_" + eachCR, "", ] + mZ2PlotRange + deltaRPlotRange2, LambdaFunc('x: [x.massZ2[0],x.deltaRL34]'), selFunc=LambdaFunc(region_sel_str_whole), dim=2), Plot("Z2_mass_" + eachCR, [ "TH1D", "Z2_mass_" + eachCR, "",
mllggPlotRange = [50, 0., 200.] elPtPlotRange = [20, 0., 200.] muPtPlotRange = [20, 0., 200.] phoPtPlotRange = [20, 0., 200.] elEtaPlotRange = [20, -3., 3.] muEtaPlotRange = [20, -3., 3.] phoEtaPlotRange = [20, -3., 3.] # ____________________________________________________________________________________________________________________________________________ || general_plots = [ Plot( "mllgg", [ "TH1D", "mllgg", "", ] + mllggPlotRange, LambdaFunc( 'x: (x.Zcand.lep1P4+x.Zcand.lep2P4+x.selPhotons[0].p4()+x.selPhotons[1].p4()).M()' ), ), ] # ____________________________________________________________________________________________________________________________________________ || lepton_plots = [ #Plot("mll",["TH1D","mll","",]+mllPlotRange, LambdaFunc('x: (x.selElectrons[0].p4()+x.selElectrons[1].p4()).M()'),), Plot( "mll", [ "TH1D", "mll",
var_mu1Eta_str = "[x.etaL1[0]] if abs(x.idL1[0]) == 13 else []" var_mu2Eta_str = "[x.etaL2[0]] if abs(x.idL2[0]) == 13 else []" var_mu3Eta_str = "[x.etaL3[0]] if abs(x.idL3[0]) == 13 else []" var_mu4Eta_str = "[x.etaL4[0]] if abs(x.idL4[0]) == 13 else []" var_el1Eta_str = "[x.etaL1[0]] if abs(x.idL1[0]) == 11 else []" var_el2Eta_str = "[x.etaL2[0]] if abs(x.idL2[0]) == 11 else []" var_el3Eta_str = "[x.etaL3[0]] if abs(x.idL3[0]) == 11 else []" var_el4Eta_str = "[x.etaL4[0]] if abs(x.idL4[0]) == 11 else []" # ________________________________________________________________________ || general_4e_plots = [ Plot("mZ1_4e", [ "TH1D", "mZ1_4e", "", ] + mZ1PlotRange, LambdaFunc('x: ' + var_mZ1_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("mZ2_4e", [ "TH1D", "mZ2_4e", "", ] + mZ2PlotRange, LambdaFunc('x: ' + var_mZ2_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("m4l_4e", [ "TH1D", "m4l_4e", "", ] + h4lPlotRange,
# HToZdZd_MZD30, # HToZdZd_MZD50, # HToZdZd_MZD60, # ] justEndSequence = False eventSelection = LambdaFunc( "x: (x.massZ1[0]-x.massZ2[0])/(x.massZ1[0]+x.massZ2[0]) > 0.05") muon_plots = [] general_plots = [ Plot( "Z1_mass", [ "TH1D", "Z1_mass", "", ] + mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), Plot( "Z2_mass", [ "TH1D", "Z2_mass", "", ] + mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), Plot("Z1_4e_mass", [ "TH1D",
#sel_str_2e2mu = "x: abs(x.lep_id[x.lep_Hindex[0]]) == 11 and abs(x.lep_id[x.lep_Hindex[1]]) == 11 and abs(x.lep_id[x.lep_Hindex[2]]) == 13 and abs(x.lep_id[x.lep_Hindex[3]]) == 13" #sel_str_2mu2e = "x: abs(x.lep_id[x.lep_Hindex[0]]) == 13 and abs(x.lep_id[x.lep_Hindex[1]]) == 13 and abs(x.lep_id[x.lep_Hindex[2]]) == 11 and abs(x.lep_id[x.lep_Hindex[3]]) == 11" sel_str_4e = "x: x.finalState[0] == 2" sel_str_4mu = "x: x.finalState[0] == 1" sel_str_2e2mu = "x: x.finalState[0] == 3" sel_str_2mu2e = "x: x.finalState[0] == 4" eachCR = "3p1f" general_plots = [] general_plots.extend([ Plot( "Z1_mass_" + eachCR, [ "TH1D", "Z1_mass_" + eachCR, "", ] + mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), Plot( "Z2_mass_" + eachCR, [ "TH1D", "Z2_mass_" + eachCR, "", ] + mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), Plot("Z1_4e_mass_" + eachCR, [ "TH1D",
from Plotter.Plot import Plot from Core.Utils.LambdaFunc import LambdaFunc eventBasedPlots = [ Plot("nJet40", ["TH1D","nJet40","",20,-0.5,19.5], LambdaFunc('x: len([j for j in x.LooseJets if j.pt > 40])')), Plot("nBJet25", ["TH1D","nBJet25","",10,-0.5,9.5], LambdaFunc('x: len([j for j in x.LooseJets if j.btagCSVV2 > 0.8989])')), Plot("ht40", ["TH1D","ht40","",60,0.,6000.], LambdaFunc('x: sum([j.pt for j in x.LooseJets if j.pt > 40])')), Plot("met", ["TH1D","met","",60,0.,6000.], LambdaFunc('x: x.MET_pt[0]')), Plot("nMediumMuon", ["TH1D","nMedMuon","",10,-0.5,9.5], LambdaFunc('x: len(x.MediumMuons)')), Plot("nMediumElectron", ["TH1D","nMedElectron","",10,-0.5,9.5], LambdaFunc('x: len(x.MediumElectrons)')), ] muonPlots = [ Plot("MedMuonPt", ["TH1D","MedMuonPt","",20,0.,1000.], LambdaFunc('x: [mu.pt for mu in x.MediumMuons]'), isCollection=True), Plot("MedMuonEta", ["TH1D","MedMuonEta","",20,-3.,3.], LambdaFunc('x: [mu.eta for mu in x.MediumMuons]'), isCollection=True), Plot("MedMuonDxy", ["TH1D","MedMuonDxy","",20,0.,0.01], LambdaFunc('x: [mu.dxy for mu in x.MediumMuons]'), isCollection=True), Plot("MedMuonDz", ["TH1D","MedMuonDz","",20,0.,0.1], LambdaFunc('x: [mu.dz for mu in x.MediumMuons]'), isCollection=True), Plot("MedMuonSip", ["TH1D","MedMuonSip","",20,0.,8], LambdaFunc('x: [mu.sip3d for mu in x.MediumMuons]'), isCollection=True), ] electronPlots = [ Plot("MedElectronPt", ["TH1D","MedElectronPt","",20,0.,1000.], LambdaFunc('x: [ele.pt for ele in x.MediumElectrons]'), isCollection=True), Plot("MedElectronEta", ["TH1D","MedElectronEta","",20,-3.,3.], LambdaFunc('x: [ele.eta for ele in x.MediumElectrons]'), isCollection=True), Plot("MedElectronDxy", ["TH1D","MedElectronDxy","",20,0.,0.01], LambdaFunc('x: [mu.dxy for mu in x.MediumElectrons]'), isCollection=True), Plot("MedElectronDz", ["TH1D","MedElectronDz","",20,0.,0.1], LambdaFunc('x: [ele.dz for ele in x.MediumElectrons]'), isCollection=True), Plot("MedElectronSip", ["TH1D","MedElectronSip","",20,0.,8], LambdaFunc('x: [ele.sip3d for ele in x.MediumElectrons]'), isCollection=True), ] allPlots = eventBasedPlots + muonPlots + electronPlots
sel_mu_str = "abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11" var_mZ1_str = "x.massZ1[0]" var_mZ2_str = "x.massZ2[0]" var_m4l_str = "x.mass4l[0]" low_m4l_str = "x.mass4l[0] > 100 and x.mass4l[0] < 118" mid_m4l_str = "x.mass4l[0] > 118 and x.mass4l[0] < 130" high_m4l_str = "x.mass4l[0] > 130 and x.mass4l[0] < 170" # ________________________________________________________________________ || general_4e_plots = [ Plot("mZ1_4e", [ "TH1D", "mZ1_4e", "", ] + mZ1PlotRange_el, LambdaFunc('x: ' + var_mZ1_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("mZ2_4e", [ "TH1D", "mZ2_4e", "", ] + mZ2PlotRange_el, LambdaFunc('x: ' + var_mZ2_str), selFunc=LambdaFunc('x: ' + sel_4e_str)), Plot("m4l_4e", [ "TH1D", "m4l_4e", "", ] + h4lPlotRange_el,
nCores = 8 outputDir = "./testPlot_v2/" nEvents = -1 disableProgressBar = False justEndSequence = False ratio_switch = False componentList = allDataSamples + allMCSamples for dataset in componentList: if dataset.isMC: dataset.lumi = 5.93 for component in dataset.componentList: component.maxEvents = nEvents data_plots = [ Plot("nJet40", ["TH1D", "nJet40", "", 10, -0.5, 9.5], LambdaFunc('x: x.nJet40')), Plot( "nBJet25", ["TH1D", "nBJet25", "", 10, -0.5, 9.5], LambdaFunc( 'x: len([j for j in x.LooseJets if j.btagCSVV2 > 0.8484])')), Plot("nLep40", ["TH1D", "nLep40", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLep40')), Plot("met", ["TH1D", "met", "", 10, 0., 500.], LambdaFunc('x: x.MET_pt[0]')), Plot("ht40", ["TH1D", "ht40", "", 10, 0., 1000.], LambdaFunc('x: x.ht40')), Plot("mll", ["TH1D", "mll", "", 16, 0., 800.], LambdaFunc('x: x.mll if x.mll else -1.')), Plot("jetPt1", ["TH1D", "jetPt1", "", 10, 0., 500.], LambdaFunc('x: x.jets[0].pt if len(x.jets) > 0 else -1')), Plot("jetEta1", ["TH1D", "jetEta1", "", 10, -3., 3.], LambdaFunc('x: x.jets[0].eta if len(x.jets) > 0 else -1')),
nCores = 5 nEvents = -1 disableProgressBar = False justEndSequence = False verbose = False componentList = skimComponentDict.values() for dataset in componentList: if dataset.isMC: dataset.lumi = 35.9 for component in dataset.componentList: component.maxEvents = nEvents plots = [ Plot("rpv_HH_TightLoose", ["TH1D", "rpv_HH_TightLoose", "", 16, 52.5, 68.5], LambdaFunc('x: x.SRCategory'), selFunc=LambdaFunc( 'x: x.leptonCategory == \"HH\" and x.met_pt[0] < 50.')), Plot("baseline_HH_TightLoose", ["TH1D", "baseline_HH_TightLoose", "", 52, 0.5, 52.5], LambdaFunc('x: x.SRCategory'), selFunc=LambdaFunc( 'x: x.leptonCategory == \"HH\" and x.met_pt[0] > 50.')), ] plotter = Plotter("Plotter", plots) srProducer = SRProducer("SRProducer") sequence = tl_rpv_sequence sequence.add(srProducer) sequence.add(plotter)
from DarkZ.Skimmer.Preskimmer import GENPreskimmer from DarkZ.Skimmer.FiducialSkimmer import FiducialSkimmer from NanoAOD.Producer.GenWeightCounter import * from NanoAOD.Weighter.XSWeighter import * from NanoAOD.EndModule.CutflowEndModule import CutflowEndModule from Plotter.Plotter import Plotter from Plotter.PlotEndModule import PlotEndModule from Plotter.Plot import Plot validation_plots = [ Plot( "nGenLep", ["TH1D", "nGenLep", "", 10, -0.5, 9.5], LambdaFunc('x: len(x.genleps)'), ), Plot( "nZCandidates", ["TH1D", "nZCandidates", "", 10, -0.5, 9.5], LambdaFunc('x: len(x.ZCandidates)'), ), Plot("GenLep1_Pt", ["TH1D", "GenLep1_pt", "", 20, 0., 200.], LambdaFunc('x: x.genleps[0].pt if len(x.genleps) >= 1 else None')), Plot( "Z1_mass", ["TH1D", "Z1_mass", "", 20, 20., 140.], LambdaFunc('x: x.Z1.vec.M()'), ), Plot(
disableProgressBar = False componentList = bkgSamples + dataSamples justEndSequence = False eventSelection = LambdaFunc("x: x.minDR_leadAK8otherAK8[0] > 3.") for dataset in componentList: if dataset.isMC: dataset.lumi = lumi for component in dataset.componentList: component.maxEvents = nEvents plots = [ Plot( "AK4HT_0b0H", ["TH1D", "AK4HT_0b0H", "", 25, 500.0, 3000.0], LambdaFunc('x: x.AK4HT[0]'), plotSetting=PlotSetting(x_axis_title="AK4 H_{T}"), selFunc=LambdaFunc( "x: x.NJetsH1btagged[0] == 0 and x.NJetsH2btagged[0] == 0 and x.NJetsCSV_JetSubCalc[0] == 0" )), Plot( "AK4HT_1b0H", ["TH1D", "AK4HT_1b0H", "", 25, 500.0, 3000.0], LambdaFunc('x: x.AK4HT[0]'), plotSetting=PlotSetting(x_axis_title="AK4 H_{T}"), selFunc=LambdaFunc( "x: x.NJetsH1btagged[0] == 0 and x.NJetsH2btagged[0] == 0 and x.NJetsCSV_JetSubCalc[0] > 0" )), Plot( "AK4HT_1b1H", ["TH1D", "AK4HT_1b1H", "", 25, 500.0, 3000.0], LambdaFunc('x: x.AK4HT[0]'), plotSetting=PlotSetting(x_axis_title="AK4 H_{T}"), selFunc=LambdaFunc(
#from DarkZ.Skimmer.FiducialSkimmer import FiducialSkimmer from DarkZ.Skimmer.RecoSkimmer import RecoSkimmer from NanoAOD.Weighter.XSWeighter import XSWeighter # Stealing module from NanoAOD framework from Plotter.Plotter import Plotter from Plotter.PlotEndModule import PlotEndModule from Plotter.Plot import Plot # Dir within /home/rosedj1/public_html/DarkZ/ out_path = "BkgAndSigWithMuonPlots/" muon_plots = [ Plot( "Muon1_Pt", ["TH1D", "Muon1_pt", "", 20, 0., 130.], LambdaFunc('x: x.Z1.lep1.vec.Pt()'), ), Plot( "Muon2_Pt", ["TH1D", "Muon2_pt", "", 20, 0., 70.], LambdaFunc('x: x.Z1.lep2.vec.Pt()'), ), Plot( "Muon3_Pt", ["TH1D", "Muon3_pt", "", 20, 0., 60.], LambdaFunc('x: x.Z2.lep1.vec.Pt()'), ), Plot( "Muon4_Pt", ["TH1D", "Muon4_pt", "", 20, 0., 30.],
Z1vsZ2_radius = "x: (x.massZ1[0]-30)**2 + (x.massZ2[0]-30)**2" radiuscut = 5 mZ1PlotRange = [40, 0., 80.] mZ2PlotRange = [40, 0., 80.] h4lPlotRange = [70, 60., 200.] #h4lPlotRange = [140,60.,200.] #____________________________________________________________________________________________________ # Plots signif_plots = [ #Plot("Z1mass_vs_Z2massTEST",["TH2D","Z1mass_vs_Z2mass","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole)), Plot("Z1mass_vs_Z2mass_rcut1", [ "TH2D", "Z1mass_vs_Z2mass_rcut1", "", ] + mZ1PlotRange + mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius + '<' + str(radiuscut**2))), ] muon_plots = [] general_plots = [ #Plot("Z1_mass", ["TH1D","Z1_mass","",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), #Plot("Z2_mass", ["TH1D","Z2_mass","",]+mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), #Plot("Z1_4e_mass", ["TH1D","Z1_4e_mass","",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), selFunc=LambdaFunc('x: x.mass4e[0] > 0') ), #Plot("Z2_4e_mass", ["TH1D","Z2_4e_mass","",]+mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), selFunc=LambdaFunc('x: x.mass4e[0] > 0') ), #Plot("Z1_4mu_mass", ["TH1D","Z1_4mu_mass","",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), selFunc=LambdaFunc('x: x.mass4mu[0] > 0') ), #Plot("Z2_4mu_mass", ["TH1D","Z2_4mu_mass","",]+mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), selFunc=LambdaFunc('x: x.mass4mu[0] > 0') ), #Plot("Z1_2e2mu_mass", ["TH1D","Z1_2e2mu_mass","",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), selFunc=LambdaFunc('x: x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13') ),
# ________________________________________________________________________ || var_muPt_str = "[l.pt for l in x.leptons_matched]" var_muEta_str = "[l.eta for l in x.leptons_matched]" var_muMass_str = "(x.leptons_matched[0].p4()+x.leptons_matched[1].p4()).M()" muPtPlotRange = [50, 0., 50.] muEtaPlotRange = [60, -3., 3.] muMassPlotRange = [90, 0., 90.] # ________________________________________________________________________ || plots = [ Plot("mu_pt", [ "TH1D", "mu_pt", "", ] + muPtPlotRange, LambdaFunc("x: " + var_muPt_str), isCollection=True), Plot("mu_eta", [ "TH1D", "mu_eta", "", ] + muEtaPlotRange, LambdaFunc("x: " + var_muEta_str), isCollection=True), Plot("mu_mass", [ "TH1D", "mu_mass", "", ] + muMassPlotRange,
from DataMC.NanoAOD.Run2016 import * nCores = 8 outputDir = "./testPlot_v1/" nEvents = -1 disableProgressBar = False justEndSequence = False ratio_switch = False componentList = allMCSamples for dataset in componentList: dataset.lumi = 35.9 for component in dataset.componentList: component.maxEvents = nEvents mc_plots = [ Plot("nJet40", ["TH1D", "nJet40", "", 10, -0.5, 9.5], LambdaFunc('x: x.nJet40')), Plot( "nBJet25", ["TH1D", "nBJet25", "", 10, -0.5, 9.5], LambdaFunc( 'x: len([j for j in x.LooseJets if j.btagCSVV2 > 0.8484])')), Plot("nLep40", ["TH1D", "nLep40", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLep40')), Plot("met", ["TH1D", "met", "", 10, 0., 500.], LambdaFunc('x: x.MET_pt[0]')), Plot("ht40", ["TH1D", "ht40", "", 10, 0., 1000.], LambdaFunc('x: x.ht40')), Plot("mll", ["TH1D", "mll", "", 16, 0., 800.], LambdaFunc('x: x.mll if x.mll else -1.')), Plot("jetPt1", ["TH1D", "jetPt1", "", 10, 0., 500.], LambdaFunc('x: x.jets[0].pt if len(x.jets) > 0 else -1')), Plot("jetPt2", ["TH1D", "jetPt2", "", 10, 0., 500.], LambdaFunc('x: x.jets[1].pt if len(x.jets) > 1 else -1')),
plot_range=[2, 0.5, 2.5], ), BaseObject( "cscSegmentRecord_localX", plot_range=[200, -100., 100.], ), BaseObject( "cscSegmentRecord_localY", plot_range=[200, -200., 200.], ), ] plots = [ Plot("Muon_" + p.name, [ "TH1D", "Muon_" + p.name, "", ] + p.plot_range, LambdaFunc("x: [m." + p.name + " for m in x.standAloneMuons]"), isCollection=True) for p in single_plot_cfgs ] + [ Plot("Muon_" + p.name, [ "TH1D", "Muon_" + p.name, "", ] + p.plot_range, LambdaFunc("x: [n for m in x.standAloneMuons for n in m." + p.name + "]"), isCollection=True) for p in vector_plot_cfgs ]
lumi = 41.4 nCores = 3 outputDir = system.getStoragePath() + "/" + User + "/Higgs/DarkZ/" + out_path nEvents = -1 disableProgressBar = False componentList = [ ZPlusX, ] justEndSequence = False general_plots = [ Plot( "Z1_mass", [ "TH1D", "Z1_mass", "", ] + mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), Plot( "Z2_mass", [ "TH1D", "Z2_mass", "", ] + mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), Plot("Z1_4e_mass", [ "TH1D",
nCores = 1 #outputDir = "/raid/raid7/lucien/SUSY/RA5/"+out_path outputDir = out_path nEvents = 100 disableProgressBar = False justEndSequence = False componentList = componentList[4:5] for dataset in componentList: if dataset.isMC: dataset.lumi = 35.9 for component in dataset.componentList: component.maxEvents = nEvents plots = [ Plot("nLepGood", ["TH1D", "nLepGood", "", 10, -0.5, 9.5], LambdaFunc('x: x.nLepGood[0]')), #Plot("nLepLoose_Mini", ["TH1D","nLepLoose_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nLepLoose_Mini[0]')), #Plot("nLepFO_Mini", ["TH1D","nLepFO_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nLepFO_Mini[0]')), #Plot("nLepFOVeto_Mini", ["TH1D","nLepFOVeto_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nLepFOVeto_Mini[0]')), #Plot("nTauSel_Mini", ["TH1D","nTauSel_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nTauSel_Mini[0]')), #Plot("nJet40_Mini", ["TH1D","nJet40_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nJet40_Mini[0]')), #Plot("nBJetMedium25_Mini", ["TH1D","nBJetMedium25_Mini","",10,-0.5,9.5], LambdaFunc('x: x.nBJetMedium25_Mini[0]')), #Plot("minMllSFOS_Mini", ["TH1D","minMllSFOS_Mini","",20,0.0,500.], LambdaFunc('x: x.minMllSFOS_Mini[0]')), #Plot("htJet40j_Mini", ["TH1D","htJet40j_Mini","",20,0.0,500.], LambdaFunc('x: x.htJet40j_Mini[0]')), #Plot("mhtJet40_Mini", ["TH1D","mhtJet40_Mini","",20,0.0,500.], LambdaFunc('x: x.mhtJet40_Mini[0]')), #Plot("JetSel_Mini_pt", ["TH1D","JetSel_Mini_pt","",10,0., 500.], LambdaFunc('x: x.JetSel_Mini_pt'), isCollection=True), #Plot("JetSel_Mini_eta", ["TH1D","JetSel_Mini_eta","",20,-3.,3.], LambdaFunc('x: x.JetSel_Mini_eta'), isCollection=True), #Plot("JetSel_Mini_phi", ["TH1D","JetSel_Mini_phi","",20,-3.,3.], LambdaFunc('x: x.JetSel_Mini_phi'), isCollection=True), #Plot("JetSel_Mini_btagCSV", ["TH1D","JetSel_Mini_btagCSV","",20,0.,1.], LambdaFunc('x: x.JetSel_Mini_btagCSV'), isCollection=True), #Plot("JetSel_Mini_mass", ["TH1D","JetSel_Mini_mass","",10,0., 200.], LambdaFunc('x: x.JetSel_Mini_mass'), isCollection=True),
out_path = "DarkPhotonSR/DataMCDistributions/2020-04-06_RunII/" User = os.environ['USER'] nCores = 5 outputDir = system.getStoragePath()+User+"/Higgs/HToZdZd/"+out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + dataSamples + sigSamples + rareBkgSamples justEndSequence = True skipHadd = False mZ12PlotRange = [14,4.,60.] var_mZ12_str = 'x: (x.massZ1[0]+x.massZ2[0])/2.' var_mZ1_str = 'x.massZ1[0]' var_mZ2_str = 'x.massZ2[0]' plots = [ Plot("mZ12_4e",["TH1D","mZ12_4e","",]+mZ12PlotRange,LambdaFunc(var_mZ12_str),selFunc=LambdaFunc('x: '+sel_4e_str)), Plot("mZ12_4mu",["TH1D","mZ12_4mu","",]+mZ12PlotRange,LambdaFunc(var_mZ12_str),selFunc=LambdaFunc('x: '+sel_4mu_str)), Plot("mZ12_2e2mu",["TH1D","mZ12_2e2mu","",]+mZ12PlotRange,LambdaFunc(var_mZ12_str),selFunc=LambdaFunc('x: '+sel_2mu2e_str+" or "+sel_2e2mu_str)), Plot("mZ1mZ2_4e",["TH2D","mZ1mZ2_4e","",]+mZ12PlotRange+mZ12PlotRange, LambdaFunc('x: ['+var_mZ1_str+','+var_mZ2_str+']'), selFunc=LambdaFunc('x: '+sel_4e_str),dim=2), Plot("mZ1mZ2_4mu",["TH2D","mZ1mZ2_4mu","",]+mZ12PlotRange+mZ12PlotRange, LambdaFunc('x: ['+var_mZ1_str+','+var_mZ2_str+']'), selFunc=LambdaFunc('x: '+sel_4mu_str),dim=2), Plot("mZ1mZ2_2e2mu",["TH2D","mZ1mZ2_2e2mu","",]+mZ12PlotRange+mZ12PlotRange, LambdaFunc('x: ['+var_mZ1_str+','+var_mZ2_str+']'), selFunc=LambdaFunc('x: '+sel_2mu2e_str+" or "+sel_2e2mu_str),dim=2), ] for sig in sigSamples: for p in plots: p.plotSetting.line_style_dict[sig.name] = 10 p.plotSetting.line_width_dict[sig.name] = 4 for dataset in componentList: for component in dataset.componentList: component.maxEvents = nEvents
from Plotter.Plotter import Plotter from Plotter.PlotEndModule import PlotEndModule from Plotter.Plot import Plot out_path = "WrongFC/DataMCDistributions/SkimTree_WrongFC_Run2016Data_v1/2018-12-10_SR/" mZ1PlotRange = [40, 40., 120.] mZ2PlotRange = [60, 0., 120.] h4lPlotRange = [110, 60., 500.] general_plots = [] general_plots.extend([ Plot( "Z1_mass", [ "TH1D", "Z1_mass", "", ] + mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), #selFunc=LambdaFunc(region_sel_str_whole) ), Plot( "Z2_mass", [ "TH1D", "Z2_mass", "", ] + mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), #selFunc=LambdaFunc(region_sel_str_whole) ), Plot( "h4L_mass",
radcut = RADIUSCUT binwidth = BINWIDTH zoom = ZOOM L = radcut + zoom binwstr = str(binwidth) radstr = str(radcut) mZ1PlotRange = [125, 0, 62.5] # ensures that all plots have same binwidth mZ2PlotRange = mZ1PlotRange h4lPlotRange = [70,60.,200.] #h4lPlotRange = [140,60.,200.] #____________________________________________________________________________________________________ # Plots signif_plots = [ Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs4e",["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs4e","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole + "and x.mass4e[0] > 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] < 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11")), Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs4mu",["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs4mu","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole + "and x.mass4e[0] < 0 and x.mass4mu[0] > 0 and x.mass2e2mu[0] < 0")), Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs2e2mu",["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs2e2mu","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole + "and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13")), Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs2mu2e",["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs2mu2e","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole + "and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11")), #Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs4e_rcutRADIUSCUTGeV_binwid"+binwstr,["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs4e_rcutRADIUSCUTGeV_binwid"+binwstr,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +'and x.mass4e[0] > 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] < 0')), #Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs4mu_rcutRADIUSCUTGeV_binwid"+binwstr,["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs4mu_rcutRADIUSCUTGeV_binwid"+binwstr,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +'and x.mass4e[0] < 0 and x.mass4mu[0] > 0 and x.mass2e2mu[0] < 0')), #Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs2e2mu_rcutRADIUSCUTGeV_binwid"+binwstr,["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs2e2mu_rcutRADIUSCUTGeV_binwid"+binwstr,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +'and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13')), #Plot("Z1mass_vs_Z2mass_mZdZDMASS_fs2mu2e_rcutRADIUSCUTGeV_binwid"+binwstr,["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_fs2mu2e_rcutRADIUSCUTGeV_binwid"+binwstr,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +'and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11')), ] #signif_plots = [] #for cut in range(1,6): # cut = str(cut) # signif_plots.append( # Plot("Z1mass_vs_Z2mass_r=%sGeV"%cut,["TH2D","Z1mass_vs_Z2mass_r=%s"%cut,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(float(cut)**2)))
binwstr = str(binwidth).replace('.','p') radcutstr = str(radcut).replace('.','p') zdmass_str = str(ZDMASS) #zdmass_str = str(ZDMASS) if ZDMASS>9 else '0'+str(ZDMASS) mZ1PlotRange = [int(2*Lmax/binwidth), zdmass-Lmax, zdmass+Lmax] # ensures that all plots have same binwidth mZ2PlotRange = mZ1PlotRange h4lPlotRange = [70,60.,200.] #h4lPlotRange = [140,60.,200.] #____________________________________________________________________________________________________ # Plots signif_plots = [ #Plot("Z1mass_vs_Z2massTEST",["TH2D","Z1mass_vs_Z2mass","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(region_sel_str_whole)), #Plot("Z1mass_vs_Z2mass_mZdZDMASS_finalstate=4e_radiuscut=RADIUSCUTGeV",["TH2D","Z1mass_vs_Z2mass_mZdZDMASS_finalstate=4e_radiuscut=RADIUSCUTGeV","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(radiuscut**2) and x.mass4e[0] > 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] < 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11)), Plot("Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs4e_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV",["TH2D","Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs4e_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +' and x.mass4e[0] > 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] < 0')), Plot("Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs4mu_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV",["TH2D","Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs4mu_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +' and x.mass4e[0] < 0 and x.mass4mu[0] > 0 and x.mass2e2mu[0] < 0')), Plot("Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs2e2mu_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV",["TH2D","Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs2e2mu_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +' and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13')), Plot("Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs2mu2e_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV",["TH2D","Z1mass_vs_Z2mass_mZd"+zdmass_str+"_fs2mu2e_rcut"+radcutstr+"GeV_binwid"+binwstr+"GeV","",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(RADIUSCUT**2) +' and x.mass4e[0] < 0 and x.mass4mu[0] < 0 and x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11')), ] #signif_plots = [] #for cut in range(1,6): # cut = str(cut) # signif_plots.append( # Plot("Z1mass_vs_Z2mass_r=%sGeV"%cut,["TH2D","Z1mass_vs_Z2mass_r=%s"%cut,"",]+mZ1PlotRange+mZ2PlotRange, LambdaFunc('x: [x.massZ1[0],x.massZ2[0]]'), dim=2, selFunc=LambdaFunc(Z1vsZ2_radius+'<'+str(float(cut)**2))) # ) muon_plots = [ ]
from Plotter.PlotEndModule import PlotEndModule from Plotter.Plot import Plot #out_path = "DataMCDistributions/SkimTree_ZXCR_HIG-16-041Selection_Run2016DataMC_v2/2018-08-23/" out_path = "ZPlusX/DataMCDistributions/SkimTree_PedjaInput_HIG-16-041/2018-09-24/" mZ1PlotRange = [40,40.,120.] mZ2PlotRange = [30,0.,60.] #h4lPlotRange = [110,60.,500.] h4lPlotRange = [55,60.,500.] #h4lPlotRange = [20,100.,140.] general_plots = [] eachCR = "3p1f" general_plots.extend([ Plot("Z1_mass_"+eachCR, ["TH1D","Z1_mass_"+eachCR,"",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), ), Plot("Z2_mass_"+eachCR, ["TH1D","Z2_mass_"+eachCR,"",]+mZ2PlotRange, LambdaFunc('x: x.massZ2[0]'), ), Plot("h4L_mass_"+eachCR, ["TH1D","h4L_mass_"+eachCR,"",]+h4lPlotRange, LambdaFunc('x: x.mass4l[0]'), ), Plot("met_"+eachCR, ["TH1D","met_"+eachCR,"",40,0.,200.], LambdaFunc('x: x.met[0]'), ), Plot("nVtx_"+eachCR, ["TH1D","nVtx_"+eachCR,"",30,0.0,60.0], LambdaFunc('x: x.nVtx[0]'), ), ]) plots = general_plots #for plot in plots: # plot.plotSetting.divideByBinWidth = True nCores = 5 outputDir = "/raid/raid7/lucien/Higgs/DarkZ/"+out_path nEvents = -1 disableProgressBar = False #componentList = [DYJetsToLL_M50,DYJetsToLL_M10To50,WZTo3LNu,TTJets,Data_Run2016,predCR]