From 9b208d683556db47013ba4e480b35ff3d44c43dd Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Wed, 1 Oct 2025 14:40:22 -0400 Subject: [PATCH 01/13] Invert rotation --- topeft/params/SMEFTsim-topU3l_dim6top.yml | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 852c19b22..351338aac 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -2,21 +2,21 @@ "CW": 0.88136 # PDG W / Z mass ratio "SW": "np.sqrt(1 - np.square({CW}))" # eval in python -# SMEFTsim j <-> dim6top q -"ctj1": "ctq1" -"cQj31": "cQq13" -"ctj8": "ctq8" -"cQj11": "cQq11" -"cQj18": "cQq81" -"cQj38": "cQq83" +# dim6top q <-> SMEFTsim j +"ctq1": "ctj1" +"cQq13": "cQj31" +"ctq8": "ctj8" +"cQq11": "cQj11" +"cQq81": "cQj18" +"cQq83": "cQj38" "cQQ1": ["expr::SEMFTsim_cQQ1('0.5 * @0', {cQQ1})", ["cQQ1"]] -"ctt": "ctt1" +"ctt1": "ctt" # ctG relative minus sign -"ctGRe": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] -"ctGIm": ["expr::ctGIm('-1 * @0', {ctGI})", ["ctGI"]] +"ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] +"ctGI": ["expr::ctGIm('-1 * @0', {ctGI})", ["ctGI"]] # ctW,ctB <-> ctW,ctZ -"ctWRe": ["expr::ctWRe('-1 * @0', {ctW})", ["ctW"]] -"ctBRe": ["expr::ctBRe('@0 / {SW} - @1 * {CW}/{SW} ', {ctZ}, {ctW})", ["ctZ", "ctW"]] # {ctZ}/SW - {ctW}/TW (TW = tan Weinberg angle) +"ctW": ["expr::ctW('-1 * @0', {ctWRe})", ["ctWRe"]] +"ctZ": ["expr::ctZ('@0 * {SW} - @1 * {CW}', {ctBRe}, {ctWRe})", ["ctBRe", "ctWRe"]] # {ctBRe}*SW - {ctWRe}*CW From 107e541be2d39b1ebe8fc199ff0b13df05bfb78b Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Wed, 1 Oct 2025 14:40:38 -0400 Subject: [PATCH 02/13] Save ttx jsons --- topeft/modules/datacard_tools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/topeft/modules/datacard_tools.py b/topeft/modules/datacard_tools.py index cc8d4a38d..66bc594ed 100644 --- a/topeft/modules/datacard_tools.py +++ b/topeft/modules/datacard_tools.py @@ -1138,6 +1138,12 @@ def analyze(self,km_dist,ch,selected_wcs, crop_negative_bins, wcs_dict): f.write("* autoMCStats 10\n") else: f.write("* autoMCStats -1\n") + + outf_json_name = self.FNAME_TEMPLATE.format(cat=ch,kmvar=km_dist,ext="json") + with open(os.path.join(self.out_dir,f"{outf_json_name}"),"w") as f: + print('making', os.path.join(self.out_dir,f"{outf_json_name}")) + json.dump(self.scalings_json, f, indent=4) + dt = time.time() - tic print(f"File Write Time: {dt:.2f} s") print(f"Total Hists Written: {num_h}") From abb146a281116b034c08e48eb921480d03566db6 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Wed, 1 Oct 2025 14:43:10 -0400 Subject: [PATCH 03/13] Caveat on `glados` --- README_FITTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README_FITTING.md b/README_FITTING.md index 6b8013c0d..219bee926 100644 --- a/README_FITTING.md +++ b/README_FITTING.md @@ -15,4 +15,5 @@ python make_cards.py path/to/your.pkl.gz -C --do-nuisance --var-lst lj0pt ptz -d ## Running combine - The next step is to run combine. This takes place inside of a CMSSW release, outside of `topcoffea`. See the [EFTFit](https://github.com/TopEFT/EFTFit) repo for instructions. +The next step is to run combine. This takes place inside of a CMSSW release, outside of `topcoffea`. See the [EFTFit](https://github.com/TopEFT/EFTFit) repo for instructions. +:warning: The EFT basis rotation does not compile correctly on `glados`. Please make your workspace on a tested machine like `lxplus`. The root limit scans can still be done on `glados`. From f9d3f52699b75d344eb009f78a5cfd220c47f07d Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Wed, 1 Oct 2025 14:47:43 -0400 Subject: [PATCH 04/13] Fixing icon --- README_FITTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README_FITTING.md b/README_FITTING.md index 219bee926..b54fe8f39 100644 --- a/README_FITTING.md +++ b/README_FITTING.md @@ -15,5 +15,6 @@ python make_cards.py path/to/your.pkl.gz -C --do-nuisance --var-lst lj0pt ptz -d ## Running combine -The next step is to run combine. This takes place inside of a CMSSW release, outside of `topcoffea`. See the [EFTFit](https://github.com/TopEFT/EFTFit) repo for instructions. :warning: The EFT basis rotation does not compile correctly on `glados`. Please make your workspace on a tested machine like `lxplus`. The root limit scans can still be done on `glados`. + +The next step is to run combine. This takes place inside of a CMSSW release, outside of `topcoffea`. See the [EFTFit](https://github.com/TopEFT/EFTFit) repo for instructions. From 911d8bdb0be28b6c4ce4dc01db53420a9bbca000 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Wed, 1 Oct 2025 15:01:11 -0400 Subject: [PATCH 05/13] Fix ranges and error printout --- topeft/modules/datacard_tools.py | 2 +- topeft/params/SMEFTsim-topU3l_dim6top.yml | 3 +++ topeft/params/wc_ranges.json | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/topeft/modules/datacard_tools.py b/topeft/modules/datacard_tools.py index 66bc594ed..124f52a58 100644 --- a/topeft/modules/datacard_tools.py +++ b/topeft/modules/datacard_tools.py @@ -328,7 +328,7 @@ def __init__(self,pkl_path,**kwargs): self.rotate[k] = v[0].format(**kwargs) if isinstance(v, str): if v not in self.wc_ranges: - raise Exception("The WC {v} was not found in params/wc_ranges.json!") + raise Exception(f"The WC {v} was not found in params/wc_ranges.json!") lo,hi = self.wc_ranges[v] v = v.replace(v,f"{v}[0,{lo},{hi}]") self.rotate[k] = v diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 351338aac..52965ef47 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -12,6 +12,9 @@ "cQQ1": ["expr::SEMFTsim_cQQ1('0.5 * @0', {cQQ1})", ["cQQ1"]] "ctt1": "ctt" +"ctp": "ctHRe" +"cpt": "cHt" +"cptb": "cHtbRe" # ctG relative minus sign "ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] diff --git a/topeft/params/wc_ranges.json b/topeft/params/wc_ranges.json index 1f6c4bd95..70252046e 100644 --- a/topeft/params/wc_ranges.json +++ b/topeft/params/wc_ranges.json @@ -13,19 +13,27 @@ "cpQ3": [-4.0, 4.0], "cpQM": [-15.0, 20.0], "cpt": [-15.0, 15.0], + "cHt": [-15.0, 15.0], "cptb": [-9.0, 9.0], + "cHtbRe": [-9.0, 9.0], "ctG": [-0.8, 0.8], + "ctGRe": [-0.8, 0.8], "ctGI": [-100, 100], + "ctGIm": [-100, 100], "ctW": [-1.5, 1.5], + "ctWRe": [-1.5, 1.5], "ctZ": [-2.0, 2.0], + "ctBRe": [-2.0, 2.0], "ctei": [-4.0, 4.0], "ctlSi": [-5.0, 5.0], "ctlTi": [-0.9, 0.9], "ctli": [-4.0, 4.0], "ctp": [-15.0, 40.0], + "ctHRe": [-15.0, 40.0], "ctq1": [-0.6, 0.6], "ctq8": [-1.4, 1.4], "ctt1": [-2.6, 2.6], + "ctt": [-2.6, 2.6], "cQd1": [-100, 100], "ctj1": [-100, 100], From af71859d8aa4983848a401a18c7373d743efb033 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Fri, 14 Nov 2025 13:18:49 -0500 Subject: [PATCH 06/13] Update instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac3281f3a..1973ba49f 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ The [v0.5 tag](https://github.com/TopEFT/topcoffea/releases/tag/v0.5) was used t 2. Run the datacard maker to obtain the cards and templates from SM (from the pickled histogram file produced in Step 1, be sure to use the version with the nonprompt estimation, i.e. the one with `_np` appended to the name you specified for the `OUT_NAME` in `fullR2_run.sh`). This step would also produce scalings-preselect.json file which the later version is necessary for IM workspace making. Note that command option `--wc-scalings` is not mandatory but to enforce the ordering of wcs in scalings. Add command `-A` to include all EFT templates in datacards for previous AAC model. Add option `-C` to run on condor. ``` - time python make_cards.py /path/to/your/examplename_np.pkl.gz --do-nuisance --var-lst lj0pt ptz -d /scratch365/you/somedir --unblind --do-mc-stat --wc-scalings cQQ1 cQei cQl3i cQlMi cQq11 cQq13 cQq81 cQq83 cQt1 cQt8 cbW cpQ3 cpQM cpt cptb ctG ctW ctZ ctei ctlSi ctlTi ctli ctp ctq1 ctq8 ctt1 + time python make_cards.py /path/to/your/examplename_np.pkl.gz --do-nuisance --var-lst lj0pt ptz -d /scratch365/you/somedir --unblind --do-mc-stat -C ``` 3. Run the post-processing checks on the cards to look for any unexpected errors, to grab the right set of ptz and lj0pt templates/cards used in TOP-22-006, and to get final version of scalings.json file. The script will copy the relevant cards/templates/ and create the json file to a directory called `ptz-lj0pt_withSys` that it makes inside of the directory you pass that points to the cards and templates made in Step 2. This `ptz-lj0pt_withSys` is the directory that can be copied to wherever you plan to run the `combine` steps (e.g. PSI). Can also run this on condor with `-c`. From 472efa75d45e40c33480d870e331681b3465ce86 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Fri, 14 Nov 2025 13:19:07 -0500 Subject: [PATCH 07/13] Add missing rotations/redefinitions --- topeft/params/SMEFTsim-topU3l_dim6top.yml | 9 ++++++++- topeft/params/wc_ranges.json | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 52965ef47..50aaf043f 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -10,12 +10,19 @@ "cQq81": "cQj18" "cQq83": "cQj38" -"cQQ1": ["expr::SEMFTsim_cQQ1('0.5 * @0', {cQQ1})", ["cQQ1"]] +"cQQ1": ["expr::dim6top_cQQ1('0.5 * @0', {cQQ1})", ["cQQ1"]] "ctt1": "ctt" "ctp": "ctHRe" "cpt": "cHt" "cptb": "cHtbRe" +"ctlSi": "cleQt1Rei" +"ctlTi": "cleQt3Rei" + +# cpQM, cpQ3 <-> cHQ1, cHQ3 +"cpQM": ["expr::cpQM('@ - @1', {cHQ1}, {cHQ3})", ["cHQ1", "cHQ3"]] # cpQM = cpQ1 - cpQ3 +"cQlMi": ["expr::cQlM('@ - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i + # ctG relative minus sign "ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] "ctGI": ["expr::ctGIm('-1 * @0', {ctGI})", ["ctGI"]] diff --git a/topeft/params/wc_ranges.json b/topeft/params/wc_ranges.json index 70252046e..1c5300338 100644 --- a/topeft/params/wc_ranges.json +++ b/topeft/params/wc_ranges.json @@ -3,6 +3,7 @@ "cQei": [-4.0, 4.0], "cQl3i": [-5.5, 5.5], "cQlMi": [-4.0, 4.0], + "cQl1i": [-4.0, 4.0], "cQq11": [-0.7, 0.7], "cQq13": [-0.35, 0.35], "cQq81": [-1.7, 1.5], @@ -11,7 +12,9 @@ "cQt8": [-10.0, 10.0], "cbW": [-3.0, 3.0], "cpQ3": [-4.0, 4.0], + "cHQ3": [-4.0, 4.0], "cpQM": [-15.0, 20.0], + "cHQ1": [-15.0, 20.0], "cpt": [-15.0, 15.0], "cHt": [-15.0, 15.0], "cptb": [-9.0, 9.0], @@ -26,7 +29,9 @@ "ctBRe": [-2.0, 2.0], "ctei": [-4.0, 4.0], "ctlSi": [-5.0, 5.0], + "cleQt1Rei": [-5.0, 5.0], "ctlTi": [-0.9, 0.9], + "cleQt3Rei": [-0.9, 0.9], "ctli": [-4.0, 4.0], "ctp": [-15.0, 40.0], "ctHRe": [-15.0, 40.0], From 6989a0a498ed8733d3a09b58716460c2f03f51ca Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Fri, 14 Nov 2025 13:51:38 -0500 Subject: [PATCH 08/13] Fix typo in `cQlMi` --- topeft/params/SMEFTsim-topU3l_dim6top.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 50aaf043f..093e3f040 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -21,7 +21,7 @@ # cpQM, cpQ3 <-> cHQ1, cHQ3 "cpQM": ["expr::cpQM('@ - @1', {cHQ1}, {cHQ3})", ["cHQ1", "cHQ3"]] # cpQM = cpQ1 - cpQ3 -"cQlMi": ["expr::cQlM('@ - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i +"cQlMi": ["expr::cQlMi('@ - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i # ctG relative minus sign "ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] From 9f54e21354b52023c639bfcf2957997743432e11 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Mon, 17 Nov 2025 10:09:48 -0500 Subject: [PATCH 09/13] Fix typo in formula --- topeft/params/SMEFTsim-topU3l_dim6top.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 093e3f040..97d8f560c 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -20,8 +20,8 @@ "ctlTi": "cleQt3Rei" # cpQM, cpQ3 <-> cHQ1, cHQ3 -"cpQM": ["expr::cpQM('@ - @1', {cHQ1}, {cHQ3})", ["cHQ1", "cHQ3"]] # cpQM = cpQ1 - cpQ3 -"cQlMi": ["expr::cQlMi('@ - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i +"cpQM": ["expr::cpQM('@0 - @1', {cHQ1}, {cHQ3})", ["cHQ1", "cHQ3"]] # cpQM = cpQ1 - cpQ3 +"cQlMi": ["expr::cQlMi('@0 - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i # ctG relative minus sign "ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] From 5c62baa432e9fc139dd8b9954928febba9471260 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Mon, 17 Nov 2025 11:38:15 -0500 Subject: [PATCH 10/13] Fix ctG (was flipped) --- topeft/params/SMEFTsim-topU3l_dim6top.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 97d8f560c..a4bdfcf11 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -24,8 +24,8 @@ "cQlMi": ["expr::cQlMi('@0 - @1', {cQl1i}, {cQl3i})", ["cQl1i", "cQl3i"]] # cQlMi = cQl1i - cQl3i # ctG relative minus sign -"ctG": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] -"ctGI": ["expr::ctGIm('-1 * @0', {ctGI})", ["ctGI"]] +"ctG": ["expr::ctG('-1 * @0', {ctGRe})", ["ctGRe"]] +"ctGI": ["expr::ctGI('-1 * @0', {ctGIm})", ["ctGIm"]] # ctW,ctB <-> ctW,ctZ "ctW": ["expr::ctW('-1 * @0', {ctWRe})", ["ctWRe"]] From dc9002436169762f7c2e97bdd7ad7e206608d0fd Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Mon, 17 Nov 2025 12:39:23 -0500 Subject: [PATCH 11/13] Removed duplicat ctGRe --- topeft/params/wc_ranges.json | 1 - 1 file changed, 1 deletion(-) diff --git a/topeft/params/wc_ranges.json b/topeft/params/wc_ranges.json index 1c5300338..c3e8b8732 100644 --- a/topeft/params/wc_ranges.json +++ b/topeft/params/wc_ranges.json @@ -46,7 +46,6 @@ "ctj8": [-100, 100], "ctd1": [-100, 100], "ctd8": [-100, 100], - "ctGRe": [-100, 100], "ctGIm": [-100, 100], "cQj11": [-100, 100], "cQj18": [-100, 100], From 1cd4a3d91d0afa6019a6e49973a29fd1e8499c65 Mon Sep 17 00:00:00 2001 From: Brent Yates Date: Tue, 18 Nov 2025 11:41:45 -0500 Subject: [PATCH 12/13] Fixed WC ranges (only new WCs are now 100) --- topeft/params/wc_ranges.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/topeft/params/wc_ranges.json b/topeft/params/wc_ranges.json index c3e8b8732..9c36edaf7 100644 --- a/topeft/params/wc_ranges.json +++ b/topeft/params/wc_ranges.json @@ -5,9 +5,13 @@ "cQlMi": [-4.0, 4.0], "cQl1i": [-4.0, 4.0], "cQq11": [-0.7, 0.7], + "cQj11": [-0.7, 0.7], "cQq13": [-0.35, 0.35], + "cQj31": [-0.35, 0.35], "cQq81": [-1.7, 1.5], + "cQj18": [-1.7, 1.5], "cQq83": [-0.6, 0.6], + "cQj38": [-0.6, 0.6], "cQt1": [-6.0, 6.0], "cQt8": [-10.0, 10.0], "cbW": [-3.0, 3.0], @@ -36,23 +40,18 @@ "ctp": [-15.0, 40.0], "ctHRe": [-15.0, 40.0], "ctq1": [-0.6, 0.6], + "ctj1": [-0.6, 0.6], "ctq8": [-1.4, 1.4], + "ctj8": [-1.4, 1.4], "ctt1": [-2.6, 2.6], "ctt": [-2.6, 2.6], "cQd1": [-100, 100], - "ctj1": [-100, 100], - "cQj31": [-100, 100], - "ctj8": [-100, 100], "ctd1": [-100, 100], "ctd8": [-100, 100], - "ctGIm": [-100, 100], - "cQj11": [-100, 100], - "cQj18": [-100, 100], "ctu8": [-100, 100], "cQd8": [-100, 100], "ctu1": [-100, 100], "cQu1": [-100, 100], - "cQj38": [-100, 100], "cQu8": [-100, 100] } From fd75fc8ae2229ea5287541a45acbfc2623753f1d Mon Sep 17 00:00:00 2001 From: "Brent R. Yates" Date: Wed, 3 Dec 2025 11:51:43 -0500 Subject: [PATCH 13/13] Fix warning message in README_FITTING.md Updated warning message regarding EFT basis rotation and combine limit scans. --- README_FITTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_FITTING.md b/README_FITTING.md index b54fe8f39..a26706af9 100644 --- a/README_FITTING.md +++ b/README_FITTING.md @@ -15,6 +15,6 @@ python make_cards.py path/to/your.pkl.gz -C --do-nuisance --var-lst lj0pt ptz -d ## Running combine -:warning: The EFT basis rotation does not compile correctly on `glados`. Please make your workspace on a tested machine like `lxplus`. The root limit scans can still be done on `glados`. +:warning: The EFT basis rotation does not compile correctly on `glados`. Please make your workspace on a tested machine like `lxplus`. The combine limit scans can still be done on `glados`. The next step is to run combine. This takes place inside of a CMSSW release, outside of `topcoffea`. See the [EFTFit](https://github.com/TopEFT/EFTFit) repo for instructions.