ATLAS Offline Software
jobOption.ParticleGun_correlated.py
Go to the documentation of this file.
1 #! -*- python -*-
2 
3 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4 
5 include("EvgenProdTools/StdEvgenSetup.py")
6 theApp.EvtMax = 100
7 
8 import ParticleGun as PG
9 
10 class MyParticleSampler(PG.ParticleSampler):
11  "A special sampler with two _correlated_ particles."
12 
13  def __init__(self):
14  self.mom1 = PG.PtEtaMPhiSampler(pt=25000, eta=[-2,2])
15 
16  def shoot(self):
17  "Return a vector of sampled particles"
18  p1 = PG.SampledParticle(11, self.mom1.shoot())
19  eta1 = p1.mom.Eta()
20  phi1 = p1.mom.Phi()
21  # TODO: will phi be properly wrapped into range?
22  mom2 = PG.PtEtaMPhiSampler(pt=25000,
23  eta=[eta1-0.5, eta1+0.5],
24  phi=[phi1-0.5, phi1+0.5])
25  p2 = PG.SampledParticle(11, mom2.shoot())
26  return [p1, p2]
27 
28 topSeq += PG.ParticleGun()
29 topSeq.ParticleGun.randomSeed = 123456
30 topSeq.ParticleGun.sampler = MyParticleSampler()
31 
32 include("EvgenProdTools/postJO.CopyWeights.py")
33 include("EvgenProdTools/postJO.PoolOutput.py")
34 include("EvgenProdTools/postJO.DumpMC.py")
jobOption.MyParticleSampler.__init__
def __init__(self)
Definition: jobOption.ParticleGun_correlated.py:13
jobOption.MyParticleSampler.shoot
def shoot(self)
Definition: jobOption.ParticleGun_correlated.py:16
jobOption.MyParticleSampler.mom1
mom1
Definition: jobOption.ParticleGun_correlated.py:14
jobOption.MyParticleSampler
Definition: jobOption.ParticleGun_correlated.py:10
python.Include.include
include
Definition: Include.py:319