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

Functions

None PoorE791_tune (P6)
 
None LHCb_tune (P6)
 
None fillp1 (hist)
 

Variables

ROOT timer = ROOT.TStopwatch()
 
argparse ap = argparse.ArgumentParser(description="Run SHiP makeCascade: generate ccbar or bbar")
 
 type
 
 default
 
 help
 
 int
 
 float
 
 choices
 
 action
 
argparse args = ap.parse_args()
 
 Fntuple
 
list idbeam = [2212, 211, 2112, 321, 130, 310]
 
list target = ["p+", "n0"]
 
float fracp = 0.40
 
 else :
 
float pbeaml = 34.0
 
list idsig = [411, 421, 431, 4122, 4132, 4232, 4332, 4412, 4414, 4422, 4424, 4432, 4434, 4444]
 
ROOT PDG = ROOT.TDatabasePDG.Instance()
 
ROOT myPythia = ROOT.TPythia6()
 
ROOT tp = ROOT.tPythia6Generator()
 
dict h = {}
 
int id = 0
 
int nb = 400
 
time t0 = time.time()
 
len idhist = len(idbeam) * 4 * [0]
 
list idw = idbeam[idp] * idpm
 
ROOT name = PDG.GetParticle(idw).GetName()
 
int idb = id * 10 + idnp * 4
 
idpn idadd = idpn * 4
 
ipbeam pbw = ipbeam * (args.pbeamh - pbeaml) / (args.nrpoints - 1) + pbeaml
 
dict ibin = h[str(id * 10 + 1 + idadd)].FindBin(pbw, 0.0, 0.0)
 
float chimx = 0.0
 
dict ibh = h[str(idw)].FindBin(args.pbeamh)
 
ROOT ftup = ROOT.TFile.Open(args.Fntuple, "RECREATE")
 
ROOT Ntup
 
ROOT kc = myPythia.Pycomp(kf)
 
int stack = 1000 * [0]
 
int nstack = 0
 
ROOT ptot = ROOT.TMath.Sqrt(stack[nstack][1] ** 2 + stack[nstack][2] ** 2 + stack[nstack][3] ** 2)
 
float prbsig = 0.0
 
int idpn = 0
 
dict ib = h[str(idw)].FindBin(ptot, 0.0, 0.0)
 
list charmFound = []
 
ROOT idabs = ROOT.TMath.Abs(myPythia.GetK(itrk, 2))
 
array vl = array("f")
 
int nsub = stack[nstack][4] - 1
 
ROOT pt2 = myPythia.GetP(itrk, 1) ** 2 + myPythia.GetP(itrk, 2) ** 2
 
argparse beta = args.pbeamh / (myPythia.GetP(1, 4) + myPythia.GetP(2, 5))
 
tuple gamma = (1 - beta**2) ** (-0.5)
 
tuple pbcm = -gamma * beta * myPythia.GetP(1, 4) + gamma * myPythia.GetP(1, 3)
 
tuple pDcm = -gamma * beta * myPythia.GetP(itrk, 4) + gamma * myPythia.GetP(itrk, 3)
 
tuple xf = pDcm / pbcm
 
int icas = stack[nstack][4] + 1
 
copy anclist = copy.copy(stack[nstack][5])
 
copy sublist = copy.copy(stack[nstack][6])
 
copy tmp = copy.copy(anclist)
 
copy stmp = copy.copy(sublist)
 
ROOT rtime = timer.RealTime()
 
ROOT ctime = timer.CpuTime()
 

Function Documentation

◆ fillp1()

None makeCascade.fillp1 (   hist)

Definition at line 199 of file makeCascade.py.

199def fillp1(hist) -> None:
200 # scan filled bins in hist, and fill intermediate bins with linear interpolation
201 nb = hist.GetNbinsX()
202 i1 = hist.FindBin(pbeaml, 0.0, 0.0)
203 y1 = hist.GetBinContent(i1)
204 p1 = hist.GetBinCenter(i1)
205 for i in range(i1 + 1, nb + 1):
206 if hist.GetBinContent(i) > 0.0:
207 y2 = hist.GetBinContent(i)
208 p2 = hist.GetBinCenter(i)
209 tg = (y2 - y1) / (p2 - p1)
210 for ib in range(i1 + 1, i):
211 px = hist.GetBinCenter(ib)
212 yx = (px - p1) * tg + y1
213 hist.Fill(px, yx)
214 i1 = i
215 y1 = y2
216 p1 = p2
217
218

◆ LHCb_tune()

None makeCascade.LHCb_tune (   P6)

Definition at line 163 of file makeCascade.py.

163def LHCb_tune(P6) -> None:
164 # settings by LHCb for Pythia 6.427
165 # https://twiki.cern.ch/twiki/bin/view/LHCb/SettingsSim08
166 print(" ")
167 print("********** LHCb_tune **********")
168 # P6.SetCKIN(41,3.0)
169 P6.SetMSTP(2, 2)
170 P6.SetMSTP(33, 3)
171 # P6.SetMSTP(128, 2) # store or not store
172 P6.SetMSTP(81, 21)
173 P6.SetMSTP(82, 3)
174 P6.SetMSTP(52, 2)
175 P6.SetMSTP(51, 10042) # (ie CTEQ6 LO fit, with LOrder alpha_S PDF from LHAPDF)
176 P6.SetMSTP(142, 0) # do not weigh events
177 P6.SetPARP(67, 1.0)
178 P6.SetPARP(82, 4.28)
179 P6.SetPARP(89, 14000)
180 P6.SetPARP(90, 0.238)
181 P6.SetPARP(85, 0.33)
182 P6.SetPARP(86, 0.66)
183 P6.SetPARP(91, 1.0)
184 P6.SetPARP(149, 0.02)
185 P6.SetPARP(150, 0.085)
186 P6.SetPARJ(11, 0.4)
187 P6.SetPARJ(12, 0.4)
188 P6.SetPARJ(13, 0.769)
189 P6.SetPARJ(14, 0.09)
190 P6.SetPARJ(15, 0.018)
191 P6.SetPARJ(16, 0.0815)
192 P6.SetPARJ(17, 0.0815)
193 P6.SetMSTJ(26, 0)
194 P6.SetPARJ(33, 0.4)
195 print("********** LHCb_tune **********")
196 print(" ")
197
198

◆ PoorE791_tune()

None makeCascade.PoorE791_tune (   P6)

Definition at line 139 of file makeCascade.py.

139def PoorE791_tune(P6) -> None:
140 # settings with default Pythia6 pdf, based on getting <pt> at 500 GeV pi-
141 # same as that of E791: http://arxiv.org/pdf/hep-ex/9906034.pdf
142 print(" ")
143 print("********** PoorE791_tune **********")
144 # change pt of D's to mimic E791 data.
145 P6.SetPARP(91, 1.6)
146 print(f"PARP(91)={P6.GetPARP(91)}")
147 # what PDFs etc.. are being used:
148 print("MSTP PDF info, i.e. (51) and (52)=", P6.GetMSTP(51), P6.GetMSTP(52))
149 # set multiple interactions equal to Fortran version, i.e.=1, default=4, and adapt parp(89) accordingly
150 P6.SetMSTP(82, 1)
151 P6.SetPARP(89, 1000.0)
152 print(
153 "And corresponding multiple parton stuff, i.e. MSTP(82),PARP(81,89,90)=",
154 P6.GetMSTP(82),
155 P6.GetPARP(81),
156 P6.GetPARP(89),
157 P6.GetPARP(90),
158 )
159 print("********** PoorE791_tune **********")
160 print(" ")
161
162

Variable Documentation

◆ action

makeCascade.action

Definition at line 42 of file makeCascade.py.

◆ anclist

copy makeCascade.anclist = copy.copy(stack[nstack][5])

Definition at line 435 of file makeCascade.py.

◆ ap

argparse makeCascade.ap = argparse.ArgumentParser(description="Run SHiP makeCascade: generate ccbar or bbar")

Definition at line 20 of file makeCascade.py.

◆ args

argparse makeCascade.args = ap.parse_args()

Definition at line 62 of file makeCascade.py.

◆ beta

argparse makeCascade.beta = args.pbeamh / (myPythia.GetP(1, 4) + myPythia.GetP(2, 5))

Definition at line 390 of file makeCascade.py.

◆ charmFound

list makeCascade.charmFound = []

Definition at line 357 of file makeCascade.py.

◆ chimx

float makeCascade.chimx = 0.0

Definition at line 283 of file makeCascade.py.

◆ choices

makeCascade.choices

Definition at line 37 of file makeCascade.py.

◆ ctime

ROOT makeCascade.ctime = timer.CpuTime()

Definition at line 476 of file makeCascade.py.

◆ default

makeCascade.default

Definition at line 25 of file makeCascade.py.

◆ else

makeCascade.else :

Definition at line 78 of file makeCascade.py.

◆ float

makeCascade.float

Definition at line 35 of file makeCascade.py.

◆ Fntuple

makeCascade.Fntuple

Definition at line 64 of file makeCascade.py.

◆ fracp

float makeCascade.fracp = 0.40

Definition at line 77 of file makeCascade.py.

◆ ftup

ROOT makeCascade.ftup = ROOT.TFile.Open(args.Fntuple, "RECREATE")

Definition at line 309 of file makeCascade.py.

◆ gamma

tuple makeCascade.gamma = (1 - beta**2) ** (-0.5)

Definition at line 391 of file makeCascade.py.

◆ h

dict makeCascade.h = {}

Definition at line 232 of file makeCascade.py.

◆ help

makeCascade.help

Definition at line 26 of file makeCascade.py.

◆ ib

dict makeCascade.ib = h[str(idw)].FindBin(ptot, 0.0, 0.0)

Definition at line 345 of file makeCascade.py.

◆ ibh

dict makeCascade.ibh = h[str(idw)].FindBin(args.pbeamh)

Definition at line 287 of file makeCascade.py.

◆ ibin

dict makeCascade.ibin = h[str(id * 10 + 1 + idadd)].FindBin(pbw, 0.0, 0.0)

Definition at line 261 of file makeCascade.py.

◆ icas

int makeCascade.icas = stack[nstack][4] + 1

Definition at line 432 of file makeCascade.py.

◆ id

int makeCascade.id = 0

Definition at line 236 of file makeCascade.py.

◆ idabs

ROOT makeCascade.idabs = ROOT.TMath.Abs(myPythia.GetK(itrk, 2))

Definition at line 359 of file makeCascade.py.

◆ idadd

idpn makeCascade.idadd = idpn * 4

Definition at line 256 of file makeCascade.py.

◆ idb

int makeCascade.idb = id * 10 + idnp * 4

Definition at line 248 of file makeCascade.py.

◆ idbeam

list makeCascade.idbeam = [2212, 211, 2112, 321, 130, 310]

Definition at line 70 of file makeCascade.py.

◆ idhist

len makeCascade.idhist = len(idbeam) * 4 * [0]

Definition at line 239 of file makeCascade.py.

◆ idpn

int makeCascade.idpn = 0

Definition at line 341 of file makeCascade.py.

◆ idsig

list makeCascade.idsig = [411, 421, 431, 4122, 4132, 4232, 4332, 4412, 4414, 4422, 4424, 4432, 4434, 4444]

Definition at line 87 of file makeCascade.py.

◆ idw

i makeCascade.idw = idbeam[idp] * idpm

Definition at line 243 of file makeCascade.py.

◆ int

makeCascade.int

Definition at line 34 of file makeCascade.py.

◆ kc

ROOT makeCascade.kc = myPythia.Pycomp(kf)

Definition at line 319 of file makeCascade.py.

◆ myPythia

ROOT makeCascade.myPythia = ROOT.TPythia6()

Definition at line 125 of file makeCascade.py.

◆ name

ROOT makeCascade.name = PDG.GetParticle(idw).GetName()

Definition at line 245 of file makeCascade.py.

◆ nb

int makeCascade.nb = 400

Definition at line 237 of file makeCascade.py.

◆ nstack

int makeCascade.nstack = 0

Definition at line 330 of file makeCascade.py.

◆ nsub

int makeCascade.nsub = stack[nstack][4] - 1

Definition at line 371 of file makeCascade.py.

◆ Ntup

ROOT makeCascade.Ntup
Initial value:
1= ROOT.TNtuple(
2 "pythia6",
3 "pythia6 heavy flavour",
4 "id:px:py:pz:E:M:mid:mpx:mpy:mpz:mE:mM:k:a0:a1:a2:a3:a4:a5:a6:a7:a8:a9:a10:a11:a12:a13:a14:a15:\
5s0:s1:s2:s3:s4:s5:s6:s7:s8:s9:s10:s11:s12:s13:s14:s15",
6)

Definition at line 310 of file makeCascade.py.

◆ pbcm

tuple makeCascade.pbcm = -gamma * beta * myPythia.GetP(1, 4) + gamma * myPythia.GetP(1, 3)

Definition at line 392 of file makeCascade.py.

◆ pbeaml

float makeCascade.pbeaml = 34.0

Definition at line 86 of file makeCascade.py.

◆ pbw

dict makeCascade.pbw = ipbeam * (args.pbeamh - pbeaml) / (args.nrpoints - 1) + pbeaml

Definition at line 259 of file makeCascade.py.

◆ pDcm

tuple makeCascade.pDcm = -gamma * beta * myPythia.GetP(itrk, 4) + gamma * myPythia.GetP(itrk, 3)

Definition at line 393 of file makeCascade.py.

◆ PDG

ROOT makeCascade.PDG = ROOT.TDatabasePDG.Instance()

Definition at line 124 of file makeCascade.py.

◆ prbsig

dict makeCascade.prbsig = 0.0

Definition at line 338 of file makeCascade.py.

◆ pt2

ROOT makeCascade.pt2 = myPythia.GetP(itrk, 1) ** 2 + myPythia.GetP(itrk, 2) ** 2

Definition at line 385 of file makeCascade.py.

◆ ptot

ROOT makeCascade.ptot = ROOT.TMath.Sqrt(stack[nstack][1] ** 2 + stack[nstack][2] ** 2 + stack[nstack][3] ** 2)

Definition at line 337 of file makeCascade.py.

◆ rtime

ROOT makeCascade.rtime = timer.RealTime()

Definition at line 475 of file makeCascade.py.

◆ stack

int makeCascade.stack = 1000 * [0]

Definition at line 326 of file makeCascade.py.

◆ stmp

copy makeCascade.stmp = copy.copy(sublist)

Definition at line 455 of file makeCascade.py.

◆ sublist

copy makeCascade.sublist = copy.copy(stack[nstack][6])

Definition at line 436 of file makeCascade.py.

◆ t0

time makeCascade.t0 = time.time()

Definition at line 238 of file makeCascade.py.

◆ target

list makeCascade.target = ["p+", "n0"]

Definition at line 71 of file makeCascade.py.

◆ timer

ROOT makeCascade.timer = ROOT.TStopwatch()

Definition at line 17 of file makeCascade.py.

◆ tmp

copy makeCascade.tmp = copy.copy(anclist)

Definition at line 453 of file makeCascade.py.

◆ tp

ROOT makeCascade.tp = ROOT.tPythia6Generator()

Definition at line 126 of file makeCascade.py.

◆ type

makeCascade.type

Definition at line 24 of file makeCascade.py.

◆ vl

array makeCascade.vl = array("f")

Definition at line 361 of file makeCascade.py.

◆ xf

tuple makeCascade.xf = pDcm / pbcm

Definition at line 394 of file makeCascade.py.