-
Notifications
You must be signed in to change notification settings - Fork 197
Implement integrated CMS Combine backend #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
captainvogon
wants to merge
28
commits into
HEP-FCC:master
Choose a base branch
from
captainvogon:feature/combine-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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…
399160d
Feat: Port datacard writer and validation to backend
2b3b38d
Feat: Integrate fit subcommand and parser into FCCAnalyses wrapper
70ea34a
Refactor: Modularize fit command to support multiple backends via --b…
03e42c1
Fix systematics matrix column alignment and add multi-channel ZH phys…
8a1b92c
feat: add -e/--execute and -l flags for direct combine fitting
4f1369b
chore: remove redundant dummy_fit.py example template
624a38b
feat: implement double-dash argument forwarding to wrapped tools
04c784f
feat: strip literal double-dash from tool arguments before execution
6b91783
feat: implement shape systematics validation and update example template
4532687
fix: resolve argument conflicts when forwarding custom combine methods
f250900
add CLI usage examples to example script and parser help
050e0bf
rename configuration validation to sanitization
c32f37c
handle keyboard interrupt to ensure termination on Ctrl+C
d7a9c59
feat: organize combine output files dynamically
55d8c31
optimize shape sanitization via bulk pre-loading and TFile disassocia…
b0868c4
ensure auto-creation of missing output directories and implement CI test
60000a4
fix: resolve combine argument positioning and update integration test…
ba183c6
fix: remove redundant duplicate subprocess execution block
4f9c713
fix test: enforce repository root cwd
a9267dd
fix test: enforce sys.executable and inject local PYTHONPATH for CI r…
b8fdc81
fix test: skip execution test in CI environments missing combine binary
fee4f2e
fix test: if/elif logic to prevent fallthrough on missing combine binary
695c632
refactor: rename user configuration class to Fit
52e2da2
Potential fix for pull request finding
captainvogon 50ab041
fix: apply copilot review suggestions for variable scoping, temp dirs…
fb64477
test: convert example systematic to lnN
f383fb1
feat: add combine_args support to Fit config, enforce --out, and hand…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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): | ||
| # 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" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.