ATLAS Offline Software
Loading...
Searching...
No Matches
jobOption.MyParticleSampler Class Reference
Inheritance diagram for jobOption.MyParticleSampler:
Collaboration diagram for jobOption.MyParticleSampler:

Public Member Functions

 __init__ (self)
 shoot (self)
 __init__ (self)
 shoot (self)

Public Attributes

 mom1 = PG.PtEtaMPhiSampler(pt=25000, eta=[-2,2])
 ip = PG.mksampler([-2,2])

Detailed Description

A special sampler to generate single particles flat in 1/pT and in
impact parameter to the beam, with flat z0.

Definition at line 10 of file jobOption.ParticleGun_correlated.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

jobOption.MyParticleSampler.__init__ ( self)

Definition at line 13 of file jobOption.ParticleGun_correlated.py.

13 def __init__(self):
14 self.mom1 = PG.PtEtaMPhiSampler(pt=25000, eta=[-2,2])
15

◆ __init__() [2/2]

jobOption.MyParticleSampler.__init__ ( self)

Definition at line 16 of file jobOption.ParticleGun_flatcurvature_flatip.py.

16 def __init__(self):
17 psamp = PG.PtEtaMPhiSampler(pt=PG.InvSampler(4000, 400000), eta=[0.1,0.3], phi=[0.3, 0.5])
18 xsamp = PG.PosSampler(0, 0, [-150,150], 0)
19 PG.ParticleSampler.__init__(self, pid={13,-13}, mom=psamp, pos=xsamp)
20 self.ip = PG.mksampler([-2,2])
21

Member Function Documentation

◆ shoot() [1/2]

jobOption.MyParticleSampler.shoot ( self)

Definition at line 16 of file jobOption.ParticleGun_correlated.py.

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

◆ shoot() [2/2]

jobOption.MyParticleSampler.shoot ( self)

Definition at line 22 of file jobOption.ParticleGun_flatcurvature_flatip.py.

22 def shoot(self):
23 "Return a vector of sampled particles"
24 ps = PG.ParticleSampler.shoot(self)
25 assert len(ps) == 1
26 p = ps[0]
27 from math import sqrt
28 m = -p.mom.X() / p.mom.Y() #< gradient of azimuthal IP sampling line, perp to mom
29 x = self.ip() / sqrt(1 + m**2) #< just decomposing sampled IP into x component...
30 y = m*x #< ... and y-component
31 p.pos.SetX(x)
32 p.pos.SetY(m*x)
33 return [p]
34

Member Data Documentation

◆ ip

jobOption.MyParticleSampler.ip = PG.mksampler([-2,2])

◆ mom1

jobOption.MyParticleSampler.mom1 = PG.PtEtaMPhiSampler(pt=25000, eta=[-2,2])

Definition at line 14 of file jobOption.ParticleGun_correlated.py.


The documentation for this class was generated from the following files: