34) -> None:
35
36 _exit_stack = contextlib.ExitStack()
37 if debug:
38 pythia_log = _exit_stack.enter_context(
open(
"pythia8_conf.txt",
"w"))
39 P8gen = MethodLogger(P8gen, sink=pythia_log)
40 h = make_interpolators(os.path.expandvars(f"$FAIRSHIP/shipgen/branchingratiosrpvsusybench{benchmark}.dat"))
41 P8gen.UseRandom3()
42 P8gen.SetMom(400)
43 if deepCopy:
44 P8gen.UseDeepCopy()
45 ROOT.TDatabasePDG.Instance()
46
47 make_particles_stable(P8gen, above_lifetime=1)
48
49 if inclusive == "True":
50 setup_pythia_inclusive(P8gen)
51
52
53 if inclusive == "c":
54 P8gen.SetParameters("HardQCD::hardccbar = on")
55
56 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
57 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
58 print("RPVSUSY ctau ", ctau)
59 P8gen.SetParameters(f"9900015:new = N2 N2 2 0 0 {mass:.12} 0.0 0.0 0.0 {ctau / u.mm:.12} 0 1 0 1 0")
60 P8gen.SetParameters("9900015:isResonance = false")
61 P8gen.SetParameters("Next:numberCount = 0")
62
63 rpvsusy_instance.AddChannelsToPythia(P8gen)
64
65
66 P8gen.SetParameters("9900015:mayDecay = on")
67 P8gen.SetHNLId(9900015)
68
69 gamma = u.hbarc / float(ctau)
70 addHNLtoROOT(pid=9900015, m=mass, g=gamma)
71
72 charmhistograms = ["d_mu", "ds_mu"]
73
74 maxsumBR = getmaxsumbrrpvsusy(h, charmhistograms, mass, couplings)
75 exit_if_zero_br(maxsumBR, inclusive, mass, particle="RPV neutralino")
76 gettotalbrrpvsusy(h, charmhistograms, mass, couplings)
77
78
79 P8gen.SetParameters(
80 "431:new D_s+ D_s- 1 3 0 1.96849"
81 " 0.00000 0.00000 0.00000 1.49900e-01 0 1 0 1 0"
82 )
83 sumBR = 0.0
84 if getbr_rpvsusy(h, "ds_mu", mass, couplings[1]) > 0.0:
85 P8gen.SetParameters(
86 "431:addChannel 1 {:.12} 0 -13 9900015".format(
87 getbr_rpvsusy(h, "ds_mu", mass, couplings[1]) / maxsumBR
88 )
89 )
90 sumBR += float(getbr_rpvsusy(h, "ds_mu", mass, couplings[1]) / maxsumBR)
91 if sumBR < 1.0 and sumBR > 0.0:
92 P8gen.SetParameters(f"431:addChannel 1 {1.0 - sumBR:.12} 0 22 -11")
93
94
95 P8gen.SetParameters(
96 "411:new D+ D- 1 3 0 1.86962 0.00000 0.00000 0.00000 3.11800e-01 0 1 0 1 0"
97 )
98 sumBR = 0.0
99 if getbr_rpvsusy(h, "d_mu", mass, couplings[1]) > 0.0:
100 P8gen.SetParameters(
101 "411:addChannel 1 {:.12} 0 -13 9900015".format(
102 getbr_rpvsusy(h, "d_mu", mass, couplings[1]) / maxsumBR
103 )
104 )
105 sumBR += float(getbr_rpvsusy(h, "d_mu", mass, couplings[1]) / maxsumBR)
106 if sumBR < 1.0 and sumBR > 0.0:
107 P8gen.SetParameters(f"411:addChannel 1 {1.0 - sumBR:.12} 0 22 -11")
108
109 P8gen.List(9900015)
110
111 if inclusive == "b":
112 P8gen.SetParameters("HardQCD::hardbbbar = on")
113
114 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
115 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
116 P8gen.SetParameters(f"9900015:new = N2 N2 2 0 0 {mass:.12} 0.0 0.0 0.0 {ctau / u.mm:.12} 0 1 0 1 0")
117 P8gen.SetParameters("9900015:isResonance = false")
118
119 rpvsusy_instance.AddChannelsToPythia(P8gen)
120
121 P8gen.SetParameters("9900015:mayDecay = on")
122 P8gen.SetHNLId(9900015)
123
124 gamma = u.hbarc / float(ctau)
125 addHNLtoROOT(pid=9900015, m=mass, g=gamma)
126
127 beautyhistograms = ["b_mu", "b_tau", "b0_nu_mu", "b0_nu_tau"]
128 maxsumBR = getmaxsumbrrpvsusy(h, beautyhistograms, mass, couplings)
129 exit_if_zero_br(maxsumBR, inclusive, mass, particle="RPV neutralino")
130 gettotalbrrpvsusy(h, beautyhistograms, mass, couplings)
131
132
133 P8gen.SetParameters(
134 "521:new B+ B- 1 3 0 5.27925"
135 " 0.00000 0.00000 0.00000 4.91100e-01 0 1 0 1 0"
136 )
137 sumBR = 0.0
138 if getbr_rpvsusy(h, "b_tau", mass, couplings[1]) > 0.0:
139 P8gen.SetParameters(
140 "521:addChannel 1 {:.12} 0 9900015 -15".format(
141 getbr_rpvsusy(h, "b_tau", mass, couplings[1]) / maxsumBR
142 )
143 )
144 sumBR += float(getbr_rpvsusy(h, "b_tau", mass, couplings[1]) / maxsumBR)
145 if sumBR < 1.0 and sumBR > 0.0:
146 P8gen.SetParameters(f"521:addChannel 1 {1.0 - sumBR:.12} 0 22 22")
147
148
149 P8gen.SetParameters(
150 "511:new B0 Bbar0 1 0 0 5.27958"
151 " 0.00000 0.00000 0.00000 4.58700e-01 0 1 0 1 0"
152 )
153 sumBR = 0.0
154 if getbr_rpvsusy(h, "b0_nu_tau", mass, couplings[1]) > 0.0:
155 P8gen.SetParameters(
156 "511:addChannel 1 {:.12} 22 9900015 16".format(
157 getbr_rpvsusy(h, "b0_nu_tau", mass, couplings[1]) / maxsumBR
158 )
159 )
160 if sumBR < 1.0 and sumBR > 0.0:
161 P8gen.SetParameters(f"511:addChannel 1 {1.0 - sumBR:.12} 0 22 22")
162
163 P8gen.List(9900015)
164
165 _exit_stack.close()
166
167