Przejdź do treści
Biblioteka skilli
Nauka i badania · Analiza

fastframes

/fastframes

Uruchamia przetwarzanie NTupli algorytmów CP lub wyjść TopCPToolkit do histogramów analizy za pomocą wspieranego frameworka opartego na RDataFrame.

Repozytorium
marketplace ↗
Licencja
MIT
Ostatnia zmiana repozytorium
16.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 16.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Uruchamia przetwarzanie NTupli algorytmów CP lub wyjść TopCPToolkit do histogramów analizy za pomocą wspieranego frameworka opartego na RDataFrame.

Oryginalny opis (EN)

Use when you need a supported RDataFrame-based framework to process CP-algorithm NTuples or TopCPToolkit outputs into analysis histograms.

Jak działa

  1. Overview
  2. When to Use
  3. Key Concepts
  4. Canonical Patterns
  5. Gotchas
  6. Interop
  7. Docs
Sekcje z nagłówków SKILL.md, w oryginale · 185 linii, 588 słów
Podgląd SKILL.md
---
name: fastframes
description: >-
  Use when you need a supported RDataFrame-based framework to process
  CP-algorithm NTuples or TopCPToolkit outputs into analysis histograms.
---

# FastFrames

## Overview

FastFrames is a histogramming and ntuple reprocessing framework built on ROOT's
RDataFrame. It processes NTuples produced by the standard CP algorithm stack in
a columnar, lazy-evaluation model that is faster than event-loop approaches for
many workflows. FastFrames automatically handles cross-section weighting,
systematic variations, and profile-likelihood unfolding. It is maintained under
the ATLAS Analysis Model Group (AMG, `gitlab.cern.ch/atlas-amglab/fastframes`)
and is the recommended method to process TopCPToolkit outputs into histograms.

## When to Use

- When you need to process TopCPToolkit outputs
- When you want a supported framework for processing CP algorithm outputs

## Key Concepts

```text
DAOD_PHYS / DAOD_PHYSLITE
    ↓ TopCPToolkit (runs in AnalysisBase/Athena)
NTuples (ROOT, flat branches)
    ↓ FastFrames / coffea
Histograms → fit
```

FastFrames takes CPalgs output (like that from TopCPToolkit or EasyJet) and
processes into histograms or ntuples.

## Canonical Patterns

### YAML Configuration

```yaml
# config.yml
general:
  input_filelist_path: "filelist.txt"
  input_sumweights_path: "sum_of_weights.txt"
  output_path_histograms: ""
  default_sumweights: "NOSYS"
  default_event_weights: "weight_mc_NOSYS *globalTriggerEffSF_NOSYS"
  xsection_files:
    - campaigns: ["mc20a", "mc20d", "mc20e"]
      files: ["test/data/PMGxsecDB_mc16.txt"]
  automatic_systematics: True
  nominal_only: False
  number_of_cpus: 4
  define_custom_columns:
    - name: "jet_pt_GeV_NOSYS"
      definition: "jet_pt_NOSYS/1e3"

regions:
  - name: "Electron"
    selection: "el_pt_NOSYS.size() > 0 && el_pt_NOSYS[0] > 30000"
    histograms_2d:
      - x: "met_met"
        y: "met_phi"
    variables:
      - name: "jet_pt"
        #title : "histo title;X axis title;Y axis title"
        definition: "jet_pt_GeV_NOSYS"
        type: RVec<double>
        is_nominal_only: True
        binning:
          min: 0
          max: 300
          number_of_bins: 10
      - name: "met_met"
        title: "histo title;X axis title;Y axis title"
        definition: "met_met_NOSYS/1e3"
        type: "double"
        is_nominal_only: True
        binning:
          bin_edges: [0, 20, 60, 80, 140, 250]
      - name: "met_phi"
        title: "histo title;X axis title;Y axis title"
        definition: "met_phi_NOSYS"
        type: "float"
        binning:
          min: -3.2
          max: 3.2
          number_of_bins: 16

truth_processing:
  - name: parton_ttbar
    produce_unfolding: True
    truth_tree_name: "truth"
    samples: ["ttbar_FS"]
    event_weight: "weight_mc_NOSYS"
    match_variables:
      - reco: "jet_pt"
        truth: "Ttbar_MC_t_afterFSR_pt"
    variables:
      - name: "Ttbar_MC_t_afterFSR_pt"
        definition: "Ttbar_MC_t_afterFSR_pt/1e3"
        type: "double"
        binning:
          min: 0
          max: 500
          number_of_bins: 10

samples:
  - name: "ttbar_FS"
    dsids: [410470]
    campaigns: ["mc20e"]
    simulation_type: "fullsim"

systematics:
  - campaigns: ["mc20e"]
    regions: ["Electron"]
    variation:
      up: "JET_BJES_Response__1up"
      down: "JET_BJES_Response__1down"
  - samples: ["ttbar_FS"]
    campaigns: ["mc20e"]
    variation:
      up: "GEN_0p5muF_0p5muR_NNPDF31_NLO_0118"
      sum_weights_up: "GEN_0p5muF_0p5muR_NNPDF31_NLO_0118"
```

### Running FastFrames

```bash
# option 1: conda-forge (pixi / conda)
pixi add fastframes
# the driver is the Python script in the source tree:
python3 fastframes/python/FastFrames.py --config config.yml

# option 2: build from source inside AnalysisBase
asetup AnalysisBase,25.2.X
cmake -S fastframes/ -B build -DCMAKE_INSTALL_PREFIX=./install
cmake --build build
cmake --install build
python3 fastframes/python/FastFrames.py --config config.yml
```

### Reading FastFrames Output

FastFrames produces ROOT files with histograms. Read with uproot:

```python
import uproot, hist

# By default FastFrames writes one ROOT file per sample
with uproot.open("output/ttbar_FS.root") as f:
    # FastFrames generally names histograms as {region}_{variable}
    h_root = f["Electron_jet_pt"]

    # Convert to hist.Hist for plotting
    h = hist.Hist(hist.axis.Variable(h_root.axis().edges(), name="pt", label=r"$p_T$ [GeV]"))
    h.view()[:] = h_root.values()
```

### Systematic Handling

FastFrames can automatically read systematics from the input files when
`automatic_systematics` is `True`.

FastFrames can also handle manually defined systematics in the YAML config.

## Gotchas

- **Units are MeV in ATLAS NTuples**: FastFrames cuts and histogram ranges are
  in the same units as your input — ATLAS NTuples use MeV, so `xmax: 2000000` is
  2 TeV.
- **RDataFrame lazy evaluation**: Column definitions aren't evaluated until an
  action (histogram fill, `Snapshot`) is triggered; bugs in column expressions
  appear at run time. Debugging is generally best performed when running with a
  single thread.

## Interop

- **TopCPToolkit**: FastFrames is the recommended way to process TopCPToolkit
  outputs
- **uproot / hist**: Downstream tools for reading FastFrames histogram output
- **cabinetry / pyhf**: Feed FastFrames histogram output into cabinetry for the
  statistical fit
- **coffea**: Alternative for columnar analysis without ROOT/CPalgs dependencies

## Docs

https://atlas-project-topreconstruction.web.cern.ch/fastframesdocumentation/latest/

Wersje

W bazie nie ma innych skilli o nazwie fastframes.

Migawka bazy z 13.11.2026 · wersja paczki e18b4f8bc9fc (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100topcptoolkit
    Konfiguruje TopCPToolkit do tworzenia ntuple z plików DAOD dla analiz ATLAS: YAML, kompilacja i uruchomienie lokalne lub na gridzie.
  • 90histograms
    Zarządza metadanymi histogramów i enumów Chromium przy dodawaniu kodu logującego histogram lub aktualizacji histograms.xml i enums.xml.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.