class CustomVariable(LambdaFunc): def __init__(self, inputStr, selStr="x: True", globalSelStr="x: True"): super(CustomVariable, self).__init__(inputStr) self.selFunc = LambdaFunc(selStr) self.globalSelFunc = LambdaFunc(globalSelStr) def end(self): if hasattr(self, "func"): del self.func if hasattr(self, "selFunc"): self.selFunc.end() if hasattr(self, "globalSelFunc"): self.globalSelFunc.end()
def makeEvalDict(self, bsfDict): evalDict = {} for op, measDict in bsfDict.iteritems(): if op not in evalDict: evalDict[op] = {} for meas, sysDict in measDict.iteritems(): if meas not in evalDict[op]: evalDict[op][meas] = {} for sys, flavDict in sysDict.iteritems(): if sys not in evalDict[op][meas]: evalDict[op][meas][sys] = {} for flav, etaptDict in flavDict.iteritems(): if flav not in evalDict[op][meas][sys]: evalDict[op][meas][sys][flav] = {} for etapt, sf in etaptDict.iteritems(): #evalDict[op][meas][sys][flav][etapt] = eval("lambda x: "+bsfDict[op][meas][sys][flav][etapt]) evalDict[op][meas][sys][flav][etapt] = LambdaFunc( "x: " + bsfDict[op][meas][sys][flav][etapt]) return evalDict
justEndSequence = False for dataset in componentList: if dataset.isMC: dataset.lumi = lumi for component in dataset.componentList: component.maxEvents = nEvents statProducer = StatInputProducer("StatInputProducer", systList = [], channelDict = { "MuMu": BaseObject( "MuMu", histKey = "MuMu", setting = ["TH2D","MuMu","",800,0.,80.,800,0.,80.,], selFunc = LambdaFunc('x: abs(x.idL1[0]) == 13 and abs(x.idL2[0]) == 13 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13'), fillFunc = LambdaFunc('x: [x.massZ1[0],x.massZ2[0],x.weight,]'), ), "ElEl": BaseObject( "ElEl", histKey = "ElEl", setting = ["TH2D","ElEl","",800,0.,80.,800,0.,80.,], selFunc = LambdaFunc('x: abs(x.idL1[0]) == 11 and abs(x.idL2[0]) == 11 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11'), fillFunc = LambdaFunc('x: [x.massZ1[0],x.massZ2[0],x.weight,]'), ), "ElMu": BaseObject( "ElMu", histKey = "ElMu", setting = ["TH2D","ElMu","",800,0.,80.,800,0.,80.,], selFunc = LambdaFunc('x: abs(x.idL1[0]) == 11 and abs(x.idL2[0]) == 11 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13'), fillFunc = LambdaFunc('x: [x.massZ1[0],x.massZ2[0],x.weight,]'),
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.],
#componentList = [sigSampleDict[40]] #componentList = sigSampleDict.values() justEndSequence = False skipGitDetail = True mvaSkim = True for dataset in componentList: if dataset.isMC: dataset.lumi = lumi for component in dataset.componentList: component.maxEvents = nEvents mu_ch_sel_str = 'abs(event.idL1[0]) == 13 and abs(event.idL2[0]) == 13 and abs(event.idL3[0]) == 13 and abs(event.idL4[0]) == 13' input_channel_dict = { "4mu": LambdaFunc('event: ' + mu_ch_sel_str), } sequence = signal_sequence yieldProducer = ParaYieldProducer( "ParaYieldProducer", channelDict=input_channel_dict, ) if mvaSkim: mvaSkimmer = MVASkimmer( "MVSkimmer", BaseObject( "MVASetting", modelPath= "/raid/raid7/lucien/AnalysisCode/ML/Zprime-ML/result/2019-06-04_Run2017_qqZZ-zpToMuMu-M40_m4l-cosTheta1-cosTheta2-cosThetaStar-phi-phi1/mlp-classifier.pkl", threshold=0.45,
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),
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 ]
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, LambdaFunc("x: " + var_muMass_str), selFunc=LambdaFunc("x: len(x.leptons_matched) >= 2")),
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)))
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
import ROOT,os,copy User = os.environ['USER'] out_path = "DarkPhotonSR/DataMCDistributions/2020-04-06_RunII/" #end_out_path = "DarkPhotonSR/DataMCDistributions/2020-04-06_RunII/" end_out_path = "DarkPhotonSR/DataMCDistributions/2020-06-04_RunII/" nCores = 3 outputDir = system.getStoragePath()+"/"+User+"/Higgs/DarkZ/"+out_path nEvents = -1 disableProgressBar = False skipHadd = True componentList = bkgSamples + dataSamples + sigSamples mZ2PlotRange = [36,0.,36.] plot_el = Plot("mZ2_el",["TH1D","mZ2_el","",]+mZ2PlotRange, LambdaFunc('x: '+var_mZ2_str), selFunc=LambdaFunc('x: '+sel_4e_str+" or "+sel_2mu2e_str)) plot_mu = Plot("mZ2_mu",["TH1D","mZ2_mu","",]+mZ2PlotRange, LambdaFunc('x: '+var_mZ2_str), selFunc=LambdaFunc('x: '+sel_4mu_str+" or "+sel_2e2mu_str)) plots = [ plot_el, plot_mu, ] #inputShapeFile = ROOT.TFile(os.path.join(outputDir,"ZPlusX","shape.root"),"READ") inputShapeFile = ROOT.TFile(os.path.join(outputDir,"ZPlusX","PlotShape.root"),"READ") for p in plots: p.plotSetting.tdr_style = True p.plotSetting.divideByBinWidth = False p.plotSetting.cms_lumi = CMS_lumi p.plotSetting.skip_leg_err = True p.plotSetting.skip_data_mc_ratio = False
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", "Z1_4e_mass", "", ] + mZ1PlotRange,
justEndSequence = False sequence = MuonSequence # _____________________________________________________________________________ || muonVarsToWrite = [ CustomVariable("x: x.pt"), CustomVariable("x: x.eta"), CustomVariable("x: x.phi"), CustomVariable("x: x.charge"), ] muonCSVFileSetting = CSVFileSetting("muon_csv", ["muon.csv", "w"]) muonCSVFileProducer = CSVFileProducer( "CSVFileProducer", muonVarsToWrite, muonCSVFileSetting, objectFunc=LambdaFunc("x: x.standAloneMuons"), globalSelFunc=LambdaFunc("x: x.numberOfSegments > 4"), ) sequence.add(muonCSVFileProducer) # _____________________________________________________________________________ || for seg_var in [ "globalX", "globalY", "endcap", "chamber", "station", "ring", ]: segmentVarsToWrite = [] for i in range(n_max_segment):
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') ), #Plot("Z1_2mu2e_mass", ["TH1D","Z1_2mu2e_mass","",]+mZ1PlotRange, LambdaFunc('x: x.massZ1[0]'), selFunc=LambdaFunc('x: x.mass2e2mu[0] > 0 and abs(x.idL3[0]) == 11 and abs(x.idL4[0]) == 11') ),
#out_path = "DarkPhotonSR/StatInput/2019-03-29_136p1_RatioCut0p02/" #out_path = "DarkPhotonSR/StatInput/2019-07-18_Run2016/" #out_path = "DarkPhotonSR/StatInput/2019-08-19_Run2016/" #out_path = "DarkPhotonSR/StatInput/2019-08-21_Run2016/" #out_path = "DarkPhotonSR/StatInput/2019-09-06_Run2016/" out_path = "DarkPhotonSR/StatInput/2019-12-02_Run2016/" lumi = 35.9 nCores = 5 outputDir = system.getStoragePath() + User + "/Higgs/HToZdZd/" + out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + [ data2016, ] + sigSamples justEndSequence = False eventSelection = LambdaFunc( "x: (x.massZ1[0]-x.massZ2[0])/(x.massZ1[0]+x.massZ2[0]) < 0.05") for dataset in componentList: if dataset.isMC: dataset.lumi = lumi for component in dataset.componentList: component.maxEvents = nEvents statProducer = ParaYieldProducer( "ParaYieldProducer", systList=[], channelDict={ "MuMu": LambdaFunc( 'x: abs(x.idL1[0]) == 13 and abs(x.idL2[0]) == 13 and abs(x.idL3[0]) == 13 and abs(x.idL4[0]) == 13' ),
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.], LambdaFunc('x: x.Z2.lep2.vec.Pt()'),
#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], LambdaFunc('x: x.NJetsCSVwithSF_JetSubCalc[0]'),
component.maxEvents = nEvents mu_Z1_ch_sel_str = 'abs(event.idL1[0]) == 13 and abs(event.idL2[0]) == 13' el_Z1_ch_sel_str = 'abs(event.idL1[0]) == 11 and abs(event.idL2[0]) == 11' mu_Z2_ch_sel_str = 'abs(event.idL3[0]) == 13 and abs(event.idL4[0]) == 13' el_Z2_ch_sel_str = 'abs(event.idL3[0]) == 11 and abs(event.idL4[0]) == 11' #mu_ch_sel_str = 'abs(event.idL3[0]) == 13 and abs(event.idL4[0]) == 13' #el_ch_sel_str = 'abs(event.idL3[0]) == 11 and abs(event.idL4[0]) == 11' higgsSR_sel_str = 'event.mass4l[0] > 118. and event.mass4l[0] < 130.' higgsSB_sel_str = 'not (event.mass4l[0] > 118. and event.mass4l[0] < 130.) and event.mass4l[0] > 100. and event.mass4l[0] < 170.' higgsLowSB_sel_str = 'event.mass4l[0] > 100. and event.mass4l[0] < 118.' higgsHighSB_sel_str = 'event.mass4l[0] > 130. and event.mass4l[0] < 170.' input_channel_dict = { "MuMu_HiggsSR": LambdaFunc( 'event: ' + ' and '.join([mu_Z1_ch_sel_str, mu_Z2_ch_sel_str, higgsSR_sel_str])), "MuMu_HiggsLowSB": LambdaFunc('event: ' + ' and '.join( [mu_Z1_ch_sel_str, mu_Z2_ch_sel_str, higgsLowSB_sel_str])), "MuMu_HiggsHighSB": LambdaFunc('event: ' + ' and '.join( [mu_Z1_ch_sel_str, mu_Z2_ch_sel_str, higgsHighSB_sel_str])), "ElMu_HiggsSR": LambdaFunc( 'event: ' + ' and '.join([el_Z1_ch_sel_str, mu_Z2_ch_sel_str, higgsSR_sel_str])), "ElMu_HiggsLowSB": LambdaFunc('event: ' + ' and '.join( [el_Z1_ch_sel_str, mu_Z2_ch_sel_str, higgsLowSB_sel_str])), "ElMu_HiggsHighSB":
#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') ),
from DarkZ.StatTools.Syst import Syst from DarkZ.Producer.VariableProducer import VariableProducer 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 from DarkZ.Config.MergeSampleDict import mergeSampleDict import copy Data_3P1F_Run2018 = copy.deepcopy(Data_Run2018) Data_3P1F_Run2018.name = "Data_3P1F" Data_3P1F_Run2018.selection = LambdaFunc("x: x.nFailedLeptonsZ2[0] == 1") Data_2P2F_Run2018 = copy.deepcopy(Data_Run2018) Data_2P2F_Run2018.name = "Data_PredCR_2P2F" Data_2P2F_Run2018.selection = LambdaFunc("x: x.nFailedLeptonsZ2[0] == 2") #out_path = "ParaInput/ZXCR_m4l130To170_Nominal/2019-06-18_v1_Run2018/" out_path = "ParaInput/ZXCR_m4l130To170_HZZ/2019-06-18_v1_Run2018/" User = os.environ['USER'] nCores = 5 outputDir = system.getStoragePath() + "/lucien/Higgs/DarkZ/" + out_path nEvents = -1 disableProgressBar = False componentList = [Data_3P1F_Run2018, Data_2P2F_Run2018, WZTo3LNu] justEndSequence = False #eventSelection = LambdaFunc("x: x.mass4l[0] > 130.")
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, LambdaFunc('x: ' + var_m4l_str), selFunc=LambdaFunc('x: ' + sel_4e_str)),
from DarkZ.Config.MergeSampleDict import mergeSampleDict from DarkZ.Config.PlotDefinition import * #out_path = "DarkPhotonSB/DataMCDistributions/2019-04-02_Run2018_m4l105To118/" #out_path = "DarkPhotonSB/DataMCDistributions/2019-04-02_Run2018_m4l130To140/" out_path = "DarkPhotonSB/DataMCDistributions/2019-05-20_Run2018_m4l70-100/" #out_path = "DarkPhotonSB/DataMCDistributions/2019-05-20_Run2018_m4l170-200/" lumi = 59.7 nCores = 2 outputDir = system.getStoragePath()+"/lucien/Higgs/DarkZ/"+out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + [data2018] #+ [HZZd_M4,HZZd_M15,HZZd_M30,] justEndSequence = False eventSelection = LambdaFunc("x: x.mass4l[0] > 70. and x.mass4l[0] < 100.") #eventSelection = LambdaFunc("x: x.mass4l[0] > 170. and x.mass4l[0] < 200.") plots = general_4e_plots + general_2mu2e_plots + general_4mu_plots + general_2e2mu_plots for p in plots: if "m4l" in p.key: p.rootSetting = p.rootSetting[:3]+[30-1,array.array('d',[60.*1.02**i for i in range(30)]),] if "mZ2" in p.key: p.rootSetting = p.rootSetting[:3]+[23,4.,50.] #if "m4l" in p.key: p.rootSetting = p.rootSetting[:3]+[15,170.,200.] #if "mZ2" in p.key: p.rootSetting = p.rootSetting[:3]+[50,0.,100.] for dataset in componentList: if dataset.isMC: dataset.lumi = lumi for component in dataset.componentList: component.maxEvents = nEvents
#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 = 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')),
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", [ "TH1D", "h4L_mass",
nCores = 1 outputDir = system.getStoragePath()+User+"/Higgs/HToZdZd/"+out_path nEvents = -1 disableProgressBar = False #componentList = [c for c in bkgSamples if any([key in c.name for key in ["ggH","VBF","WHplus","WHminus","ZH",]]) ] componentList = [c for c in bkgSamples if any([key in c.name for key in ["ggH",]]) ] justEndSequence = False skipHadd = False for dataset in componentList: for component in dataset.componentList: component.maxEvents = nEvents sequence = darkphoton_signal_unblind_sequence varsToWrite = [ LambdaFunc("x: x.pTL1[0]"), LambdaFunc("x: x.pTL2[0]"), LambdaFunc("x: x.pTL3[0]"), LambdaFunc("x: x.pTL4[0]"), LambdaFunc("x: x.etaL1[0]"), LambdaFunc("x: x.etaL2[0]"), LambdaFunc("x: x.etaL3[0]"), LambdaFunc("x: x.etaL4[0]"), LambdaFunc("x: x.phiL1[0]"), LambdaFunc("x: x.phiL2[0]"), LambdaFunc("x: x.phiL3[0]"), LambdaFunc("x: x.phiL4[0]"), LambdaFunc("x: x.etaL21"), LambdaFunc("x: x.etaL31"), LambdaFunc("x: x.etaL41"), LambdaFunc("x: x.phiL21"),
#out_path = "MCDistributions/MC_BaselineSelection_v1/2018-07-09/" #out_path = "StatInput/DarkPhotonSelection_v1/2018-08-20/" #out_path = "StatInput/DarkPhotonSelection_ATLAS-BrHToZZd100_v1/2018-08-20/" #out_path = "StatInput/DarkPhotonSelection_m4l118To130/2018-08-31/" #out_path = "StatInput/DarkPhotonSelection_m4l118To130_Nominal/2018-09-21/" #out_path = "StatInput/DarkPhotonSelection_m4l118To130_Nominal/2018-10-24_DarkPhotonSR-Unblinding/" #out_path = "StatInput/DarkPhotonSelection_m4l118To130_Nominal/2018-10-25_DarkPhotonSR-Unblinding/" #out_path = "ParaInput/DarkPhotonSelection_m4l118To130_Nominal/2018-11-21_DarkPhotonSR_mZ2-35_Norm/" #out_path = "ParaInput/DarkPhotonSelection_m4l118To130_Nominal/2019-03-29_DarkPhotonSR_mZ2-35_Norm/" #out_path = "ParaInput/DarkPhotonSelection_m4l100To170_Nominal/2019-04-04_DarkPhotonSR_mZ2-35_Norm/" out_path = "ParaInput/DarkPhotonSelection_m4l100To170_Nominal/2019-04-04_DarkPhotonSR_mZ2-35_Norm_qqZZXs0p04pb/" #out_path = "StatInput/DarkPhotonSelection_m4l118To130_UniformIso/2018-09-21/" #out_path = "StatInput/DarkPhotonSelection_m4l105To140/2018-08-31/" syst_list = [ Syst("FRUniIso", LambdaFunc("x: x.weight_FRUniIso")), Syst("FRAsymIso", LambdaFunc("x: x.weight_FRAsymIso")), ] User = os.environ['USER'] nCores = 5 outputDir = "/raid/raid7/" + User + "/Higgs/DarkZ/" + out_path nEvents = -1 disableProgressBar = False componentList = bkgSamples + sigSamples + [data2016] + ppZZdSamples justEndSequence = False skipGitDetail = True for dataset in componentList: if dataset.isMC: dataset.lumi = 136.1
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( "Z2_mass",
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 = [ ]
#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),