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

Merge branch 'ECAL' into 'master'

FaserParticleGun modified to include radial position sampler

See merge request faser/calypso!199
parents 14f71e1c ebf168b0
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,10 @@ from AthenaConfiguration.ComponentFactory import CompFactory ...@@ -12,6 +12,10 @@ from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaCommon.SystemOfUnits import TeV from AthenaCommon.SystemOfUnits import TeV
from AthenaCommon.PhysicalConstants import pi from AthenaCommon.PhysicalConstants import pi
### add radial pos sampler ### with gaussian beam implemented
from FaserParticleGun.RadialPosSampler import RadialPosSampler
def FaserParticleGunCommonCfg(ConfigFlags, **kwargs) : def FaserParticleGunCommonCfg(ConfigFlags, **kwargs) :
cfg = ComponentAccumulator(AthSequencer("AthBeginSeq", Sequential = True)) cfg = ComponentAccumulator(AthSequencer("AthBeginSeq", Sequential = True))
...@@ -46,6 +50,32 @@ def FaserParticleGunSingleParticleCfg(ConfigFlags, **kwargs) : ...@@ -46,6 +50,32 @@ def FaserParticleGunSingleParticleCfg(ConfigFlags, **kwargs) :
return cfg 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) : def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) :
cfg = FaserParticleGunCommonCfg(ConfigFlags, **kwargs) cfg = FaserParticleGunCommonCfg(ConfigFlags, **kwargs)
...@@ -62,7 +92,7 @@ def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) : ...@@ -62,7 +92,7 @@ def FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs) :
t = kwargs.setdefault("t", 0.0) ) t = kwargs.setdefault("t", 0.0) )
return cfg return cfg
'''
def FaserParticleGunCosmicsCfg(ConfigFlags, **kwargs) : def FaserParticleGunCosmicsCfg(ConfigFlags, **kwargs) :
# Supported keyword arguments: # Supported keyword arguments:
# #
......
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