13def configurerpvsusy(P8gen, mass, couplings, sfermionmass, benchmark, inclusive, deepCopy=False, debug=True):
14
15 if debug:
16 pythia_log=open('pythia8_conf.txt','w')
17 P8gen = MethodLogger(P8gen, sink=pythia_log)
18 h = make_interpolators(
19 os.path.expandvars("$FAIRSHIP/shipgen/branchingratiosrpvsusybench{}.dat".format(benchmark)))
20 P8gen.UseRandom3()
21 P8gen.SetMom(400)
22 if deepCopy: P8gen.UseDeepCopy()
23 pdg = ROOT.TDatabasePDG.Instance()
24
25 make_particles_stable(P8gen, above_lifetime=1)
26
27 if inclusive=="True":
28 setup_pythia_inclusive(P8gen)
29
30
31 if inclusive=="c":
32 P8gen.SetParameters("HardQCD::hardccbar = on")
33
34 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
35 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
36 print("RPVSUSY ctau ",ctau)
37 P8gen.SetParameters("9900015:new = N2 N2 2 0 0 {:.12} 0.0 0.0 0.0 {:.12} 0 1 0 1 0".format(mass, ctau/u.mm))
38 P8gen.SetParameters("9900015:isResonance = false")
39 P8gen.SetParameters("Next:numberCount = 0")
40
41 rpvsusy_instance.AddChannelsToPythia(P8gen)
42
43
44 P8gen.SetParameters("9900015:mayDecay = on")
45 P8gen.SetHNLId(9900015)
46
47 gamma = u.hbarc / float(ctau)
48 addHNLtoROOT(pid=9900015,m=mass,g=gamma)
49
50 charmhistograms = ['d_mu','ds_mu']
51
52 totaltauBR = 0.0
53 maxsumBR = getmaxsumbrrpvsusy(h,charmhistograms,mass,couplings)
54 exit_if_zero_br(maxsumBR, inclusive, mass, particle='RPV neutralino')
55 totalBR = gettotalbrrpvsusy(h,charmhistograms,mass,couplings)
56
57
58
59 P8gen.SetParameters("431:new D_s+ D_s- 1 3 0 1.96849"\
60 " 0.00000 0.00000 0.00000 1.49900e-01 0 1 0 1 0")
61 sumBR=0.
62 if getbr_rpvsusy(h,'ds_mu',mass,couplings[1])>0.:
63 P8gen.SetParameters("431:addChannel 1 {:.12} 0 -13 9900015"\
64 .format(getbr_rpvsusy(h,'ds_mu',mass,couplings[1])/maxsumBR))
65 sumBR+=float(getbr_rpvsusy(h,'ds_mu',mass,couplings[1])/maxsumBR)
66 if sumBR<1. and sumBR>0.:
67 P8gen.SetParameters("431:addChannel 1 {:.12} 0 22 -11".format(1.-sumBR))
68
69
70 P8gen.SetParameters("411:new D+ D- 1 3 0 1.86962"\
71 " 0.00000 0.00000 0.00000 3.11800e-01 0 1 0 1 0")
72 sumBR=0.
73 if getbr_rpvsusy(h,'d_mu',mass,couplings[1])>0.:
74 P8gen.SetParameters("411:addChannel 1 {:.12} 0 -13 9900015"\
75 .format(getbr_rpvsusy(h,'d_mu',mass,couplings[1])/maxsumBR))
76 sumBR+=float(getbr_rpvsusy(h,'d_mu',mass,couplings[1])/maxsumBR)
77 if sumBR<1. and sumBR>0.:
78 P8gen.SetParameters("411:addChannel 1 {:.12} 0 22 -11".format(1.-sumBR))
79
80 P8gen.List(9900015)
81
82 if inclusive=="b":
83 P8gen.SetParameters("HardQCD::hardbbbar = on")
84
85 rpvsusy_instance =
rpvsusy.RPVSUSY(mass, couplings, sfermionmass, benchmark, debug=
True)
86 ctau = rpvsusy_instance.computeNLifetime(system="FairShip") * u.c_light * u.cm
87 P8gen.SetParameters("9900015:new = N2 N2 2 0 0 {:.12} 0.0 0.0 0.0 {:.12} 0 1 0 1 0".format(mass, ctau/u.mm))
88 P8gen.SetParameters("9900015:isResonance = false")
89
90 rpvsusy_instance.AddChannelsToPythia(P8gen)
91
92 P8gen.SetParameters("9900015:mayDecay = on")
93 P8gen.SetHNLId(9900015)
94
95 gamma = u.hbarc / float(ctau)
96 addHNLtoROOT(pid=9900015,m=mass,g=gamma)
97
98 beautyhistograms = ['b_mu','b_tau','b0_nu_mu','b0_nu_tau']
99 maxsumBR=getmaxsumbrrpvsusy(h,beautyhistograms,mass,couplings)
100 exit_if_zero_br(maxsumBR, inclusive, mass, particle='RPV neutralino')
101 totalBR=gettotalbrrpvsusy(h,beautyhistograms,mass,couplings)
102
103
104 P8gen.SetParameters("521:new B+ B- 1 3 0 5.27925"\
105 " 0.00000 0.00000 0.00000 4.91100e-01 0 1 0 1 0")
106 sumBR=0.
107 if getbr_rpvsusy(h,'b_tau',mass,couplings[1])>0.:
108 P8gen.SetParameters("521:addChannel 1 {:.12} 0 9900015 -15"\
109 .format(getbr_rpvsusy(h,'b_tau',mass,couplings[1])/maxsumBR))
110 sumBR+=float(getbr_rpvsusy(h,'b_tau',mass,couplings[1])/maxsumBR)
111 if sumBR<1. and sumBR>0.:
112 P8gen.SetParameters("521:addChannel 1 {:.12} 0 22 22"\
113 .format(1.-sumBR))
114
115
116 P8gen.SetParameters("511:new B0 Bbar0 1 0 0 5.27958"\
117 " 0.00000 0.00000 0.00000 4.58700e-01 0 1 0 1 0")
118 sumBR=0.
119 if getbr_rpvsusy(h,'b0_nu_tau',mass,couplings[1])>0.:
120 P8gen.SetParameters("511:addChannel 1 {:.12} 22 9900015 16"\
121 .format(getbr_rpvsusy(h,'b0_nu_tau',mass,couplings[1])/maxsumBR))
122 if sumBR<1. and sumBR>0.:
123 P8gen.SetParameters("511:addChannel 1 {:.12} 0 22 22"\
124 .format(1.-sumBR))
125
126 P8gen.List(9900015)
127
128 if debug: pythia_log.close()
129
130