From b7beca7c1a7d06476075f7caf4ae55ca009064ab Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 11 May 2020 12:10:17 -0500 Subject: update ockham factor, remove hack, and don't submit all flashers This commit contains the following updates: - remove hack to get rid of low energy events in plot-energy since while writing the unidoc I realized it's not necessary now that we add +100 to multi-particle fits - update Ockham factor to use an energy resolution of 5% - update submit-grid-jobs to submit jobs according to the following criteria: - always submit prompt events with no data cleaning cuts - submit 10% of prompt flasher events - submit all other prompt events - submit followers only if they have no data cleaning cuts - update submit-grid-jobs to place the nhit cut of 100 on the calibrated nhit --- utils/dc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'utils/dc') diff --git a/utils/dc b/utils/dc index b551925..0c14053 100755 --- a/utils/dc +++ b/utils/dc @@ -26,7 +26,6 @@ import emcee from scipy.optimize import brentq from scipy.stats import truncnorm from matplotlib.lines import Line2D -from sddm.dc import get_proposal_func, estimate_errors, metropolis_hastings, EPSILON from sddm.plot import despine from sddm.dc import * from sddm.plot_energy import * @@ -372,28 +371,13 @@ if __name__ == '__main__': # so we can tag retrigger events ev['dt'] = ev.groupby(['run'],as_index=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)) fits['w'] -= fits['n']*100 # Note: we index on the left hand site with loc to avoid a copy error -- cgit