◆ __init__()
| 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
◆ shoot()
| 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
27
28 pid = self.pid()
29 mom = PG.PtEtaMPhiSampler(pt=ptrand, eta=etarand, mass=PG.MASSES[abs(pid)])
30 p = PG.SampledParticle(pid, mom())
31
32 particles.append(p)
33 return particles
34
void xrange(TH1 *h, bool symmetric)
◆ hist
| jobOption.PtEtaHistParticleSampler.hist = PG.TH2(histfile, "h_pt_eta") |
◆ numparticles
| jobOption.PtEtaHistParticleSampler.numparticles = num |
◆ pid
| jobOption.PtEtaHistParticleSampler.pid = PG.mksampler(pid) |
The documentation for this class was generated from the following file: