(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator( 'ee_singleelectron_nominal/ntuple', '/ceph/jbechtel/2018/scalefactors/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1.root' ), 'Data': analysis.TTreeEvaluator( 'ee_singleelectron_nominal/ntuple', '/ceph/jbechtel/2018/scalefactors/EGamma_Run2018C_17Sep2018v1_13TeV_MINIAOD/EGamma_Run2018C_17Sep2018v1_13TeV_MINIAOD.root' ), 'Embedding': analysis.TTreeEvaluator( 'ee_singleelectron_nominal/ntuple', '/ceph/jbechtel/2018/scalefactors/Embedding2018C_ElectronEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1/Embedding2018C_ElectronEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1.root' ) } for sample in trees: outfile = ROOT.TFile('output_17_5/ZeeTP_%s.root' % sample, 'RECREATE')
andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYplusSUSY': analysis.TTreeEvaluator('inclusive/GenTau', 'output/HTT2016Studies_genTau/DYplusSUSY.root') #'DYJetsToLL': analysis.TTreeEvaluator('inclusive/GenTau', 'output/HTT2016Studies_genTau/DYJetsToLLM50.root')#, #'Data': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_v16_2/ZmmTP/SingleMuon.root') #, #'DataB': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonB.root'), #'DataC': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonC.root'), #'DataD': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonD.root'), #'DataE': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonE.root'), #'DataF': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonF.root'), #'DataG': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonG.root'), #'DataH': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonH.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('genTau_truth/genTau_%s.root' % sample, 'RECREATE')
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator( 'inclusive/GenElectron', 'output/HTT2016Studies_Truth1/GenElectron/DYJetsToLLM50.root'), #'EmbeddingMC': analysis.TTreeEvaluator('inclusive/GenElectron', 'output/HTT2016Studies_Truth1/GenElectron/EmbeddingMC.root'), 'EmbeddingData': analysis.TTreeEvaluator( 'inclusive/GenElectron', 'output/HTT2016Studies_Truth1/GenElectron/EmbeddingData.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('genElectron_truth/genElectron_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True)
cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j), )) andable.add('%s>=%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinLowEdge(i))) andable.add('%s<%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinUpEdge(i))) andable.add('%s>=%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinLowEdge(j))) andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append((cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append((cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_v16_2_truth/ZeeTP/DYJetsToLLM50.root'), #'Data': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_v16_2/ZeeTP/SingleElectron.root') #'DataB': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronB.root'), #'DataC': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronC.root'), #'DataD': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronD.root'), #'DataE': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronE.root'), #'DataF': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronF.root'), #'DataG': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronG.root'), #'DataH': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronH.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('v16_2_truthZ/ZeeTP_%s.root' % sample, 'RECREATE')
cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j), )) andable.add('%s>=%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinLowEdge(i))) andable.add('%s<%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinUpEdge(i))) andable.add('%s>=%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinLowEdge(j))) andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append((cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append((cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator('tt_nominal/GenTau', 'output/GenTau/DYJetsToLLM50.root'), #'EmbeddingMC': analysis.TTreeEvaluator('inclusive/GenMuon', 'output/HTT2016Studies_Truth1/GenMuon/EmbeddingMC.root'), 'EmbeddingData': analysis.TTreeEvaluator('tt_nominal/GenTau', 'output/GenTau/Embedding2017B.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('genTau_truth/genTau_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True) i = 0 for cfg in bin_cfgs: wsp = ROOT.RooWorkspace('wsp_'+cfg['name'], '') var = wsp.factory('pt_p[99,10,1000]')
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator( 'inclusive/ZeeTP', 'output/HTT2016Studies_v16_2/ZeeTP/DYJetsToLLM50.root'), 'Data': analysis.TTreeEvaluator( 'inclusive/ZeeTP', 'output/HTT2016Studies_v16_2/ZeeTP/SingleElectron.root') #'DataB': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronB.root'), #'DataC': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronC.root'), #'DataD': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronD.root'), #'DataE': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronE.root'), #'DataF': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronF.root'), #'DataG': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronG.root'), #'DataH': analysis.TTreeEvaluator('inclusive/ZeeTP', 'output/HTT2016Studies_Jan16/ZeeTP/SingleElectronH.root') } # sys.exit(0)
cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j), )) andable.add('%s>=%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinLowEdge(i))) andable.add('%s<%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinUpEdge(i))) andable.add('%s>=%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinLowEdge(j))) andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append((cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append((cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator('ZeeTP', 'output/HTT2016Studies_July19/DYJetsToLL.root'), 'Data': analysis.TTreeEvaluator('ZeeTP', 'output/HTT2016Studies_July19/SingleElectron.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('ZeeTP_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True) i = 0 for cfg in bin_cfgs: wsp = ROOT.RooWorkspace('wsp_'+cfg['name'], '') var = wsp.factory('m_ll[100,75,125]')
andable.add('%s<%g' % (cfg['binvar_x'], hist.GetXaxis().GetBinUpEdge(i))) andable.add('%s>=%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinLowEdge(j))) andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append((cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append((cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { #'Embedding': analysis.TTreeEvaluator('mm_nominal/ZmmTP', 'tp_files/MuonEmbedding2017.root'), #'DY': analysis.TTreeEvaluator('mm_nominal/ZmmTP', 'tp_files/DYJetsToLL_mm_2017.root'), #'Data_sM': analysis.TTreeEvaluator("mm_nominal/ZmmTP", 'tp_files/SingleMuon2017.root') 'Data': analysis.TTreeEvaluator('mm_nominal/ZmmTP', 'tp_files/DoubleMuon2017.root') } for sample in trees: outfile = ROOT.TFile('output/ZmmTP_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True) i = 0 for cfg in bin_cfgs: wsp = ROOT.RooWorkspace('wsp_'+cfg['name'], '') var = wsp.factory('m_ll[100,75,125]') outfile.cd() outfile.mkdir(cfg['name']) ROOT.gDirectory.cd(cfg['name'])
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator( 'inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/DYJetsToLLM50.root'), 'Data': analysis.TTreeEvaluator( 'inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuon.root') #, #'DataB': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonB.root'), #'DataC': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonC.root'), #'DataD': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonD.root'), #'DataE': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonE.root'), #'DataF': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonF.root'), #'DataG': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonG.root'), #'DataH': analysis.TTreeEvaluator('inclusive/ZmmTP', 'output/HTT2016Studies_Jan12/ZmmTP/SingleMuonH.root') } # sys.exit(0)
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) ' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'Embedding': analysis.TTreeEvaluator( 'mm_new_nominal/ntuple', '/storage/9/sbrommer/artus_outputs/TPZmm/2018-11-06/output/Muon_Embedding.root' ), 'DY': analysis.TTreeEvaluator( 'mm_new_nominal/ntuple', '/storage/9/sbrommer/artus_outputs/TPZmm/2018-11-06/output/Muon_DY.root' ), 'Data_sm': analysis.TTreeEvaluator( "mm_new_nominal/ntuple", '/storage/9/sbrommer/artus_outputs/TPZmm/2018-10-10/output/SingleMuon.root' ), # 'Data': analysis.TTreeEvaluator('mm_new_nominal/ntuple', '/storage/9/sbrommer/artus_outputs/TPZmm/2018-11-06/output/DoubleMuon.root') } for sample in trees:
andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator('ZmmTP', 'output/HTT2016Studies_Aug5/DYJetsToLL.root'), 'Data': analysis.TTreeEvaluator('ZmmTP', 'output/HTT2016Studies_Aug5/SingleMuon.root') } # sys.exit(0) for sample in trees: outfile = ROOT.TFile('ZmmTP_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True) i = 0 for cfg in bin_cfgs: wsp = ROOT.RooWorkspace('wsp_' + cfg['name'], '') var = wsp.factory('m_ll[100,75,125]')
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator( 'ee_crosselectron/ntuple', 'files_crosselectron/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1.root' ), 'Data': analysis.TTreeEvaluator( 'ee_crosselectron/ntuple', 'files_crosselectron/EGamma_Run2018C_17Sep2018v1_13TeV_MINIAOD/EGamma_Run2018C_17Sep2018v1_13TeV_MINIAOD.root' ), 'Embedding': analysis.TTreeEvaluator( 'ee_crosselectron/ntuple', 'files_crosselectron/Embedding2018C_ElectronEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1/Embedding2018C_ElectronEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1.root' ) } #trees = { # 'Embedding': analysis.TTreeEvaluator('ee_crosselectron/ntuple', 'files_3/emb.root')#, # 'DYJetsToLL': analysis.TTreeEvaluator('ee_crosselectron/ntuple', 'files_3/mc.root'),
andable.add('%s<%g' % (cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) * wt' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'DYJetsToLL': analysis.TTreeEvaluator('ee_nominal/ZeeTP', 'tp_files/DYJetsToLL_ee_2017.root'), 'Data': analysis.TTreeEvaluator('ee_nominal/ZeeTP', 'tp_files/SingleElectron2017.root'), 'Embedding': analysis.TTreeEvaluator('ee_nominal/ZeeTP', 'tp_files/ElectronEmbedding2017.root') } for sample in trees: outfile = ROOT.TFile('output/ZeeTP_%s.root' % sample, 'RECREATE') hists = trees[sample].Draw(drawlist, compiled=True) i = 0 for cfg in bin_cfgs:
(cfg['binvar_y'], hist.GetYaxis().GetBinUpEdge(j))) for b in cfg['bins']: drawlist.append( (cfg['var'], '((%s) && !(%s) && (%s))' % (b, cfg['probe'], cfg['tag']))) drawlist.append( (cfg['var'], '((%s) && (%s) && (%s)) ' % (b, cfg['probe'], cfg['tag']))) andable.add(cfg['probe']) andable.add(cfg['tag']) trees = { 'Embedding': analysis.TTreeEvaluator( 'mm_crossmuon/ntuple', 'files_mu18tauXX/Embedding2018C_MuonEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1/Embedding2018C_MuonEmbedding_inputDoubleMu102XminiAODv1_13TeV_USER_v1.root' ), 'DY': analysis.TTreeEvaluator( 'mm_crossmuon/ntuple', 'files_mu18tauXX/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1/DYJetsToLLM50_RunIIAutumn18MiniAOD_102X_13TeV_MINIAOD_madgraph-pythia8_v1.root' ), 'Data_sm': analysis.TTreeEvaluator( "mm_crossmuon/ntuple", 'files_mu18tauXX/SingleMuon_Run2018C_17Sep2018v1_13TeV_MINIAOD/SingleMuon_Run2018C_17Sep2018v1_13TeV_MINIAOD.root' ), # 'Data': analysis.TTreeEvaluator('mm_new_nominal/ntuple', '/storage/9/sbrommer/artus_outputs/TPZmm/2018-11-06/output/DoubleMuon.root') } #trees = { # 'Embedding': analysis.TTreeEvaluator('mm_crossmuon/ntuple', 'files_3/emb.root')#,