Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion scripts/rabbit/feedRabbitSigmaUL.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,33 @@ 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",
)
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}"
Expand Down Expand Up @@ -378,13 +401,26 @@ 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()
args.fitresultMapping = _join_cli_tokens(args.fitresultMapping)
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,
Expand All @@ -409,6 +445,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(
Expand Down
12 changes: 10 additions & 2 deletions scripts/rabbit/setupRabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion wremnants-data
Submodule wremnants-data updated from ce16ff to 9d970c
Loading