aboutsummaryrefslogtreecommitdiff
path: root/utils/plot-muons
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-07-27 17:13:39 -0500
committertlatorre <tlatorre@uchicago.edu>2020-07-27 17:13:39 -0500
commit9591e9a42ec0b79883fd2f7772e8bfecaa5cea33 (patch)
treeb1122b9640989f6c6cee929079b619965935e3b9 /utils/plot-muons
parent6c453d47775a0fe05d7da55b1b211c594a014f36 (diff)
downloadsddm-9591e9a42ec0b79883fd2f7772e8bfecaa5cea33.tar.gz
sddm-9591e9a42ec0b79883fd2f7772e8bfecaa5cea33.tar.bz2
sddm-9591e9a42ec0b79883fd2f7772e8bfecaa5cea33.zip
update plot-muons
Diffstat (limited to 'utils/plot-muons')
-rwxr-xr-xutils/plot-muons12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/plot-muons b/utils/plot-muons
index e80d0af..128eaa2 100755
--- a/utils/plot-muons
+++ b/utils/plot-muons
@@ -154,13 +154,15 @@ if __name__ == '__main__':
fig = plt.figure()
plt.subplot(2,1,1)
plt.hist(muons.ke.values, bins=np.logspace(3,7,100), histtype='step', color='C0', label="Data")
- plt.hist(muons_mc.ke.values, bins=np.logspace(3,7,100), histtype='step', color='C1', label="Monte Carlo")
+ norm = len(muons.ke.values)/len(muons_mc.ke.values)
+ plt.hist(muons_mc.ke.values, weights=np.tile(norm,len(muons_mc.ke.values)), bins=np.logspace(3,7,100), histtype='step', color='C1', label="Monte Carlo")
plt.legend()
plt.xlabel("Energy (MeV)")
plt.gca().set_xscale("log")
plt.subplot(2,1,2)
plt.hist(np.cos(muons.theta.values), bins=np.linspace(-1,1,100), histtype='step', color='C0', label="Data")
- plt.hist(np.cos(muons_mc.theta.values), bins=np.linspace(-1,1,100), histtype='step', color='C1', label="Monte Carlo")
+ norm = len(muons.theta.values)/len(muons_mc.theta.values)
+ plt.hist(np.cos(muons_mc.theta.values), weights=np.tile(norm,len(muons_mc.ke.values)), bins=np.linspace(-1,1,100), histtype='step', color='C1', label="Monte Carlo")
plt.legend()
despine(fig,trim=True)
plt.xlabel(r"$\cos(\theta)$")
@@ -197,13 +199,15 @@ if __name__ == '__main__':
fig = plt.figure()
plt.subplot(2,1,1)
plt.hist(stopping_muons.ke.values, bins=np.logspace(3,7,100), histtype='step', color='C0', label="Data")
- plt.hist(stopping_muons_mc.ke.values, bins=np.logspace(3,7,100), histtype='step', color='C1', label="Monte Carlo")
+ norm = len(stopping_muons.ke.values)/len(stopping_muons_mc.ke.values)
+ plt.hist(stopping_muons_mc.ke.values, weights=np.tile(norm,len(stopping_muons_mc.ke.values)), bins=np.logspace(3,7,100), histtype='step', color='C1', label="Monte Carlo")
plt.legend()
plt.xlabel("Energy (MeV)")
plt.gca().set_xscale("log")
plt.subplot(2,1,2)
plt.hist(np.cos(stopping_muons.theta.values), bins=np.linspace(-1,1,100), histtype='step', color='C0', label="Data")
- plt.hist(np.cos(stopping_muons_mc.theta.values), bins=np.linspace(-1,1,100), histtype='step', color='C1', label="Monte Carlo")
+ norm = len(stopping_muons.theta.values)/len(stopping_muons_mc.theta.values)
+ plt.hist(np.cos(stopping_muons_mc.theta.values), weights=np.tile(norm,len(stopping_muons_mc.theta.values)), bins=np.linspace(-1,1,100), histtype='step', color='C1', label="Monte Carlo")
plt.legend()
despine(fig,trim=True)
plt.xlabel(r"$\cos(\theta)$")