tdub.config

Analysis configuration module.

tdub is a Python library for physics analysis. Naturally some properties of the analysis need to be easily modifiable for various studies. This module houses a handful of variables that can be modified simply by importing the module.

For example, we can call tdub.data.features_for() and expect different results without changing the API usage, just changing the configuration module FEATURESET_foo constants:

>>> from tdub.data import features_for
>>> features_for("2j2b")
['mass_lep1jet1', 'mass_lep2jet1', 'pT_jet2', ...]
>>> import tdub.config
>>> tdub.config.FEATURESET_2j2b = ["pT_jet1", "met"]
>>> features_for("2j2b")
['pT_jet1', 'met']

Similarly, we can modify the selection via this module:

>>> from tdub.data import selection_for
>>> selection_for("2j2b")
'(reg2j2b == True) & (OS == True)'
>>> import tdub.config
>>> tdub.config.SELECTION_2j2b = "(reg2j2b == True) & (OS == True) & (mass_lep1jet1 < 155)"
>>> selection_for("2j2b")
'(reg2j2b == True) & (OS == True) & (mass_lep1jet1 < 155)'

This module also contains some convenience functions for helping to automate the process of providing some sensible defaults for some configuration options, but not at import time (i.e. if the default requires importing a module or parsing some data from the web).

Constant Summary

AVOID_IN_CLF

List of features to avoid in classifiers.

AVOID_IN_CLF_1j1b

List of features to avoid specifically in 1j1b classifiers.

AVOID_IN_CLF_2j1b

List of features to avoid specifically in 2j1b classifiers.

AVOID_IN_CLF_2j2b

List of features to avoid specifically in 2j2b classifiers.

DEFAULT_SCAN_PARAMETERS

The default grid to perform a parameter scan.

FEATURESET_1j1b

List of features we use for classifiers in the 1j1b region.

FEATURESET_2j1b

List of features we use for classifiers in the 2j1b region.

FEATURESET_2j2b

List of features we use for classifiers in the 2j2b region.

PLOTTING_LOGY

Plots (defined as TRExFitter Regions) to use log scale.

PLOTTING_META_TABLE

Plotting metadata table.

RANDOM_STATE

Seed for various random tasks requiring reproducibility.

SELECTION_1j1b

The numexpr selection string for the 1j1b region.

SELECTION_2j1b

The numexpr selection string for the 2j1b region.

SELECTION_2j2b

The numexpr selection string for the 2j2b region.

Function Summary

init_meta_table()

Load metadata from network to define PLOTTING_META_TABLE.

init_meta_logy()

Set a sensible default PLOTTING_LOGY value.

Constant Reference

tdub.config.AVOID_IN_CLF

List of features to avoid in classifiers.

Type

list(str)

tdub.config.AVOID_IN_CLF_1j1b

List of features to avoid specifically in 1j1b classifiers.

Type

list(str)

tdub.config.AVOID_IN_CLF_2j1b

List of features to avoid specifically in 2j1b classifiers.

Type

list(str)

tdub.config.AVOID_IN_CLF_2j2b

List of features to avoid specifically in 2j2b classifiers.

Type

list(str)

tdub.config.FEATURESET_1j1b

List of features we use for classifiers in the 1j1b region.

Type

list(str)

tdub.config.FEATURESET_2j1b

List of features we use for classifiers in the 2j1b region.

Type

list(str)

tdub.config.FEATURESET_2j2b

List of features we use for classifiers in the 2j2b region.

Type

list(str)

tdub.config.PLOTTING_LOGY

Plots (defined as TRExFitter Regions) to use log scale.

Type

list(str)

tdub.config.PLOTTING_META_TABLE

Plotting metadata table.

Type

dict, optional

tdub.config.RANDOM_STATE

Seed for various random tasks requiring reproducibility.

Type

int

tdub.config.SELECTION_1j1b

The numexpr selection string for the 1j1b region.

Type

str

tdub.config.SELECTION_2j1b

The numexpr selection string for the 2j1b region.

Type

str

tdub.config.SELECTION_2j2b

The numexpr selection string for the 2j2b region.

Type

str

Function Reference

tdub.config.init_meta_table()[source]

Load metadata from network to define PLOTTING_META_TABLE.

tdub.config.init_meta_logy()[source]

Set a sensible default PLOTTING_LOGY value.