From 1583e91c6086a344e5827ec6f28cf3e89b7e3df0 Mon Sep 17 00:00:00 2001 From: amanmdesai Date: Sat, 7 Jan 2023 19:26:14 +0530 Subject: [PATCH 1/2] update saving events --- README.md | 2 ++ notebooks/cross-section.ipynb | 2 +- src/compscat/save_events.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 217def7..5c6ed5e 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ Plot showing the cross section versus energy (with error bars): | 500 MeV | 2.194 $\pm$ 0.0161 | 2.203 $\pm$ 0.0044 | +In the following, the initial photon energy is set to 0.1 GeV (electron is at rest). + ### Photon final state kinematics

diff --git a/notebooks/cross-section.ipynb b/notebooks/cross-section.ipynb index 1136088..d733bf5 100644 --- a/notebooks/cross-section.ipynb +++ b/notebooks/cross-section.ipynb @@ -124,7 +124,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/src/compscat/save_events.py b/src/compscat/save_events.py index f10995d..518e8a8 100644 --- a/src/compscat/save_events.py +++ b/src/compscat/save_events.py @@ -17,6 +17,7 @@ def to_root(self): self.Nevent, self.w_max, self.E ).gen_events() file = uproot.recreate("MC_compton.root") + # factor of 1e6 ensures the result is in KeV file["events"] = { "Photon_Energy": ph_e * 1e6, "Photon_Px": ph_px * 1e6, @@ -33,7 +34,7 @@ def to_csv(self): self.Nevent, self.w_max, self.E ).gen_events() - data = list(zip(ph_e, ph_px, ph_py, ph_pz, el_e, el_px, el_py, el_pz)) + data = list(zip(ph_e* 1e6, ph_px* 1e6, ph_py* 1e6, ph_pz* 1e6, el_e* 1e6, el_px* 1e6, el_py* 1e6, el_pz* 1e6)) column_name = [ "Photon_Energy", From c132e112ed9528d65b346ea6a7831b34888dfd3f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 7 Jan 2023 13:57:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/compscat/save_events.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compscat/save_events.py b/src/compscat/save_events.py index 518e8a8..ea4e1cd 100644 --- a/src/compscat/save_events.py +++ b/src/compscat/save_events.py @@ -34,7 +34,18 @@ def to_csv(self): self.Nevent, self.w_max, self.E ).gen_events() - data = list(zip(ph_e* 1e6, ph_px* 1e6, ph_py* 1e6, ph_pz* 1e6, el_e* 1e6, el_px* 1e6, el_py* 1e6, el_pz* 1e6)) + data = list( + zip( + ph_e * 1e6, + ph_px * 1e6, + ph_py * 1e6, + ph_pz * 1e6, + el_e * 1e6, + el_px * 1e6, + el_py * 1e6, + el_pz * 1e6, + ) + ) column_name = [ "Photon_Energy",