From 052b8c2ba517d5542b8dee056f0fceadc34d2c3e Mon Sep 17 00:00:00 2001 From: Luca Lavezzo Date: Thu, 9 Apr 2026 20:16:02 -0400 Subject: [PATCH 1/3] add ISR uncertainty to theory fit --- scripts/rabbit/feedRabbitSigmaUL.py | 42 ++++++++++++++++++++++++++++- scripts/rabbit/setupRabbit.py | 12 +++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/scripts/rabbit/feedRabbitSigmaUL.py b/scripts/rabbit/feedRabbitSigmaUL.py index bb5cc13fc..5fcf03d66 100644 --- a/scripts/rabbit/feedRabbitSigmaUL.py +++ b/scripts/rabbit/feedRabbitSigmaUL.py @@ -294,10 +294,34 @@ def add_pdf_variations(args, writer, pdf_name): ) +def add_ew_isr_variation(args, writer): + ew_isr_name = "pythiaew_ISR" + corrh_num = theory_corrections.load_corr_hist( + f"{common.data_dir}/TheoryCorrections/{ew_isr_name}CorrZ.pkl.lz4", + "Z", + f"{ew_isr_name}_num", + ) + corrh_den = theory_corrections.load_corr_hist( + f"{common.data_dir}/TheoryCorrections/{ew_isr_name}CorrZ.pkl.lz4", + "Z", + f"{ew_isr_name}_den", + ) + print(corrh_num) + writer.add_scale_systematic( + [corrh_num, corrh_den], + f"{ew_isr_name}_Corr", + PROCESS_NAME, + SIGMAUL_CHANNEL, + kfactor=2, + mirror=True, + symmetrize="average", + groups=["theory_ew", "theory"], + ) + + def output_name(args): name = args.outname name += f"_{args.predGenerator}" - name += f"_{args.pdfs[0]}" name += f"_{'_'.join(args.nois)}" if args.postfix: name += f"_{args.postfix}" @@ -378,6 +402,17 @@ def make_parser(): return parser +def _validate_args(args): + """ + Make sure the the first PDF (the only one used) matches the args.predGenerator. + TODO: at some point, we should have a dataclass for each theory correction that specifies which PDF it belongs to, so we don't have to rely on string parsing of the generator name. + """ + if args.pdfs[0].lower() not in args.predGenerator.lower(): + raise ValueError( + f"Make sure the that the PDF you pass (--pdfs) matches the --predGenerator name." + ) + + def main(): parser = make_parser() args = parser.parse_args() @@ -385,6 +420,8 @@ def main(): args.channelSigmaUL = _join_cli_tokens(args.channelSigmaUL) logger = logging.setup_logger(__file__, args.verbose, args.noColorLogger) + _validate_args(args) + writer = SigmaULTheoryFitWriter( sparse=args.sparse, systematic_type=args.systematicType, @@ -409,6 +446,9 @@ def main(): logger.info("Adding PDF variations") add_pdf_variations(args, writer, pdf_name) + logger.info("Adding EW ISR variation") + add_ew_isr_variation(args, writer) + outfolder = args.outfolder or "./" meta = build_output_metadata(args, input_meta) writer.write( diff --git a/scripts/rabbit/setupRabbit.py b/scripts/rabbit/setupRabbit.py index ac59f9b17..4132ab077 100644 --- a/scripts/rabbit/setupRabbit.py +++ b/scripts/rabbit/setupRabbit.py @@ -1824,8 +1824,16 @@ def setup( passToFakes=passSystToFakes, ) - if inputBaseName != "prefsr": - # make prefsr and EW free definition + if inputBaseName == "prefsr": + # ISR only for pre-FSR + rabbit_helpers.add_electroweak_uncertainty( + datagroups, + [*args.isrUnc], + samples="single_v_samples", + flavor=datagroups.flavor, + passSystToFakes=passSystToFakes, + ) + else: rabbit_helpers.add_electroweak_uncertainty( datagroups, [*args.ewUnc, *args.fsrUnc, *args.isrUnc], From 4b996409e7320deb93c4f9bbb5692249ad9544a8 Mon Sep 17 00:00:00 2001 From: Luca Lavezzo Date: Thu, 9 Apr 2026 20:17:03 -0400 Subject: [PATCH 2/3] bump wremnants-data --- wremnants-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wremnants-data b/wremnants-data index ce16ff6db..9d970c372 160000 --- a/wremnants-data +++ b/wremnants-data @@ -1 +1 @@ -Subproject commit ce16ff6db3d916ca210e8186a57c1bcd99a0bea0 +Subproject commit 9d970c372abd8b1787af0a4567aa8d0cda805cbf From 7f4c410b5595f8248318f3fc2816f754bb13dc67 Mon Sep 17 00:00:00 2001 From: Luca Lavezzo Date: Thu, 9 Apr 2026 20:46:11 -0400 Subject: [PATCH 3/3] t commit -m "remove --- scripts/rabbit/feedRabbitSigmaUL.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/rabbit/feedRabbitSigmaUL.py b/scripts/rabbit/feedRabbitSigmaUL.py index 5fcf03d66..9503c05a8 100644 --- a/scripts/rabbit/feedRabbitSigmaUL.py +++ b/scripts/rabbit/feedRabbitSigmaUL.py @@ -297,16 +297,15 @@ def add_pdf_variations(args, writer, pdf_name): def add_ew_isr_variation(args, writer): ew_isr_name = "pythiaew_ISR" corrh_num = theory_corrections.load_corr_hist( - f"{common.data_dir}/TheoryCorrections/{ew_isr_name}CorrZ.pkl.lz4", + f"{common.data_dir}/TheoryCorrections/{ew_isr_name}_CorrZ.pkl.lz4", "Z", f"{ew_isr_name}_num", ) corrh_den = theory_corrections.load_corr_hist( - f"{common.data_dir}/TheoryCorrections/{ew_isr_name}CorrZ.pkl.lz4", + f"{common.data_dir}/TheoryCorrections/{ew_isr_name}_CorrZ.pkl.lz4", "Z", f"{ew_isr_name}_den", ) - print(corrh_num) writer.add_scale_systematic( [corrh_num, corrh_den], f"{ew_isr_name}_Corr",