Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
669946c
Draft: Implement Combine backend skeleton and object-oriented fit con…
Jun 25, 2026
399160d
Feat: Port datacard writer and validation to backend
Jun 25, 2026
2b3b38d
Feat: Integrate fit subcommand and parser into FCCAnalyses wrapper
Jun 26, 2026
70ea34a
Refactor: Modularize fit command to support multiple backends via --b…
Jun 26, 2026
03e42c1
Fix systematics matrix column alignment and add multi-channel ZH phys…
Jun 26, 2026
8a1b92c
feat: add -e/--execute and -l flags for direct combine fitting
Jun 29, 2026
4f1369b
chore: remove redundant dummy_fit.py example template
Jul 2, 2026
624a38b
feat: implement double-dash argument forwarding to wrapped tools
Jul 6, 2026
04c784f
feat: strip literal double-dash from tool arguments before execution
Jul 6, 2026
6b91783
feat: implement shape systematics validation and update example template
Jul 6, 2026
4532687
fix: resolve argument conflicts when forwarding custom combine methods
Jul 6, 2026
f250900
add CLI usage examples to example script and parser help
Jul 16, 2026
050e0bf
rename configuration validation to sanitization
Jul 16, 2026
c32f37c
handle keyboard interrupt to ensure termination on Ctrl+C
Jul 16, 2026
d7a9c59
feat: organize combine output files dynamically
Jul 16, 2026
55d8c31
optimize shape sanitization via bulk pre-loading and TFile disassocia…
Jul 17, 2026
b0868c4
ensure auto-creation of missing output directories and implement CI test
Jul 17, 2026
60000a4
fix: resolve combine argument positioning and update integration test…
Jul 17, 2026
ba183c6
fix: remove redundant duplicate subprocess execution block
Jul 17, 2026
4f9c713
fix test: enforce repository root cwd
Jul 17, 2026
a9267dd
fix test: enforce sys.executable and inject local PYTHONPATH for CI r…
Jul 17, 2026
b8fdc81
fix test: skip execution test in CI environments missing combine binary
Jul 17, 2026
fee4f2e
fix test: if/elif logic to prevent fallthrough on missing combine binary
Jul 17, 2026
695c632
refactor: rename user configuration class to Fit
Jul 17, 2026
52e2da2
Potential fix for pull request finding
captainvogon Jul 21, 2026
50ab041
fix: apply copilot review suggestions for variable scoping, temp dirs…
Jul 21, 2026
fb64477
test: convert example systematic to lnN
Jul 21, 2026
f383fb1
feat: add combine_args support to Fit config, enforce --out, and hand…
Jul 21, 2026
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
3 changes: 3 additions & 0 deletions bin/fccanalysis
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from run_analysis import run
from run_final_analysis import run_final
from do_plots import do_plots
from do_combine import do_combine
from fit import run_fit


# _____________________________________________________________________________
Expand Down Expand Up @@ -125,6 +126,8 @@ def main():
do_plots(parser)
elif args.command == 'combine':
do_combine(parser)
elif args.command == 'fit':
run_fit(parser)
else:
run(parser)

Expand Down
104 changes: 104 additions & 0 deletions examples/fcc_ee_zh_mumu_bb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
"""Example configuration script for FCC-ee ZH angular/mass fitting.

Usage Examples:
1. Generate the text datacard only:
fccanalysis fit examples/fcc_ee_zh_mumu_bb.py -o outputs/datacard.txt

2. Generate datacard and run the default AsymptoticLimits engine:
fccanalysis fit examples/fcc_ee_zh_mumu_bb.py -o outputs/datacard.txt -e

3. Override the default engine with custom options (e.g. FitDiagnostics):
fccanalysis fit examples/fcc_ee_zh_mumu_bb.py -o outputs/datacard.txt -e -- -M FitDiagnostics
"""

class Fit:
def __init__(self):
Comment thread
kjvbrt marked this conversation as resolved.
# 1. Global framework configurations
self.autoMCStats = False

# 2. Path templates for the input shape histograms
self.shapes = {
"*": {
"mumu_bjets_channel": "fcc_ee_zh_shapes.root $CHANNEL/$PROCESS $CHANNEL/$PROCESS_$SYSTEMATIC",
"mumu_inter_channel": "fcc_ee_zh_shapes.root $CHANNEL/$PROCESS $CHANNEL/$PROCESS_$SYSTEMATIC"
}
}

# 3. Channel definitions based on event selection categories
# Category 1: High purity b-tagged category
# Category 2: Intermediate/loose b-tagged category (to constrain backgrounds)
self.channels = {
"mumu_bjets_channel": {
"observation": -1, # -1 instructs Combine to use asymptotic or toy datasets
"processes": {
"ZH_signal": {"type": "signal", "rate": -1},
"ZZ_bkg": {"type": "background", "rate": -1},
"Zjets_bkg": {"type": "background", "rate": -1}
}
},
"mumu_inter_channel": {
"observation": -1,
"processes": {
"ZH_signal": {"type": "signal", "rate": -1},
"ZZ_bkg": {"type": "background", "rate": -1},
"Zjets_bkg": {"type": "background", "rate": -1}
}
}
}

# 4. Systematics Matrix
# Models how uncertainties affect each process in each distinct channel
self.systematics = {
# Integrated luminosity precision at FCC-ee (highly precise, ~0.1% to 0.5%)
"lumi_FCC": {
"type": "lnN",
"apply_to": {
"ZH_signal": 1.005,
"ZZ_bkg": 1.005,
"Zjets_bkg": 1.005
}
},
# Muon tracking and Identification efficiency uncertainty
"muon_eff": {
"type": "lnN",
"apply_to": {
"ZH_signal": 1.01,
"ZZ_bkg": 1.01,
"Zjets_bkg": 1.01
}
},
# B-tagging efficiency uncertainty (highly correlated with signal)
"btag_eff": {
"type": "lnN",
"apply_to": {
"ZH_signal": {"mumu_bjets_channel": 1.03, "mumu_inter_channel": 0.98},
"ZZ_bkg": {"mumu_bjets_channel": 1.03, "mumu_inter_channel": 0.98}
}
},
# Mistag rate uncertainty for light/charm jets leaking into the b-jet channel
"mistag_light": {
"type": "lnN",
"apply_to": {
"Zjets_bkg": {"mumu_bjets_channel": 1.10, "mumu_inter_channel": 1.04}
}
},
# Theoretical cross-section uncertainty for electroweak backgrounds
"theory_ZZ_xsec": {
"type": "lnN",
"apply_to": {
"ZZ_bkg": 1.04
}
},
# Recoil mass resolution shape systematic
"recoil_res": {
"type": "lnN",
"apply_to": {
"ZH_signal": 1.05,
"ZZ_bkg": 1.05
}
}
}

# Optional: Define default command-line arguments to pass to the Combine tool
# The framework will automatically append `--out <output_dir>` to this.
self.combine_args = "-M FitDiagnostics"
Loading