Skip to content
Snippets Groups Projects

Add scripts to generator events from Foresee and a sampler to read these in to...

Merged Carl Gwilliam requested to merge gwilliam/calypso:signal_generation into master
9 files
+ 994
3
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -140,6 +140,51 @@ def FaserParticleGunDecayInFlightCfg(ConfigFlags, **kwargs) :
return cfg
def FaserParticleGunForeseeCfg(ConfigFlags, **kwargs) :
# Supported keyword arguments:
# model_path (detault: $PWD)
# model_name (default: DarkPhoton)
# mother_mass (default: 0.01 GeV)
# com_energy (default: 14 TeV)
# daughter1_pid (default: 11)
# daughter2_pid (default: -11)
# mother_pid (default: none)
# mother_pos (default: CylinderSampler([0, 100**2],[0, 2*pi],[-1500, 0],0))
#
# Note that ALL of these can be samplers themselves - either the simple, "literal" variety or a sampler object configured by the caller
#
cfg = FaserParticleGunCommonCfg(ConfigFlags, **kwargs)
pg = cfg.getPrimary()
from DIFGenerator.DIFSampler import CylinderSampler
from DIFGenerator import DIFSampler
pg.sampler = DIFSampler(
daughter1_pid = kwargs.get("daughter1_pid", 11),
daughter2_pid = kwargs.get("daughter2_pid", -11),
mother_pid = kwargs.get("mother_pid", None),
mother_pos = kwargs.get("mother_pos", CylinderSampler([0, 100**2],[0, 2*pi],[-1500, 0],0))
)
from ForeseeGenerator.ForeseeSampler import ForeseeNumpySampler
mother_mom = ForeseeNumpySampler(
model_path = kwargs.get("model_path", "."),
model_name = kwargs.get("model_name", "DarkPhoton"),
com_energy = kwargs.get("com_energy", "14"),
mother_mass = kwargs.get("mother_mass", 0.01),
daughter1_pid = kwargs.get("daughter1_pid", 11),
daughter2_pid = kwargs.get("daughter2_pid", -11),
)
pg.sampler.mother_sampler = PG.ParticleSampler(pid=kwargs.get("mother_pid", None),mom=mother_mom,n=1,pos=pg.sampler.mother_sampler.pos)
pg.sampler.mother_sampler.mass_override = False
return cfg
def FaserParticleGunCfg(ConfigFlags) :
generator = ConfigFlags.Sim.Gun.setdefault("Generator", "SingleParticle")
kwargs = ConfigFlags.Sim.Gun
@@ -149,5 +194,7 @@ def FaserParticleGunCfg(ConfigFlags) :
return FaserParticleGunCosmicsCfg(ConfigFlags, **kwargs)
elif generator == "DecayInFlight" :
return FaserParticleGunDecayInFlightCfg(ConfigFlags, **kwargs)
elif generator == "Foresee" :
return FaserParticleGunForeseeCfg(ConfigFlags, **kwargs)
else :
return FaserParticleGunSingleParticleCfg(ConfigFlags, **kwargs )
Loading