diff --git a/cmsdb/campaigns/run3_2022_postEE_nano_tau_skim_2025_v1/bkgs.py b/cmsdb/campaigns/run3_2022_postEE_nano_tau_skim_2025_v1/bkgs.py index 59c16663..cb26717b 100644 --- a/cmsdb/campaigns/run3_2022_postEE_nano_tau_skim_2025_v1/bkgs.py +++ b/cmsdb/campaigns/run3_2022_postEE_nano_tau_skim_2025_v1/bkgs.py @@ -111,10 +111,10 @@ def add_merged_datasets(dataset_rows, cpn, procs): ("WWZ_4F", ["/WWZ_4F"], 5249916, 14, 515645709, "wwz" ), ("WZ", ["/WZ"], 26722782, 26, 1690550817, "wz" ), ("WZZ", ["/WZZ"], 5229208, 14, 363955451, "wzz" ), - ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 63910, 1, 2986674282, "wh_htt" ), - ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 66154, 1, 2058886370, "wh_htt" ), + ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 63910, 1, 2986674282, "w_minus_h_htt_UU" ), + ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 66154, 1, 2058886370, "w_plus_h_htt_UU" ), ("WtoLNu_amcatnloFXFX", ["/WtoLNu_amcatnloFXFX"], 195475400, 261, 1538031583, "w_lnu" ), - ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 69650, 1, 1072228519, "zh_htt" ), + ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 69650, 1, 1072228519, "zh_htt_UU" ), ("ZZ", ["/ZZ"], 4043040, 4, 3513629804, "zz" ), ("ZZZ", ["/ZZZ"], 5063206, 11, 493426600, "zzz" ), ] diff --git a/cmsdb/campaigns/run3_2022_preEE_nano_tau_skim_2025_v1/bkgs.py b/cmsdb/campaigns/run3_2022_preEE_nano_tau_skim_2025_v1/bkgs.py index d7a0e654..95d9d890 100644 --- a/cmsdb/campaigns/run3_2022_preEE_nano_tau_skim_2025_v1/bkgs.py +++ b/cmsdb/campaigns/run3_2022_preEE_nano_tau_skim_2025_v1/bkgs.py @@ -113,10 +113,10 @@ def add_merged_datasets(dataset_rows, cpn, procs): ("WWZ_4F", ["/WWZ_4F"], 1774030, 5, 2917961763, "wwz" ), ("WZ", ["/WZ"], 7479528, 8, 3919470500, "wz" ), ("WZZ", ["/WZZ"], 1806418, 5, 2297343689, "wzz" ), - ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 27789, 1, 1056944567, "wh_htt" ), - ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 28300, 1, 1400713916, "wh_htt" ), + ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 27789, 1, 1056944567, "w_minus_h_htt_UU" ), + ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 28300, 1, 1400713916, "w_plus_h_htt_UU" ), ("WtoLNu_amcatnloFXFX", ["/WtoLNu_amcatnloFXFX"], 55638210, 84, 3758145551, "w_lnu" ), - ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 28992, 1, 4033200945, "zh_htt" ), + ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 28992, 1, 4033200945, "zh_htt_UU" ), ("ZZ", ["/ZZ"], 1181750, 2, 1546658281, "zz" ), ("ZZZ", ["/ZZZ"], 1751582, 4, 2151038362, "zzz" ), ] diff --git a/cmsdb/campaigns/run3_2023_postBPix_nano_tau_skim_2025_v1/bkgs.py b/cmsdb/campaigns/run3_2023_postBPix_nano_tau_skim_2025_v1/bkgs.py index 74bd9f26..63e0fb73 100644 --- a/cmsdb/campaigns/run3_2023_postBPix_nano_tau_skim_2025_v1/bkgs.py +++ b/cmsdb/campaigns/run3_2023_postBPix_nano_tau_skim_2025_v1/bkgs.py @@ -101,10 +101,10 @@ def add_merged_datasets(dataset_rows, cpn, procs): ("WWZ_4F", ["/WWZ_4F"], 1585526, 5, 2697542704, "wwz" ), ("WZ", ["/WZ"], 8379000, 9, 4042228682, "wz" ), ("WZZ", ["/WZZ"], 1625116, 5, 587043658, "wzz" ), - ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 28420, 1, 135171825, "wh_htt" ), - ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 28316, 1, 2701689366, "wh_htt" ), + ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 28420, 1, 135171825, "w_minus_h_htt_UU" ), + ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 28316, 1, 2701689366, "w_plus_h_htt_UU" ), ("WtoLNu_amcatnloFXFX", ["/WtoLNu_amcatnloFXFX"], 64991689, 91, 2516868007, "w_lnu" ), - ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 29949, 1, 4242094042, "zh_htt" ), + ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 29949, 1, 4242094042, "zh_htt_UU" ), ("ZZ", ["/ZZ"], 1254000, 2, 1161952647, "zz" ), ("ZZZ", ["/ZZZ"], 1589388, 4, 707067929, "zzz" ), ] diff --git a/cmsdb/campaigns/run3_2023_preBPix_nano_tau_skim_2025_v1/bkgs.py b/cmsdb/campaigns/run3_2023_preBPix_nano_tau_skim_2025_v1/bkgs.py index 84ce3325..2002d64e 100644 --- a/cmsdb/campaigns/run3_2023_preBPix_nano_tau_skim_2025_v1/bkgs.py +++ b/cmsdb/campaigns/run3_2023_preBPix_nano_tau_skim_2025_v1/bkgs.py @@ -100,10 +100,10 @@ def add_merged_datasets(dataset_rows, cpn, procs): ("WWZ_4F", ["/WWZ_4F"], 3275962, 9, 1632014525, "wwz" ), ("WZ", ["/WZ"], 16770000, 17, 1361197249, "wz" ), ("WZZ", ["/WZZ"], 3251476, 9, 3046016889, "wzz" ), - ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 66292, 1, 349669845, "wh_htt" ), - ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 64190, 1, 342803527, "wh_htt" ), + ("WminusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WminusHto2Tau_UncorrelatedDecay_UnFiltered"], 66292, 1, 349669845, "w_minus_h_htt_UU" ), + ("WplusHto2Tau_UncorrelatedDecay_UnFiltered", ["/WplusHto2Tau_UncorrelatedDecay_UnFiltered"], 64190, 1, 342803527, "w_plus_h_htt_UU" ), ("WtoLNu_amcatnloFXFX", ["/WtoLNu_amcatnloFXFX"], 135956411, 191, 2145010577, "w_lnu" ), - ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 69949, 1, 3203188888, "zh_htt" ), + ("ZHto2Tau_UncorrelatedDecay_UnFiltered", ["/ZHto2Tau_UncorrelatedDecay_UnFiltered"], 69949, 1, 3203188888, "zh_htt_UU" ), ("ZZ", ["/ZZ"], 2517000, 3, 3834398348, "zz" ), ("ZZZ", ["/ZZZ"], 3201470, 8, 3176535082, "zzz" ), ] diff --git a/cmsdb/processes/Di_boson.py b/cmsdb/processes/Di_boson.py new file mode 100644 index 00000000..2a7440d2 --- /dev/null +++ b/cmsdb/processes/Di_boson.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +__all__ = [ +"vv","zz", "ww", "wz", +] + + +from order import Process +from scinum import Number + +import cmsdb.constants as const + +# +# Di-boson +# + +vv = Process( + name="vv", + id=8000, + label="Di-Boson", + color="#80cdc1", +) + +# # ZZ 13 TeV xsec values at nNNLO from +# zz = vv.add_process( +# name="zz", +# id=8100, +# label="ZZ", +# xsecs={ +# 13.6: Number(24.97, {"scale": (0.029j, 0.027j)}) * (12.75 / 12.14), +# }, +# color="#01665e", +# ) + +# ww = vv.add_process( +# name="ww", +# id=8300, +# label="WW", +# xsecs={ +# 13.6: Number(80.22, { +# "tot": 0.01677, # xsdb: Number(80.23, {"tot": 0.3733}) +# }), +# }, +# color="#c7eae5", +# ) + +# wz = vv.add_process( +# name="wz", +# id=8200, +# label="WZ", +# xsecs={ +# 13.6: Number(29.17, { +# "tot": 0.005941, # xsdb: Number(29.1, {"tot": 0.1318}), +# }), +# }, +# color="#5ab4ac", +# ) + +# ZZ 13 TeV xsec values at nNNLO from +zz = vv.add_process( + name="zz", + id=8100, + label="ZZ", + xsecs={ + 13.6: Number(19.431) + }, + color="#01665e", +) + +ww = vv.add_process( + name="ww", + id=8300, + label="WW", + xsecs={ + 13.6: Number(122.27052), + }, + color="#c7eae5", +) + +wz = vv.add_process( + name="wz", + id=8200, + label="WZ", + xsecs={ + 13.6: Number(41.1474), + }, + color="#5ab4ac", +) \ No newline at end of file diff --git a/cmsdb/processes/Tri_boson.py b/cmsdb/processes/Tri_boson.py new file mode 100644 index 00000000..3988bdfb --- /dev/null +++ b/cmsdb/processes/Tri_boson.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +__all__ = [ +"vvv","zzz", "www", "wwz", "wzz", +] + + +from order import Process +from scinum import Number + +import cmsdb.constants as const + + +# +# Triple-boson +# + +vvv = Process( + name="vvv", + id=9000, + label="Triple-Boson", + # xsecs set below as sum over individual processes + color="#bdbdbd", +) + +# based on GenXSecAnalyzer +# for ZZZ_TuneCP5_13TeV-amcatnlo-pythia8 (Summer20UL16, NLO) +# remark: calculated xsec has lower error for sample without ext-1 as not all events were used for calculation of ext-1 +# therefore the value for the sample without ext-1 is taken +# using command ./calculateXSectionAndFilterEfficiency.sh -f datasets.txt -c RunIISummer20UL16MiniAODv2-106X_mcRun2_asymptotic_v17-v1 -n 5000000 # noqa +zzz = vvv.add_process( + name="zzz", + id=9100, + xsecs={ + 13: Number(0.01476, {"tot": 2.347 * 10**(-6)}), + # 13.6 from GenXSecAnalyzer: + # similar values also found in http://cms.cern.ch/iCMS/jsp/openfile.jsp?tp=draft&files=AN2023_179_v6.pdf + # same value as xsdb obtained + 13.6: Number(0.01591, { + "tot": 0.000007828, + }), + }, + color="#525252" +) + +# based on GenXSecAnalyzer +# for WZZ_TuneCP5_13TeV-amcatnlo-pythia8 (Summer20UL16, NLO, ext-1) +# remark: calculated xsec is the same for simple sample and ext-1 sample +# using command ./calculateXSectionAndFilterEfficiency.sh -f datasets.txt -c RunIISummer20UL16MiniAODv2-106X_mcRun2_asymptotic_v17_ext1-v1 -n 5000000 # noqa +wzz = vvv.add_process( + name="wzz", + id=9200, + xsecs={ + 13: Number(0.05709, {"tot": 6.213 * 10**(-5)}), + # 13.6 from GenXSecAnalyzer: + # similar values also found in http://cms.cern.ch/iCMS/jsp/openfile.jsp?tp=draft&files=AN2023_179_v6.pdf + # same value as xsdb obtained + 13.6: Number(0.06206, { + "tot": 0.00003689, + }), + }, +) + +# based on GenXSecAnalyzer +# for WWZ_4F_TuneCP5_13TeV-amcatnlo-pythia8 (Summer20UL16, NLO, ext-1) +# remark: calculated xsec is the same for simple sample and ext-1 sample +# using command ./calculateXSectionAndFilterEfficiency.sh -f datasets.txt -c RunIISummer20UL16MiniAODv2-106X_mcRun2_asymptotic_v17_ext1-v1 -n 5000000 # noqa +wwz = vvv.add_process( + name="wwz", + id=9300, + xsecs={ + 13: Number(0.1707, {"tot": 0.0001757}), + # 13.6 from GenXSecAnalyzer: + # similar values also found in http://cms.cern.ch/iCMS/jsp/openfile.jsp?tp=draft&files=AN2023_179_v6.pdf + # same value as xsdb obtained + 13.6: Number(0.1851, { + "tot": 0.00009482, + }), + }, + color="#737373", +) + +# based on GenXSecAnalyzer +# for WWW_4F_TuneCP5_13TeV-amcatnlo-pythia8 (Summer20UL16, NLO, ext-1) +# remark: calculated xsec is the same for simple sample and ext-1 sample +# using command ./calculateXSectionAndFilterEfficiency.sh -f datasets.txt -c RunIISummer20UL16MiniAODv2-106X_mcRun2_asymptotic_v17_ext1-v1 -n 5000000 # noqa +www = vvv.add_process( + name="www", + id=9400, + xsecs={ + 13: Number(0.2158, {"tot": 0.0002479}), + # 13.6 from GenXSecAnalyzer: + # similar values also found in http://cms.cern.ch/iCMS/jsp/openfile.jsp?tp=draft&files=AN2023_179_v6.pdf + # same value as xsdb obtained + 13.6: Number(0.2328, { + "tot": 0.0001247, + }), + }, + color="#969696", +) diff --git a/cmsdb/processes/__init__.py b/cmsdb/processes/__init__.py index 6c1cee76..a3885c8d 100644 --- a/cmsdb/processes/__init__.py +++ b/cmsdb/processes/__init__.py @@ -5,12 +5,13 @@ """ # provisioning imports -# from cmsdb.processes.combined_procs import * # noqa from cmsdb.processes.data import * # noqa from cmsdb.processes.top import * # noqa -# from cmsdb.processes.ewk import * # noqa from cmsdb.processes.qcd import * # noqa from cmsdb.processes.higgs import * # noqa -# from cmsdb.processes.httcp import * # noqa -from cmsdb.processes.ewk_uhh import * # noqa from cmsdb.processes.dy_tautau_nj import * # noqa +from cmsdb.processes.vh_htt import * # noqa +from cmsdb.processes.dy_ll import * # noqa +from cmsdb.processes.Tri_boson import * # noqa +from cmsdb.processes.Di_boson import * # noqa +from cmsdb.processes.w_lnu import * # noqa diff --git a/cmsdb/processes/dy_ll.py b/cmsdb/processes/dy_ll.py new file mode 100644 index 00000000..3d1dba56 --- /dev/null +++ b/cmsdb/processes/dy_ll.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +__all__ = [ +"dy_ll","dy_m50toinf", "dy_m10to50", "dy_m50toinf_0j", "dy_m50toinf_1j", "dy_m50toinf_2j", +] + + +from order import Process +from scinum import Number + +import cmsdb.constants as const + +dy_ll = Process( + name="dy_ll", + id=20950+6282+5378+973+312, + label="Z/γ*→ll", + color="#b2d99a" +) + +# dy_m10to50 = dy_ll.add_process( +# name="dy_m10to50", +# id=20950, +# xsecs={13.6: 20950.0}, +# color="#c6dbef", +# aux={ +# "mll": (10.0, 50.0), +# }, +# ) +# dy_m50toinf = dy_ll.add_process( +# name="dy_m50toinf", +# id=6282, +# xsecs={ +# 13.6: Number(6282.6, { +# "scale": (0.008j, 0.013j), +# "pdf": 0.01j, +# }), +# }, +# color="#08519c", +# aux={ +# "mll": (50.0, const.inf), +# }, +# ) +# dy_m50toinf_0j = dy_ll.add_process( +# name="dy_m50toinf_0j", +# id=5378, +# xsecs={ +# 13.6: Number(5378, +# {"tot": 8.007}), +# }, +# color="#9ecae1", +# aux={ +# "mll": (50.0, const.inf), +# "njets": (0, 1), +# }, +# ) + +# dy_m50toinf_1j = dy_ll.add_process( +# name="dy_m50toinf_1j", +# id=973, +# xsecs={ +# 13.6: Number(973.1, +# {"tot": 2.613}), +# }, +# color="#4292c6", +# aux={ +# "mll": (50.0, const.inf), +# "njets": (1, 2), +# }, +# ) + +# dy_m50toinf_2j = dy_ll.add_process( +# name="dy_m50toinf_2j", +# id=312, +# xsecs={ +# 13.6: Number(312.4, +# {"tot": 0.915}), +# }, +# color="#2171b5", +# aux={ +# "mll": (50.0, const.inf), +# "njets": (2, 3), +# }, +# ) + +dy_m10to50 = dy_ll.add_process( + name="dy_m10to50", + id=20950, + xsecs={13.6: 20950.0}, + color="#c6dbef", + aux={ + "mll": (10.0, 50.0), + }, +) +dy_m50toinf = dy_ll.add_process( + name="dy_m50toinf", + id=6282, + xsecs={ + 13.6: Number(6748.0, { + "scale": (0.008j, 0.013j), + "pdf": 0.01j, + }), + }, + color="#08519c", + aux={ + "mll": (50.0, const.inf), + }, +) +dy_m50toinf_0j = dy_ll.add_process( + name="dy_m50toinf_0j", + id=5378, + xsecs={ + 13.6: Number(5364, + {"tot": 8.007}), + }, + color="#9ecae1", + aux={ + "mll": (50.0, const.inf), + "njets": (0, 1), + }, +) + +dy_m50toinf_1j = dy_ll.add_process( + name="dy_m50toinf_1j", + id=973, + xsecs={ + 13.6: Number(1019.0, + {"tot": 2.613}), + }, + color="#4292c6", + aux={ + "mll": (50.0, const.inf), + "njets": (1, 2), + }, +) + +dy_m50toinf_2j = dy_ll.add_process( + name="dy_m50toinf_2j", + id=312, + xsecs={ + 13.6: Number(375.3, + {"tot": 0.915}), + }, + color="#2171b5", + aux={ + "mll": (50.0, const.inf), + "njets": (2, 3), + }, +) diff --git a/cmsdb/processes/dy_tautau_nj.py b/cmsdb/processes/dy_tautau_nj.py index e8bc1baf..d5a70c94 100644 --- a/cmsdb/processes/dy_tautau_nj.py +++ b/cmsdb/processes/dy_tautau_nj.py @@ -12,7 +12,7 @@ """ __all__ = [ -"dy_tautau_m50toinf_0j", "dy_tautau_m50toinf_1j", "dy_tautau_m50toinf_2j", +"dy_tautau_nj","dy_tautau_m50toinf_0j", "dy_tautau_m50toinf_1j", "dy_tautau_m50toinf_2j", ] @@ -22,39 +22,108 @@ import cmsdb.constants as const from cmsdb.util import multiply_xsecs +dy_tautau_nj = Process( + name="dy_tautau_nj", + id=161150, + label="Z/γ*→ττ", + xsecs={13.6: Number(0.1)}, + color="#f768a1" +) -dy_tautau_m50toinf_0j = Process( +dy_tautau_m50toinf_0j = dy_tautau_nj.add_process( name="dy_tautau_m50toinf_0j", id=51650, xsecs={ 13.6: Number(1664.684), }, + color="#b99ad9", # light shade aux={ "lep_id": 15, "mll": (50.0, const.inf), }, ) -dy_tautau_m50toinf_1j = Process( +dy_tautau_m50toinf_1j = dy_tautau_nj.add_process( name="dy_tautau_m50toinf_1j", id=51651, xsecs={ 13.6: Number(316.240), }, + color="#8f63c9", # medium shade aux={ "lep_id": 15, "mll": (50.0, const.inf), }, ) -dy_tautau_m50toinf_2j = Process( +dy_tautau_m50toinf_2j = dy_tautau_nj.add_process( name="dy_tautau_m50toinf_2j", id=51652, xsecs={ 13.6: Number(116.472), }, + color="#6a3fb8", # dark shade aux={ "lep_id": 15, "mll": (50.0, const.inf), }, -) \ No newline at end of file +) +# ------------------------- +# Cross-section extractor +# ------------------------- + +# import csv + +# # Your target list +# process_names = [ +# # DY->tautau +# "dy_tautau_nj", +# "dy_tautau_m50toinf_0j", +# "dy_tautau_m50toinf_1j", +# "dy_tautau_m50toinf_2j", +# ] + +# def _is_process(obj) -> bool: +# # duck-typing for order.Process +# return hasattr(obj, "name") and hasattr(obj, "get_xsec") and hasattr(obj, "xsecs") + +# def _to_float(x): +# """Plain float from scinum.Number or numeric; None if unavailable.""" +# try: +# return float(x) +# except Exception: +# for attr in ("nominal", "n", "value", "val"): +# if hasattr(x, attr): +# try: +# return float(getattr(x, attr)) +# except Exception: +# pass +# return None + +# energy = 13.6 +# out_path = "used_xsecs.txt" + +# # Build registry from module globals +# proc_map = {obj.name: obj for obj in globals().values() if _is_process(obj)} + +# # Collect rows +# rows = [] +# for pname in process_names: +# p = proc_map.get(pname) +# if p is None: +# rows.append([pname, None, "Process not found"]) +# continue +# try: +# v = p.get_xsec(energy) # may raise if energy not present +# except Exception: +# v = None +# rows.append([pname, _to_float(v) if v is not None else None, ""]) + +# # Write TSV +# header = ["process", "xsec_13.6TeV_pb", "note"] +# with open(out_path, "a", newline="") as f: +# w = csv.writer(f, delimiter="\t") +# w.writerow(header) +# w.writerows(rows) + +# print(f"Wrote {len(rows)} rows -> {out_path}") diff --git a/cmsdb/processes/ewk_uhh.py b/cmsdb/processes/ewk_uhh.py index 71e7cd24..c9f0b696 100644 --- a/cmsdb/processes/ewk_uhh.py +++ b/cmsdb/processes/ewk_uhh.py @@ -11,7 +11,7 @@ - njets: number of extra jets on generator level (mostly NLO) """ -__all__ = [ # noqa: F822 +__all__ = [ "dy", "dy_m4to10", "dy_m10to50", @@ -112,7 +112,7 @@ dy = Process( name="dy", id=50000, - label="Drell-Yan", + label="Z/γ*→ll" ) # NNLO cross section, based on: @@ -152,11 +152,12 @@ "pdf": 14.78, }), # nnlo - 13.6: const.n_leps * Number(2091.7, { + 13.6: Number(6282.6, { "scale": (0.008j, 0.013j), "pdf": 0.01j, }), }, + color="#08519c", aux={ "mll": (50.0, const.inf), }, @@ -198,6 +199,7 @@ xsecs={ 13.6: dy_m10to50_nlo_13p6tev_xsec * dy_k_factor_nlo_to_nnlo[13.6], }, + color="#c6dbef", aux={ "mll": (10.0, 50.0), }, @@ -220,6 +222,7 @@ # NLO xsec taken from https://xsdb-temp.app.cern.ch/xsdb/?columns=39911424¤tPage=0&pageSize=10&searchQuery=DAS%3DDYto2L-2Jets_MLL-50_0J_TuneCP5_13p6TeV_amcatnloFXFX-pythia8 # noqa 13.6: Number(5378, {"tot": 8.007}) * dy_k_factor_nlo_to_nnlo[13.6], }, + color="#9ecae1", aux={ "mll": (50.0, const.inf), "njets": (0, 1), @@ -236,6 +239,7 @@ # 13.6: Number(1017, {"tot": 6.264}) * dy_k_factor_nlo_to_nnlo[13.6], 13.6: Number(973.1, {"tot": 2.613}) * dy_k_factor_lo_to_nnlo[13.6], }, + color="#4292c6", aux={ "mll": (50.0, const.inf), "njets": (1, 2), @@ -252,6 +256,7 @@ # 13.6: Number(385.5, {"tot": 3.858}) * dy_k_factor_nlo_to_nnlo[13.6], 13.6: Number(312.4, {"tot": 0.915}) * dy_k_factor_lo_to_nnlo[13.6], }, + color="#2171b5", aux={ "mll": (50.0, const.inf), "njets": (2, 3), @@ -814,11 +819,50 @@ dy_tautau = dy.add_process( name="dy_tautau", id=50300, + color="#C84145", + label=f"Z/\gamma* \rightarrow \tau\tau", aux={ "lep_id": 15, }, ) - +# dy_tautau_m50toinf_0j = dy_tautau.add_process( +# name="dy_tautau_m50toinf_0j", +# id=51650, +# xsecs={ +# 13.6: Number(1664.684), +# }, +# color="#b99ad9", # light shade +# aux={ +# "lep_id": 15, +# "mll": (50.0, const.inf), +# }, +# ) + +# dy_tautau_m50toinf_1j = dy_tautau.add_process( +# name="dy_tautau_m50toinf_1j", +# id=51651, +# xsecs={ +# 13.6: Number(316.240), +# }, +# color="#8f63c9", # medium shade +# aux={ +# "lep_id": 15, +# "mll": (50.0, const.inf), +# }, +# ) + +# dy_tautau_m50toinf_2j = dy_tautau.add_process( +# name="dy_tautau_m50toinf_2j", +# id=51652, +# xsecs={ +# 13.6: Number(116.472), +# }, +# color="#6a3fb8", # dark shade +# aux={ +# "lep_id": 15, +# "mll": (50.0, const.inf), +# }, +# ) # 2 e dy_ee_m10to50 = dy_ee.add_process( name="dy_ee_m10to50", @@ -1681,6 +1725,7 @@ # addition necessary due to absence of combined value 13.6: wm_lnu_xs_13p6 + wp_lnu_xs_13p6, }, + color="#74c476", ) # LO cross section, needed for scaling to NNLO: @@ -1796,6 +1841,7 @@ name="w_lnu_1j", id=610010, label=rf"{w_lnu.label[:-1]}, 1j)", + color="#31a354", aux={ "njets": (1, 2), }, @@ -1805,6 +1851,7 @@ name="w_lnu_2j", id=610020, label=rf"{w_lnu.label[:-1]}, 2j)", + color="#238b45", aux={ "njets": (2, 3), }, @@ -2011,6 +2058,7 @@ name="vv", id=8000, label="Di-Boson", + color="#80cdc1", ) # ZZ 13 TeV xsec values at nNNLO from @@ -2025,6 +2073,7 @@ # of XSDB values at https://xsdb-temp.app.cern.ch/xsdb/?columns=67108863¤tPage=0&pageSize=40&searchQuery=process_name%3D%5EZZ_TuneCP5_13.%2Bpythia8%24 # noqa 13.6: Number(24.97, {"scale": (0.029j, 0.027j)}) * (12.75 / 12.14), }, + color="#01665e", ) zz_zqq_zll = zz.add_process( @@ -2082,6 +2131,7 @@ "tot": 0.005941, # xsdb: Number(29.1, {"tot": 0.1318}), }), }, + color="#5ab4ac", ) wz_wlnu_zll = wz.add_process( @@ -2127,6 +2177,7 @@ "tot": 0.01677, # xsdb: Number(80.23, {"tot": 0.3733}) }), }, + color="#c7eae5", ) # update vv cross section @@ -2185,6 +2236,7 @@ id=9000, label="Triple-Boson", # xsecs set below as sum over individual processes + color="#bdbdbd", ) # based on GenXSecAnalyzer @@ -2204,6 +2256,7 @@ "tot": 0.000007828, }), }, + color="#525252" ) # based on GenXSecAnalyzer @@ -2240,6 +2293,7 @@ "tot": 0.00009482, }), }, + color="#737373", ) # based on GenXSecAnalyzer @@ -2258,9 +2312,87 @@ "tot": 0.0001247, }), }, + color="#969696", ) # update vvv cross section for cme in [13]: vvv.set_xsec(cme, www.get_xsec(cme) + wwz.get_xsec(cme) + wzz.get_xsec(cme) + zzz.get_xsec(cme)) +# ------------------------- +# Cross-section extractor +# ------------------------- + +# import csv + +# # Your target list +# process_names = [ +# # DY->ll +# "dy", +# "dy_m10to50", +# "dy_m50toinf_0j", +# "dy_m50toinf_1j", +# "dy_m50toinf_2j", +# "dy_m50toinf", +# # W + jets +# "w_lnu", +# "w_lnu_1j", +# "w_lnu_2j", +# # vv +# "vv", +# "ww", +# "wz", +# "zz", +# # vvv +# "vvv", +# "www", +# "wwz", +# "zzz", +# ] + +# def _is_process(obj) -> bool: +# # duck-typing for order.Process +# return hasattr(obj, "name") and hasattr(obj, "get_xsec") and hasattr(obj, "xsecs") + +# def _to_float(x): +# """Plain float from scinum.Number or numeric; None if unavailable.""" +# try: +# return float(x) +# except Exception: +# for attr in ("nominal", "n", "value", "val"): +# if hasattr(x, attr): +# try: +# return float(getattr(x, attr)) +# except Exception: +# pass +# return None + +# energy = 13.6 +# out_path = "used_xsecs.txt" + +# # Build registry from module globals +# proc_map = {obj.name: obj for obj in globals().values() if _is_process(obj)} + +# # Collect rows +# rows = [] +# for pname in process_names: +# p = proc_map.get(pname) +# if p is None: +# rows.append([pname, None, "Process not found"]) +# continue +# try: +# v = p.get_xsec(energy) # may raise if energy not present +# except Exception: +# v = None +# rows.append([pname, _to_float(v) if v is not None else None, ""]) + +# # Write TSV +# header = ["process", "xsec_13.6TeV_pb", "note"] +# with open(out_path, "a", newline="") as f: +# w = csv.writer(f, delimiter="\t") +# w.writerow(header) +# w.writerows(rows) + +# print(f"Wrote {len(rows)} rows -> {out_path}") + + diff --git a/cmsdb/processes/higgs.py b/cmsdb/processes/higgs.py index 952f46f8..1de9d7c4 100644 --- a/cmsdb/processes/higgs.py +++ b/cmsdb/processes/higgs.py @@ -521,7 +521,7 @@ ) # Higgs decay channels -h_ggf_htt = add_decay_process(h_ggf, h_decay_map.htt) +h_ggf_htt = add_decay_process(h_ggf, h_decay_map.htt,color="#e377c2") h_ggf_hww = add_decay_process(h_ggf, h_decay_map.hww) h_ggf_hzz = add_decay_process(h_ggf, h_decay_map.hzz) h_ggf_hbb = add_decay_process(h_ggf, h_decay_map.hbb) @@ -552,7 +552,10 @@ proc = h_ggf_htt.add_process( name=f"h_ggf_htt_{mass}", id=mass+10**8, - xsecs=h_ggf_htt_xsecs, + xsecs={ + 13: Number(1.0,), + 13.6: Number(1.0,), + }, ) # define a variable like h_ggf_htt_60, h_ggf_htt_65, … setattr(this_module, f"h_ggf_htt_{mass}", proc) @@ -596,7 +599,7 @@ ) # Higgs decay channels -h_vbf_htt = add_decay_process(h_vbf, h_decay_map.htt) +h_vbf_htt = add_decay_process(h_vbf, h_decay_map.htt,color="#c51b8a") h_vbf_hww = add_decay_process(h_vbf, h_decay_map.hww) h_vbf_hzz = add_decay_process(h_vbf, h_decay_map.hzz) h_vbf_hbb = add_decay_process(h_vbf, h_decay_map.hbb) @@ -729,7 +732,7 @@ # Higgs decay channels -vh_htt = add_decay_process(vh, h_decay_map.htt) +vh_htt = add_decay_process(vh, h_decay_map.htt,color="#dd3497") vh_hww = add_decay_process(vh, h_decay_map.hww) vh_hzz = add_decay_process(vh, h_decay_map.hzz) vh_hbb = add_decay_process(vh, h_decay_map.hbb) @@ -896,7 +899,7 @@ #################################################################################################### # Higgs decay channels -zh_htt = add_decay_process(zh, h_decay_map.htt) +zh_htt = add_decay_process(zh, h_decay_map.htt, color="#ce1256") zh_hww = add_decay_process(zh, h_decay_map.hww) zh_hzz = add_decay_process(zh, h_decay_map.hzz) zh_hbb = add_decay_process(zh, h_decay_map.hbb) @@ -1455,7 +1458,10 @@ proc = bbh_htt.add_process( name=f"bbh_htt_{mass}", id=mass+1+10**8, - xsecs=bbh_htt_xsecs, + xsecs={ + 13: Number(1.0,), + 13.6: Number(1.0,), + }, ) # define a variable like bbh_htt_60, bbh_htt_65, … setattr(this_module, f"bbh_htt_{mass}", proc) @@ -1527,4 +1533,58 @@ }), # TODO: only preliminary }, aux={"production_mode_parent": h}, -) \ No newline at end of file +) + +# import csv + +# # Your target list +# process_names = [ +# # SM H->tautau +# "h_ggf_htt", +# "h_vbf_htt", +# ] + +# def _is_process(obj) -> bool: +# # duck-typing for order.Process +# return hasattr(obj, "name") and hasattr(obj, "get_xsec") and hasattr(obj, "xsecs") + +# def _to_float(x): +# """Plain float from scinum.Number or numeric; None if unavailable.""" +# try: +# return float(x) +# except Exception: +# for attr in ("nominal", "n", "value", "val"): +# if hasattr(x, attr): +# try: +# return float(getattr(x, attr)) +# except Exception: +# pass +# return None + +# energy = 13.6 +# out_path = "used_xsecs.txt" + +# # Build registry from module globals +# proc_map = {obj.name: obj for obj in globals().values() if _is_process(obj)} + +# # Collect rows +# rows = [] +# for pname in process_names: +# p = proc_map.get(pname) +# if p is None: +# rows.append([pname, None, "Process not found"]) +# continue +# try: +# v = p.get_xsec(energy) # may raise if energy not present +# except Exception: +# v = None +# rows.append([pname, _to_float(v) if v is not None else None, ""]) + +# # Write TSV +# header = ["process", "xsec_13.6TeV_pb", "note"] +# with open(out_path, "a", newline="") as f: +# w = csv.writer(f, delimiter="\t") +# w.writerow(header) +# w.writerows(rows) + +# print(f"Wrote {len(rows)} rows -> {out_path}") \ No newline at end of file diff --git a/cmsdb/processes/top.py b/cmsdb/processes/top.py index 5f7972fb..9bde7449 100644 --- a/cmsdb/processes/top.py +++ b/cmsdb/processes/top.py @@ -64,7 +64,7 @@ id=1100, label=f"{tt.label}, SL", color=(205, 0, 9), - xsecs= {13.6 : 334.8*kfactor_ttbar,} + xsecs= {13.6 : 334.8*kfactor_ttbar,}, # xsecs=multiply_xsecs(tt, const.br_ww.sl), ) @@ -220,6 +220,7 @@ id=2211, xsecs={13.6 : 15.9}, # multiply_xsecs(st_twchannel_t, const.br_ww.sl), + color="#3f2814", ) st_twchannel_t_dl = st_twchannel_t.add_process( @@ -227,11 +228,13 @@ id=2212, xsecs={13.6 : 3.8}, #multiply_xsecs(st_twchannel_t, const.br_ww.dl), + color="#55351c", ) st_twchannel_t_fh = st_twchannel_t.add_process( name="st_twchannel_t_fh", id=2213, xsecs=multiply_xsecs(st_twchannel_t, const.br_ww.fh), + color="#996d3f", ) st_twchannel_tbar = st_twchannel.add_process( @@ -248,6 +251,7 @@ id=2221, xsecs={13.6 : 15.9}, # multiply_xsecs(st_twchannel_tbar, const.br_ww.sl), + color="#6b4424", ) st_twchannel_tbar_dl = st_twchannel_tbar.add_process( @@ -255,12 +259,14 @@ id=2222, xsecs= {13.6 : 3.8}, # multiply_xsecs(st_twchannel_tbar, const.br_ww.dl), + color="#7f552e", ) st_twchannel_tbar_fh = st_twchannel_tbar.add_process( name="st_twchannel_tbar_fh", id=2223, xsecs=multiply_xsecs(st_twchannel_tbar, const.br_ww.fh), + color="#ad8a5c", ) st_schannel = st.add_process( @@ -560,10 +566,66 @@ ttzz.get_xsec(13) + ttwz.get_xsec(13) + ttww.get_xsec(13), ) - -# # List of top-level processes -# processes = [tt, st, tt_fh, tt_dl, tt_sl, st_tchannel_t, st_tchannel_tbar, st_twchannel_t_sl, st_twchannel_tbar_sl, st_twchannel_t_dl, st_twchannel_tbar_dl, st_twchannel_t_fh, st_twchannel_tbar_fh] - -# # Save the xsec values to 'top.txt' for energy 13.6 TeV -# save_xsecs_to_file(processes, 'top.txt', 13.6) - +# import csv + +# # Your target list +# process_names = [ +# # single top +# "st", +# "st_twchannel_tbar_fh", +# "st_twchannel_t_fh", +# "st_twchannel_tbar_dl", +# "st_twchannel_tbar_sl", +# "st_twchannel_t_dl", +# "st_twchannel_t_sl", +# # tt +# "tt", +# "tt_dl", +# "tt_fh", +# "tt_sl", +# ] + +# def _is_process(obj) -> bool: +# # duck-typing for order.Process +# return hasattr(obj, "name") and hasattr(obj, "get_xsec") and hasattr(obj, "xsecs") + +# def _to_float(x): +# """Plain float from scinum.Number or numeric; None if unavailable.""" +# try: +# return float(x) +# except Exception: +# for attr in ("nominal", "n", "value", "val"): +# if hasattr(x, attr): +# try: +# return float(getattr(x, attr)) +# except Exception: +# pass +# return None + +# energy = 13.6 +# out_path = "used_xsecs.txt" + +# # Build registry from module globals +# proc_map = {obj.name: obj for obj in globals().values() if _is_process(obj)} + +# # Collect rows +# rows = [] +# for pname in process_names: +# p = proc_map.get(pname) +# if p is None: +# rows.append([pname, None, "Process not found"]) +# continue +# try: +# v = p.get_xsec(energy) # may raise if energy not present +# except Exception: +# v = None +# rows.append([pname, _to_float(v) if v is not None else None, ""]) + +# # Write TSV +# header = ["process", "xsec_13.6TeV_pb", "note"] +# with open(out_path, "a", newline="") as f: +# w = csv.writer(f, delimiter="\t") +# w.writerow(header) +# w.writerows(rows) + +# print(f"Wrote {len(rows)} rows -> {out_path}") \ No newline at end of file diff --git a/cmsdb/processes/vh_htt.py b/cmsdb/processes/vh_htt.py new file mode 100644 index 00000000..358f7c45 --- /dev/null +++ b/cmsdb/processes/vh_htt.py @@ -0,0 +1,109 @@ +# coding: utf-8 +from __future__ import annotations + +__all__ = [ + "vh_htt","w_plus_h_htt_UU","w_minus_h_htt_UU","zh_htt_UU", +] + +from order import Process +from scinum import Number + +import cmsdb.constants as const +from cmsdb.util import add_xsecs, DotDict, add_decay_process, add_sub_decay_process + +#################################################################################################### +# +# WH subprocesses +# +#################################################################################################### + +vh_htt = Process( + name="vh_htt", + id=16100, + label="VH", + xsecs={13.6: Number(0.1)}, + color="#f768a1" +) + +# Higgs decay channels +w_plus_h_htt_UU = vh_htt.add_process( + name="w_plus_h_htt_UU", + id=16101, + xsecs={ + 13.6: Number(0.05575), + }, + color="#f768a1", +) + +w_minus_h_htt_UU = vh_htt.add_process( + name="w_minus_h_htt_UU", + id=16102, + xsecs={ + 13.6: Number(0.03561), + }, + color="#f768a1", +) +zh_htt_UU = vh_htt.add_process( + name="zh_htt_UU", + id=16103, + xsecs={ + 13.6: Number(0.0592), + }, + color="#ce1256" +) + +# import csv + +# # Your target list +# process_names = [ +# # vh_htt +# "vh_htt", +# "zh_htt_UU", +# "w_plus_h_htt_UU", +# "w_minus_h_htt_UU", +# ] + +# def _is_process(obj) -> bool: +# # duck-typing for order.Process +# return hasattr(obj, "name") and hasattr(obj, "get_xsec") and hasattr(obj, "xsecs") + +# def _to_float(x): +# """Plain float from scinum.Number or numeric; None if unavailable.""" +# try: +# return float(x) +# except Exception: +# for attr in ("nominal", "n", "value", "val"): +# if hasattr(x, attr): +# try: +# return float(getattr(x, attr)) +# except Exception: +# pass +# return None + +# energy = 13.6 +# out_path = "used_xsecs.txt" + +# # Build registry from module globals +# proc_map = {obj.name: obj for obj in globals().values() if _is_process(obj)} + +# # Collect rows +# rows = [] +# for pname in process_names: +# p = proc_map.get(pname) +# if p is None: +# rows.append([pname, None, "Process not found"]) +# continue +# try: +# v = p.get_xsec(energy) # may raise if energy not present +# except Exception: +# v = None +# rows.append([pname, _to_float(v) if v is not None else None, ""]) + +# # Write TSV +# header = ["process", "xsec_13.6TeV_pb", "note"] +# with open(out_path, "a", newline="") as f: +# w = csv.writer(f, delimiter="\t") +# w.writerow(header) +# w.writerows(rows) + +# print(f"Wrote {len(rows)} rows -> {out_path}") \ No newline at end of file diff --git a/cmsdb/processes/w_lnu.py b/cmsdb/processes/w_lnu.py new file mode 100644 index 00000000..b4027360 --- /dev/null +++ b/cmsdb/processes/w_lnu.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +__all__ = [ +"w_lnu","w_lnu_0j", "w_lnu_1j", "w_lnu_2j", +] + + +from order import Process +from scinum import Number + +import cmsdb.constants as const + +w_lnu = Process( + name="w_lnu", + id=6100, + label=rf"$W \rightarrow l\nu$", + xsecs={13.6: 63425.1}, + color="#74c476", +) + +w_lnu_0j = w_lnu.add_process( + name="w_lnu_0j", + id=610000, + label=rf"$W \rightarrow l\nu$ 0j", + aux={ + "njets": (0, 1), + }, +) + +w_lnu_1j = w_lnu.add_process( + name="w_lnu_1j", + id=610010, + label=rf"$W \rightarrow l\nu$ 1j", + color="#31a354", + aux={ + "njets": (1, 2), + }, +) + +w_lnu_2j = w_lnu.add_process( + name="w_lnu_2j", + id=610020, + label=rf"$W \rightarrow l\nu$ 2j", + color="#238b45", + aux={ + "njets": (2, 3), + }, +) \ No newline at end of file