Skip to content

Commit

Permalink
Use versioned cross section paths in Example2
Browse files Browse the repository at this point in the history
  • Loading branch information
austinschneider committed Jan 24, 2024
1 parent f3128b7 commit ef3af3c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
9 changes: 6 additions & 3 deletions resources/Examples/Example2/DipolePortal_CCM.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from leptoninjector import _util
from leptoninjector.LIController import LIController

import DarkNews

darknews_version = _util.normalize_version(DarkNews.__version__)

resources_dir = _util.resource_package_dir()

# Define a DarkNews model
Expand Down Expand Up @@ -33,11 +37,10 @@
# Particle to inject
primary_type = LI.dataclasses.Particle.ParticleType.NuMu

xs_path = _util.get_cross_section_model_path(f"DarkNewsTables-v{darknews_version}", must_exist=False)
# Define DarkNews Model
table_dir = os.path.join(
resources_dir,
"CrossSections",
"DarkNewsTables",
xs_path,
"Dipole_M%2.2f_mu%2.2e" % (model_kwargs["m4"], model_kwargs["mu_tr_mu4"]),
)
controller.InputDarkNewsModel(primary_type, table_dir, model_kwargs)
Expand Down
9 changes: 6 additions & 3 deletions resources/Examples/Example2/DipolePortal_MINERvA.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from leptoninjector import _util
from leptoninjector.LIController import LIController

import DarkNews

darknews_version = _util.normalize_version(DarkNews.__version__)

resources_dir = _util.resource_package_dir()

# Define a DarkNews model
Expand Down Expand Up @@ -33,11 +37,10 @@
# Particle to inject
primary_type = LI.dataclasses.Particle.ParticleType.NuMu

xs_path = _util.get_cross_section_model_path(f"DarkNewsTables-v{darknews_version}", must_exist=False)
# Define DarkNews Model
table_dir = os.path.join(
resources_dir,
"CrossSectionTables",
"DarkNewsTables",
xs_path,
"Dipole_M%2.2f_mu%2.2e" % (model_kwargs["m4"], model_kwargs["mu_tr_mu4"]),
)
controller.InputDarkNewsModel(primary_type, table_dir, model_kwargs)
Expand Down
11 changes: 8 additions & 3 deletions resources/Examples/Example2/DipolePortal_MiniBooNE.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

resources_dir = _util.resource_package_dir()

import DarkNews

darknews_version = _util.normalize_version(DarkNews.__version__)

resources_dir = _util.resource_package_dir()

# Define a DarkNews model
model_kwargs = {
"m4": 0.47, # 0.140,
Expand All @@ -31,11 +37,10 @@
# Particle to inject
primary_type = LI.dataclasses.Particle.ParticleType.NuMu

xs_path = _util.get_cross_section_model_path(f"DarkNewsTables-v{darknews_version}", must_exist=False)
# Define DarkNews Model
table_dir = os.path.join(
resources_dir,
"CrossSectionTables",
"DarkNewsTables",
xs_path,
"Dipole_M%2.2f_mu%2.2e" % (model_kwargs["m4"], model_kwargs["mu_tr_mu4"]),
)
controller.InputDarkNewsModel(primary_type, table_dir, model_kwargs)
Expand Down

0 comments on commit ef3af3c

Please sign in to comment.