Skip to content
Snippets Groups Projects
Commit 771f81f0 authored by Carl Gwilliam's avatar Carl Gwilliam
Browse files

Update foresee generation to allow testing with new version. Old version default for now

parent 91798887
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,6 @@ import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from foresee import Foresee, Model, Utility
class ForeseeGenerator(object):
"""
Generate LLP particles within FASER acceptance from FORESEE
......@@ -328,6 +326,11 @@ def setup_foresee(path):
return
def add_to_python_path(path):
if path in sys.path: return
path = os.path.expandvars(os.path.expanduser(path))
os.sys.path.append(path)
return
def parse_couplings(data, write_hepMC = False):
......@@ -364,6 +367,10 @@ if __name__ == "__main__":
parser.add_argument("--nevents", "-n", default = 10, type = int, help = "Number of HepMC events ")
args = parser.parse_args()
add_to_python_path(f"{args.path}/src")
from foresee import Foresee, Model, Utility
# Create PIDs
if args.pid2 is None:
args.pid2 = -args.pid1
......@@ -373,7 +380,7 @@ if __name__ == "__main__":
print(f"Generating {args.model} events at Ecom = {args.Ecom}")
print(f" mother mass = {args.mass} GeV")
print(f" decay = {args.pid1} {args.pid2}")
print(f" couplings = {couplings}")
print(f" couplings = {couplings}")
f = ForeseeGenerator(args.model, args.Ecom, args.mass, couplings, args.pid1, args.pid2, outdir = args.outdir, path = args.path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment