Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions macro/run_simScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import uuid
from argparse import ArgumentParser
from array import array
from typing import cast

import geometry_config
import ROOT
Expand Down Expand Up @@ -573,6 +574,7 @@
P8gen, options.theMass, theProductionCouplings, theDecayCouplings, inclusive, options.deepCopy
)
if options.RPVSUSY:
assert theCouplings is not None, "options.thecouplings is required for --RPVSUSY"
print("Generating RPVSUSY events of mass %.3f GeV" % theHNLMass)
print(f"and with couplings=[{theCouplings[0]:.3f},{theCouplings[1]:.3f}]")
print("and with stop mass=%.3f GeV\n" % theCouplings[2])
Expand Down Expand Up @@ -604,6 +606,7 @@
if passDPconf != 1:
sys.exit()
if HNL or options.RPVSUSY or options.DarkPhoton:
assert P8gen is not None # guaranteed by the three branches above
P8gen.SetSmearBeam(options.SmearBeam * u.cm) # Gaussian beam smearing
P8gen.SetPaintRadius(options.PaintBeam * u.cm) # beam painting radius
P8gen.SetLmin(ship_geo.decayVolume.z0 - ship_geo.target.z0)
Expand All @@ -615,7 +618,7 @@
# projective, so a single angle cut at the exit (widest point) suffices.
max_theta_x = (ship_geo.decayVolume.xEndInner / 2 + margin) / z_end
max_theta_y = (ship_geo.decayVolume.yEndInner / 2 + margin) / z_end
P8gen.SetMaxTheta(max_theta_x, max_theta_y) # slope bounds: |px/pz|, |py/pz|

Check failure on line 621 in macro/run_simScript.py

View workflow job for this annotation

GitHub Actions / static-analysis

Pyrefly missing-attribute

Object of class `DPPythia8Generator` has no attribute `SetMaxTheta` Object of class `HNLPythia8Generator` has no attribute `SetMaxTheta`
if charmonly:
primGen.SetTarget(0.0, 0.0) # vertex is set in pythia8Generator
ut.checkFileExists(inputFile)
Expand Down Expand Up @@ -851,6 +854,7 @@
# ROOT.kShipMuonsCrossSectionFactor = 100.
#
if options.cosmics:
assert Opt_high is not None # guaranteed by the same options.cosmics check above
primGen.SetTarget(0.0, 0.0)
Cosmicsgen = ROOT.CosmicsGenerator()
import CMBG_conf
Expand Down Expand Up @@ -983,7 +987,7 @@
elif options.DarkPhoton:
print("number of retries (no DP produced) ", P8gen.nrOfRetries())
print("number of geometric rejections (outside vessel acceptance) ", P8gen.nrOfGeoRejections())
print("total number of dark photons (including multiple meson decays per single collision) ", P8gen.nrOfDP())

Check failure on line 990 in macro/run_simScript.py

View workflow job for this annotation

GitHub Actions / static-analysis

Pyrefly missing-attribute

Object of class `Pythia8Generator` has no attribute `nrOfDP`

print("Output file is ", outFile)
print("Parameter file is ", parFile)
Expand All @@ -997,13 +1001,14 @@
tmpFile = outFile + "tmp"
xxx = outFile.split("/")
check = xxx[len(xxx) - 1]
fin = False
fin: ROOT.TFile | None = None
for ff in ROOT.gROOT.GetListOfFiles():
nm = ff.GetName().split("/")
if nm[len(nm) - 1] == check:
fin = ff
if not fin:
fin = cast(ROOT.TFile, ff)
if fin is None:
fin = ROOT.TFile.Open(outFile)
assert fin is not None # TFile.Open returns nullptr on failure; treat that as fatal
t = fin["cbmsim"]
fout = ROOT.TFile(tmpFile, "recreate")
fSink = ROOT.FairRootFileSink(fout)
Expand Down
Loading