ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
jobOption.PtEtaHistParticleSampler Class Reference
Inheritance diagram for jobOption.PtEtaHistParticleSampler:
Collaboration diagram for jobOption.PtEtaHistParticleSampler:

Public Member Functions

def __init__ (self, pid, histfile, num=100)
 
def shoot (self)
 

Public Attributes

 pid
 
 hist
 
 numparticles
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

def jobOption.PtEtaHistParticleSampler.__init__ (   self,
  pid,
  histfile,
  num = 100 
)

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

16  def __init__(self, pid, histfile, num=100):
17  self.pid = PG.mksampler(pid)
18  self.hist = PG.TH2(histfile, "h_pt_eta")
19  self.numparticles = num
20 

Member Function Documentation

◆ shoot()

def jobOption.PtEtaHistParticleSampler.shoot (   self)

Definition at line 21 of file jobOption.ParticleGun_corrhist.py.

21  def shoot(self):
22  "Return a vector of sampled particles from the provided pT--eta histogram"
23  particles = []
24  for i in xrange(self.numparticles):
25  ptrand, etarand = self.hist.GetRandom()
26  ptrand *= 1000 # NB. This _particular_ histogram is in GeV, but Athena needs MeV!
27  # TODO: Provide 4-mom construction functions to avoid building this one-time sampler
28  pid = self.pid()
29  mom = PG.PtEtaMPhiSampler(pt=ptrand, eta=etarand, mass=PG.MASSES[abs(pid)])
30  p = PG.SampledParticle(pid, mom())
31  #print p.mom.Pt(), "\t", p.mom.Eta(), "\t", p.mom.Phi(), "\t", p.mom.M()
32  particles.append(p)
33  return particles
34 

Member Data Documentation

◆ hist

jobOption.PtEtaHistParticleSampler.hist

Definition at line 18 of file jobOption.ParticleGun_corrhist.py.

◆ numparticles

jobOption.PtEtaHistParticleSampler.numparticles

Definition at line 19 of file jobOption.ParticleGun_corrhist.py.

◆ pid

jobOption.PtEtaHistParticleSampler.pid

Definition at line 17 of file jobOption.ParticleGun_corrhist.py.


The documentation for this class was generated from the following file:
xrange
void xrange(TH1 *h, bool symmetric)
Definition: computils.cxx:515
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18