This release is a pre-release and may not be stable for production use.
[TOC]
$R_X$ selection
This project is meant to apply an offline selection to ntuples produced by post_ap and downloaded with rx_data. the selection is done with jobs sent to an HTCondor cluster.
How to pick up selection and apply it to data and MC
For this do:
from rx_selection import selection as sel
# trigger : HLT2 trigger, e.g. Hlt2RD_BuToKpEE_MVA
# q2bin : low, central, jpsi, psi2, high
# smeared : If true (default), the selection will use cuts on smeared masses. Only makes sense for electron MC samples
# process :
# One of the keys in https://gitlab.cern.ch/rx_run3/rx_data/-/blob/master/src/rx_data_lfns/rx/v7/rk_samples.yaml
# DATA will do all the data combined
d_sel = sel.selection(trigger='Hlt2RD_BuToKpEE_MVA', q2bin='jpsi', process='DATA', smeared=True)
# You can override the selection here
for cut_name, cut_value in d_sel.items():
rdf = rdf.Filter(cut_value, cut_name)
rep = rdf.Report()
# Here you cross check that the cuts were applied and see the statistics
rep.Print()
Changing selection
Overriding default
The selection stored in the config files can be overriden with:
from rx_selection import selection as sel
with sel.custom_selection(d_sel = {'bdt' : 'mva_cmb > 0.1'}):
run_function_that_uses_selection()
This will make sure that the bdt field:
- Is added with a
mva_cmb > 0.1cut, if it does not exist - Is updated, if it exists
inside the context, outside, the nominal selection will be used.
This manager implements a lock that prevents custom selections from been set more than once in a nested way.
If the user has to use a ustom selection inside a context already using a custom selection, he has to use:
from rx_selection import selection as sel
with sel.custom_selection(d_sel = {'bdt_cmb' : 'mva_cmb > 0.1'}):
# mva_cmb cut added on top of default selection
run_with_cmb_cut()
with sel.custom_selection(d_sel = {'bdt_prc' : 'mva_prc > 0.2'}, force_override=True):
# mva_prc cut added on top of default selection
run_with_prc_cut()
Overriding current selection
In order to override whatever is the current selection do:
from rx_selection import selection as sel
with sel.custom_selection(d_sel = {'bdt' : 'mva_cmb > 0.1'}):
# Here you run with mva_cmb only
with sel.update_selection(d_sel = {'bdt_prc' : 'mva_prc > 0.2'}):
# Here you run with both mva_cmb and mva_prc
run_function_that_uses_selection()
This will not override the default selection, as custom_selection does.
It will override the current selection, which might be a custom selection.
Metadata
Release files for rx-selection 0.1.9.dev280
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rx_selection-0.1.9.dev280.tar.gz | 15.4 kB | With provenance | Details for rx_selection-0.1.9.dev280.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rx_selection-0.1.9.dev280-py3-none-any.whl | Python 3 | none | any | Details for rx_selection-0.1.9.dev280-py3-none-any.whl |
Total release size: 35.9 kB
Release files / rx_selection-0.1.9.dev280.tar.gz
| Download URL | rx_selection-0.1.9.dev280.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b76734432d8bd1a68dec257a7e7fa73fbbd9206f93d43d526e79f2b99fe9793
|
|
BLAKE2b-256 checksum How to use checksums |
c9f5ff7c52d648f382d45907b3bbc6b9c27b2ca843c9800a6ea616eedc903078
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2025.
Transparency logRelease files / rx_selection-0.1.9.dev280-py3-none-any.whl
| Download URL | rx_selection-0.1.9.dev280-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b453545a52565dce9c79417dd1e16375c25ebf03bfca36b5679f727100ec786f
|
|
BLAKE2b-256 checksum How to use checksums |
13216605274a9274b5b7c7165c6a830bc54f2ca19e7a419109e8c71ef447f361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2025.
Transparency logSecurity for rx-selection 0.1.9.dev280
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for rx_selection-0.1.9.dev280.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.