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