saga.rescale

This module implements methods for rescaling asymmetry results for future experiments.

saga.rescale.rescale_csv_data(path, outpath='', old_dat_path='old_dat_path.csv', new_sim_path='new_sim_path.csv', old_sim_path='old_sim_path.csv', count_key='count', y_key='a0', yerr_key='a0err', xs_ratio=1.0, lumi_ratio=1.0, tpol_factor=1.0, tdil_factor=1.0, yvalue=-100.0, float_format='%.3g', config=None, aggregate_config=None, chain_configs=None, aliases=None)

Parameters

pathstr, required

Path where the given graph data will be stored

outfile_namestr, optional

Output path, if empty the path argument will be used with _rescaled inserted before the csv extension

old_dat_pathstr, optional

Part of path to replace

new_sim_pathstr, optional

Path with which to replace old_dat_path to find new simulation graph CSVs

old_sim_pathstr, optional

Path with which to replace old_dat_path to find new simulation graph CSVs

count_keystr, optional

CSV column key for graph bin counts

y_keystr, optional

CSV column key for the asymmetry value corresponding to the rescaled errors

yerr_keystr, optional

CSV column key for graph bin y errors

xs_ratiostr, optional

Cross-section ratio (new/old) for scaling

lumi_ratiostr, optional

Luminosity ratio (new/old) for scaling

tpol_factorfloat, optional

Target polarization factor \(P_{T}\) for rescaling

tdil_factorfloat, optional

Target dilution factor \(D_{T}\) for rescaling

yvaluefloat, optional

Constant asymmetry value to be used for computing rescaled errors

float_formatstr or Callable, optional

Format string for floating point numbers passed to pd.DataFrame.to_csv()

configdict, optional

Map of configuration option names to option values for chaining across old_dat_path CSVs

aggregate_configdict, optional

Map of aggregate configuration option names to option values for chaining across old_dat_path CSVs

chain_configsdict, optional

Map of configuration option names to lists of values across which to chain for old_dat_path CSVs

aliasesdict, optional

Map of configuration option names to maps of option values to string aliases

Description

Rescale a set of results from data (old_dat) loading new and old simulation results (new_sim and old_sim) from file to compute the bin dependent acceptance ratio. Start from the ratio (new_sim/old_sim) of counts in each bin. The rescaling ratio is then computed by multiplying by lumi_ratio / xs_ratio. This ratio is used to rescale the counts, but the errors are further multiplied by a factor \(\frac{1}{P_{T} \cdot D_{T}}\) to account for the target polarization and dilution factors. Note that the asymmetry values can be set to a constant with yvalue=A if you only care about the rescaled errors. If the value satisfies \(A\in[-1,0)\), the asymmetry errors will be set to \(\sigma_{A} = \frac{1}{P_{T} \cdot D_{T}} \cdot \sqrt{\frac{1-(A \cdot P_{T} \cdot D_{T})^{2}}{N_{Rescaled}}}\). If the value satisfies \(A\in[0,+1]\), the asymmetry errors will be rescaled by the factor \(\sqrt{\frac{1-(A \cdot P_{T} \cdot D_{T})^{2} N_{Old Data}}{N_{Rescaled}}}\). Otherwise, the yvalue from old_dat will be used.

saga.rescale.rescale_graph_data(ct_mean, x_mean, y_mean, xerr_mean, yerr_mean, path, old_dat_path='old_dat_path.csv', new_sim_path='new_sim_path.csv', old_sim_path='old_sim_path.csv', count_key='count', yerr_key='', xs_ratio=1.0, lumi_ratio=1.0, tpol_factor=1.0, tdil_factor=1.0, yvalue=-100.0, xvar_keys=None, sgasym=0.0, aliases=None)

Parameters

ct_meanlist, required

Count mean values for each bin

x_meanlist, required

x mean values for each bin

y_meanlist, required

y mean values for each bin

xerr_meanlist, required

x error alues for each bin

yerr_meanlist, required

y error values for each bin

pathstr, required

Path where the given graph data will be stored

old_dat_pathstr, optional

Part of path to replace

new_sim_pathstr, optional

Path with which to replace old_dat_path to find new simulation graph CSVs

old_sim_pathstr, optional

Path with which to replace old_dat_path to find new simulation graph CSVs

count_keystr, optional

CSV column key for graph bin counts

yerr_keystr, optional

CSV column key for graph bin y errors

xs_ratiostr, optional

Cross-section ratio (new/old) for scaling

lumi_ratiostr, optional

Luminosity ratio (new/old) for scaling

tpol_factorfloat, optional

Target polarization factor \(P_{T}\) for rescaling

tdil_factorfloat, optional

Target dilution factor \(D_{T}\) for rescaling

yvaluefloat, optional

Constant asymmetry value to be used for computing rescaled errors

xvar_keyslist, optional

List of binning variables for which to return mean values

sgasymfloat or list, optional

Injected signal asymmetry for computing difference of measured and injected values

aliasesdict, optional

Map of configuration option names to maps of option values to string aliases

Returns

dict

A dictionary of graph data produced by get_aggregate_graph()

Description

Rescale a graph from data (old_dat) loading new and old simulation graphs (new_sim and old_sim) from file to compute the bin dependent acceptance ratio. Start from the ratio (new_sim/old_sim) of counts in each bin. The rescaling ratio is then computed by multiplying by lumi_ratio / xs_ratio. This ratio is used to rescale the counts, but the errors are further multiplied by a factor \(\frac{1}{P_{T} \cdot D_{T}}\) to account for the target polarization and dilution factors. Note that the asymmetry values can be set to a constant with yvalue=A if you only care about the rescaled errors. If the value satisfies \(A\in[-1,0)\), the asymmetry errors will be set to \(\sigma_{A} = \frac{1}{P_{T} \cdot D_{T}} \cdot \sqrt{\frac{1-(A \cdot P_{T} \cdot D_{T})^{2}}{N_{Rescaled}}}\). If the value satisfies \(A\in[0,+1]\), the asymmetry errors will be rescaled by the factor \(\sqrt{\frac{1-(A \cdot P_{T} \cdot D_{T})^{2} N_{Old Data}}{N_{Rescaled}}}\). Otherwise, the yvalue from old_dat will be used.