xmlanawsbuilder
/xmlanawsbuilder
Use when building a RooFit workspace from XML cards with xmlAnaWSBuilder or XMLReader, constructing analytic signal or background models for H→γγ or similar ATLAS analyses, configuring systematic uncertainties in the XML workspace builder, setting up counting experiments, implementing blinded analysis ranges, or combining categories into a likelihood workspace for downstream fitting with quickFit or workspaceCombiner.
- Author
- usatlas ↗
- Repository
- marketplace ↗
- Licence
- MIT
- Last repository change
- 16.10.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 0
- HTML comments
- 5
- URLs in SKILL.md
- 4
No signals detected. Repository changed on 16.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (5). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
Use when building a RooFit workspace from XML cards with xmlAnaWSBuilder or XMLReader, constructing analytic signal or background models for H→γγ or similar ATLAS analyses, configuring systematic uncertainties in the XML workspace builder, setting up counting experiments, implementing blinded analysis ranges, or combining categories into a likelihood workspace for downstream fitting with quickFit or workspaceCombiner.
Original author description
Use when building a RooFit workspace from XML cards with xmlAnaWSBuilder or XMLReader, constructing analytic signal or background models for H→γγ or similar ATLAS analyses, configuring systematic uncertainties in the XML workspace builder, setting up counting experiments, implementing blinded analysis ranges, or combining categories into a likelihood workspace for downstream fitting with quickFit or workspaceCombiner.
How it works
- Overview
- When to Use
- Key Concepts
- Canonical Patterns
- Reference Files
- Gotchas
- Interop
- Docs
SKILL.md preview
---
name: xmlanawsbuilder
description: >-
Use when building a RooFit workspace from XML cards with xmlAnaWSBuilder or
XMLReader, constructing analytic signal or background models for H→γγ or
similar ATLAS analyses, configuring systematic uncertainties in the XML
workspace builder, setting up counting experiments, implementing blinded
analysis ranges, or combining categories into a likelihood workspace for
downstream fitting with quickFit or workspaceCombiner.
---
# xmlAnaWSBuilder
## Overview
xmlAnaWSBuilder constructs RooFit workspaces for statistical analyses using XML
configuration cards. It specializes in:
- **1D analytic models** (e.g. H→γγ signal as double-sided Crystal Ball,
background as polynomial or power-law)
- **Counting experiments** (no shape information)
- **Multi-category likelihoods** combining signal and background processes
The produced workspace follows the standard `RooSimultaneous` + `ModelConfig`
convention and can be used directly with
[workspaceCombiner](https://gitlab.cern.ch/atlas_higgs_combination/software/workspaceCombiner)
and
[quickFit](https://gitlab.cern.ch/atlas_higgs_combination/software/quickFit).
xmlAnaWSBuilder is included in the StatAnalysis release. It can also be built
standalone from: https://gitlab.cern.ch/atlas-hgam-sw/xmlAnaWSBuilder
## When to Use
- Building an analytic signal or background model for an ATLAS analysis (e.g.
H→γγ with double-sided Crystal Ball signal and polynomial or power-law
background)
- Constructing a counting experiment workspace where no shape information is
needed
- Combining multiple analysis categories into a joint likelihood workspace for
downstream fitting with quickFit or workspaceCombiner
- Implementing a blinded analysis with a configurable veto range in the
observable
- Configuring and correlating systematic uncertainties (yield or shape NPs)
across categories using the XML card system
## Key Concepts
### Three-Level XML Structure
```text
top-level card (.xml)
└── category-level cards (one per analysis category)
└── pdf-level cards (one per physics process per category)
```
`AnaWSBuilder.dtd` must be present alongside every XML card file.
### XML Keywords
| Keyword | Meaning |
| --------------------------- | -------------------------------------------------------- |
| `response::<NP>` | Response function for NP (in same domain) |
| `:category:` | Replaced by current category name |
| `:observable:` | Observable name of current category |
| `:process:` | Name of current Sample |
| `:common:` | All ungrouped common systematics |
| `:self:` | Only process-specific systematics; suppresses `:common:` |
| `:lt:` `:le:` `:gt:` `:ge:` | `<` `<=` `>` `>=` (XML-safe math symbols) |
| `:and:` `:or:` | Logic operators for ntuple cuts |
`RooFormulaVar` must use indexed syntax `@0, @1, ...` — never variable names
(renaming during workspace creation breaks name-based references).
## Canonical Patterns
### Running XMLReader
```bash
XMLReader -x config/myanalysis/top.xml
# With options
XMLReader -x config/top.xml --plot rebin10
XMLReader -x config/top.xml -b 1 -s 0 # binned fit, Minuit2 strategy 0
XMLReader -x config/top.xml -v # verbose debug output
```
| Option | Description |
| ----------------------------- | ------------------------------------- |
| `-x` / `--xml` | Top-level XML card path (required) |
| `-v` / `--verbose` | Print debug info |
| `-m` / `--minimizerAlgo` | `Minuit2` (default) or `Minuit` |
| `-s` / `--minimizerStrategy` | 0, 1 (default), or 2 |
| `-t` / `--minimizerTolerance` | Default 1e-3 |
| `-b` / `--binned` | Fit to binned (pseudo-binned) dataset |
| `-o` / `--plotOption` | Plot options (e.g. `logy`, `rebin10`) |
### Top-Level Card
```xml
<!DOCTYPE Combination SYSTEM 'AnaWSBuilder.dtd'>
<Combination WorkspaceName="combWS" ModelConfigName="ModelConfig"
DataName="combData" OutputFile="workspace/output.root" Blind="false">
<Input>config/category_A.xml</Input>
<Input>config/category_B.xml</Input>
<POI>mu,mu_ttH</POI>
<!-- Fit and/or Asimov generation actions -->
<Asimov Name="asimovData_0" Setup="mu=0"
Action="fixsyst:fit:genasimov:float:savesnapshot"
SnapshotNuis="nominalNuis" SnapshotGlob="nominalGlob"/>
<Asimov Name="asimovData_1" Setup="mu=1,mu_ttH=1"
Action="fit:matchglob:genasimov:savesnapshot:reset"
SnapshotNuis="conditionalNuis_1" SnapshotGlob="conditionalGlob_1"/>
</Combination>
```
For blinded analysis set `Blind="true"` and add `BlindRange` to each `Data` node
(full example in `references/advanced-configurations.md`). The `Action`
attribute takes a colon-separated list of keywords (`fit`, `genasimov`,
`savesnapshot`, `matchglob`, `reset`, `raw`, `fixsyst`, `fixall`, `float`, or a
snapshot name) — see `references/xml-schema-reference.md` for the full keyword
table.
### Category-Level Card
```xml
<!DOCTYPE Channel SYSTEM 'AnaWSBuilder.dtd'>
<Channel Name="ttH_c27" Type="shape" Lumi="139">
<!-- Dataset from text file -->
<Data InputFile="data/mass_points.txt"
Observable="atlas_invMass_:category:[105,160]"
Binning="220" InjectGhost="true" BlindRange="120,130"/>
<!-- Common yield systematics (applied to processes via ImportSyst) -->
<Systematic Name="ATLAS_lumi_run2" Constr="logn"
CentralValue="1" Mag="0.017" WhereTo="yield"/>
<!-- Common items (variables, functions) -->
<Item Name="prod::resp_RES(response::ATLAS_EG_RESOLUTION_ALL)"/>
<!-- Physics process -->
<Sample Name="signal" InputFile="config/model/signal_:category:.xml"
ImportSyst=":common:" MultiplyLumi="true" SharePdf="commonSig">
<NormFactor Name="yield_sig[10,0,1000]"/>
<NormFactor Name="mu[1,0,5]"/>
</Sample>
<Sample Name="background" InputFile="config/model/bkg_:category:.xml"
ImportSyst=":self:" MultiplyLumi="false">
<NormFactor Name="nbkg_:category:[100,0,100000]"/>
</Sample>
</Channel>
```
`Data`, `Systematic`, and `Sample` each take many attributes (file types,
constraint types, lumi/norm scale factors, `NormFactor`/`ShapeFactor`
distinction) — see `references/xml-schema-reference.md` for the full attribute
tables. Two attributes to know up front: choose `Data Binning` finely (~10×
smaller than detector resolution) since the pseudo-binned dataset is biased when
bins are coarse, and `Systematic Constr` selects the constraint type (`gaus`,
`logn`, `asym`, `dfd`) whose sign convention in `Mag` must match the upstream
tool.
### PDF-Level Card
```xml
<!DOCTYPE Model SYSTEM 'AnaWSBuilder.dtd'>
<Model Type="UserDef">
<Item Name="mu_CB[125.09]"/>
<Item Name="sigma_CB[1.7]"/>
<Item Name="prod::mu_smeared(mu_CB, response::ATLAS_EG_SCALE_ALL)"/>
<Item Name="prod::sigma_smeared(sigma_CB, response::ATLAS_EG_RESOLUTION_ALL)"/>
<ModelItem Name="RooTwoSidedCBShape::signal(:observable:,
mu_smeared, sigma_smeared, alphaCBLo[1.9], nCBLo[3.4],
alphaCBHi[1.9], nCBHi[3.8])"/>
</Model>
```
## Reference Files
For deeper detail beyond what this skill covers, read the reference files in
`references/`:
- **`xml-schema-reference.md`** — Full attribute tables for `Data`,
`Systematic`, and `Sample` nodes, the constraint-type/response-function table,
and the `Asimov` `Action` keyword table. Read when looking up a specific XML
attribute or choosing a constraint type.
- **`advanced-configurations.md`** — Full XML examples for importing an external
HistFactory PDF, counting-experiment channels, and blinded-analysis side-band
fits. Read when the analysis needs one of these variant configurations rather
than the default shape-based category.
## Gotchas
- **`AnaWSBuilder.dtd` location**: must be in every folder containing XML cards
— copy or symlink (`ln -s`) from the xmlAnaWSBuilder repo `dtd/` directory.
- **Fine binning is critical**: pseudo-binned and Asimov datasets are biased
when bins are coarse; use ~10× finer than detector resolution.
- **Indexed proxies in formulas**: `RooFormulaVar` must use `@0, @1, ...`
because variables are renamed during workspace construction.
- **`matchglob` + `reset`**: always call `reset` at the end of any action list
containing `matchglob`, otherwise global observable values are altered in the
final workspace.
- **ResponseFunction custom class**: all workspaces produced by xmlAnaWSBuilder
contain the `ResponseFunction` class (available in `RooFitExtensions`);
downstream tools must have `RooFitExtensions` on `LD_LIBRARY_PATH`.
- **External HistFactory PDFs**: keep the observable name identical to the
HistFactory one; renaming it breaks the binned model.
## Interop
- **workspaceCombiner**: consumes xmlAnaWSBuilder output for multi-channel
combinations; observable unique-naming convention is required.
- **quickFit**: recommended fitting tool for workspaces created by
xmlAnaWSBuilder.
- **StatAnalysis**: `XMLReader` is available after
`asetup StatAnalysis,0.7,latest`.
Contact: xmlanawsbuilder-user@cern.ch
## Docs
https://gitlab.cern.ch/atlas-hgam-sw/xmlAnaWSBuilder
Files in this package (3)
- SKILL.md 9 KB
- references/advanced-configurations.md 2 KB
- references/xml-schema-reference.md 6 KB
Versions
The database has no other skills named xmlanawsbuilder.
Database snapshot: 13.11.2026 · package version 08a3bbf08ab0 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100analysis-spec-builder
Use when producing a structured ATLAS analysis specification document: formalizing an analysis design into a specification.md file, documenting signal/control/validation regions, background methods, systematic uncertainties, and statistical model choices, or when the… - 100xroofit
Use when building RooFit statistical models with xRooFit, constructing workspaces with channels and samples, adding systematics or nuisance parameters, fitting models to data, constructing NLL functions, diagnosing fit convergence failures (status codes, covariance quality),…