2020-03-31 15:35:03 +02:00
|
|
|
|
#+PROPERTY: header-args :exports both :output-dir results :session xs :kernel python3
|
2020-03-27 15:43:13 +01:00
|
|
|
|
|
2020-03-27 13:39:00 +01:00
|
|
|
|
* Init
|
|
|
|
|
** Required Modules
|
|
|
|
|
#+NAME: e988e3f2-ad1f-49a3-ad60-bedba3863283
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :tangle tangled/xs.py
|
2020-03-27 19:34:22 +01:00
|
|
|
|
import numpy as np
|
|
|
|
|
import matplotlib.pyplot as plt
|
2020-03-31 15:19:51 +02:00
|
|
|
|
import monte_carlo
|
2020-03-27 19:34:22 +01:00
|
|
|
|
#+end_src
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
|
|
|
|
#+RESULTS: e988e3f2-ad1f-49a3-ad60-bedba3863283
|
|
|
|
|
|
2020-03-31 15:35:03 +02:00
|
|
|
|
|
2020-03-27 13:39:00 +01:00
|
|
|
|
** Utilities
|
|
|
|
|
#+NAME: 53548778-a4c1-461a-9b1f-0f401df12b08
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+BEGIN_SRC jupyter-python :exports both
|
2020-03-27 13:39:00 +01:00
|
|
|
|
%run ../utility.py
|
2020-03-30 19:19:48 +02:00
|
|
|
|
%load_ext autoreload
|
|
|
|
|
%aimport monte_carlo
|
2020-03-31 15:19:51 +02:00
|
|
|
|
%autoreload 1
|
2020-03-27 13:39:00 +01:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
#+RESULTS: 53548778-a4c1-461a-9b1f-0f401df12b08
|
|
|
|
|
|
2020-03-30 15:43:55 +02:00
|
|
|
|
* Implementation
|
2020-03-27 13:39:00 +01:00
|
|
|
|
#+NAME: 777a013b-6c20-44bd-b58b-6a7690c21c0e
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+BEGIN_SRC jupyter-python :exports both :results raw drawer :exports code :tangle tangled/xs.py
|
2020-03-27 13:39:00 +01:00
|
|
|
|
"""
|
|
|
|
|
Implementation of the analytical cross section for q q_bar ->
|
|
|
|
|
gamma gamma
|
|
|
|
|
|
|
|
|
|
Author: Valentin Boettcher <hiro@protagon.space>
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
from scipy.constants import alpha
|
|
|
|
|
|
|
|
|
|
# NOTE: a more elegant solution would be a decorator
|
|
|
|
|
def energy_factor(charge, esp):
|
|
|
|
|
"""
|
|
|
|
|
Calculates the factor common to all other values in this module
|
|
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementary charge
|
|
|
|
|
"""
|
|
|
|
|
|
2020-03-27 14:30:55 +01:00
|
|
|
|
return charge**4*(alpha/esp)**2/6
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
|
|
|
|
|
2020-03-28 11:43:21 +01:00
|
|
|
|
def diff_xs(θ, charge, esp):
|
2020-03-27 13:39:00 +01:00
|
|
|
|
"""
|
|
|
|
|
Calculates the differential cross section as a function of the
|
2020-03-30 15:43:55 +02:00
|
|
|
|
azimuth angle θ in units of 1/GeV².
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
|
|
|
|
Arguments:
|
2020-03-28 11:43:21 +01:00
|
|
|
|
θ -- azimuth angle
|
2020-03-27 13:39:00 +01:00
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementary charge
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
f = energy_factor(charge, esp)
|
2020-03-30 19:19:48 +02:00
|
|
|
|
return f*((np.cos(θ)**2+1)/np.sin(θ)**2)
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
2020-03-30 19:56:02 +02:00
|
|
|
|
def diff_xs_cosθ(cosθ, charge, esp):
|
|
|
|
|
"""
|
|
|
|
|
Calculates the differential cross section as a function of the
|
|
|
|
|
cosine of the azimuth angle θ in units of 1/GeV².
|
|
|
|
|
|
|
|
|
|
Arguments:
|
2020-03-30 20:26:10 +02:00
|
|
|
|
cosθ -- cosine of the azimuth angle
|
2020-03-30 19:56:02 +02:00
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementary charge
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
f = energy_factor(charge, esp)
|
|
|
|
|
return f*((cosθ**2+1)/(1-cosθ**2))
|
|
|
|
|
|
2020-03-28 11:53:45 +01:00
|
|
|
|
def diff_xs_eta(η, charge, esp):
|
2020-03-27 13:39:00 +01:00
|
|
|
|
"""
|
|
|
|
|
Calculates the differential cross section as a function of the
|
|
|
|
|
pseudo rapidity of the photons in units of 1/GeV^2.
|
|
|
|
|
|
|
|
|
|
Arguments:
|
2020-03-28 11:43:21 +01:00
|
|
|
|
η -- pseudo rapidity
|
2020-03-27 13:39:00 +01:00
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementary charge
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
f = energy_factor(charge, esp)
|
2020-03-28 11:43:21 +01:00
|
|
|
|
return f*(2*np.cosh(η)**2 - 1)
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
2020-03-30 20:26:10 +02:00
|
|
|
|
def diff_xs_pt(pt, charge, esp):
|
|
|
|
|
"""
|
|
|
|
|
Calculates the differential cross section as a function of the
|
|
|
|
|
transversal impulse of the photons in units of 1/GeV^2.
|
|
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
|
η -- transversal impulse
|
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementary charge
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
f = energy_factor(charge, esp)
|
|
|
|
|
return f*((esp/pt)**2/2 - 1)
|
|
|
|
|
|
2020-03-28 11:53:45 +01:00
|
|
|
|
def total_xs_eta(η, charge, esp):
|
2020-03-27 13:39:00 +01:00
|
|
|
|
"""
|
|
|
|
|
Calculates the total cross section as a function of the pseudo
|
|
|
|
|
rapidity of the photons in units of 1/GeV^2. If the rapditiy is
|
|
|
|
|
specified as a tuple, it is interpreted as an interval. Otherwise
|
2020-03-28 11:43:21 +01:00
|
|
|
|
the interval [-η, η] will be used.
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
|
|
|
|
Arguments:
|
2020-03-28 11:43:21 +01:00
|
|
|
|
η -- pseudo rapidity (tuple or number)
|
2020-03-27 13:39:00 +01:00
|
|
|
|
esp -- center of momentum energy in GeV
|
|
|
|
|
charge -- charge of the particle in units of the elementar charge
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
f = energy_factor(charge, esp)
|
2020-03-28 11:43:21 +01:00
|
|
|
|
if not isinstance(η, tuple):
|
|
|
|
|
η = (-η, η)
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
2020-03-28 11:43:21 +01:00
|
|
|
|
if len(η) != 2:
|
|
|
|
|
raise ValueError('Invalid η cut.')
|
2020-03-27 13:39:00 +01:00
|
|
|
|
|
|
|
|
|
def F(x):
|
|
|
|
|
return np.tanh(x) - 2*x
|
|
|
|
|
|
2020-03-28 11:43:21 +01:00
|
|
|
|
return 2*np.pi*f*(F(η[0]) - F(η[1]))
|
2020-03-27 13:39:00 +01:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
#+RESULTS: 777a013b-6c20-44bd-b58b-6a7690c21c0e
|
|
|
|
|
|
|
|
|
|
* Calculations
|
|
|
|
|
** XS qq -> gamma gamma
|
|
|
|
|
First, set up the input parameters.
|
|
|
|
|
#+NAME: 7e62918a-2935-41ac-94e0-f0e7c3af8e0d
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+BEGIN_SRC jupyter-python :exports both :results raw drawer
|
2020-03-28 11:43:21 +01:00
|
|
|
|
η = 2.5
|
2020-03-27 13:39:00 +01:00
|
|
|
|
charge = 1/3
|
|
|
|
|
esp = 200 # GeV
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2020-03-31 12:16:57 +02:00
|
|
|
|
Set up the integration and plot intervals.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 12:16:57 +02:00
|
|
|
|
interval_η = [-η, η]
|
|
|
|
|
interval = η_to_θ([-η, η])
|
|
|
|
|
interval_cosθ = np.cos(interval)
|
|
|
|
|
interval_pt = η_to_pt([0, η], esp/2)
|
|
|
|
|
plot_interval = [0.1, np.pi-.1]
|
|
|
|
|
#+end_src
|
|
|
|
|
|
2020-03-31 15:19:51 +02:00
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
2020-03-27 13:39:00 +01:00
|
|
|
|
#+RESULTS: 7e62918a-2935-41ac-94e0-f0e7c3af8e0d
|
|
|
|
|
|
2020-03-30 19:19:48 +02:00
|
|
|
|
*** Analytical Integratin
|
2020-03-27 13:39:00 +01:00
|
|
|
|
And now calculate the cross section in picobarn.
|
|
|
|
|
#+NAME: cf853fb6-d338-482e-bc55-bd9f8e796495
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+BEGIN_SRC jupyter-python :exports both :results drawer output file :file xs.tex
|
2020-03-30 15:43:55 +02:00
|
|
|
|
xs_gev = total_xs_eta(η, charge, esp)
|
2020-03-28 11:43:21 +01:00
|
|
|
|
xs_pb = gev_to_pb(xs_gev)
|
2020-03-30 15:43:55 +02:00
|
|
|
|
print(tex_value(xs_pb, unit=r'\pico\barn', prefix=r'\sigma = ', prec=5))
|
2020-03-27 13:39:00 +01:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
#+RESULTS: cf853fb6-d338-482e-bc55-bd9f8e796495
|
2020-03-31 15:35:03 +02:00
|
|
|
|
: \(\sigma = \SI{0.05379}{\pico\barn}\)
|
2020-03-27 14:30:55 +01:00
|
|
|
|
|
2020-03-27 15:43:13 +01:00
|
|
|
|
Compared to sherpa, it's pretty close.
|
2020-03-27 14:30:55 +01:00
|
|
|
|
#+NAME: 81b5ed93-0312-45dc-beec-e2ba92e22626
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+BEGIN_SRC jupyter-python :exports both :results raw drawer
|
2020-03-27 14:30:55 +01:00
|
|
|
|
sherpa = 0.0538009
|
|
|
|
|
xs_pb/sherpa
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
#+RESULTS: 81b5ed93-0312-45dc-beec-e2ba92e22626
|
2020-03-31 15:35:03 +02:00
|
|
|
|
: 0.9998585425137037
|
2020-03-27 15:43:13 +01:00
|
|
|
|
|
|
|
|
|
I had to set the runcard option ~EW_SCHEME: alpha0~ to use the pure
|
|
|
|
|
QED coupling constant.
|
2020-03-31 12:16:57 +02:00
|
|
|
|
*** Numerical Integration
|
2020-03-30 19:19:48 +02:00
|
|
|
|
|
|
|
|
|
Plot our nice distribution:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-30 19:19:48 +02:00
|
|
|
|
plot_points = np.linspace(*plot_interval, 1000)
|
|
|
|
|
|
|
|
|
|
fig, ax = set_up_plot()
|
|
|
|
|
ax.plot(plot_points, gev_to_pb(diff_xs(plot_points, charge=charge, esp=esp)))
|
|
|
|
|
ax.set_xlabel(r'$\theta$')
|
|
|
|
|
ax.set_ylabel(r'$\frac{d\sigma}{d\Omega}$ [pb]')
|
|
|
|
|
ax.axvline(interval[0], color='gray', linestyle='--')
|
|
|
|
|
ax.axvline(interval[1], color='gray', linestyle='--', label=rf'$|\eta|={η}$')
|
|
|
|
|
ax.legend()
|
|
|
|
|
save_fig(fig, 'diff_xs', 'xs', size=[4, 4])
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
[[file:./.ob-jupyter/d30ededeaa03958fae5b649f50f3c5c3e6ae4677.png]]
|
2020-03-30 19:19:48 +02:00
|
|
|
|
|
|
|
|
|
Define the integrand.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-30 19:19:48 +02:00
|
|
|
|
def xs_pb_int(θ):
|
|
|
|
|
return gev_to_pb(np.sin(θ)*diff_xs(θ, charge=charge, esp=esp))
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
|
|
|
|
Plot the integrand. # TODO: remove duplication
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-30 19:19:48 +02:00
|
|
|
|
fig, ax = set_up_plot()
|
|
|
|
|
ax.plot(plot_points, xs_pb_int(plot_points))
|
|
|
|
|
ax.set_xlabel(r'$\theta$')
|
|
|
|
|
ax.set_ylabel(r'$\sin(\theta)\cdot\frac{d\sigma}{d\theta}$ [pb]')
|
|
|
|
|
ax.axvline(interval[0], color='gray', linestyle='--')
|
|
|
|
|
ax.axvline(interval[1], color='gray', linestyle='--', label=rf'$|\eta|={η}$')
|
|
|
|
|
ax.legend()
|
|
|
|
|
save_fig(fig, 'xs_integrand', 'xs', size=[4, 4])
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
[[file:./.ob-jupyter/78974a2e2315c72bd7ae8e4ac009b3d79cfe7001.png]]
|
2020-03-30 19:19:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Intergrate σ with the mc method.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
xs_pb_mc, xs_pb_mc_err = monte_carlo.integrate(xs_pb_int, interval, 10000)
|
2020-03-30 19:19:48 +02:00
|
|
|
|
xs_pb_mc = xs_pb_mc*np.pi*2
|
|
|
|
|
xs_pb_mc, xs_pb_mc_err
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
| 0.05365000636562272 | 4.2342293364016736e-05 |
|
2020-03-30 19:19:48 +02:00
|
|
|
|
|
2020-03-31 15:19:51 +02:00
|
|
|
|
We gonna export that as tex.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer output :file xs_mc.tex
|
2020-03-30 19:19:48 +02:00
|
|
|
|
print(tex_value(xs_pb_mc, unit=r'\pico\barn', prefix=r'\sigma = ', prec=5))
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
: \(\sigma = \SI{0.05365}{\pico\barn}\)
|
2020-03-30 19:19:48 +02:00
|
|
|
|
|
2020-03-31 12:16:57 +02:00
|
|
|
|
*** Sampling and Analysis
|
2020-03-31 15:19:51 +02:00
|
|
|
|
Define the sample number.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
sample_num = 1000
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
2020-03-30 20:26:10 +02:00
|
|
|
|
|
2020-03-31 15:19:51 +02:00
|
|
|
|
Now we monte-carlo sample our distribution.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
cosθ_sample = monte_carlo.sample_unweighted_array(sample_num, lambda x:
|
|
|
|
|
diff_xs_cosθ(x, charge, esp),
|
|
|
|
|
interval_cosθ)
|
2020-03-30 19:56:02 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
|
|
|
|
Nice! And now draw some histograms.
|
|
|
|
|
|
|
|
|
|
We define an auxilliary method for convenience.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-30 19:56:02 +02:00
|
|
|
|
def draw_histo(points, xlabel, bins=20):
|
|
|
|
|
fig, ax = set_up_plot()
|
|
|
|
|
ax.hist(points, bins, histtype='step')
|
|
|
|
|
ax.set_xlabel(xlabel)
|
|
|
|
|
ax.set_xlim([points.min(), points.max()])
|
|
|
|
|
return fig, ax
|
2020-03-30 19:19:48 +02:00
|
|
|
|
#+end_src
|
2020-03-30 19:56:02 +02:00
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
|
|
|
|
The histogram for cosθ.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-30 19:56:02 +02:00
|
|
|
|
fig, _ = draw_histo(cosθ_sample, r'$\cos\theta$')
|
2020-03-31 15:19:51 +02:00
|
|
|
|
save_fig(fig, 'histo_cos_theta', 'xs', size=(4,3))
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
[[file:./.ob-jupyter/ddc5e5b2a628d9f9add43555d7386acf4d92c6ee.png]]
|
2020-03-31 15:19:51 +02:00
|
|
|
|
|
|
|
|
|
Now we define some utilities to draw real 4-impulse samples.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :tangle tangled/xs.py
|
2020-03-31 15:19:51 +02:00
|
|
|
|
def sample_impulses(sample_num, interval, charge, esp, seed=None):
|
|
|
|
|
"""Samples `sample_num` unweighted photon 4-impulses from the cross-section.
|
|
|
|
|
|
|
|
|
|
:param sample_num: number of samples to take
|
|
|
|
|
:param interval: cosθ interval to sample from
|
|
|
|
|
:param charge: the charge of the quark
|
|
|
|
|
:param esp: center of mass energy
|
|
|
|
|
:param seed: the seed for the rng, optional, default is system
|
|
|
|
|
time
|
|
|
|
|
|
|
|
|
|
:returns: an array of 4 photon impulses
|
|
|
|
|
:rtype: np.ndarray
|
|
|
|
|
"""
|
|
|
|
|
cosθ_sample = \
|
|
|
|
|
monte_carlo.sample_unweighted_array(sample_num,
|
|
|
|
|
lambda x:
|
|
|
|
|
diff_xs_cosθ(x, charge, esp),
|
|
|
|
|
interval_cosθ)
|
|
|
|
|
φ_sample = np.random.uniform(0, 1, sample_num)
|
|
|
|
|
|
|
|
|
|
def make_impulse(esp, cosθ, φ):
|
|
|
|
|
sinθ = np.sqrt(1-cosθ**2)
|
|
|
|
|
return np.array([1, sinθ*np.cos(φ), sinθ*np.sin(φ), cosθ])*esp/2
|
|
|
|
|
|
|
|
|
|
impulses = np.array([make_impulse(esp, cosθ, φ) \
|
|
|
|
|
for cosθ, φ in np.array([cosθ_sample, φ_sample]).T])
|
|
|
|
|
return impulses
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
2020-03-31 15:35:03 +02:00
|
|
|
|
To generate histograms of other obeservables, we have to define them
|
|
|
|
|
as functions on 4-impuleses. Using those to transform samples is
|
|
|
|
|
analogous to transforming the distribution itself.
|
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer :tangle tangled/observables.py
|
2020-03-31 15:19:51 +02:00
|
|
|
|
"""This module defines some observables on arrays of 4-pulses."""
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
|
def p_t(p):
|
|
|
|
|
"""Transverse impulse
|
|
|
|
|
|
|
|
|
|
:param p: array of 4-impulses
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
return np.linalg.norm(p[:,1:3], axis=1)
|
|
|
|
|
|
|
|
|
|
def η(p):
|
|
|
|
|
"""Pseudo rapidity.
|
|
|
|
|
|
|
|
|
|
:param p: array of 4-impulses
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
return np.arccosh(np.linalg.norm(p[:,1:], axis=1)/p_t(p))*np.sign(p[:, 3])
|
2020-03-30 19:56:02 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
|
2020-03-31 15:19:51 +02:00
|
|
|
|
|
|
|
|
|
Lets try it out.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
impulse_sample = sample_impulses(2000, interval_cosθ, charge, esp)
|
|
|
|
|
impulse_sample
|
2020-03-30 19:56:02 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
: array([[100. , 60.93780026, 38.29391655, 69.42737539],
|
|
|
|
|
: [100. , 16.62473755, 5.08308744, -98.47730867],
|
|
|
|
|
: [100. , 62.52584971, 41.05712399, 66.3688985 ],
|
|
|
|
|
: ...,
|
|
|
|
|
: [100. , 36.93115123, 10.77808502, -92.30342871],
|
|
|
|
|
: [100. , 34.39831699, 43.0134429 , 83.46615792],
|
|
|
|
|
: [100. , 69.87424822, 3.87926805, 71.43207063]])
|
2020-03-30 20:26:10 +02:00
|
|
|
|
|
2020-03-31 15:19:51 +02:00
|
|
|
|
Now let's make a histogram of the η distribution.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
η_sample = η(impulse_sample)
|
|
|
|
|
draw_histo(η_sample, r'$\eta$')
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
:RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
| <Figure | size | 432x288 | with | 1 | Axes> | <matplotlib.axes._subplots.AxesSubplot | at | 0x7fb464af2040> |
|
|
|
|
|
[[file:./.ob-jupyter/347b6d473f38cf692e5614a095c9bc1a0e89c763.png]]
|
2020-03-31 15:19:51 +02:00
|
|
|
|
:END:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And the same for the p_t (transverse impulse) distribution.
|
2020-03-31 15:35:03 +02:00
|
|
|
|
#+begin_src jupyter-python :exports both :results raw drawer
|
2020-03-31 15:19:51 +02:00
|
|
|
|
p_t_sample = p_t(impulse_sample)
|
|
|
|
|
draw_histo(p_t_sample, r'$p_T$')
|
2020-03-30 20:26:10 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
|
:RESULTS:
|
2020-03-31 15:35:03 +02:00
|
|
|
|
| <Figure | size | 432x288 | with | 1 | Axes> | <matplotlib.axes._subplots.AxesSubplot | at | 0x7fb463469d60> |
|
|
|
|
|
[[file:./.ob-jupyter/880ac31d31bd9a537c0faacd56dc38f9eb668c7d.png]]
|
2020-03-30 19:56:02 +02:00
|
|
|
|
:END:
|