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

Functions

def 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 = {}
 
ArgumentParser parser = ArgumentParser()
 
 dest
 
 type
 
 int
 
 help
 
 default
 
 float
 
 action
 
 str
 
ArgumentParser options = parser.parse_args()
 
ROOT X = ROOT.FixedTargetGenerator()
 
dict generators = {"p": ROOT.Pythia8.Pythia(), "n": ROOT.Pythia8.Pythia()}
 
 else :
 
dict rc = generators["p"].next()
 
dict processes = generators["p"].info.codesHard()
 
tuple hname
 
ROOT f = ROOT.TFile("ntuple-" + hname + ".root", "RECREATE")
 
ROOT signal = ROOT.TNtuple("ntuple", "ntuple", "M:P:Pt:y:p1x:p1y:p1z:p2x:p2y:p2z:cosCS")
 
ROOT timer = ROOT.TStopwatch()
 
dict ntagged = {"p": 0, "n": 0}
 
def ybeam = yBeam(pbeam=options.fMom)
 
dict py = generators[g]
 
dict nmu = {}
 
list 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]
 
ROOT rtime = timer.RealTime()
 
ROOT ctime = timer.CpuTime()
 
dict sigma = generators[g].info.sigmaGen(processes[0])
 

Function Documentation

◆ debugging()

None runPythia8.debugging (   g)

Definition at line 287 of file runPythia8.py.

287def debugging(g) -> None:
288 generators[g].settings.listAll()

◆ muflux()

None runPythia8.muflux ( )

Definition at line 258 of file runPythia8.py.

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

◆ 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 print("generator sigma mumu-ratio in-mass-range in-y-range")
210 print(
211 "%s %s %6.2F nbarn, %5.2F, %5.2G, %5.2F "
212 % (
213 g,
214 name,
215 sigma * 1e6,
216 float(h["MA"].GetEntries()) / options.NPoT,
217 h["MA"].Integral(Mmin, Mmax) / float(h["MA"].GetEntries()),
218 h["M"].GetEntries() / float(h["MA"].GetEntries()),
219 )
220 )
221 fraction = h["M"].Integral(Mmin, Mmax) / options.NPoT
222 # multiply with 0.5 assuming no polarization -0.5 < cosCS < 0.5
223 print(f"cross section a la NA50 for : {g} {0.5 * fraction * sigma * 1e9:5.2F} pb")
224 # via cosCS
225 for g in generators:
226 if online:
227 processes = generators[g].info.codesHard()
228 name = generators[g].info.nameProc(processes[0])
229 sigma = generators[g].info.sigmaGen(processes[0])
230 else:
231 name = ""
232 sigma = h["xsec_" + g].GetBinContent(1)
233 yax = h["cosCSJpsi_" + g].GetYaxis()
234 xax = h["cosCSJpsi_" + g].GetXaxis()
235 Mmin = xax.FindBin(-0.5)
236 Mmax = xax.FindBin(0.5)
237 Ymin = yax.FindBin(-0.425)
238 Ymax = yax.FindBin(0.575)
239 h["MA"] = h["cosCSJpsi_" + g].ProjectionX("MA")
240 h["M"] = h["cosCSJpsi_" + g].ProjectionX("M", Ymin, Ymax)
241 print("generator sigma mumu-in-mass-range% cosCS in-y-range")
242 print(
243 "%s %s %6.2F nbarn, %5.2F, %5.2F, %5.2F "
244 % (
245 g,
246 name,
247 sigma * 1e6,
248 float(h["MA"].GetEntries()) / options.NPoT * 100.0,
249 h["MA"].Integral(Mmin, Mmax) / float(h["MA"].GetEntries()),
250 h["M"].GetEntries() / float(h["MA"].GetEntries()),
251 )
252 )
253 fraction = h["M"].Integral(Mmin, Mmax) / options.NPoT
254 # taking polarization into account.
255 print("cross section a la NA50, -0.5<cosCS<0.5: %5.2F pb" % (fraction * sigma * 1e9))
256
257

◆ yBeam()

def 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

ROOT 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.

◆ else

runPythia8.else :

Definition at line 87 of file runPythia8.py.

◆ f

ROOT 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

list 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

ArgumentParser 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

ArgumentParser 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

ROOT 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

ROOT 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

ROOT runPythia8.timer = ROOT.TStopwatch()

Definition at line 108 of file runPythia8.py.

◆ type

runPythia8.type

Definition at line 23 of file runPythia8.py.

◆ X

ROOT runPythia8.X = ROOT.FixedTargetGenerator()

Definition at line 39 of file runPythia8.py.

◆ ybeam

def 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.