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`. diff --git a/README_FITTING.md b/README_FITTING.md index 6b8013c0d..a26706af9 100644 --- a/README_FITTING.md +++ b/README_FITTING.md @@ -15,4 +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 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. diff --git a/topeft/modules/datacard_tools.py b/topeft/modules/datacard_tools.py index cc8d4a38d..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 @@ -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}") diff --git a/topeft/params/SMEFTsim-topU3l_dim6top.yml b/topeft/params/SMEFTsim-topU3l_dim6top.yml index 852c19b22..a4bdfcf11 100644 --- a/topeft/params/SMEFTsim-topU3l_dim6top.yml +++ b/topeft/params/SMEFTsim-topU3l_dim6top.yml @@ -2,21 +2,31 @@ "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" +"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('@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 -"ctGRe": ["expr::ctGRe('-1 * @0', {ctG})", ["ctG"]] -"ctGIm": ["expr::ctGIm('-1 * @0', {ctGI})", ["ctGI"]] +"ctG": ["expr::ctG('-1 * @0', {ctGRe})", ["ctGRe"]] +"ctGI": ["expr::ctGI('-1 * @0', {ctGIm})", ["ctGIm"]] # 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 diff --git a/topeft/params/wc_ranges.json b/topeft/params/wc_ranges.json index 1f6c4bd95..9c36edaf7 100644 --- a/topeft/params/wc_ranges.json +++ b/topeft/params/wc_ranges.json @@ -3,44 +3,55 @@ "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], + "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], "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], + "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], + "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], "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], - "ctGRe": [-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] }