Vindaar / TimepixAnalysis

Contains code related to calibration and analysis of Timepix based detector + CAST related code
MIT License
19 stars 6 forks source link

Gas gain slicing: disallow very short slices at ends of runs #50

Closed Vindaar closed 3 years ago

Vindaar commented 3 years ago

In the current implementation of the gas gain slicing the last slice of the gas gain intervals is always going to be

t_run % t_slice

which can end up being arbitrarily small. This is an issue, because we end up with slices, which have too little statistics in the Polya for the gas gain determination.

Instead we should probably assimilate the remainder into the second to last slice, iff the remainder is shorter than a specific time. We know 30 min yields good results, so that seems like an acceptable time.

Note: when making this change it is important that we make sure that at no point in the code the "interval" time from the config.toml file or the name of the gas gain slice dataset in the H5 file is used for some sort of normalization, because it is not guaranteed that the slice actually has that length. Instead the GasGainIntervalData (and Result) should store the real time in addition to the expected interval length. All further code needs to use that time.

As far as I know no code currently depends on that time though.