Skip to content

YR5 XS update#1254

Closed
amarini wants to merge 1 commit into
cms-analysis:mainfrom
amarini:yr5
Closed

YR5 XS update#1254
amarini wants to merge 1 commit into
cms-analysis:mainfrom
amarini:yr5

Conversation

@amarini

@amarini amarini commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Starting but still have to verify that nothing breaks.

Summary by CodeRabbit

  • New Features

    • Added support for YR5 (Year 5) Higgs cross-section data.
    • Introduced new production modes (tH_schan, tH_tchan).
    • Added support for modern spreadsheet formats (.xlsx HXSWG tables).
    • Added 13.6 TeV cross-section predictions.
  • Data Updates

    • Updated cross-section values and uncertainty components across all production processes and energy levels (7–14 TeV).
    • Reformatted cross-section tables with refined uncertainty quantification.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends the HXSWG Higgs cross-section infrastructure to support Year 5 (YR5) data. It refactors the Python script to read modern Excel files via openpyxl, introduces YR5 schema definitions, adds file-writing capabilities, updates the C++ spline generation macro to accommodate more processes, and refreshes all downstream cross-section lookup tables across seven collision energies with new uncertainty column layouts while preserving YR4 data as historical archive.

Changes

YR5 Higgs cross-section updates

Layer / File(s) Summary
Spreadsheet abstraction and openpyxl integration
data/lhc-hxswg/makeSMtables.py
Top-level imports now include openpyxl alongside legacy xlrd. New wrapper classes OpenPyXLSheet and OpenPyXLBook normalize cell access and sheet enumeration; open_workbook(path) selects the backend by file extension, enabling modern .xlsx spreadsheet support.
YR5 schema definitions and find_starting_points utility
data/lhc-hxswg/makeSMtables.py
YR5 table definitions (stdHeadingYR5, xsecGroupsYR5, specsYR5) are introduced and merged into the main specs configuration. New find_starting_points(o) function scans spreadsheet rows to auto-discover column offsets for each process group by substring matching.
File output infrastructure and write mode
data/lhc-hxswg/makeSMtables.py
When --write flag is set, the script writes per-process tables to sm/xs/{sqrtS}/{sqrtS}-{procname}.txt. Special handling includes duplicating tH_Wassoc entries for 120/130 GeV at 7/8TeV, and custom column restructuring for ZH output. CLI gains -x/--find-starting-points and -w/--write boolean options.
Spline generation updates for YR5 support
data/lhc-hxswg/sm/makeAllSMSplines.C
Increases XS mode count from 9 to 10. New formatSqrtS() helper normalizes energy naming (e.g., 13.6 → 13p6TeV). Refactors makeXSSplines to use formatted energy strings in file paths and workspace naming. Splits tHq production mode into tH_schan and tH_tchan components (combined via RooFormulaVar). Updates qqZH to depend on formatted ZH and ggZH functions.
13 TeV cross-section data updates
data/lhc-hxswg/sm/xs/13TeV/*.txt
Replaces old scale/PDF column schema (Scale_pos/Scale_neg, PDF_plus_alpha_s) with new YR5 layout (Sca_Hi/Sca_Lo, Pdf_alpha_S, Total_Hi/Total_Lo). Introduces new *-tH_schan.txt and *-tH_tchan.txt process tables. Updates all existing process (WH, ZH, bbH, ggH, ggZH, tHW, ttH, vbfH) rows with reformatted values and mass-point sampling.
13.6 TeV cross-section data (new energy level)
data/lhc-hxswg/sm/xs/13p6TeV/*.txt
Introduces complete new 13p6TeV dataset at all production processes using YR5 column schema, covering WH, ZH, bbH, ggH, ggZH, tHW, tH_schan, tH_tchan, ttH, vbfH.
14 TeV cross-section data updates
data/lhc-hxswg/sm/xs/14TeV/*.txt
Updates 14 TeV tables to new column schema and introduces tH_schan/tH_tchan process tables at all energies; mirrors 13 TeV restructuring across all process types.
7 TeV cross-section data updates
data/lhc-hxswg/sm/xs/7TeV/*.txt
Updates 7 TeV tables to new column schema and introduces tH_schan/tH_tchan process tables; mirrors structural changes from higher energies.
8 TeV cross-section data updates
data/lhc-hxswg/sm/xs/8TeV/*.txt
Updates 8 TeV tables to new column schema and introduces tH_schan/tH_tchan process tables; mirrors structural changes from higher energies.
YR4 cross-section data archive (multiple energies)
data/lhc-hxswg/sm/xs/yr4-{7,8,13,14}TeV/*.txt
Adds backward-compatible YR4 tables at all four collision energies using legacy column schema for historical reference; covers all production processes (WH, ZH, bbH, ggH, ggZH, tHW, ttH, vbfH).
README update for YC5 reference
data/lhc-hxswg/README.md
Adds citation reference to YC5 Higgs cross-sections spreadsheet on GitLab.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 YR5 arrives with formats new and clean,
Spreadsheets parse through openpyxl's sheen,
Cross-sections bloom at thirteen-point-six,
While YR4 archives hold history fixed,
A woodland feast of Higgs data divine!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'YR5 XS update' directly and clearly summarizes the main change: updating cross-section data to a new YR5 (Year 5) release, which is the core focus of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
data/lhc-hxswg/sm/makeAllSMSplines.C

data/lhc-hxswg/sm/makeAllSMSplines.C:2:7: error: use of undeclared identifier 'std'
2 | const std::string location = "./"; //"$CMSSW_BASE/src/HiggsAnalysis/CombinedLimit/data/lhc-hxswg/sm/";
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:9:2: error: unknown type name 'RooRealVar'
9 | RooRealVar MH("MH","MH",125.09,120,130); MH.setConstant();
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:10:9: error: unknown type name 'TFile'
10 | TFile *fout = new TFile("sm_br_yr4.root","RECREATE");
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:10:27: error: unknown type name 'TFile'
10 | TFile *fout = new TFile("sm_br_yr4.root","RECREATE");
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:12:2: error: unknown type name 'RooWorkspace'
12 | RooWorkspace ws("br","br");
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:14:2: error: use of undeclared identifier 'std'
14 | std::string br[nbr]

... [truncated 2200 characters] ...

s.C:26:26: error: subscripted value is not an array, pointer, or vector
26 | std::string name = br4f[bri];
| ~~~~^~~~
data/lhc-hxswg/sm/makeAllSMSplines.C:27:3: error: unknown type name 'RooSpline1D'
27 | RooSpline1D spline(Form("%s",name.c_str()),Form("file br/BR4_4f.txt, x=%d, y=%d",0,1),MH,Form("%s/br/BR4_4f.txt",location.c_str()),0,bri+1,1,"CSPLINE");
| ^
data/lhc-hxswg/sm/makeAllSMSplines.C:27:46: error: use of undeclared identifier 'Form'
27 | RooSpline1D spline(Form("%s",name.c_str()),Form("file br/BR4_4f.txt, x=%d, y=%d",0,1),MH,Form("%s/br/BR4_4f.txt",location.c_str()),0,bri+1,1,"CSPLINE");
| ^
data


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-tHW.txt (1)

1-5: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Sparse and mass-independent data for tHW process.

This table contains only 3 mass points (120, 125, 130 GeV) with identical cross-section values (3.510E-03 pb) and uncertainties, showing no mass dependence. This is significantly sparser and simpler than other processes in the archive. While unusual, this reflects the historical YR4 state where tHW calculations may have been limited or approximated as mass-independent. Users interpolating this data should be aware of these limitations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-tHW.txt` around lines 1 - 5, This table
for the tHW process only contains three identical mass points and is effectively
mass-independent; add an explicit data-quality note/metadata above the table
(referencing the tHW entry and the header line "mH_GeV  XS_pb") stating that the
dataset is sparse (120,125,130 GeV), cross-sections are identical, and users
should treat the values as mass-independent and exercise caution when
interpolating (or set a flag like "mass_independent: true" / "notes: limited YR4
approximation") so downstream consumers know to handle interpolation
differently.
data/lhc-hxswg/sm/makeAllSMSplines.C (1)

80-92: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing spline generation for 13.6 TeV.

The PR introduces 13.6 TeV cross-section data files (layer 6 in the stack), and formatSqrtS(13.6) correctly formats it as "13p6TeV", but makeAllSMSplines() does not call makeXSSplines(13.6). Without this call, the 13.6 TeV data will lack corresponding spline ROOT files, breaking any analysis that attempts to use 13.6 TeV cross-sections.

🐛 Proposed fix
 	// Make XS 
 	makeXSSplines(14);	
+	makeXSSplines(13.6);	
 	makeXSSplines(13);	
 	makeXSSplines(8);	
 	makeXSSplines(7);	
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/makeAllSMSplines.C` around lines 80 - 92, The
makeAllSMSplines function is missing the call to generate 13.6 TeV cross-section
splines; update makeAllSMSplines to invoke makeXSSplines(13.6) alongside the
existing calls (makeXSSplines(14), makeXSSplines(13), makeXSSplines(8),
makeXSSplines(7)) so that the 13.6 TeV layer (formatted by formatSqrtS(13.6) as
"13p6TeV") produces its ROOT spline files; ensure the call uses the same pattern
as the others and keep makeBRSplines() unchanged.
🟡 Minor comments (13)
data/lhc-hxswg/README.md-4-4 (1)

4-4: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Typo: "YC5" should be "YR5".

The text says "YC5" but the PR title, description, and entire codebase refer to "YR5" (Year 5). This appears to be a typo.

📝 Proposed fix
-YC5 cross-sections and citation in the spreadsheet [here](https://gitlab.cern.ch/LHCHIGGSXS/LHCHXSWG1/crosssections/-/blob/master/Higgs_cross_sections.xlsx?ref_type=heads)
+YR5 cross-sections and citation in the spreadsheet [here](https://gitlab.cern.ch/LHCHIGGSXS/LHCHXSWG1/crosssections/-/blob/master/Higgs_cross_sections.xlsx?ref_type=heads)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/README.md` at line 4, Replace the typo "YC5" with "YR5" in the
README entry that currently reads "YC5 cross-sections and citation in the
spreadsheet..." so the sentence matches the PR and codebase naming; update the
text string in the README.md (the line containing "YC5 cross-sections and
citation in the spreadsheet") to "YR5 cross-sections and citation in the
spreadsheet..." ensuring no other occurrences of "YC5" remain.
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt-23-23 (1)

23-23: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Verify another outlier uncertainty value.

The Scale_PDF_alpha_S_pos value of +23.0 at mH=125.20 GeV is another outlier compared to neighboring values (~+20.1). Please verify this is correct from the source data.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt` at line 23, At mH = 125.20
(line showing "125.20	5.501E-01	+23.0	-24.0") the Scale_PDF_alpha_S_pos value
"+23.0" appears as an outlier versus neighboring entries (~+20.1); verify the
original source table for the Scale_PDF_alpha_S_pos value and if it was a
transcription error replace "+23.0" with the correct value (likely "+20.1") in
this file, ensuring the entry format "125.20\t5.501E-01\t<pos>\t<neg>" is
preserved and update any related metadata/comments if present.
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-vbfH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Column name contains space instead of underscore.

The header uses PDF alpha_S with a space, while other columns use underscores. This inconsistency may cause parsing issues.

📝 Proposed fix
-mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s  PDF alpha_S
+mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s  PDF_alpha_S
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-vbfH.txt` at line 1, The header row uses
"PDF alpha_S" with a space which breaks the underscore naming convention; update
the header to "PDF_alpha_S" (matching other columns like PDF_plus_alpha_s) so
the first line becomes: mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s
PDF_alpha_S, ensuring you preserve the original spacing/separators so downstream
parsers continue to split columns correctly.
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-tHW.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Column name contains space instead of underscore.

The header uses PDF alpha_S with a space, while other columns use underscores. This inconsistency may cause parsing issues and should match the convention used in other columns.

📝 Proposed fix
-mH_GeV  XS_pb		Scale_pos Scale_neg PDF_plus_alpha_s PDF alpha_S
+mH_GeV  XS_pb		Scale_pos Scale_neg PDF_plus_alpha_s PDF_alpha_S
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-tHW.txt` at line 1, The header has an
inconsistent column name "PDF alpha_S" containing a space; change it to use an
underscore to match the other columns (e.g., rename "PDF alpha_S" to
"PDF_alpha_S") so parsing is consistent with existing headers like "mH_GeV",
"XS_pb", "Scale_pos", "Scale_neg", and "PDF_plus_alpha_s".
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ttH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Column name contains space instead of underscore.

The header uses PDF alpha_S with a space, while other columns use underscores. This is inconsistent with naming conventions and may cause parsing issues.

📝 Proposed fix
-mH_GeV  XS_pb		Scale_pos Scale_neg PDF_plus_alpha_s PDF alpha_S
+mH_GeV  XS_pb		Scale_pos Scale_neg PDF_plus_alpha_s PDF_alpha_S
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ttH.txt` at line 1, The header has an
inconsistent column name "PDF alpha_S" with a space; change it to "PDF_alpha_S"
to match the underscore convention used by "mH_GeV", "XS_pb", "Scale_pos",
"Scale_neg", and "PDF_plus_alpha_s" so parsers won't break; update the header
string in the file (look for the header line containing mH_GeV  XS_pb  Scale_pos
Scale_neg PDF_plus_alpha_s PDF alpha_S) to replace the space with an underscore.
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-WH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Column name contains space instead of underscore.

The header uses PDF alpha_S with a space, while other columns use underscores (e.g., PDF_plus_alpha_s). This inconsistency may cause parsing issues.

📝 Proposed fix for consistent column naming
-mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s PDF alpha_S	XS_W_plus_pb  XS_W_minus_pb
+mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s PDF_alpha_S	XS_W_plus_pb  XS_W_minus_pb
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-WH.txt` at line 1, The header has an
inconsistent column name "PDF alpha_S" (contains a space and different casing)
which will break parsers; update that header token to use underscores and match
the existing style by replacing "PDF alpha_S" with "PDF_alpha_s" (consistent
with "PDF_plus_alpha_s") in the header line so all column names use underscores
and consistent casing.
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify ambiguous column header.

The header text Gauss PDF_plus_alpha_s PDF alpha_S is ambiguous. The data rows contain 8 columns, but it's unclear whether the header defines:

  • Gauss PDF_plus_alpha_s PDF alpha_S (4 separate columns), or
  • Gauss_PDF_plus_alpha_s PDF_alpha_S (2 columns)

Additionally, PDF alpha_S uses a space instead of an underscore, inconsistent with other column names.

📝 Proposed fix for clearer header

If the intended columns are separate uncertainty components:

-mH_GeV  XS_pb       Scale_pos	Scale_neg Gauss PDF_plus_alpha_s  PDF alpha_S
+mH_GeV  XS_pb       Scale_pos	Scale_neg Gauss	PDF_plus_alpha_s  PDF	alpha_S
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggH.txt` at line 1, The header is
ambiguous about the last columns and uses a space in "PDF alpha_S"; update the
header to explicitly list all eight columns and use underscores for consistency
— e.g. change the header line to: mH_GeV XS_pb Scale_pos Scale_neg Gauss
PDF_plus_alpha_s PDF PDF_alpha_S so each data column maps unambiguously to a
header (adjust the exact names if "PDF" should be more descriptive).
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt-10-10 (1)

10-10: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Verify Scale_PDF_alpha_S_pos outlier at mH=124.00 GeV

In data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt, this row has Scale_PDF_alpha_S_pos=+23.4:

124.00	5.672E-01	+23.4	-24.2

Adjacent points in the same table are ~+20.0 to +20.3, and other bbH tables at mH=124.00 are much closer to +20 (13TeV: +20.1, 8TeV: +20.6, 7TeV: +20.8). Please confirm the +23.4 entry matches the source data (or correct if erroneous).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt` at line 10, The
Scale_PDF_alpha_S_pos value "+23.4" in the row "124.00	5.672E-01	+23.4	-24.2" of
data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt appears to be an outlier; verify
the original HXSWG source (or generation script) for the mH=124.00 bbH entry
and, if the source shows a different value (likely near +20.0–+20.3 as in
adjacent points), replace "+23.4" with the correct Scale_PDF_alpha_S_pos value
in that row (keeping the rest of the row intact) and save the corrected file.
Ensure the corrected numeric format (sign and precision) matches surrounding
entries.
data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Header has inconsistent naming convention.

The header uses "PDF alpha_S" with a space separator, while other columns use underscores (e.g., PDF_plus_alpha_s). This inconsistency could cause parsing issues if the reader expects uniform naming conventions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggH.txt` at line 1, The header contains an
inconsistent column name "PDF alpha_S" (with a space) that breaks the underscore
naming convention used by other columns like mH_GeV, XS_pb, Scale_pos, Gauss,
and PDF_plus_alpha_s; change "PDF alpha_S" to "PDF_alpha_S" so all column names
use underscores consistently to avoid parser failures and to match the existing
naming pattern.
data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-WH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Header has inconsistent delimiter and naming convention.

The header mixes tabs and spaces as delimiters, and "PDF alpha_S" uses a space instead of an underscore (unlike PDF_plus_alpha_s). This inconsistency could cause parsing issues if the reader expects uniform delimiters or naming conventions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-WH.txt` at line 1, The header line "mH_GeV
XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s PDF alpha_S	XS_W_plus_pb 
XS_W_minus_pb" uses mixed tabs/spaces and an inconsistent column name; change it
to use a single delimiter style (e.g., all tabs or all single spaces) and rename
"PDF alpha_S" to "PDF_alpha_S" to match the naming of "PDF_plus_alpha_s"; update
the header so column names are consistently formatted (for example:
mH_GeV<TAB>XS_pb<TAB>Scale_pos<TAB>Scale_neg<TAB>PDF_plus_alpha_s<TAB>PDF_alpha_S<TAB>XS_W_plus_pb<TAB>XS_W_minus_pb).
data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ZH.txt-1-1 (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Header has trailing tab creating an empty column.

The header line ends with a trailing tab after "alpha_S", creating an implicit empty column. This could cause parsing issues or confusion about the expected column count.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ZH.txt` at line 1, The header line
currently ends with a trailing tab after the "alpha_S" column causing an empty
implicit column; edit the header string (the line containing "mH_GeV  XS_pb     
Scale_pos	Scale_neg PDF_plus_alpha_s  PDF  alpha_S") to remove the trailing tab
so the header ends exactly with "alpha_S" and no extra delimiter, ensuring the
column count matches the data rows.
data/lhc-hxswg/sm/xs/7TeV/7TeV-tHW.txt-2-4 (1)

2-4: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Inconsistent number formatting for mH_GeV.

Line 2 formats mH_GeV as +125 (with explicit + sign), while lines 3-4 use 120 and 130 (without + sign). For consistency with the header comment and other rows throughout the file set, all values should use the + prefix.

✨ Proposed fix
 +125  +0.00223  +4.2  -5.5  +8.4  +9.39148550549912  -10.0404183179786
-120  +0.00223  +4.2  -5.5  +8.4  +9.39148550549912  -10.0404183179786
-130  +0.00223  +4.2  -5.5  +8.4  +9.39148550549912  -10.0404183179786
++120  +0.00223  +4.2  -5.5  +8.4  +9.39148550549912  -10.0404183179786
++130  +0.00223  +4.2  -5.5  +8.4  +9.39148550549912  -10.0404183179786
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tHW.txt` around lines 2 - 4, The mH_GeV column
values are inconsistently formatted: the first row shows "+125" while the next
rows show "120" and "130" without a leading plus; update those entries so every
mH_GeV value uses a leading '+' (e.g., change "120" to "+120" and "130" to
"+130") to match the header and other rows and ensure consistent formatting for
the mH_GeV field.
data/lhc-hxswg/sm/xs/8TeV/8TeV-vbfH.txt-12-12 (1)

12-12: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Minor: Inconsistent precision in Total_Hi value.

Line 12 (mH=125.6) has Total_Hi rounded to +2.55, while all other rows maintain full precision (e.g., +2.54360531529559). This inconsistency in formatting should be corrected for uniformity.

Suggested fix

The exact value should match the precision of other rows. Please verify the source data and update to full precision.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-vbfH.txt` at line 12, The row for mH=125.6 has
an inconsistent Total_Hi value ("+2.55")—replace that truncated value with the
full-precision Total_Hi from the source data so it matches the precision of
other rows (i.e., update the 125.6 row: "125.6  +1.603502046  +1.08  -1.061 
+2.31  +2.55  -2.54201121161965" by restoring the full-precision Total_Hi),
verifying the exact digits from the original dataset before committing.
🧹 Nitpick comments (7)
data/lhc-hxswg/README.md (1)

4-4: ⚡ Quick win

Improve grammar and use descriptive link text.

The sentence is grammatically incomplete (missing a verb), and the link text "here" is not descriptive per markdown best practices.

♻️ Proposed fix
-YC5 cross-sections and citation in the spreadsheet [here](https://gitlab.cern.ch/LHCHIGGSXS/LHCHXSWG1/crosssections/-/blob/master/Higgs_cross_sections.xlsx?ref_type=heads)
+YR5 cross-sections and citations are available in the [YR5 cross-sections spreadsheet](https://gitlab.cern.ch/LHCHIGGSXS/LHCHXSWG1/crosssections/-/blob/master/Higgs_cross_sections.xlsx?ref_type=heads).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/README.md` at line 4, The sentence in README.md is missing a
verb and uses non-descriptive link text; update it to a complete sentence that
names the resource and replaces "here" with descriptive link text (e.g., "Higgs
cross sections spreadsheet on GitLab") so it reads like "YC5 cross-sections and
citation are available in the Higgs cross sections spreadsheet on GitLab" and
make the link target the provided URL.
data/lhc-hxswg/makeSMtables.py (2)

243-251: ⚡ Quick win

Debug print statements left in code.

Multiple print statements appear to be debug artifacts. Line 243 prints every row value which will produce excessive output. Consider removing these or converting to logging.debug() for consistency with the rest of the codebase.

♻️ Proposed fix: Convert to logging
-                print(vals)
+                logging.debug("Row values: %s", vals)
                 for key in ['ggF', 'VBF', 'WH', 'ZH', 'ttH', 'bbH', 'tH (s-ch', 'tH (t-ch', 'tH (W-ass']:
                     col = find_col_by_substring(vals, cols, offset, key)
                     if col is not None:
                         startings[key] = col
-        print('------------------------------------------------------------')
-        print(s.name, startings)
-        print('------------------------------------------------------------')
-    print("==============================================================")
+        logging.info("Sheet [%s] starting columns: %s", s.name, startings)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/makeSMtables.py` around lines 243 - 251, The code contains
leftover debug print calls (print(vals),
print('------------------------------------------------------------'),
print(s.name, startings), and the final
print("==============================================================")) within
the loop that builds startings; replace these with appropriate logging.debug
calls (or remove them) to avoid excessive console output and match the project's
logging practice, e.g., use logging.debug with context including s.name,
startings and avoid printing full row data unless debug-level logging is
enabled; update imports if needed and ensure the logic around
find_col_by_substring, vals, cols, offset, key remains unchanged.

356-368: 💤 Low value

Redundant conditional and assignment.

  • Line 356: if True: is always true and can be removed.
  • Line 367: line2[1] = table[1][1] is redundant since line2 is already a copy of table[1], so line2[1] already equals table[1][1].
♻️ Proposed cleanup
-                if True: ## thisi is the default behaviour
-                    os.makedirs(f"sm/xs/{sqrtS}", exist_ok=True)
-                    outname = f"sm/xs/{sqrtS}/{sqrtS}-{procname}.txt"
-                    with open(outname, "w") as out:
-                        for line in table:
-                            out.write("  ".join(line) + "\n")
-                        if group == 'tH_Wassoc' and sqrtS in ["7TeV", "8TeV"]:
-                            ## add 120 and 130 as duplicate of 125
-                            for mh in [120, 130]:
-                                line2 = list(table[1][:])
-                                line2[0] = str(mh)
-                                line2[1] = table[1][1] ## tHW XS_pb
-                                out.write("  ".join(line2) + "\n")
+                os.makedirs(f"sm/xs/{sqrtS}", exist_ok=True)
+                outname = f"sm/xs/{sqrtS}/{sqrtS}-{procname}.txt"
+                with open(outname, "w") as out:
+                    for line in table:
+                        out.write("  ".join(line) + "\n")
+                    if group == 'tH_Wassoc' and sqrtS in ["7TeV", "8TeV"]:
+                        # add 120 and 130 as duplicate of 125
+                        for mh in [120, 130]:
+                            line2 = list(table[1][:])
+                            line2[0] = str(mh)
+                            out.write("  ".join(line2) + "\n")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/makeSMtables.py` around lines 356 - 368, Remove the no-op "if
True:" wrapper and dedent its body so the directory creation, file open, and
write loop run directly; inside the special-case block for group == 'tH_Wassoc'
and sqrtS in ["7TeV","8TeV"], remove the redundant assignment line2[1] =
table[1][1] (since line2 is already a shallow copy of table[1]) and only
overwrite line2[0] = str(mh) before writing; keep using variables outname,
table, group, sqrtS, procname and the existing out.write calls.
data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-vbfH.txt (1)

1-40: 💤 Low value

Inconsistent whitespace could affect parsing.

The table uses inconsistent spacing with a mix of tabs and spaces, particularly in the PDF_plus_alpha_s and PDF alpha_S columns. While flexible whitespace-based parsers will likely handle this, fixed-column parsers might fail.

Consider standardizing to consistent tab separation for robustness.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-vbfH.txt` around lines 1 - 40, The
file's whitespace is inconsistent across rows in the table (headers: mH_GeV,
XS_pb, Scale_pos, Scale_neg, PDF_plus_alpha_s, PDF alpha_S) which can break
fixed-column parsers; fix by normalizing each line to use a single delimiter
(prefer tabs) between all six columns, ensure the header row and every data row
have exactly six tab-separated fields and remove extra spaces/tabs within fields
so values like "PDF_plus_alpha_s" and "PDF alpha_S" align consistently across
all lines.
data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ZH.txt (1)

2-39: ⚡ Quick win

Trailing tabs after the last column.

Each data row has trailing tab character(s) after the alpha_S column. While this may not break parsing, it creates inconsistency and could cause issues with whitespace-sensitive parsers.

🧹 Remove trailing tabs

Strip trailing whitespace from all data rows to ensure clean formatting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ZH.txt` around lines 2 - 39, Rows in the
data block contain trailing tab characters after the last column (alpha_S) —
e.g. lines starting with "120.00" through "130.00" end with extra tabs — remove
those trailing whitespace characters from every data row so each line ends
immediately after the last numeric column; update the data-generation/export
step or run a whitespace trim on each line to ensure no tabs/spaces remain at
line ends.
data/lhc-hxswg/sm/makeAllSMSplines.C (1)

38-41: 💤 Low value

Consider returning const char* to indicate the pointer's limited lifetime.

The Form() function in ROOT returns a pointer to a static buffer that rotates. While safe for immediate use, returning char* (non-const) suggests the caller might modify or own the memory, which is not the case. Returning const char* better reflects the semantics.

♻️ Proposed refactor
-char* formatSqrtS(float sqrts){
+const char* formatSqrtS(float sqrts){
 	if (fabs(sqrts - 13.6)<0.001) return Form("13p6TeV");
 	return Form("%dTeV",(int)sqrts);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/makeAllSMSplines.C` around lines 38 - 41, Change the
function signature of formatSqrtS from returning char* to const char* (i.e.,
const char* formatSqrtS(float sqrts)), leaving the return expressions using
Form(...) unchanged; update any declarations/prototypes and call sites that
expect a non-const char* to accept const char* (or add explicit copies where
caller needs ownership) so the function accurately reflects the static/immutable
lifetime of the Form() buffer.
data/lhc-hxswg/sm/xs/8TeV/8TeV-tHW.txt (1)

2-4: 💤 Low value

Consider sorting mass points in ascending order.

The mass points are listed in non-standard order (125, 120, 130) rather than ascending order. While functionally correct, sorting them (120, 125, 130) would improve readability and consistency with other data files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tHW.txt` around lines 2 - 4, The mass-point
block containing the lines with masses "125  +0.00351...", "120  +0.00351...",
"130  +0.00351..." should be reordered so mass values are ascending; reorder
those three rows to "120", "125", "130" while preserving each row's full columns
and formatting to keep values aligned and unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@data/lhc-hxswg/makeSMtables.py`:
- Around line 1-4: The code calls xlrd when handling legacy .xls workbooks but
never imports it, causing a NameError; add a conditional (lazy) import of xlrd
right before the .xls handling path so xlrd is only required for legacy files,
e.g., in the branch that decides between load_workbook and xlrd (the logic
around the .xls/.xlsx handling where xlrd is referenced) import xlrd inside a
try/except ImportError and raise a clear error instructing the user to install
xlrd if missing; ensure the import name is exactly xlrd so the existing
references resolve.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-bbH.txt`:
- Line 4: Replace the incorrect positive scale-low entry on the row "124  +0.176
+9.6  +9.6  +3.6  +10.2  -10.2": the Sca_Lo column (currently "+9.6" immediately
after "+0.176") must be "-9.6" to reflect a downward scale variation; update
that token to "-9.6" so the row reads "124  +0.176  -9.6  +9.6  +3.6  +10.2 
-10.2".

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_schan.txt`:
- Around line 2-15: The Sca_Lo column entries (the fourth whitespace-separated
field in each row, currently values like +16.6, +17.0, etc.) use the wrong sign;
change each of those values to its negative (e.g. +16.6 -> -16.6) throughout the
file so Sca_Lo follows the downward-uncertainty convention referenced as Sca_Lo
in this diff and appears negative for every mass row (entries starting with 120,
122, 124, 124.6, ... 130).

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_tchan.txt`:
- Around line 2-15: The Sca_Lo column (the entries showing +2.5 / +2.6 in each
row) is using the wrong sign; change every Sca_Lo value to negative (e.g., +2.5
-> -2.5, +2.6 -> -2.6) across all rows in this file while preserving the
existing spacing and plus signs for other columns so the file formatting remains
unchanged.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-ttH.txt`:
- Around line 3-15: The Sca_Lo column values in the provided diff are using the
wrong sign (they are +9.2 but should be negative); update each Sca_Lo entry in
these rows (the field showing +9.2) to be negative (e.g., change +9.2 to -9.2,
and any other positive Sca_Lo values to their negative equivalents) so the
Sca_Lo column follows the downward-uncertainty convention consistent with the
-9.3 example.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-bbH.txt`:
- Line 8: The Sca_Lo value in the row "+125.09  +0.221  +9.3  +9.3  +3.4  +9.9 
-9.9" is signed incorrectly; change the third column (Sca_Lo) from "+9.3" to
"-9.3" so the row reads "+125.09  +0.221  -9.3  +9.3  +3.4  +9.9  -9.9".

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_schan.txt`:
- Around line 2-15: The Sca_Lo column in this data block is using positive signs
but should be negative; update every Sca_Lo entry (e.g., values currently "+16",
"+16.1", "+16.4", "+16.5", etc.) to have a leading minus sign (e.g., "-16",
"-16.1", "-16.4", "-16.5") across all rows in the diff so the lower scale
uncertainty follows the same negative convention as Total_Lo.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_tchan.txt`:
- Around line 2-15: The Total_Hi/Total_Lo values in the 8TeV tH_tchan table are
inconsistent across the mH grid (notably at mH=124.0 vs 124.6) while
Sca_Hi/Sca_Lo change, so inspect the source calculation that produces Total_Hi
and Total_Lo for entries around mH=124/124.6 (the rows with mH=124.0, 124.6 and
the repeated value +3.95979797464467 / -3.68781778291715), verify whether
Total_* should be constant across the grid, and either (a) recompute
Total_Hi/Total_Lo for mH=124.6 from the same component contributions used for
other rows (fixing any spreadsheet formula or script bug), or (b) apply
consistent rounding/propagation rules so the totals match the pattern seen in
other energies; update the data row(s) so Total_Hi/Total_Lo align with the
intended computation for the mH grid.

---

Outside diff comments:
In `@data/lhc-hxswg/sm/makeAllSMSplines.C`:
- Around line 80-92: The makeAllSMSplines function is missing the call to
generate 13.6 TeV cross-section splines; update makeAllSMSplines to invoke
makeXSSplines(13.6) alongside the existing calls (makeXSSplines(14),
makeXSSplines(13), makeXSSplines(8), makeXSSplines(7)) so that the 13.6 TeV
layer (formatted by formatSqrtS(13.6) as "13p6TeV") produces its ROOT spline
files; ensure the call uses the same pattern as the others and keep
makeBRSplines() unchanged.

In `@data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-tHW.txt`:
- Around line 1-5: This table for the tHW process only contains three identical
mass points and is effectively mass-independent; add an explicit data-quality
note/metadata above the table (referencing the tHW entry and the header line
"mH_GeV  XS_pb") stating that the dataset is sparse (120,125,130 GeV),
cross-sections are identical, and users should treat the values as
mass-independent and exercise caution when interpolating (or set a flag like
"mass_independent: true" / "notes: limited YR4 approximation") so downstream
consumers know to handle interpolation differently.

---

Minor comments:
In `@data/lhc-hxswg/README.md`:
- Line 4: Replace the typo "YC5" with "YR5" in the README entry that currently
reads "YC5 cross-sections and citation in the spreadsheet..." so the sentence
matches the PR and codebase naming; update the text string in the README.md (the
line containing "YC5 cross-sections and citation in the spreadsheet") to "YR5
cross-sections and citation in the spreadsheet..." ensuring no other occurrences
of "YC5" remain.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tHW.txt`:
- Around line 2-4: The mH_GeV column values are inconsistently formatted: the
first row shows "+125" while the next rows show "120" and "130" without a
leading plus; update those entries so every mH_GeV value uses a leading '+'
(e.g., change "120" to "+120" and "130" to "+130") to match the header and other
rows and ensure consistent formatting for the mH_GeV field.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-vbfH.txt`:
- Line 12: The row for mH=125.6 has an inconsistent Total_Hi value
("+2.55")—replace that truncated value with the full-precision Total_Hi from the
source data so it matches the precision of other rows (i.e., update the 125.6
row: "125.6  +1.603502046  +1.08  -1.061  +2.31  +2.55  -2.54201121161965" by
restoring the full-precision Total_Hi), verifying the exact digits from the
original dataset before committing.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt`:
- Line 23: At mH = 125.20 (line showing "125.20	5.501E-01	+23.0	-24.0") the
Scale_PDF_alpha_S_pos value "+23.0" appears as an outlier versus neighboring
entries (~+20.1); verify the original source table for the Scale_PDF_alpha_S_pos
value and if it was a transcription error replace "+23.0" with the correct value
(likely "+20.1") in this file, ensuring the entry format
"125.20\t5.501E-01\t<pos>\t<neg>" is preserved and update any related
metadata/comments if present.
- Line 10: The Scale_PDF_alpha_S_pos value "+23.4" in the row
"124.00	5.672E-01	+23.4	-24.2" of data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt
appears to be an outlier; verify the original HXSWG source (or generation
script) for the mH=124.00 bbH entry and, if the source shows a different value
(likely near +20.0–+20.3 as in adjacent points), replace "+23.4" with the
correct Scale_PDF_alpha_S_pos value in that row (keeping the rest of the row
intact) and save the corrected file. Ensure the corrected numeric format (sign
and precision) matches surrounding entries.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggH.txt`:
- Line 1: The header is ambiguous about the last columns and uses a space in
"PDF alpha_S"; update the header to explicitly list all eight columns and use
underscores for consistency — e.g. change the header line to: mH_GeV XS_pb
Scale_pos Scale_neg Gauss PDF_plus_alpha_s PDF PDF_alpha_S so each data column
maps unambiguously to a header (adjust the exact names if "PDF" should be more
descriptive).

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-tHW.txt`:
- Line 1: The header has an inconsistent column name "PDF alpha_S" containing a
space; change it to use an underscore to match the other columns (e.g., rename
"PDF alpha_S" to "PDF_alpha_S") so parsing is consistent with existing headers
like "mH_GeV", "XS_pb", "Scale_pos", "Scale_neg", and "PDF_plus_alpha_s".

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ttH.txt`:
- Line 1: The header has an inconsistent column name "PDF alpha_S" with a space;
change it to "PDF_alpha_S" to match the underscore convention used by "mH_GeV",
"XS_pb", "Scale_pos", "Scale_neg", and "PDF_plus_alpha_s" so parsers won't
break; update the header string in the file (look for the header line containing
mH_GeV  XS_pb  Scale_pos Scale_neg PDF_plus_alpha_s PDF alpha_S) to replace the
space with an underscore.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-vbfH.txt`:
- Line 1: The header row uses "PDF alpha_S" with a space which breaks the
underscore naming convention; update the header to "PDF_alpha_S" (matching other
columns like PDF_plus_alpha_s) so the first line becomes: mH_GeV  XS_pb      
Scale_pos	Scale_neg PDF_plus_alpha_s  PDF_alpha_S, ensuring you preserve the
original spacing/separators so downstream parsers continue to split columns
correctly.

In `@data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-WH.txt`:
- Line 1: The header has an inconsistent column name "PDF alpha_S" (contains a
space and different casing) which will break parsers; update that header token
to use underscores and match the existing style by replacing "PDF alpha_S" with
"PDF_alpha_s" (consistent with "PDF_plus_alpha_s") in the header line so all
column names use underscores and consistent casing.

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggH.txt`:
- Line 1: The header contains an inconsistent column name "PDF alpha_S" (with a
space) that breaks the underscore naming convention used by other columns like
mH_GeV, XS_pb, Scale_pos, Gauss, and PDF_plus_alpha_s; change "PDF alpha_S" to
"PDF_alpha_S" so all column names use underscores consistently to avoid parser
failures and to match the existing naming pattern.

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-WH.txt`:
- Line 1: The header line "mH_GeV  XS_pb       Scale_pos	Scale_neg
PDF_plus_alpha_s PDF alpha_S	XS_W_plus_pb  XS_W_minus_pb" uses mixed tabs/spaces
and an inconsistent column name; change it to use a single delimiter style
(e.g., all tabs or all single spaces) and rename "PDF alpha_S" to "PDF_alpha_S"
to match the naming of "PDF_plus_alpha_s"; update the header so column names are
consistently formatted (for example:
mH_GeV<TAB>XS_pb<TAB>Scale_pos<TAB>Scale_neg<TAB>PDF_plus_alpha_s<TAB>PDF_alpha_S<TAB>XS_W_plus_pb<TAB>XS_W_minus_pb).

In `@data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ZH.txt`:
- Line 1: The header line currently ends with a trailing tab after the "alpha_S"
column causing an empty implicit column; edit the header string (the line
containing "mH_GeV  XS_pb       Scale_pos	Scale_neg PDF_plus_alpha_s  PDF 
alpha_S") to remove the trailing tab so the header ends exactly with "alpha_S"
and no extra delimiter, ensuring the column count matches the data rows.

---

Nitpick comments:
In `@data/lhc-hxswg/makeSMtables.py`:
- Around line 243-251: The code contains leftover debug print calls
(print(vals),
print('------------------------------------------------------------'),
print(s.name, startings), and the final
print("==============================================================")) within
the loop that builds startings; replace these with appropriate logging.debug
calls (or remove them) to avoid excessive console output and match the project's
logging practice, e.g., use logging.debug with context including s.name,
startings and avoid printing full row data unless debug-level logging is
enabled; update imports if needed and ensure the logic around
find_col_by_substring, vals, cols, offset, key remains unchanged.
- Around line 356-368: Remove the no-op "if True:" wrapper and dedent its body
so the directory creation, file open, and write loop run directly; inside the
special-case block for group == 'tH_Wassoc' and sqrtS in ["7TeV","8TeV"], remove
the redundant assignment line2[1] = table[1][1] (since line2 is already a
shallow copy of table[1]) and only overwrite line2[0] = str(mh) before writing;
keep using variables outname, table, group, sqrtS, procname and the existing
out.write calls.

In `@data/lhc-hxswg/README.md`:
- Line 4: The sentence in README.md is missing a verb and uses non-descriptive
link text; update it to a complete sentence that names the resource and replaces
"here" with descriptive link text (e.g., "Higgs cross sections spreadsheet on
GitLab") so it reads like "YC5 cross-sections and citation are available in the
Higgs cross sections spreadsheet on GitLab" and make the link target the
provided URL.

In `@data/lhc-hxswg/sm/makeAllSMSplines.C`:
- Around line 38-41: Change the function signature of formatSqrtS from returning
char* to const char* (i.e., const char* formatSqrtS(float sqrts)), leaving the
return expressions using Form(...) unchanged; update any declarations/prototypes
and call sites that expect a non-const char* to accept const char* (or add
explicit copies where caller needs ownership) so the function accurately
reflects the static/immutable lifetime of the Form() buffer.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tHW.txt`:
- Around line 2-4: The mass-point block containing the lines with masses "125 
+0.00351...", "120  +0.00351...", "130  +0.00351..." should be reordered so mass
values are ascending; reorder those three rows to "120", "125", "130" while
preserving each row's full columns and formatting to keep values aligned and
unchanged.

In `@data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-vbfH.txt`:
- Around line 1-40: The file's whitespace is inconsistent across rows in the
table (headers: mH_GeV, XS_pb, Scale_pos, Scale_neg, PDF_plus_alpha_s, PDF
alpha_S) which can break fixed-column parsers; fix by normalizing each line to
use a single delimiter (prefer tabs) between all six columns, ensure the header
row and every data row have exactly six tab-separated fields and remove extra
spaces/tabs within fields so values like "PDF_plus_alpha_s" and "PDF alpha_S"
align consistently across all lines.

In `@data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ZH.txt`:
- Around line 2-39: Rows in the data block contain trailing tab characters after
the last column (alpha_S) — e.g. lines starting with "120.00" through "130.00"
end with extra tabs — remove those trailing whitespace characters from every
data row so each line ends immediately after the last numeric column; update the
data-generation/export step or run a whitespace trim on each line to ensure no
tabs/spaces remain at line ends.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd2cb9f0-e9f0-4a5f-8dcf-8ea79605bd28

📥 Commits

Reviewing files that changed from the base of the PR and between da0a2f4 and 433572a.

⛔ Files ignored due to path filters (1)
  • data/lhc-hxswg/Higgs_cross_sections_YR5.xlsx is excluded by !**/*.xlsx
📒 Files selected for processing (101)
  • data/lhc-hxswg/README.md
  • data/lhc-hxswg/makeSMtables.py
  • data/lhc-hxswg/sm/makeAllSMSplines.C
  • data/lhc-hxswg/sm/sm_yr5_13TeV.root
  • data/lhc-hxswg/sm/sm_yr5_14TeV.root
  • data/lhc-hxswg/sm/sm_yr5_7TeV.root
  • data/lhc-hxswg/sm/sm_yr5_8TeV.root
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-WH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-tH_schan.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-tH_tchan.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/13TeV/13TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-WH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-tH_schan.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-tH_tchan.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/13p6TeV/13p6TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-WH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-tH_schan.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-tH_tchan.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/14TeV/14TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-WH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_schan.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_tchan.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/7TeV/7TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-WH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_schan.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_tchan.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/8TeV/8TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-WH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-ggH-NNLO-NLL.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-tHq.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/13TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/yr4-13TeV/README.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-WH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggH-NNLO-NLL.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-tHq.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/14TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/yr4-14TeV/README.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-WH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggH-NNLO-NLL.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-tHq.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/7TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/yr4-7TeV/README.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-WH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ZH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-bbH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ggH-NNLO-NLL.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ggH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ggZH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-tHW.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-tHq.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-ttH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/8TeV-vbfH.txt
  • data/lhc-hxswg/sm/xs/yr4-8TeV/README.txt

Comment on lines 1 to +4
import logging
import sys
import os, sys

from openpyxl import load_workbook

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing xlrd import causes NameError for legacy .xls files.

The code references xlrd at lines 301 and 304, but it is never imported. This will raise a NameError at runtime when attempting to open a non-.xlsx file.

🐛 Proposed fix: Add conditional import for xlrd
 import logging
 import os, sys
 
 from openpyxl import load_workbook
+
+try:
+    import xlrd
+except ImportError:
+    xlrd = None
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import logging
import sys
import os, sys
from openpyxl import load_workbook
import logging
import os, sys
from openpyxl import load_workbook
try:
import xlrd
except ImportError:
xlrd = None
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/makeSMtables.py` around lines 1 - 4, The code calls xlrd when
handling legacy .xls workbooks but never imports it, causing a NameError; add a
conditional (lazy) import of xlrd right before the .xls handling path so xlrd is
only required for legacy files, e.g., in the branch that decides between
load_workbook and xlrd (the logic around the .xls/.xlsx handling where xlrd is
referenced) import xlrd inside a try/except ImportError and raise a clear error
instructing the user to install xlrd if missing; ensure the import name is
exactly xlrd so the existing references resolve.

mH_GeV XS_pb Sca_Hi Sca_Lo Pdf_alpha_S Total_Hi Total_Lo
+120 +0.197 +9.7 -9.7 +3.7 +10.4 -10.4
+122 +0.186 +9.6 -9.6 +3.7 +10.3 -10.3
+124 +0.176 +9.6 +9.6 +3.6 +10.2 -10.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Sign error in Sca_Lo column.

Line 4 has Sca_Lo = +9.6, but based on the convention established in all other rows (and the column name), this should be -9.6. Scale "Lo" uncertainties are downward variations and should be negative.

🐛 Proposed fix
-+124  +0.176  +9.6  +9.6  +3.6  +10.2  -10.2
++124  +0.176  +9.6  -9.6  +3.6  +10.2  -10.2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+124 +0.176 +9.6 +9.6 +3.6 +10.2 -10.2
124 +0.176 +9.6 -9.6 +3.6 +10.2 -10.2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-bbH.txt` at line 4, Replace the incorrect
positive scale-low entry on the row "124  +0.176  +9.6  +9.6  +3.6  +10.2 
-10.2": the Sca_Lo column (currently "+9.6" immediately after "+0.176") must be
"-9.6" to reflect a downward scale variation; update that token to "-9.6" so the
row reads "124  +0.176  -9.6  +9.6  +3.6  +10.2  -10.2".

Comment on lines +2 to +15
+120 +0.01289 +7.6 +16.6 +4.9 +9.04267659490264 -17.3080905937079 +0.00888 +0.004
+122 +0.0126 +7.5 +16.6 +4.9 +8.95879456177002 -17.3080905937079 +0.00869 +0.00392
+124 +0.01236 +7.4 +17 +4.9 +8.8752464754507 -17.6920886274063 +0.00851 +0.00384
+124.6 +0.01228 +7.4 +16.8 +4.9 +8.8752464754507 -17.5 +0.00847 +0.00382
+124.8 +0.01225 +7.4 +16.8 +4.9 +8.8752464754507 -17.5 +0.00844 +0.00381
+125 +0.01226 +7.3 +17.2 +4.9 +8.79204185613331 -17.8843507011018 +0.00843 +0.0038
+125.09 +0.01223 +7.4 +17 +5 +8.93084542470644 -17.7200451466694 +0.00842 +0.0038
+125.2 +0.01222 +7.3 +16.9 +5 +8.84816365128946 -17.6241311842598 +0.00841 +0.0038
+125.3 +0.01221 +7.4 +16.9 +5 +8.93084542470644 -17.6241311842598 +0.00841 +0.00379
+125.38 +0.01217 +7.4 +16.8 +5 +8.93084542470644 -17.5282628916844 +0.0084 +0.00379
+125.6 +0.01218 +7.3 +17.1 +5 +8.84816365128946 -17.8160040413107 +0.00839 +0.00378
+126 +0.01213 +7.3 +17 +5 +8.84816365128946 -17.7200451466694 +0.00834 +0.00377
+128 +0.0119 +7.2 +17.2 +5 +8.76584280032445 -17.9120071460459 +0.0082 +0.0037
+130 +0.01167 +7.2 +17.4 +5 +8.76584280032445 -18.1041431722134 +0.00804 +0.00365

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Sign convention error in Sca_Lo column throughout the file.

All rows have positive values for Sca_Lo (e.g., +16.6, +17.0, +16.8), but this column should represent downward scale uncertainties and should be negative, consistent with the convention in all other cross-section files in this PR.

🐛 Proposed fix
-+120  +0.01289  +7.6  +16.6  +4.9  +9.04267659490264  -17.3080905937079  +0.00888  +0.004
-+122  +0.0126  +7.5  +16.6  +4.9  +8.95879456177002  -17.3080905937079  +0.00869  +0.00392
-+124  +0.01236  +7.4  +17  +4.9  +8.8752464754507  -17.6920886274063  +0.00851  +0.00384
-+124.6  +0.01228  +7.4  +16.8  +4.9  +8.8752464754507  -17.5  +0.00847  +0.00382
-+124.8  +0.01225  +7.4  +16.8  +4.9  +8.8752464754507  -17.5  +0.00844  +0.00381
-+125  +0.01226  +7.3  +17.2  +4.9  +8.79204185613331  -17.8843507011018  +0.00843  +0.0038
-+125.09  +0.01223  +7.4  +17  +5  +8.93084542470644  -17.7200451466694  +0.00842  +0.0038
-+125.2  +0.01222  +7.3  +16.9  +5  +8.84816365128946  -17.6241311842598  +0.00841  +0.0038
-+125.3  +0.01221  +7.4  +16.9  +5  +8.93084542470644  -17.6241311842598  +0.00841  +0.00379
-+125.38  +0.01217  +7.4  +16.8  +5  +8.93084542470644  -17.5282628916844  +0.0084  +0.00379
-+125.6  +0.01218  +7.3  +17.1  +5  +8.84816365128946  -17.8160040413107  +0.00839  +0.00378
-+126  +0.01213  +7.3  +17  +5  +8.84816365128946  -17.7200451466694  +0.00834  +0.00377
-+128  +0.0119  +7.2  +17.2  +5  +8.76584280032445  -17.9120071460459  +0.0082  +0.0037
-+130  +0.01167  +7.2  +17.4  +5  +8.76584280032445  -18.1041431722134  +0.00804  +0.00365
++120  +0.01289  +7.6  -16.6  +4.9  +9.04267659490264  -17.3080905937079  +0.00888  +0.004
++122  +0.0126  +7.5  -16.6  +4.9  +8.95879456177002  -17.3080905937079  +0.00869  +0.00392
++124  +0.01236  +7.4  -17  +4.9  +8.8752464754507  -17.6920886274063  +0.00851  +0.00384
++124.6  +0.01228  +7.4  -16.8  +4.9  +8.8752464754507  -17.5  +0.00847  +0.00382
++124.8  +0.01225  +7.4  -16.8  +4.9  +8.8752464754507  -17.5  +0.00844  +0.00381
++125  +0.01226  +7.3  -17.2  +4.9  +8.79204185613331  -17.8843507011018  +0.00843  +0.0038
++125.09  +0.01223  +7.4  -17  +5  +8.93084542470644  -17.7200451466694  +0.00842  +0.0038
++125.2  +0.01222  +7.3  -16.9  +5  +8.84816365128946  -17.6241311842598  +0.00841  +0.0038
++125.3  +0.01221  +7.4  -16.9  +5  +8.93084542470644  -17.6241311842598  +0.00841  +0.00379
++125.38  +0.01217  +7.4  -16.8  +5  +8.93084542470644  -17.5282628916844  +0.0084  +0.00379
++125.6  +0.01218  +7.3  -17.1  +5  +8.84816365128946  -17.8160040413107  +0.00839  +0.00378
++126  +0.01213  +7.3  -17  +5  +8.84816365128946  -17.7200451466694  +0.00834  +0.00377
++128  +0.0119  +7.2  -17.2  +5  +8.76584280032445  -17.9120071460459  +0.0082  +0.0037
++130  +0.01167  +7.2  -17.4  +5  +8.76584280032445  -18.1041431722134  +0.00804  +0.00365
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+120 +0.01289 +7.6 +16.6 +4.9 +9.04267659490264 -17.3080905937079 +0.00888 +0.004
+122 +0.0126 +7.5 +16.6 +4.9 +8.95879456177002 -17.3080905937079 +0.00869 +0.00392
+124 +0.01236 +7.4 +17 +4.9 +8.8752464754507 -17.6920886274063 +0.00851 +0.00384
+124.6 +0.01228 +7.4 +16.8 +4.9 +8.8752464754507 -17.5 +0.00847 +0.00382
+124.8 +0.01225 +7.4 +16.8 +4.9 +8.8752464754507 -17.5 +0.00844 +0.00381
+125 +0.01226 +7.3 +17.2 +4.9 +8.79204185613331 -17.8843507011018 +0.00843 +0.0038
+125.09 +0.01223 +7.4 +17 +5 +8.93084542470644 -17.7200451466694 +0.00842 +0.0038
+125.2 +0.01222 +7.3 +16.9 +5 +8.84816365128946 -17.6241311842598 +0.00841 +0.0038
+125.3 +0.01221 +7.4 +16.9 +5 +8.93084542470644 -17.6241311842598 +0.00841 +0.00379
+125.38 +0.01217 +7.4 +16.8 +5 +8.93084542470644 -17.5282628916844 +0.0084 +0.00379
+125.6 +0.01218 +7.3 +17.1 +5 +8.84816365128946 -17.8160040413107 +0.00839 +0.00378
+126 +0.01213 +7.3 +17 +5 +8.84816365128946 -17.7200451466694 +0.00834 +0.00377
+128 +0.0119 +7.2 +17.2 +5 +8.76584280032445 -17.9120071460459 +0.0082 +0.0037
+130 +0.01167 +7.2 +17.4 +5 +8.76584280032445 -18.1041431722134 +0.00804 +0.00365
120 +0.01289 +7.6 -16.6 +4.9 +9.04267659490264 -17.3080905937079 +0.00888 +0.004
122 +0.0126 +7.5 -16.6 +4.9 +8.95879456177002 -17.3080905937079 +0.00869 +0.00392
124 +0.01236 +7.4 -17 +4.9 +8.8752464754507 -17.6920886274063 +0.00851 +0.00384
124.6 +0.01228 +7.4 -16.8 +4.9 +8.8752464754507 -17.5 +0.00847 +0.00382
124.8 +0.01225 +7.4 -16.8 +4.9 +8.8752464754507 -17.5 +0.00844 +0.00381
125 +0.01226 +7.3 -17.2 +4.9 +8.79204185613331 -17.8843507011018 +0.00843 +0.0038
125.09 +0.01223 +7.4 -17 +5 +8.93084542470644 -17.7200451466694 +0.00842 +0.0038
125.2 +0.01222 +7.3 -16.9 +5 +8.84816365128946 -17.6241311842598 +0.00841 +0.0038
125.3 +0.01221 +7.4 -16.9 +5 +8.93084542470644 -17.6241311842598 +0.00841 +0.00379
125.38 +0.01217 +7.4 -16.8 +5 +8.93084542470644 -17.5282628916844 +0.0084 +0.00379
125.6 +0.01218 +7.3 -17.1 +5 +8.84816365128946 -17.8160040413107 +0.00839 +0.00378
126 +0.01213 +7.3 -17 +5 +8.84816365128946 -17.7200451466694 +0.00834 +0.00377
128 +0.0119 +7.2 -17.2 +5 +8.76584280032445 -17.9120071460459 +0.0082 +0.0037
130 +0.01167 +7.2 -17.4 +5 +8.76584280032445 -18.1041431722134 +0.00804 +0.00365
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_schan.txt` around lines 2 - 15, The Sca_Lo
column entries (the fourth whitespace-separated field in each row, currently
values like +16.6, +17.0, etc.) use the wrong sign; change each of those values
to its negative (e.g. +16.6 -> -16.6) throughout the file so Sca_Lo follows the
downward-uncertainty convention referenced as Sca_Lo in this diff and appears
negative for every mass row (entries starting with 120, 122, 124, 124.6, ...
130).

Comment on lines +2 to +15
+120 +0.001028 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000709 +0.000319
+122 +0.000987 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000682 +0.000305
+124 +0.000949 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000655 +0.000293
+124.6 +0.000937 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000648 +0.000289
+124.8 +0.000934 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000645 +0.000288
+125 +0.00093 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000642 +0.000287
+125.09 +0.000929 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000642 +0.000286
+125.2 +0.000925 +2.8 +2.5 +3 +4.10365690573664 -3.90512483795333 +0.000641 +0.000285
+125.3 +0.000925 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.00064 +0.000285
+125.38 +0.000922 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000638 +0.000284
+125.6 +0.000919 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000636 +0.000283
+126 +0.000912 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.00063 +0.00028
+128 +0.000875 +2.9 +2.5 +3.1 +4.24499705535823 -3.98246155034798 +0.000607 +0.00027
+130 +0.000843 +2.9 +2.6 +3.1 +4.24499705535823 -4.04598566482878 +0.000585 +0.000259

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Sign convention error in Sca_Lo column throughout the file.

All rows have positive values for Sca_Lo (consistently +2.5 or +2.6), but this column should represent downward scale uncertainties and should be negative, consistent with the convention in all other cross-section files in this PR.

🐛 Proposed fix
-+120  +0.001028  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000709  +0.000319
-+122  +0.000987  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000682  +0.000305
-+124  +0.000949  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000655  +0.000293
-+124.6  +0.000937  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000648  +0.000289
-+124.8  +0.000934  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000645  +0.000288
-+125  +0.00093  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.000642  +0.000287
-+125.09  +0.000929  +2.9  +2.6  +3  +4.17252920900501  -3.96988664825584  +0.000642  +0.000286
-+125.2  +0.000925  +2.8  +2.5  +3  +4.10365690573664  -3.90512483795333  +0.000641  +0.000285
-+125.3  +0.000925  +2.9  +2.6  +3  +4.17252920900501  -3.96988664825584  +0.00064  +0.000285
-+125.38  +0.000922  +2.9  +2.6  +3  +4.17252920900501  -3.96988664825584  +0.000638  +0.000284
-+125.6  +0.000919  +2.9  +2.6  +3  +4.17252920900501  -3.96988664825584  +0.000636  +0.000283
-+126  +0.000912  +2.9  +2.5  +3  +4.17252920900501  -3.90512483795333  +0.00063  +0.00028
-+128  +0.000875  +2.9  +2.5  +3.1  +4.24499705535823  -3.98246155034798  +0.000607  +0.00027
-+130  +0.000843  +2.9  +2.6  +3.1  +4.24499705535823  -4.04598566482878  +0.000585  +0.000259
++120  +0.001028  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000709  +0.000319
++122  +0.000987  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000682  +0.000305
++124  +0.000949  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000655  +0.000293
++124.6  +0.000937  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000648  +0.000289
++124.8  +0.000934  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000645  +0.000288
++125  +0.00093  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.000642  +0.000287
++125.09  +0.000929  +2.9  -2.6  +3  +4.17252920900501  -3.96988664825584  +0.000642  +0.000286
++125.2  +0.000925  +2.8  -2.5  +3  +4.10365690573664  -3.90512483795333  +0.000641  +0.000285
++125.3  +0.000925  +2.9  -2.6  +3  +4.17252920900501  -3.96988664825584  +0.00064  +0.000285
++125.38  +0.000922  +2.9  -2.6  +3  +4.17252920900501  -3.96988664825584  +0.000638  +0.000284
++125.6  +0.000919  +2.9  -2.6  +3  +4.17252920900501  -3.96988664825584  +0.000636  +0.000283
++126  +0.000912  +2.9  -2.5  +3  +4.17252920900501  -3.90512483795333  +0.00063  +0.00028
++128  +0.000875  +2.9  -2.5  +3.1  +4.24499705535823  -3.98246155034798  +0.000607  +0.00027
++130  +0.000843  +2.9  -2.6  +3.1  +4.24499705535823  -4.04598566482878  +0.000585  +0.000259
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+120 +0.001028 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000709 +0.000319
+122 +0.000987 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000682 +0.000305
+124 +0.000949 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000655 +0.000293
+124.6 +0.000937 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000648 +0.000289
+124.8 +0.000934 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000645 +0.000288
+125 +0.00093 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.000642 +0.000287
+125.09 +0.000929 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000642 +0.000286
+125.2 +0.000925 +2.8 +2.5 +3 +4.10365690573664 -3.90512483795333 +0.000641 +0.000285
+125.3 +0.000925 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.00064 +0.000285
+125.38 +0.000922 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000638 +0.000284
+125.6 +0.000919 +2.9 +2.6 +3 +4.17252920900501 -3.96988664825584 +0.000636 +0.000283
+126 +0.000912 +2.9 +2.5 +3 +4.17252920900501 -3.90512483795333 +0.00063 +0.00028
+128 +0.000875 +2.9 +2.5 +3.1 +4.24499705535823 -3.98246155034798 +0.000607 +0.00027
+130 +0.000843 +2.9 +2.6 +3.1 +4.24499705535823 -4.04598566482878 +0.000585 +0.000259
120 +0.001028 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000709 +0.000319
122 +0.000987 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000682 +0.000305
124 +0.000949 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000655 +0.000293
124.6 +0.000937 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000648 +0.000289
124.8 +0.000934 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000645 +0.000288
125 +0.00093 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.000642 +0.000287
125.09 +0.000929 +2.9 -2.6 +3 +4.17252920900501 -3.96988664825584 +0.000642 +0.000286
125.2 +0.000925 +2.8 -2.5 +3 +4.10365690573664 -3.90512483795333 +0.000641 +0.000285
125.3 +0.000925 +2.9 -2.6 +3 +4.17252920900501 -3.96988664825584 +0.00064 +0.000285
125.38 +0.000922 +2.9 -2.6 +3 +4.17252920900501 -3.96988664825584 +0.000638 +0.000284
125.6 +0.000919 +2.9 -2.6 +3 +4.17252920900501 -3.96988664825584 +0.000636 +0.000283
126 +0.000912 +2.9 -2.5 +3 +4.17252920900501 -3.90512483795333 +0.00063 +0.00028
128 +0.000875 +2.9 -2.5 +3.1 +4.24499705535823 -3.98246155034798 +0.000607 +0.00027
130 +0.000843 +2.9 -2.6 +3.1 +4.24499705535823 -4.04598566482878 +0.000585 +0.000259
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-tH_tchan.txt` around lines 2 - 15, The Sca_Lo
column (the entries showing +2.5 / +2.6 in each row) is using the wrong sign;
change every Sca_Lo value to negative (e.g., +2.5 -> -2.5, +2.6 -> -2.6) across
all rows in this file while preserving the existing spacing and plus signs for
other columns so the file formatting remains unchanged.

Comment on lines +3 to +15
+122 +0.09572 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124 +0.09107 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124.6 +0.08972 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124.8 +0.0893 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125 +0.08878 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607
+125.09 +0.08864 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.2 +0.08841 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.3 +0.08825 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607
+125.38 +0.08794 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.6 +0.08761 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+126 +0.08674 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+128 +0.08262 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+130 +0.07882 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Sign convention error in Sca_Lo column for most rows.

Lines 3-15 have positive values for Sca_Lo (consistently +9.2), but this column should represent downward scale uncertainties and should be negative. Line 2 correctly uses -9.3 for this column, establishing the expected convention.

🐛 Proposed fix
-+122  +0.09572  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+124  +0.09107  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+124.6  +0.08972  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+124.8  +0.0893  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+125  +0.08878  +3.4  +9.2  +4.5  +5.64003546088143  -10.2415819090607
-+125.09  +0.08864  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+125.2  +0.08841  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+125.3  +0.08825  +3.4  +9.2  +4.5  +5.64003546088143  -10.2415819090607
-+125.38  +0.08794  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+125.6  +0.08761  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+126  +0.08674  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+128  +0.08262  +3.5  +9.2  +4.5  +5.70087712549569  -10.2415819090607
-+130  +0.07882  +3.4  +9.2  +4.5  +5.64003546088143  -10.2415819090607
++122  +0.09572  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++124  +0.09107  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++124.6  +0.08972  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++124.8  +0.0893  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++125  +0.08878  +3.4  -9.2  +4.5  +5.64003546088143  -10.2415819090607
++125.09  +0.08864  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++125.2  +0.08841  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++125.3  +0.08825  +3.4  -9.2  +4.5  +5.64003546088143  -10.2415819090607
++125.38  +0.08794  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++125.6  +0.08761  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++126  +0.08674  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++128  +0.08262  +3.5  -9.2  +4.5  +5.70087712549569  -10.2415819090607
++130  +0.07882  +3.4  -9.2  +4.5  +5.64003546088143  -10.2415819090607
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+122 +0.09572 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124 +0.09107 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124.6 +0.08972 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+124.8 +0.0893 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125 +0.08878 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607
+125.09 +0.08864 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.2 +0.08841 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.3 +0.08825 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607
+125.38 +0.08794 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+125.6 +0.08761 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+126 +0.08674 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+128 +0.08262 +3.5 +9.2 +4.5 +5.70087712549569 -10.2415819090607
+130 +0.07882 +3.4 +9.2 +4.5 +5.64003546088143 -10.2415819090607
122 +0.09572 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
124 +0.09107 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
124.6 +0.08972 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
124.8 +0.0893 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
125 +0.08878 +3.4 -9.2 +4.5 +5.64003546088143 -10.2415819090607
125.09 +0.08864 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
125.2 +0.08841 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
125.3 +0.08825 +3.4 -9.2 +4.5 +5.64003546088143 -10.2415819090607
125.38 +0.08794 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
125.6 +0.08761 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
126 +0.08674 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
128 +0.08262 +3.5 -9.2 +4.5 +5.70087712549569 -10.2415819090607
130 +0.07882 +3.4 -9.2 +4.5 +5.64003546088143 -10.2415819090607
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/7TeV/7TeV-ttH.txt` around lines 3 - 15, The Sca_Lo
column values in the provided diff are using the wrong sign (they are +9.2 but
should be negative); update each Sca_Lo entry in these rows (the field showing
+9.2) to be negative (e.g., change +9.2 to -9.2, and any other positive Sca_Lo
values to their negative equivalents) so the Sca_Lo column follows the
downward-uncertainty convention consistent with the -9.3 example.

+124.6 +0.224 +9.3 -9.3 +3.4 +9.9 -9.9
+124.8 +0.223 +9.3 -9.3 +3.4 +9.9 -9.9
+125 +0.221 +9.3 -9.3 +3.4 +9.9 -9.9
+125.09 +0.221 +9.3 +9.3 +3.4 +9.9 -9.9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix sign error in Sca_Lo column.

The Sca_Lo value at line 8 is incorrectly positive (+9.3). Based on the schema convention and all other rows in this file and related files, Sca_Lo should be negative.

🐛 Proposed fix
-+125.09  +0.221  +9.3  +9.3  +3.4  +9.9  -9.9
++125.09  +0.221  +9.3  -9.3  +3.4  +9.9  -9.9
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+125.09 +0.221 +9.3 +9.3 +3.4 +9.9 -9.9
125.09 +0.221 +9.3 -9.3 +3.4 +9.9 -9.9
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-bbH.txt` at line 8, The Sca_Lo value in the
row "+125.09  +0.221  +9.3  +9.3  +3.4  +9.9  -9.9" is signed incorrectly;
change the third column (Sca_Lo) from "+9.3" to "-9.3" so the row reads "+125.09
+0.221  -9.3  +9.3  +3.4  +9.9  -9.9".

Comment on lines +2 to +15
+120 +0.01959 +7.4 +16 +4.6 +8.71320836431679 -16.6481230173254 +0.01337 +0.00622
+122 +0.01921 +7.4 +16.1 +4.6 +8.71320836431679 -16.7442527453452 +0.0131 +0.00611
+124 +0.01887 +7.3 +16.4 +4.6 +8.62844134244418 -17.0329093228374 +0.01286 +0.00599
+124.6 +0.01875 +7.3 +16.4 +4.6 +8.62844134244418 -17.0329093228374 +0.01278 +0.00597
+124.8 +0.01871 +7.2 +16.5 +4.6 +8.54400374531753 -17.1292148097921 +0.01276 +0.00595
+125 +0.01869 +7.3 +16.5 +4.6 +8.62844134244418 -17.1292148097921 +0.01273 +0.00595
+125.09 +0.01866 +7.3 +16.6 +4.6 +8.62844134244418 -17.2255624001076 +0.01272 +0.00595
+125.2 +0.01866 +7.3 +16.6 +4.6 +8.62844134244418 -17.2255624001076 +0.01274 +0.00594
+125.3 +0.01864 +7.2 +16.5 +4.6 +8.54400374531753 -17.1292148097921 +0.0127 +0.00592
+125.38 +0.01862 +7.2 +16.5 +4.6 +8.54400374531753 -17.1292148097921 +0.01269 +0.00593
+125.6 +0.01857 +7.2 +16.6 +4.6 +8.54400374531753 -17.2255624001076 +0.01266 +0.00592
+126 +0.01852 +7.2 +16.6 +4.7 +8.59825563704639 -17.252536045463 +0.01262 +0.0059
+128 +0.0182 +7.1 +16.8 +4.7 +8.5146931829632 -17.4450566063857 +0.01242 +0.00579
+130 +0.01787 +7.1 +16.9 +4.7 +8.5146931829632 -17.541379649275 +0.01219 +0.00571

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix sign error in Sca_Lo column throughout the file.

All Sca_Lo values in this file are incorrectly positive (e.g., +16, +16.1, +16.4, etc.). Based on the schema convention used in all other cross-section files, Sca_Lo represents the lower scale uncertainty and should be negative. The Total_Lo values are correctly negative, confirming that the lower uncertainties follow the negative sign convention.

🐛 Proposed fix for first few rows (apply pattern to all rows)
-+120  +0.01959  +7.4  +16  +4.6  +8.71320836431679  -16.6481230173254  +0.01337  +0.00622
++120  +0.01959  +7.4  -16  +4.6  +8.71320836431679  -16.6481230173254  +0.01337  +0.00622
-+122  +0.01921  +7.4  +16.1  +4.6  +8.71320836431679  -16.7442527453452  +0.0131  +0.00611
++122  +0.01921  +7.4  -16.1  +4.6  +8.71320836431679  -16.7442527453452  +0.0131  +0.00611
-+124  +0.01887  +7.3  +16.4  +4.6  +8.62844134244418  -17.0329093228374  +0.01286  +0.00599
++124  +0.01887  +7.3  -16.4  +4.6  +8.62844134244418  -17.0329093228374  +0.01286  +0.00599

Apply the same sign correction to all remaining rows (lines 5-15).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_schan.txt` around lines 2 - 15, The Sca_Lo
column in this data block is using positive signs but should be negative; update
every Sca_Lo entry (e.g., values currently "+16", "+16.1", "+16.4", "+16.5",
etc.) to have a leading minus sign (e.g., "-16", "-16.1", "-16.4", "-16.5")
across all rows in the diff so the lower scale uncertainty follows the same
negative convention as Total_Lo.

Comment on lines +2 to +15
+120 +0.001339 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000913 +0.000426
+122 +0.001287 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000878 +0.000409
+124 +0.001238 +2.7 +2.3 +2.8 +3.88973006775534 -3.62353418639869 +0.000845 +0.000393
+124.6 +0.001224 +2.7 +2.4 +2.8 +3.88973006775534 -3.68781778291715 +0.000836 +0.000388
+124.8 +0.001219 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000832 +0.000386
+125 +0.001214 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000829 +0.000385
+125.09 +0.001211 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000828 +0.000384
+125.2 +0.001209 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000827 +0.000383
+125.3 +0.001208 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000825 +0.000383
+125.38 +0.001204 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000824 +0.000381
+125.6 +0.0012 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.00082 +0.00038
+126 +0.001191 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000814 +0.000377
+128 +0.001146 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000784 +0.000363
+130 +0.001103 +2.8 +2.4 +2.8 +3.95979797464467 -3.68781778291715 +0.000755 +0.000348

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if other 8 TeV files show similar patterns
echo "=== Checking tH_schan for comparison ==="
if [ -f data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_schan.txt ]; then
  head -6 data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_schan.txt | tail -5
else
  echo "tH_schan file not found"
fi

echo -e "\n=== Checking if pattern exists in other energies ==="
fd -e txt 'tH_tchan' data/lhc-hxswg/sm/xs/ --exec grep -H "^+124 " {} \; 2>/dev/null || echo "No other tH_tchan files found"

Repository: cms-analysis/HiggsAnalysis-CombinedLimit

Length of output: 1437


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import glob, re, os, math

paths = sorted(glob.glob("data/lhc-hxswg/sm/xs/*/*tH_tchan.txt"))
print(f"Found {len(paths)} tH_tchan files")
for p in paths:
    with open(p, "r", encoding="utf-8") as f:
        header = f.readline().strip()
        lines = [ln.strip() for ln in f if ln.strip()]
    rows=[]
    for ln in lines:
        # split on whitespace; keep scientific-friendly tokens
        parts = ln.split()
        if len(parts) != 10:
            print(f"[WARN] {p}: line token count {len(parts)} != 10: {ln}")
            continue
        # Columns: mH_GeV XS_pb Sca_Hi Sca_Lo Pdf_alpha_S Total_Hi Total_Lo XS_tH_pb XS_tbarH_pb
        mH=float(parts[0])
        Total_Hi=float(parts[5])
        Total_Lo=float(parts[6])
        Sca_Hi=float(parts[2])
        rows.append((mH,Sca_Hi,Total_Hi,Total_Lo))
    if not rows:
        print(f"[WARN] {p}: no parsed rows")
        continue

    total_hi_vals = {round(x[2], 14) for x in rows}
    total_lo_vals = {round(x[3], 14) for x in rows}
    print("\n==", p, "==")
    print("rows:", len(rows))
    print("unique Total_Hi (rounded 14dp):", len(total_hi_vals))
    print("unique Total_Lo (rounded 14dp):", len(total_lo_vals))

    # focus around 124-126
    focus = [r for r in rows if 123.5 <= r[0] <= 126.5]
    if focus:
        focus_sorted = sorted(focus)
        print("mH, Sca_Hi, Total_Hi, Total_Lo in [123.5,126.5]:")
        for mH,sca_hi,tot_hi,tot_lo in focus_sorted:
            print(f"  {mH:>6}  Sca_Hi={sca_hi}  Total_Hi={tot_hi}  Total_Lo={tot_lo}")
PY

echo "=== Quick token-count sanity for the specific 8TeV file ==="
awk 'NR==1{print "HEADER:",$0; next}
{
  n=NF
  if (n!=10) {print "BAD NF at line",NR, "NF=",n,":",$0}
}' data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_tchan.txt

Repository: cms-analysis/HiggsAnalysis-CombinedLimit

Length of output: 15146


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import glob, math

paths = sorted(glob.glob("data/lhc-hxswg/sm/xs/*/*tH_tchan.txt"))
print(f"Found {len(paths)} tH_tchan files")

def parse_file(p):
    rows=[]
    with open(p, "r", encoding="utf-8") as f:
        header=f.readline().strip()
        for ln in f:
            ln=ln.strip()
            if not ln: 
                continue
            parts=ln.split()
            # expected 9 columns per header:
            # mH_GeV XS_pb Sca_Hi Sca_Lo Pdf_alpha_S Total_Hi Total_Lo XS_tH_pb XS_tbarH_pb
            if len(parts)!=9:
                return None, f"unexpected token count {len(parts)}: {ln}"
            mH=float(parts[0])
            Sca_Hi=float(parts[2])
            Total_Hi=float(parts[5])
            Total_Lo=float(parts[6])
            rows.append((mH,Sca_Hi,Total_Hi,Total_Lo))
    return rows, None

for p in paths:
    rows, err = parse_file(p)
    print("\n==", p, "==")
    if err:
        print("[ERROR]", err)
        continue
    # stats
    hi_vals=set(round(r[2],14) for r in rows)
    lo_vals=set(round(r[3],14) for r in rows)
    print("rows:", len(rows))
    print("unique Total_Hi (14dp):", len(hi_vals))
    print("unique Total_Lo (14dp):", len(lo_vals))

    # dominant values
    from collections import Counter
    hi_c=Counter(round(r[2],14) for r in rows)
    lo_c=Counter(round(r[3],14) for r in rows)
    hi_dom=hi_c.most_common(1)[0]
    lo_dom=lo_c.most_common(1)[0]
    print("dominant Total_Hi:", hi_dom)
    print("dominant Total_Lo:", lo_dom)

    # list rows that differ from dominant values
    diffs=[]
    for mH,sca_hi,tot_hi,tot_lo in rows:
        if round(tot_hi,14)!=hi_dom[0] or round(tot_lo,14)!=lo_dom[0]:
            diffs.append((mH,sca_hi,tot_hi,tot_lo))
    print("rows differing from dominant Total_Hi/Total_Lo:", len(diffs))
    for r in sorted(diffs):
        mH,sca_hi,tot_hi,tot_lo=r
        print(f"  mH={mH} Sca_Hi={sca_hi} Total_Hi={tot_hi} Total_Lo={tot_lo}")

    # specifically show 124.0-126.5 region
    focus=[r for r in rows if 123.9<=r[0]<=126.6]
    print("\nFocus 123.9-126.6:")
    for mH,sca_hi,tot_hi,tot_lo in sorted(focus):
        print(f"  mH={mH} Sca_Hi={sca_hi} Total_Hi={tot_hi} Total_Lo={tot_lo}")
PY

Repository: cms-analysis/HiggsAnalysis-CombinedLimit

Length of output: 5888


Check 8TeV tH_tchan uncertainty discontinuity at mH=124–124.6
In data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_tchan.txt, 12/14 points share Total_Hi=+3.95979797464467 and Total_Lo=-3.68781778291715, but:

  • mH=124.0: Total_Hi=+3.88973006775534 and Total_Lo=-3.62353418639869 (Sca_Hi=2.7, Sca_Lo=2.3)
  • mH=124.6: Total_Hi=+3.88973006775534 while Total_Lo stays -3.68781778291715 (Sca_Hi=2.7, Sca_Lo=2.4)
    13/13p6/14 TeV tH_tchan tables keep Total_Hi/Total_Lo constant across the same grid, so the 8 TeV splice behavior should be traced to the source spreadsheet / computation to confirm it’s intentional (or fix the data generation/rounding).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@data/lhc-hxswg/sm/xs/8TeV/8TeV-tH_tchan.txt` around lines 2 - 15, The
Total_Hi/Total_Lo values in the 8TeV tH_tchan table are inconsistent across the
mH grid (notably at mH=124.0 vs 124.6) while Sca_Hi/Sca_Lo change, so inspect
the source calculation that produces Total_Hi and Total_Lo for entries around
mH=124/124.6 (the rows with mH=124.0, 124.6 and the repeated value
+3.95979797464467 / -3.68781778291715), verify whether Total_* should be
constant across the grid, and either (a) recompute Total_Hi/Total_Lo for
mH=124.6 from the same component contributions used for other rows (fixing any
spreadsheet formula or script bug), or (b) apply consistent rounding/propagation
rules so the totals match the pattern seen in other energies; update the data
row(s) so Total_Hi/Total_Lo align with the intended computation for the mH grid.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.90%. Comparing base (e5bfa69) to head (433572a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1254      +/-   ##
==========================================
+ Coverage   20.89%   20.90%   +0.01%     
==========================================
  Files         195      195              
  Lines       26310    26316       +6     
  Branches     3947     3947              
==========================================
+ Hits         5498     5502       +4     
- Misses      20812    20814       +2     

see 2 files with indirect coverage changes
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amarini

amarini commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this as it is duplicated. We will work on #1255

@amarini amarini closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant