10muonIn =
"/media/Data/HNL/muVetoDIS/muDISVetoCounter.root"
13from array
import array
15PDG = ROOT.TDatabasePDG.Instance()
21 if apid
not in masssq:
22 _p = ut.get_particle(apid)
23 masssq[apid] = _p.Mass() ** 2
32fout = ROOT.TFile(
"muonEm_" + str(nJob) +
".root",
"recreate")
33dTree = ROOT.TTree(
"pythia8-Geant4",
"muons for EM studies")
34iMuon = ROOT.TClonesArray(
"TVectorD")
35iMuonBranch = dTree.Branch(
"InMuon", iMuon, 32000, -1)
36dPart = ROOT.TClonesArray(
"TVectorD")
37dPartBranch = dTree.Branch(
"Particles", dPart, 32000, -1)
40fin = ROOT.TFile(muonIn)
43for k
in range(sTree.GetEntries()):
44 rc = sTree.GetEvent(k)
46 px, py, pz = sTree.px, sTree.py, sTree.pz
47 x, y, z = sTree.x, sTree.y, sTree.z
48 pid, w = sTree.id, sTree.w
49 p = ROOT.TMath.Sqrt(px * px + py * py + pz * pz)
51 mu = array(
"d", [pid, px, py, pz, E, x, y, z, w])
52 muPart = ROOT.TVectorD(9, mu)
53 for n
in range(nMult):
57 ut.assignClonesArrayItem(iMuon, 0, muPart)
58 m = array(
"d", [pid, px, py, pz, E])
59 part = ROOT.TVectorD(5, m)
61 ut.assignClonesArrayItem(dPart, len(dPart), part)
65print(
"created", sTree.GetEntries() * nMult,
" events")