Skip to content

Commit

Permalink
Merge pull request #29 from amanmdesai/dev
Browse files Browse the repository at this point in the history
update saving events
  • Loading branch information
amanmdesai authored Jan 7, 2023
2 parents 118f7c1 + c132e11 commit 5a78625
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion notebooks/cross-section.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
14 changes: 13 additions & 1 deletion src/compscat/save_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,7 +34,18 @@ 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",
Expand Down

0 comments on commit 5a78625

Please sign in to comment.