From 0ae87ca70b621f9f4b7c48cd20827fb0470e406e Mon Sep 17 00:00:00 2001 From: Fanurs Date: Thu, 6 Apr 2023 11:15:36 -0400 Subject: [PATCH] :bug: Replaced with exact AmBe Compton edge --- calibrations/NWB_PulseHeightCalibration.dat | 51 +++++++++++---------- corrections/NWB_light_recalibration.py | 10 ++-- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/calibrations/NWB_PulseHeightCalibration.dat b/calibrations/NWB_PulseHeightCalibration.dat index 693abb4..b853c87 100644 --- a/calibrations/NWB_PulseHeightCalibration.dat +++ b/calibrations/NWB_PulseHeightCalibration.dat @@ -1,25 +1,26 @@ -*numbar a b c d e -NWBbar01 265.715 -0.0208427 0.00899404 -0.183013 1.06701 -NWBbar02 270.948 -0.0121215 0.00799162 -0.178676 1.0787 -NWBbar03 208.035 0.00751658 0.0095658 -0.184792 1.07976 -NWBbar04 289.835 -0.00982418 0.00816866 -0.17786 1.08718 -NWBbar05 339.892 0.111553 0.00826487 -0.181898 1.08548 -NWBbar06 278.233 0.0335855 0.0089949 -0.18183 1.06797 -NWBbar07 268.263 0.017025 0.00895266 -0.180163 1.0766 -NWBbar08 247.703 0.0237359 0.00850408 -0.176009 1.0785 -NWBbar09 234.631 0.0555843 0.00911143 -0.182341 1.07141 -NWBbar10 294.523 0.0714755 0.00760774 -0.170139 1.02323 -NWBbar11 250.609 0.0287793 0.00864147 -0.178709 1.08023 -NWBbar12 281.526 0.0945725 0.00726915 -0.173134 1.04379 -NWBbar13 315.952 0.1132 0.00842136 -0.17912 1.06597 -NWBbar14 223.131 -0.0312044 0.00931666 -0.181888 1.07369 -NWBbar15 249.643 0.0795784 0.00960933 -0.199318 1.09423 -NWBbar16 273.288 -0.0561292 0.0077277 -0.182123 1.12544 -NWBbar17 237.793 -0.12649 0.00738453 -0.190175 1.16842 -NWBbar18 243.349 -0.033644 0.00929518 -0.170863 1.08343 -NWBbar19 243.387 -0.0455902 0.00837621 -0.184127 1.08238 -NWBbar20 270.984 -0.0236044 0.0102719 -0.182612 1.0254 -NWBbar21 281.389 -0.0171469 0.00912915 -0.171173 1.03895 -NWBbar22 281.791 -0.00787292 0.00687425 -0.166382 1.02101 -NWBbar23 267.294 -0.0273952 0.00698371 -0.16942 1.16528 -NWBbar24 345.084 0.0281295 0.00802125 -0.191348 1.0936 +*numbar a b c d e +NWBbar01 265.715 -0.0208427 0.00899404 -0.117415 1.06365 +NWBbar02 270.948 -0.0121215 0.00799162 -0.138084 1.0766 +NWBbar03 208.035 0.00751658 0.0095658 -0.140782 1.07748 +NWBbar04 289.835 -0.00982418 0.00816866 -0.153481 1.08591 +NWBbar05 339.892 0.111553 0.00826487 -0.150821 1.08387 +NWBbar06 278.233 0.0335855 0.0089949 -0.119031 1.06475 +NWBbar07 268.263 0.017025 0.00895266 -0.134435 1.07423 +NWBbar08 247.703 0.0237359 0.00850408 -0.137448 1.07651 +NWBbar09 234.631 0.0555843 0.00911143 -0.125301 1.06848 +NWBbar10 294.523 0.0714755 0.00760774 -0.0365673 1.01666 +NWBbar11 250.609 0.0287793 0.00864147 -0.140925 1.07827 +NWBbar12 281.526 0.0945725 0.00726915 -0.0741191 1.03883 +NWBbar13 315.952 0.1132 0.00842136 -0.115023 1.06269 +NWBbar14 223.131 -0.0312044 0.00931666 -0.129359 1.07099 +NWBbar15 249.643 0.0795784 0.00960933 -0.169015 1.09264 +NWBbar16 273.288 -0.0561292 0.0077277 -0.223785 1.1277 +NWBbar17 237.793 -0.12649 0.00738453 -0.286297 1.17359 +NWBbar18 243.349 -0.033644 0.00929518 -0.145655 1.08212 +NWBbar19 243.386 -0.0455902 0.00837621 -0.145526 1.08038 +NWBbar20 270.984 -0.0236044 0.0102719 -0.0421602 1.01849 +NWBbar21 281.389 -0.0171469 0.00912915 -0.0650806 1.03366 +NWBbar22 281.791 -0.00787292 0.00687425 -0.0321136 1.01443 +NWBbar23 267.294 -0.0273952 0.00698371 -0.241489 1.16865 +NWBbar24 345.084 0.0281295 0.00802125 -0.166835 1.09232 + diff --git a/corrections/NWB_light_recalibration.py b/corrections/NWB_light_recalibration.py index 930f1d1..0536647 100644 --- a/corrections/NWB_light_recalibration.py +++ b/corrections/NWB_light_recalibration.py @@ -35,11 +35,11 @@ def get_adc(light, x, a, b, c, d, e): # updated the calibration points (MeVee) # using Geant4 simulation, with the correct NW bar dimensions old_calib_lights = { - 'pedestal': 0.0, 'AmBe': 4.20, + 'pedestal': 0.0, 'AmBe': 4.196, '90 deg': 11.02, '44.4 deg': 15.6538, '56.3 deg': 20.3242, } new_calib_lights = { - 'pedestal': 0.0, 'AmBe': 4.20, + 'pedestal': 0.0, 'AmBe': 4.196, '90 deg': 11.96, '44.4 deg': 17.0536, '56.3 deg': 22.1550, } @@ -62,7 +62,7 @@ def routine(bar, ax): new_data = pd.DataFrame( [ [new_calib_lights['pedestal'], 0.0], - [new_calib_lights['AmBe'], old_data.loc['AmBe', 'adc']], + [new_calib_lights['AmBe'], df_ambe.loc[bar, 'p0']], [new_calib_lights['90 deg'], old_data.loc['90 deg', 'adc']], [new_calib_lights['44.4 deg'], old_data.loc['44.4 deg', 'adc']], [new_calib_lights['56.3 deg'], old_data.loc['56.3 deg', 'adc']], @@ -80,8 +80,8 @@ def routine(bar, ax): new_data['light'], new_data['adc'], p0=x0, bounds=( - (x0[0] - 1e-2, x0[1] - 1e-3, x0[2] - 1e-5, x0[3] - 0.2, x0[4] - 0.2), - (x0[0] + 1e-2, x0[1] + 1e-3, x0[2] + 1e-5, x0[3] + 0.2, x0[4] + 0.2), + (x0[0] - 5e-2, x0[1] - 5e-3, x0[2] - 5e-5, x0[3] - 0.25, x0[4] - 0.25), + (x0[0] + 5e-2, x0[1] + 5e-3, x0[2] + 5e-5, x0[3] + 0.25, x0[4] + 0.25), ), )[0]