Skip to content
Snippets Groups Projects
Commit 9bb78b4e authored by Tobias Bockh's avatar Tobias Bockh
Browse files

use DecayInFlight generator by default

parent 0ae54815
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
import ParticleGun as PG
from math import sqrt, sin, cos, acos
from random import uniform
from AthenaCommon.SystemOfUnits import TeV, MeV
from AthenaCommon.SystemOfUnits import TeV, GeV, MeV
from AthenaCommon.PhysicalConstants import pi
from ROOT import TLorentzVector
......@@ -90,7 +90,10 @@ class DIFSampler(PG.ParticleSampler):
else:
self.mom = None
def __init__(self, daughter1_pid = 11, daughter2_pid = -11, mother_pid = None, mother_mom = PG.EThetaMPhiSampler(sqrt((1*TeV)**2 + (10*MeV)**2),0,10*MeV,0),mother_pos = CylinderSampler([0, 100**2],[0, 2*pi],[-1500, 0],0)):
# def __init__(self, daughter1_pid = 11, daughter2_pid = -11, mother_pid = None, mother_mom = PG.EThetaMPhiSampler(sqrt((1*TeV)**2 + (10*MeV)**2),0,10*MeV,0),mother_pos = CylinderSampler([0, 100**2],[0, 2*pi],[-1500, 0],0)):
def __init__(self, daughter1_pid=13, daughter2_pid=-13, mother_pid=None,
mother_mom=PG.EThetaMPhiSampler([sqrt((10*GeV)**2 + (500*MeV)**2), sqrt((1*TeV)**2 + (500*MeV)**2)], [0, 0.015], 500*MeV, [0, 2*pi]),
mother_pos=CylinderSampler([0, 100**2], [0, 2*pi], [-1500, 0], 0)):
self._mother_sampler = PG.ParticleSampler(pid = mother_pid, mom = mother_mom, pos = mother_pos)
self.daughter1 = self.particle(daughter1_pid)
......
......@@ -141,7 +141,7 @@ def FaserParticleGunDecayInFlightCfg(ConfigFlags, **kwargs) :
return cfg
def FaserParticleGunCfg(ConfigFlags) :
generator = ConfigFlags.Sim.Gun.setdefault("Generator", "SingleParticle")
generator = ConfigFlags.Sim.Gun.setdefault("Generator", "DecayInFlight")
kwargs = ConfigFlags.Sim.Gun
if generator == "SingleEcalParticle" :
return FaserParticleGunSingleEcalParticleCfg(ConfigFlags, **kwargs)
......
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