aboutsummaryrefslogtreecommitdiff
path: root/utils/plot-energy
diff options
context:
space:
mode:
Diffstat (limited to 'utils/plot-energy')
-rwxr-xr-xutils/plot-energy17
1 files changed, 1 insertions, 16 deletions
diff --git a/utils/plot-energy b/utils/plot-energy
index f082b8c..4cd116b 100755
--- a/utils/plot-energy
+++ b/utils/plot-energy
@@ -171,28 +171,13 @@ if __name__ == '__main__':
# so we can tag retrigger events
ev['dt'] = ev.groupby(['run'],group_keys=False)['gtr'].transform(lambda x: np.concatenate(([1e9],np.diff(x.values))))
- # This is a bit of a hack. It appears that many times the fit will
- # actually do much better by including a very low energy electron or
- # muon. I believe the reason for this is that of course my likelihood
- # function is not perfect (for example, I don't include the correct
- # angular distribution for Rayleigh scattered light), and so the fitter
- # often wants to add a very low energy electron or muon to fix things.
- #
- # Ideally I would fix the likelihood function, but for now we just
- # discard any fit results which have a very low energy electron or
- # muon.
- #
- # FIXME: Test this since query() is new to pandas
- fits = fits.query('not (n > 1 and ((id1 == 20 and energy1 < 20) or (id2 == 20 and energy2 < 20) or (id3 == 20 and energy3 < 20)))')
- fits = fits.query('not (n > 1 and ((id2 == 22 and energy1 < 200) or (id2 == 22 and energy2 < 200) or (id3 == 22 and energy3 < 200)))')
-
# Calculate the approximate Ockham factor.
# See Chapter 20 in "Probability Theory: The Logic of Science" by Jaynes
#
# Note: This is a really approximate form by assuming that the shape of
# the likelihood space is equal to the average uncertainty in the
# different parameters.
- fits['w'] = fits['n']*np.log(0.1*0.001) + np.log(fits['energy1']) + fits['n']*np.log(1e-4/(4*np.pi))
+ fits['w'] = fits['n']*np.log(0.05/10e3) + np.log(fits['energy1']) + fits['n']*np.log(1e-4/(4*np.pi))
# Apply a fudge factor to the Ockham factor of 100 for each extra particle
# FIXME: I chose 100 a while ago but didn't really investigate what the