Skip to content

Commit

Permalink
Adding ability to compare two different files
Browse files Browse the repository at this point in the history
  • Loading branch information
Horoho committed Nov 8, 2023
1 parent b407ba3 commit 73497ed
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions Validation/src/Validation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from . import hcal
from . import photonuclear
from . import dark_brem
from . import simparticles
45 changes: 45 additions & 0 deletions Validation/src/Validation/simparticles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from ._differ import Differ
from ._plotter import plotter
import logging

log = logging.getLogger('8GeV')

@plotter(hist=True, event=False)
def beamenergy_comp(d: Differ, out_dir=None):

pdgid_labels = ['', 'e+', 'e-', 'μ+', 'μ-', 'γ', 'p', 'n', 'π+', 'π-', 'π0', 'K+', 'K-', 'K-L', 'K-S', 'nucleus', 'exotic', ''] # finish later

d.plot1d("SampleValidation/SampleValidation_pdgid_primaries", "PDG ID, primaries",
tick_labels=pdgid_labels,
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_energy_primaries", "Energy of primaries (MeV)",
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_pdgid_primarydaughters", "PDG ID, primary daughters",
tick_labels=pdgid_labels,
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_startZ_hardbrem", "Start z position of hard primary daughter",
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_endZ_hardbrem", "End z position of hard primary daughter",
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_energy_hardbrem", "Energy spectrum of hard primary daughter",
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_pdgid_hardbremdaughters", "PDG ID, hard brem daughters",
tick_labels=pdgid_labels,
out_dir=out_dir,
density=True)

d.plot1d("SampleValidation/SampleValidation_startZ_hardbremdaughters", "Start z position of hard brem daughters",
out_dir=out_dir,
density=True)

0 comments on commit 73497ed

Please sign in to comment.