9path =
"/eos/experiment/ship/data/Mbias/background-prod-2018/"
14charmExtern = [4332, 4232, 4132, 4322, 4122, 431, 411, 421, 15]
15neutrinos = [12, 14, 16]
20weightMbias1GeV = 27778.0
26weightCharm1GeV = 4895.24
33weight: float = weightMbias
37PDG = ROOT.TDatabasePDG.Instance()
38for idnu
in range(12, 17, 2):
40 for idadd
in range(-1, 2):
46 _p = ut.get_particle(idw)
48 title = name +
" momentum (GeV)"
50 ut.bookHist(h, key, title, 400, 0.0, 400.0)
51 title = name +
" log10-p vs log10-pt"
53 ut.bookHist(h, key, title, 100, -0.3, 1.7, 100, -2.0, 0.5)
54 title = name +
" log10-p vs log10-pt"
56 ut.bookHist(h, key, title, 25, -0.3, 1.7, 100, -2.0, 0.5)
60 f = ROOT.TFile.Open(os.environ[
"EOSSHIP"] + path + fin)
61 print(
"opened file ", fin)
62 sTree = f.Get(
"cbmsim")
63 for n
in range(sTree.GetEntries()):
65 for v
in sTree.vetoPoint:
68 pdgCode = t.GetPdgCode()
69 if abs(pdgCode)
not in neutrinos:
71 moID = abs(sTree.MCTrack[t.GetMotherId()].GetPdgCode())
72 if moID
in charmExtern
and noCharm:
74 idhnu = abs(pdgCode) + 1000
77 l10ptot = ROOT.TMath.Min(ROOT.TMath.Max(ROOT.TMath.Log10(t.GetP()), -0.3), 1.69999)
78 l10pt = ROOT.TMath.Min(ROOT.TMath.Max(ROOT.TMath.Log10(t.GetPt()), -2.0), 0.4999)
80 h[key].Fill(t.GetP(), weight)
82 h[key].Fill(l10ptot, l10pt, weight)
84 h[key].Fill(l10ptot, l10pt, weight)
88 tmp =
"pythia8_Geant4_10.0_cXX.root"
91 for run
in range(0, 67000, 1000):
93 ut.writeHists(h,
"pythia8_Geant4_10.0_c0-67000_nu.root")
97 tmp =
"pythia8_Geant4_1.0_cXX.root"
99 weight = weightMbias1GeV
100 for run
in range(0, 19000, 1000):
102 ut.writeHists(h,
"pythia8_Geant4_1.0_c0-19000_nu.root")
106 tmp =
"pythia8_Geant4_charm_XX-YY_10.0.root"
109 for cycle
in [0, 1, 2]:
110 for run
in range(0, 100, 20):
111 crun = run + cycle * 1000
112 fname = tmp.replace(
"XX", str(crun)).replace(
"YY", str(crun + 19))
114 ut.writeHists(h,
"pythia8_Geant4_charm_10.0_nu.root")
118 fname =
"pythia8_Geant4_charm_0-19_1.0.root"
120 weight = weightCharm1GeV
122 ut.writeHists(h,
"pythia8_Geant4_charm_1.0_nu.root")
127 weight = weightBeauty
128 fname =
"pythia8_Geant4_beauty_5336B_10.0.root"
131 fmu = fname.replace(
".root",
"_mu.root")
132 rc = os.system(
"xrdcp " + fmu +
" $EOSSHIP/eos/experiment/ship/data/Mbias/background-prod-2018/" + fmu)
134 print(
"copy to EOS failed, stop", fmu)
136 rc = os.system(
"rm " + fmu)
141 ut.readHists(h10,
"pythia8_Geant4_10.0_c0-67000_nu.root")
143 ut.readHists(h1,
"pythia8_Geant4_1.0_c0-19000_nu.root")
145 ut.readHists(c10,
"pythia8_Geant4_charm_10.0_nu.root")
147 ut.readHists(c1,
"pythia8_Geant4_charm_1.0_nu.root")
148 cmd =
"hadd pythia8_Geant4_10.0_withCharm_nu.root pythia8_Geant4_10.0_c0-67000_nu.root pythia8_Geant4_charm_10.0_nu.root"
151 "hadd pythia8_Geant4_1.0_withCharm_nu.root pythia8_Geant4_1.0_c0-19000_nu.root pythia8_Geant4_charm_1.0_nu.root"
None processFile(str fin, bool noCharm=True)