e15190.neutron_wall.light_output_calibration.LogOfLightRatio

class e15190.neutron_wall.light_output_calibration.LogOfLightRatio(pos, light_L, light_R)

Functions

__init__(pos, light_L, light_R)

Class to help analyzing the logarithm of light ratio.

add_straightened_xy()

decorate_descale_xy(func)

deflatten(x, y)

Rotates flattened (x, y) back to the original points.

extract_longest_increasing_subarray(x)

fit_linear()

A robust linear fit on (x, y) using PCA and RANSAC.

fit_wavy()

fit_wavy_on_flat([return_xy])

flatten(x, y)

Rotates (x, y) to zero slope of the linear fit.

get_wavy_slopes(x)

intercept_to_gain_ratio(intercept)

rotate(x, y, angle)

slope_to_attenuation_length(slope)

straighten(pos, log_light_ratio)

Properties

attenuation_length

attenuation_length_from_linear

In unit of centimeter

attenuation_length_from_wavy

In unit of centimeter

gain_ratio

Gain right divided by gain left

log_light_ratio_spread

__init__(pos, light_L, light_R)

Class to help analyzing the logarithm of light ratio.

Data are assumed to be coming from one single NW bar. Experimental runs of the same nuclear reactions that are closeby in time could be chained together for more statistics.

Both self.x and self.y will be defined as dimensionless quantities. The scaling factors are chosen empirically to make the ranges of x and y roughly the same.

Parameters
  • light_L (array-like) – The light output of detected at the left side of the bar in ADC.

  • light_R (array-like) – The light output of detected at the right side of the bar in ADC.

  • pos (array-like) – The hit positions on the bar in centimeter.

fit_linear()

A robust linear fit on (x, y) using PCA and RANSAC.

To improve robustness against outliers, PCA is first performed so that data points with 2nd components far from zero are removed. The remaining data are fed to RANSAC to find the most robust linear fit, updated as self.linear_fit.

flatten(x, y)

Rotates (x, y) to zero slope of the linear fit.

Rotation center is at origin, not the intersection between the linear fit and the y-axis. This function is only used intermediately for fitting the “wavy” relation.

deflatten(x, y)

Rotates flattened (x, y) back to the original points.

property attenuation_length_from_wavy

In unit of centimeter

property attenuation_length_from_linear

In unit of centimeter

property gain_ratio

Gain right divided by gain left