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 is True:
50 inclusive = "True"
51
52 if inclusive == "True":
53 setup_pythia_inclusive(P8gen)
54
55
56 if inclusive == "c":
57 P8gen.SetParameters("HardQCD::hardccbar = on")
58
59 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
60 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
61 print("RPVSUSY ctau ", ctau)
62 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")
63 P8gen.SetParameters("9900015:isResonance = false")
64 P8gen.SetParameters("Next:numberCount = 0")
65
66 rpvsusy_instance.AddChannelsToPythia(P8gen)
67
68
69 P8gen.SetParameters("9900015:mayDecay = on")
70 P8gen.SetHNLId(9900015)
71
72 gamma = u.hbarc / float(ctau)
73 addHNLtoROOT(pid=9900015, m=mass, g=gamma)
74
75 charmhistograms = ["d_mu", "ds_mu"]
76
77 maxsumBR = getmaxsumbrrpvsusy(h, charmhistograms, mass, couplings)
78 exit_if_zero_br(maxsumBR, inclusive, mass, particle="RPV neutralino")
79 gettotalbrrpvsusy(h, charmhistograms, mass, couplings)
80
81
82 P8gen.SetParameters(
83 "431:new D_s+ D_s- 1 3 0 1.96849"
84 " 0.00000 0.00000 0.00000 1.49900e-01 0 1 0 1 0"
85 )
86 sumBR = 0.0
87 br_ds_mu = getbr_rpvsusy(h, "ds_mu", mass, couplings[1])
88 if br_ds_mu > 0.0:
89 P8gen.SetParameters(f"431:addChannel 1 {br_ds_mu / maxsumBR:.12} 0 -13 9900015")
90 sumBR += float(br_ds_mu / 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 br_d_mu = getbr_rpvsusy(h, "d_mu", mass, couplings[1])
100 if br_d_mu > 0.0:
101 P8gen.SetParameters(f"411:addChannel 1 {br_d_mu / maxsumBR:.12} 0 -13 9900015")
102 sumBR += float(br_d_mu / maxsumBR)
103 if sumBR < 1.0 and sumBR > 0.0:
104 P8gen.SetParameters(f"411:addChannel 1 {1.0 - sumBR:.12} 0 22 -11")
105
106 P8gen.List(9900015)
107
108 if inclusive == "b":
109 P8gen.SetParameters("HardQCD::hardbbbar = on")
110
111 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
112 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
113 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")
114 P8gen.SetParameters("9900015:isResonance = false")
115
116 rpvsusy_instance.AddChannelsToPythia(P8gen)
117
118 P8gen.SetParameters("9900015:mayDecay = on")
119 P8gen.SetHNLId(9900015)
120
121 gamma = u.hbarc / float(ctau)
122 addHNLtoROOT(pid=9900015, m=mass, g=gamma)
123
124 beautyhistograms = ["b_mu", "b_tau", "b0_nu_mu", "b0_nu_tau"]
125 maxsumBR = getmaxsumbrrpvsusy(h, beautyhistograms, mass, couplings)
126 exit_if_zero_br(maxsumBR, inclusive, mass, particle="RPV neutralino")
127 gettotalbrrpvsusy(h, beautyhistograms, mass, couplings)
128
129
130 P8gen.SetParameters(
131 "521:new B+ B- 1 3 0 5.27925"
132 " 0.00000 0.00000 0.00000 4.91100e-01 0 1 0 1 0"
133 )
134 sumBR = 0.0
135 br_b_tau = getbr_rpvsusy(h, "b_tau", mass, couplings[1])
136 if br_b_tau > 0.0:
137 P8gen.SetParameters(f"521:addChannel 1 {br_b_tau / maxsumBR:.12} 0 9900015 -15")
138 sumBR += float(br_b_tau / maxsumBR)
139 if sumBR < 1.0 and sumBR > 0.0:
140 P8gen.SetParameters(f"521:addChannel 1 {1.0 - sumBR:.12} 0 22 22")
141
142
143 P8gen.SetParameters(
144 "511:new B0 Bbar0 1 0 0 5.27958"
145 " 0.00000 0.00000 0.00000 4.58700e-01 0 1 0 1 0"
146 )
147 sumBR = 0.0
148 br_b0_nu_tau = getbr_rpvsusy(h, "b0_nu_tau", mass, couplings[1])
149 if br_b0_nu_tau > 0.0:
150 P8gen.SetParameters(f"511:addChannel 1 {br_b0_nu_tau / maxsumBR:.12} 22 9900015 16")
151 sumBR += float(br_b0_nu_tau / maxsumBR)
152 if sumBR < 1.0 and sumBR > 0.0:
153 P8gen.SetParameters(f"511:addChannel 1 {1.0 - sumBR:.12} 0 22 22")
154
155 P8gen.List(9900015)
156
157 _exit_stack.close()
158
159