Skip to content
Snippets Groups Projects

FaserParticleGun modified to include radial position sampler

Merged Charlotte Cavanagh requested to merge ccavanag/calypso:ECAL into master
1 file
+ 31
1
Compare changes
  • Side-by-side
  • Inline
@@ -12,6 +12,10 @@ from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaCommon.SystemOfUnits import TeV
from AthenaCommon.PhysicalConstants import pi
### add radial pos sampler ### with gaussian beam implemented
from FaserParticleGun.RadialPosSampler import RadialPosSampler
def FaserParticleGunCommonCfg(ConfigFlags, **kwargs) :
cfg = ComponentAccumulator(AthSequencer("AthBeginSeq", Sequential = True))
@@ -46,6 +50,32 @@ def FaserParticleGunSingleParticleCfg(ConfigFlags, **kwargs) :
return cfg
def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) :
cfg = FaserParticleGunCommonCfg(ConfigFlags, **kwargs)
pg = cfg.getPrimary()
pg.sampler.pid = kwargs.setdefault("pid", 13)
pg.sampler.mom = PG.EThetaMPhiSampler(energy = kwargs.setdefault("energy", 1*TeV),
theta = kwargs.setdefault("theta", 0.0),
phi = kwargs.setdefault("phi", 0.0),
mass = kwargs.setdefault("mass", 105.7) )
if "radius" in kwargs:
pg.sampler.pos = RadialPosSampler(x = kwargs.setdefault("x", 0.0),
y = kwargs.setdefault("y", 0.0),
z = kwargs.setdefault("z", 0.0),
r = kwargs.setdefault("radius", 1.0),
t = kwargs.setdefault("t", 0.0) )
else:
pg.sampler.pos = PG.PosSampler(x = kwargs.setdefault("x", 0.0),
y = kwargs.setdefault("y", 0.0),
z = kwargs.setdefault("z", 0.0),
t = kwargs.setdefault("t", 0.0) )
return cfg
'''
def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) :
cfg = FaserParticleGunCommonCfg(ConfigFlags, **kwargs)
@@ -62,7 +92,7 @@ def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) :
t = kwargs.setdefault("t", 0.0) )
return cfg
'''
def FaserParticleGunCosmicsCfg(ConfigFlags, **kwargs) :
# Supported keyword arguments:
#
Loading