1from __future__
import print_function
5muonIn =
'/media/Data/HNL/muVetoDIS/muDISVetoCounter.root'
9PDG = ROOT.TDatabasePDG.Instance()
14 if not apid
in masssq:
15 masssq[apid] = PDG.GetParticle(apid).Mass()**2
23fout = ROOT.TFile(
'muonEm_'+str(nJob)+
'.root',
'recreate')
24dTree = ROOT.TNtuple(
"pythia8-Geant4",
"muons for EM studies",
"id:px:py:pz:x:y:z:ox:oy:oz:pythiaid:parentid:ecut:w")
27fin = ROOT.TFile(muonIn)
30for k
in range(sTree.GetEntries()):
31 rc = sTree.GetEvent(k)
33 px,py,pz = sTree.px,sTree.py,sTree.pz
34 x,y,z = sTree.x,sTree.y,sTree.z
35 pid,w = sTree.id,sTree.w
36 p = ROOT.TMath.Sqrt(px*px+py*py+pz*pz)
38 mu = array(
'd',[pid,px,py,pz,E,x,y,z,w])
39 muPart = ROOT.TVectorD(9,mu)
40 for n
in range(nMult):
44 m = array(
'd',[pid,px,py,pz,E])
45 part = ROOT.TVectorD(5,m)
47 nPart = dPart.GetEntries()
52print(
"created",sTree.GetEntries()*nMult,
" events")