FairShip
Loading...
Searching...
No Matches
runPythia8 Namespace Reference

Functions

 yBeam (float Mproton=0.938272081, float pbeam=400.0)
None na50 (bool online=True)
None muflux ()
None debugging (g)

Variables

int theSeed = 0
dict h = {}
 parser = ArgumentParser()
 dest
 type
 int
 help
 default
 float
 action
 str
 options = parser.parse_args()
 X = ROOT.FixedTargetGenerator()
dict generators = {"p": ROOT.Pythia8.Pythia(), "n": ROOT.Pythia8.Pythia()}
dict rc = generators["p"].next()
dict processes = generators["p"].info.codesHard()
tuple hname
 f = ROOT.TFile("ntuple-" + hname + ".root", "RECREATE")
 signal = ROOT.TNtuple("ntuple", "ntuple", "M:P:Pt:y:p1x:p1y:p1z:p2x:p2y:p2z:cosCS")
 timer = ROOT.TStopwatch()
dict ntagged = {"p": 0, "n": 0}
 ybeam = yBeam(pbeam=options.fMom)
dict py = generators[g]
dict nmu = {}
 ks = list(nmu)
dict Zstar = py.event[nmu[ks[0]]]
dict ii = nmu[ks[0]]
dict d0 = py.event.daughterList(ii)[0]
dict d1 = py.event.daughterList(ii)[1]
dict nlep = py.event[d0]
dict nantilep = py.event[d1]
dict P1pl = nlep.e() + nlep.pz()
dict P2pl = nantilep.e() + nantilep.pz()
dict P1mi = nlep.e() - nlep.pz()
dict P2mi = nantilep.e() - nantilep.pz()
dict A = P1pl * P2mi - P2pl * P1mi
tuple cosCS
dict M = {}
int k = 0
dict G = M[0] + M[1]
 rtime = timer.RealTime()
 ctime = timer.CpuTime()
dict sigma = generators[g].info.sigmaGen(processes[0])

Function Documentation

◆ debugging()

None runPythia8.debugging ( g)

Definition at line 298 of file runPythia8.py.

298def debugging(g) -> None:
299 generators[g].settings.listAll()

◆ muflux()

None runPythia8.muflux ( )

Definition at line 264 of file runPythia8.py.

264def muflux() -> None:
265 Z_Mo = 96.0
266 P_Mo = 42
267 fraction = {}
268 sigma = 0.0
269 for g in generators:
270 processes = generators[g].info.codesHard()
271 name = generators[g].info.nameProc(processes[0])
272 sigma = generators[g].info.sigmaGen(processes[0])
273 yax = h["M_" + g].GetYaxis()
274 xax = h["M_" + g].GetXaxis()
275 Mmin = xax.FindBin(0.0)
276 Mmax = xax.FindBin(5.0)
277 Ymin = yax.FindBin(0.3)
278 Ymax = yax.FindBin(3.0)
279 h["MA"] = h["M_" + g].ProjectionX("MA")
280 h["M"] = h["M_" + g].ProjectionX("M", Ymin, Ymax)
281 if h["MA"].GetEntries() == 0:
282 print(f"muflux: empty histogram for generator {g}, skipping")
283 fraction[g] = 0.0
284 continue
285 print(
286 g,
287 name,
288 sigma,
289 float(h["MA"].GetEntries()) / options.NPoT,
290 h["MA"].Integral(Mmin, Mmax) / float(h["MA"].GetEntries()),
291 h["M"].GetEntries() / float(h["MA"].GetEntries()),
292 )
293 fraction[g] = h["M"].Integral(Mmin, Mmax) / options.NPoT
294 meanFraction = (fraction["p"] * P_Mo + fraction["n"] * (Z_Mo - P_Mo)) / Z_Mo * sigma
295 print("cross section a la muflux: %5.2F pb" % (0.5 * meanFraction * 1e9))
296
297

◆ na50()

None runPythia8.na50 ( bool online = True)

Definition at line 192 of file runPythia8.py.

192def na50(online: bool = True) -> None:
193 for g in generators:
194 if online:
195 processes = generators[g].info.codesHard()
196 name = generators[g].info.nameProc(processes[0])
197 sigma = generators[g].info.sigmaGen(processes[0])
198 else:
199 name = ""
200 sigma = h["xsec_" + g].GetBinContent(1)
201 yax = h["M_" + g].GetYaxis()
202 xax = h["M_" + g].GetXaxis()
203 Mmin = xax.FindBin(2.9)
204 Mmax = xax.FindBin(4.5)
205 Ymin = yax.FindBin(-0.425)
206 Ymax = yax.FindBin(0.575)
207 h["MA"] = h["M_" + g].ProjectionX("MA")
208 h["M"] = h["M_" + g].ProjectionX("M", Ymin, Ymax)
209 if h["MA"].GetEntries() == 0:
210 print(f"na50: empty histogram for generator {g}, skipping")
211 continue
212 print("generator sigma mumu-ratio in-mass-range in-y-range")
213 print(
214 "%s %s %6.2F nbarn, %5.2F, %5.2G, %5.2F "
215 % (
216 g,
217 name,
218 sigma * 1e6,
219 float(h["MA"].GetEntries()) / options.NPoT,
220 h["MA"].Integral(Mmin, Mmax) / float(h["MA"].GetEntries()),
221 h["M"].GetEntries() / float(h["MA"].GetEntries()),
222 )
223 )
224 fraction = h["M"].Integral(Mmin, Mmax) / options.NPoT
225 # multiply with 0.5 assuming no polarization -0.5 < cosCS < 0.5
226 print(f"cross section a la NA50 for : {g} {0.5 * fraction * sigma * 1e9:5.2F} pb")
227 # via cosCS
228 for g in generators:
229 if online:
230 processes = generators[g].info.codesHard()
231 name = generators[g].info.nameProc(processes[0])
232 sigma = generators[g].info.sigmaGen(processes[0])
233 else:
234 name = ""
235 sigma = h["xsec_" + g].GetBinContent(1)
236 yax = h["cosCSJpsi_" + g].GetYaxis()
237 xax = h["cosCSJpsi_" + g].GetXaxis()
238 Mmin = xax.FindBin(-0.5)
239 Mmax = xax.FindBin(0.5)
240 Ymin = yax.FindBin(-0.425)
241 Ymax = yax.FindBin(0.575)
242 h["MA"] = h["cosCSJpsi_" + g].ProjectionX("MA")
243 h["M"] = h["cosCSJpsi_" + g].ProjectionX("M", Ymin, Ymax)
244 if h["MA"].GetEntries() == 0:
245 print(f"na50: empty histogram for generator {g}, skipping")
246 continue
247 print("generator sigma mumu-in-mass-range% cosCS in-y-range")
248 print(
249 "%s %s %6.2F nbarn, %5.2F, %5.2F, %5.2F "
250 % (
251 g,
252 name,
253 sigma * 1e6,
254 float(h["MA"].GetEntries()) / options.NPoT * 100.0,
255 h["MA"].Integral(Mmin, Mmax) / float(h["MA"].GetEntries()),
256 h["M"].GetEntries() / float(h["MA"].GetEntries()),
257 )
258 )
259 fraction = h["M"].Integral(Mmin, Mmax) / options.NPoT
260 # taking polarization into account.
261 print("cross section a la NA50, -0.5<cosCS<0.5: %5.2F pb" % (fraction * sigma * 1e9))
262
263

◆ yBeam()

runPythia8.yBeam ( float Mproton = 0.938272081,
float pbeam = 400.0 )

Definition at line 43 of file runPythia8.py.

43def yBeam(Mproton: float = 0.938272081, pbeam: float = 400.0):
44 Ebeam = ROOT.TMath.Sqrt(pbeam**2 + Mproton**2)
45 betaCM = pbeam / (Ebeam + Mproton)
46 y_beam = 0.5 * ROOT.TMath.Log((1 + betaCM) / (1 - betaCM)) # https://arxiv.org/pdf/1604.02651.pdf
47 return y_beam
48
49

Variable Documentation

◆ A

dict runPythia8.A = P1pl * P2mi - P2pl * P1mi

Definition at line 146 of file runPythia8.py.

◆ action

runPythia8.action

Definition at line 28 of file runPythia8.py.

◆ cosCS

tuple runPythia8.cosCS
Initial value:
1= (
2 Zstar.pz() / abs(Zstar.pz()) * 1.0 / Zstar.m() / ROOT.TMath.Sqrt(Zstar.m2() + Zstar.pT() ** 2) * A
3 )

Definition at line 147 of file runPythia8.py.

◆ ctime

runPythia8.ctime = timer.CpuTime()

Definition at line 183 of file runPythia8.py.

◆ d0

dict runPythia8.d0 = py.event.daughterList(ii)[0]

Definition at line 134 of file runPythia8.py.

◆ d1

dict runPythia8.d1 = py.event.daughterList(ii)[1]

Definition at line 135 of file runPythia8.py.

◆ default

runPythia8.default

Definition at line 23 of file runPythia8.py.

◆ dest

runPythia8.dest

Definition at line 23 of file runPythia8.py.

◆ f

runPythia8.f = ROOT.TFile("ntuple-" + hname + ".root", "RECREATE")

Definition at line 105 of file runPythia8.py.

◆ float

runPythia8.float

Definition at line 26 of file runPythia8.py.

◆ G

dict runPythia8.G = M[0] + M[1]

Definition at line 172 of file runPythia8.py.

◆ generators

dict runPythia8.generators = {"p": ROOT.Pythia8.Pythia(), "n": ROOT.Pythia8.Pythia()}

Definition at line 50 of file runPythia8.py.

◆ h

dict runPythia8.h = {}

Definition at line 11 of file runPythia8.py.

◆ help

runPythia8.help

Definition at line 23 of file runPythia8.py.

◆ hname

tuple runPythia8.hname
Initial value:
1= (
2 "pythia8_PDFpset"
3 + options.PDFpSet
4 + "_Emin"
5 + str(options.Emin)
6 + "_"
7 + generators["p"].info.nameProc(processes[0])
8)

Definition at line 93 of file runPythia8.py.

◆ ii

dict runPythia8.ii = nmu[ks[0]]

Definition at line 133 of file runPythia8.py.

◆ int

runPythia8.int

Definition at line 23 of file runPythia8.py.

◆ k

int runPythia8.k = 0

Definition at line 168 of file runPythia8.py.

◆ ks

runPythia8.ks = list(nmu)

Definition at line 128 of file runPythia8.py.

◆ M

dict runPythia8.M = {}

Definition at line 167 of file runPythia8.py.

◆ nantilep

dict runPythia8.nantilep = py.event[d1]

Definition at line 138 of file runPythia8.py.

◆ nlep

dict runPythia8.nlep = py.event[d0]

Definition at line 137 of file runPythia8.py.

◆ nmu

dict runPythia8.nmu = {}

Definition at line 117 of file runPythia8.py.

◆ ntagged

dict runPythia8.ntagged = {"p": 0, "n": 0}

Definition at line 111 of file runPythia8.py.

◆ options

runPythia8.options = parser.parse_args()

Definition at line 37 of file runPythia8.py.

◆ P1mi

dict runPythia8.P1mi = nlep.e() - nlep.pz()

Definition at line 144 of file runPythia8.py.

◆ P1pl

dict runPythia8.P1pl = nlep.e() + nlep.pz()

Definition at line 142 of file runPythia8.py.

◆ P2mi

dict runPythia8.P2mi = nantilep.e() - nantilep.pz()

Definition at line 145 of file runPythia8.py.

◆ P2pl

dict runPythia8.P2pl = nantilep.e() + nantilep.pz()

Definition at line 143 of file runPythia8.py.

◆ parser

runPythia8.parser = ArgumentParser()

Definition at line 22 of file runPythia8.py.

◆ processes

dict runPythia8.processes = generators["p"].info.codesHard()

Definition at line 92 of file runPythia8.py.

◆ py

dict runPythia8.py = generators[g]

Definition at line 115 of file runPythia8.py.

◆ rc

dict runPythia8.rc = generators["p"].next()

Definition at line 91 of file runPythia8.py.

◆ rtime

runPythia8.rtime = timer.RealTime()

Definition at line 182 of file runPythia8.py.

◆ sigma

dict runPythia8.sigma = generators[g].info.sigmaGen(processes[0])

Definition at line 187 of file runPythia8.py.

◆ signal

runPythia8.signal = ROOT.TNtuple("ntuple", "ntuple", "M:P:Pt:y:p1x:p1y:p1z:p2x:p2y:p2z:cosCS")

Definition at line 106 of file runPythia8.py.

◆ str

runPythia8.str

Definition at line 32 of file runPythia8.py.

◆ theSeed

int runPythia8.theSeed = 0

Definition at line 10 of file runPythia8.py.

◆ timer

runPythia8.timer = ROOT.TStopwatch()

Definition at line 108 of file runPythia8.py.

◆ type

runPythia8.type

Definition at line 23 of file runPythia8.py.

◆ X

runPythia8.X = ROOT.FixedTargetGenerator()

Definition at line 39 of file runPythia8.py.

◆ ybeam

runPythia8.ybeam = yBeam(pbeam=options.fMom)

Definition at line 112 of file runPythia8.py.

◆ Zstar

dict runPythia8.Zstar = py.event[nmu[ks[0]]]

Definition at line 130 of file runPythia8.py.