SND@LHC Software
Loading...
Searching...
No Matches
makeCascade Namespace Reference

Functions

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

Variables

 timer = ROOT.TStopwatch()
 
str R = ''
 
int mselcb = 4
 
int pbeamh = 400.
 
bool storePrimaries = False
 
int nevgen = 100000
 
str Fntuple = 'Cascade100k-parp16-MSTP82-1-MSEL'+str(mselcb)+'-ntuple.root'
 
 opts
 
 args
 
int nev = 5000
 
int nrpoints = 20
 
list idbeam = [2212,211,2112,321,130,310]
 
list target = ['p+','n0']
 
float fracp = 0.43
 
int pbeaml = 34.
 
list idsig = [411, 421, 431,4122,4132,4232,4332,4412,4414,4422,4424,4432,4434,4444]
 
 PDG = ROOT.TDatabasePDG.Instance()
 
 myPythia = ROOT.TPythia6()
 
 tp = ROOT.tPythia6Generator()
 
dict h = {}
 
int id = 0
 
int nb = 400
 
 t0 = time.time()
 
int idhist = len(idbeam)*4*[0]
 
list idw = idbeam[idp]*idpm
 
 name = PDG.GetParticle(idw).GetName()
 
int idb = id*10+idnp*4
 
int idadd = idpn*4
 
int pbw = ipbeam*(pbeamh-pbeaml)/(nrpoints-1)+pbeaml
 
dict ibin = h[str(id*10+1+idadd)].FindBin(pbw,0.,0.)
 
int chimx = 0.
 
dict ibh = h[str(idw)].FindBin(pbeamh)
 
 ftup = ROOT.TFile.Open(Fntuple, 'RECREATE')
 
 Ntup
 
 kc = myPythia.Pycomp(kf)
 
int stack = 1000*[0]
 
int nstack = 0
 
 ptot = ROOT.TMath.Sqrt(stack[nstack][1]**2+stack[nstack][2]**2+stack[nstack][3]**2)
 
int prbsig = 0.
 
int idpn = 0
 
dict ib = h[str(idw)].FindBin(ptot,0.,0.)
 
list charmFound = []
 
 idabs = ROOT.TMath.Abs(myPythia.GetK(itrk,2))
 
 vl = array('f')
 
int nsub = stack[nstack][4]-1
 
int pt2 = myPythia.GetP(itrk,1)**2+myPythia.GetP(itrk,2)**2
 
int beta = 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
 
 anclist = copy.copy(stack[nstack][5])
 
 sublist = copy.copy(stack[nstack][6])
 
 tmp = copy.copy(anclist)
 
 stmp = copy.copy(sublist)
 
 rtime = timer.RealTime()
 
 ctime = timer.CpuTime()
 

Function Documentation

◆ fillp1()

makeCascade.fillp1 (   hist)

Definition at line 144 of file makeCascade.py.

144def fillp1(hist):
145# scan filled bins in hist, and fill intermediate bins with lineair interpolation
146 nb=hist.GetNbinsX()
147 i1=hist.FindBin(pbeaml,0.,0.)
148 y1=hist.GetBinContent(i1)
149 p1=hist.GetBinCenter(i1)
150 for i in range(i1+1,nb+1):
151 if hist.GetBinContent(i)>0.:
152 y2=hist.GetBinContent(i)
153 p2=hist.GetBinCenter(i)
154 tg=(y2-y1)/(p2-p1)
155 for ib in range(i1+1,i):
156 px=hist.GetBinCenter(ib)
157 yx=(px-p1)*tg+y1
158 hist.Fill(px,yx)
159 i1=i
160 y1=y2
161 p1=p2
162
163
164#choose the Pythia tune:

◆ LHCb_tune()

makeCascade.LHCb_tune (   P6)

Definition at line 109 of file makeCascade.py.

109def LHCb_tune(P6):
110# settings by LHCb for Pythia 6.427
111# https://twiki.cern.ch/twiki/bin/view/LHCb/SettingsSim08
112 print(' ')
113 print('********** LHCb_tune **********')
114 #P6.SetCKIN(41,3.0)
115 P6.SetMSTP(2, 2)
116 P6.SetMSTP(33, 3)
117 #P6.SetMSTP(128, 2) #store or not store
118 P6.SetMSTP(81, 21)
119 P6.SetMSTP(82, 3)
120 P6.SetMSTP(52, 2)
121 P6.SetMSTP(51, 10042)# (ie CTEQ6 LO fit, with LOrder alpha_S PDF from LHAPDF)
122 P6.SetMSTP(142, 0) #do not weigh events
123 P6.SetPARP(67, 1.0)
124 P6.SetPARP(82, 4.28)
125 P6.SetPARP(89, 14000)
126 P6.SetPARP(90, 0.238)
127 P6.SetPARP(85, 0.33)
128 P6.SetPARP(86, 0.66)
129 P6.SetPARP(91, 1.0)
130 P6.SetPARP(149, 0.02)
131 P6.SetPARP(150, 0.085)
132 P6.SetPARJ(11, 0.4)
133 P6.SetPARJ(12, 0.4)
134 P6.SetPARJ(13, 0.769)
135 P6.SetPARJ(14, 0.09)
136 P6.SetPARJ(15, 0.018)
137 P6.SetPARJ(16, 0.0815)
138 P6.SetPARJ(17, 0.0815)
139 P6.SetMSTJ(26, 0)
140 P6.SetPARJ(33, 0.4)
141 print('********** LHCb_tune **********')
142 print(' ')
143

◆ PoorE791_tune()

makeCascade.PoorE791_tune (   P6)

Definition at line 92 of file makeCascade.py.

92def PoorE791_tune(P6):
93# settings with default Pythia6 pdf, based on getting <pt> at 500 GeV pi-
94# same as that of E791: http://arxiv.org/pdf/hep-ex/9906034.pdf
95 print(' ')
96 print('********** PoorE791_tune **********')
97 #change pt of D's to mimic E791 data.
98 P6.SetPARP(91,1.6)
99 print('PARP(91)=',P6.GetPARP(91))
100 #what PDFs etc.. are being used:
101 print('MSTP PDF info, i.e. (51) and (52)=',P6.GetMSTP(51),P6.GetMSTP(52))
102 #set multiple interactions equal to Fortran version, i.e.=1, default=4, and adapt parp(89) accordingly
103 P6.SetMSTP(82,1)
104 P6.SetPARP(89,1000.)
105 print('And corresponding multiple parton stuff, i.e. MSTP(82),PARP(81,89,90)=',P6.GetMSTP(82),P6.GetPARP(81),P6.GetPARP(89),P6.GetPARP(90))
106 print('********** PoorE791_tune **********')
107 print(' ')
108

Variable Documentation

◆ anclist

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

Definition at line 371 of file makeCascade.py.

◆ args

makeCascade.args

Definition at line 22 of file makeCascade.py.

◆ beta

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

Definition at line 339 of file makeCascade.py.

◆ charmFound

list makeCascade.charmFound = []

Definition at line 306 of file makeCascade.py.

◆ chimx

int makeCascade.chimx = 0.

Definition at line 237 of file makeCascade.py.

◆ ctime

makeCascade.ctime = timer.CpuTime()

Definition at line 399 of file makeCascade.py.

◆ Fntuple

makeCascade.Fntuple = 'Cascade100k-parp16-MSTP82-1-MSEL'+str(mselcb)+'-ntuple.root'

Definition at line 17 of file makeCascade.py.

◆ fracp

float makeCascade.fracp = 0.43

Definition at line 62 of file makeCascade.py.

◆ ftup

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

Definition at line 260 of file makeCascade.py.

◆ gamma

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

Definition at line 340 of file makeCascade.py.

◆ h

dict makeCascade.h = {}

Definition at line 181 of file makeCascade.py.

◆ ib

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

Definition at line 294 of file makeCascade.py.

◆ ibh

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

Definition at line 241 of file makeCascade.py.

◆ ibin

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

Definition at line 214 of file makeCascade.py.

◆ icas

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

Definition at line 369 of file makeCascade.py.

◆ id

int makeCascade.id = 0

Definition at line 185 of file makeCascade.py.

◆ idabs

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

Definition at line 308 of file makeCascade.py.

◆ idadd

int makeCascade.idadd = idpn*4

Definition at line 208 of file makeCascade.py.

◆ idb

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

Definition at line 199 of file makeCascade.py.

◆ idbeam

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

Definition at line 55 of file makeCascade.py.

◆ idhist

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

Definition at line 188 of file makeCascade.py.

◆ idpn

int makeCascade.idpn = 0

Definition at line 290 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 70 of file makeCascade.py.

◆ idw

int makeCascade.idw = idbeam[idp]*idpm

Definition at line 193 of file makeCascade.py.

◆ kc

makeCascade.kc = myPythia.Pycomp(kf)

Definition at line 267 of file makeCascade.py.

◆ mselcb

makeCascade.mselcb = 4

Definition at line 13 of file makeCascade.py.

◆ myPythia

makeCascade.myPythia = ROOT.TPythia6()

Definition at line 79 of file makeCascade.py.

◆ name

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

Definition at line 195 of file makeCascade.py.

◆ nb

int makeCascade.nb = 400

Definition at line 186 of file makeCascade.py.

◆ nev

int makeCascade.nev = 5000

Definition at line 52 of file makeCascade.py.

◆ nevgen

makeCascade.nevgen = 100000

Definition at line 16 of file makeCascade.py.

◆ nrpoints

int makeCascade.nrpoints = 20

Definition at line 53 of file makeCascade.py.

◆ nstack

int makeCascade.nstack = 0

Definition at line 279 of file makeCascade.py.

◆ nsub

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

Definition at line 321 of file makeCascade.py.

◆ Ntup

makeCascade.Ntup
Initial value:
1= ROOT.TNtuple("pythia6","pythia6 heavy flavour",\
2 "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:\
3s0:s1:s2:s3:s4:s5:s6:s7:s8:s9:s10:s11:s12:s13:s14:s15")

Definition at line 261 of file makeCascade.py.

◆ opts

makeCascade.opts

Definition at line 22 of file makeCascade.py.

◆ pbcm

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

Definition at line 341 of file makeCascade.py.

◆ pbeamh

makeCascade.pbeamh = 400.

Definition at line 14 of file makeCascade.py.

◆ pbeaml

int makeCascade.pbeaml = 34.

Definition at line 69 of file makeCascade.py.

◆ pbw

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

Definition at line 212 of file makeCascade.py.

◆ pDcm

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

Definition at line 342 of file makeCascade.py.

◆ PDG

makeCascade.PDG = ROOT.TDatabasePDG.Instance()

Definition at line 78 of file makeCascade.py.

◆ prbsig

dict makeCascade.prbsig = 0.

Definition at line 286 of file makeCascade.py.

◆ pt2

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

Definition at line 334 of file makeCascade.py.

◆ ptot

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

Definition at line 285 of file makeCascade.py.

◆ R

makeCascade.R = ''

Definition at line 11 of file makeCascade.py.

◆ rtime

makeCascade.rtime = timer.RealTime()

Definition at line 398 of file makeCascade.py.

◆ stack

int makeCascade.stack = 1000*[0]

Definition at line 275 of file makeCascade.py.

◆ stmp

makeCascade.stmp = copy.copy(sublist)

Definition at line 387 of file makeCascade.py.

◆ storePrimaries

bool makeCascade.storePrimaries = False

Definition at line 15 of file makeCascade.py.

◆ sublist

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

Definition at line 372 of file makeCascade.py.

◆ t0

makeCascade.t0 = time.time()

Definition at line 187 of file makeCascade.py.

◆ target

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

Definition at line 56 of file makeCascade.py.

◆ timer

makeCascade.timer = ROOT.TStopwatch()

Definition at line 8 of file makeCascade.py.

◆ tmp

makeCascade.tmp = copy.copy(anclist)

Definition at line 385 of file makeCascade.py.

◆ tp

makeCascade.tp = ROOT.tPythia6Generator()

Definition at line 80 of file makeCascade.py.

◆ vl

makeCascade.vl = array('f')

Definition at line 311 of file makeCascade.py.

◆ xf

tuple makeCascade.xf = pDcm/pbcm

Definition at line 343 of file makeCascade.py.