91):
92 """
93 Configures the DP decay table in Pythia8
94
95 Inputs:
96 - P8gen: an instance of ROOT.HNLPythia8Generator()
97 - conffile: a file listing the channels one wishes to activate
98 """
99 isResonant = P8gen.GetDPId() == 4900023
100
101 allowed = DP.allowedChannels()
102
103 wanted = load(conffile=conffile, verbose=verbose)
104
105 for dec in allowed:
106 print("channel allowed:", dec)
107 if dec not in wanted:
108 print("addDarkPhotondecayChannels WARNING: channel not configured! Please add also in conf file.\t", dec)
109 quit()
110 print("channel wanted:", dec)
111
112 if allowed[dec] == "yes" and wanted[dec] == "yes":
113 BR = DP.findBranchingRatio(dec)
114
115 meMode = 0
116 if isResonant:
117 meMode = 103
118 if "hadrons" in dec:
119
120 print("debug readdecay table hadrons BR ", BR)
121
122 dpid = P8gen.GetDPId()
123 if mDP < 3.0:
124 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.167 * BR:.12} {meMode} 1 -1")
125 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.666 * BR:.12} {meMode} 2 -2")
126 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.167 * BR:.12} {meMode} 3 -3")
127 if mDP >= 3.0:
128 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.1 * BR:.12} {meMode} 1 -1")
129 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.4 * BR:.12} {meMode} 2 -2")
130 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.1 * BR:.12} {meMode} 3 -3")
131 P8gen.SetParameters(f"{dpid}:addChannel = 1 {0.4 * BR:.12} {meMode} 4 -4")
132 else:
133 particles = list(dec.replace("->", " ").split())
134 children = particles[1:]
135 childrenCodes = [PDGcode(p) for p in children]
136 codes = " ".join(str(code) for code in childrenCodes)
137 P8gen.SetParameters(f"{P8gen.GetDPId()}:addChannel = 1 {BR:.12} {meMode} {codes}")
138 print("debug readdecay table ", particles, children, BR)
139
140