Decay files#
EvtGen describes which channels a particle decays into, and with which physics model, in decay files. The default table is DECAY_FILE. A user decay file overrides its entries, which is the usual way to study a single channel.
Creating a Generator reads the decay and particle tables and initializes Pythia8, which prints a lot of log output. That output is hidden on this page.
from pyevtgen import DECAY_FILE, Generator, final_state_momenta
generator = Generator(seed=0)
In the default table, a \(D^+\) decays into hundreds of channels. One of them is \(D^+ \to K^- \pi^+ \pi^+\) with the D_DALITZ model, which describes the resonances in this decay:
lines = DECAY_FILE.read_text().splitlines()
start = lines.index("Decay D+")
end = lines.index("Enddecay", start)
print("\n".join(line for line in lines[start:end] if "D_DALITZ" in line))
0.094000000 K- pi+ pi+ D_DALITZ; #[Reconstructed PDG2011]
0.069900000 K_S0 pi+ pi0 D_DALITZ; # PDG2014
0.069900000 K_L0 pi+ pi0 D_DALITZ; # Assume to be same as K_S0 pi+ pi0
0.000000000 anti-K0 pi+ pi0 D_DALITZ; #[Reconstructed PDG2011]
Forcing a channel#
A user decay file only needs the entries that it overrides. Here we write one that forces \(D^+ \to K^- \pi^+ \pi^+\) with the D_DALITZ model, and load it with Generator.read_user_decay_file(). The same file can also be passed to the user_decay_file argument of Generator.
directory = Path(mkdtemp())
dalitz_file = directory / "dalitz.dec"
dalitz_file.write_text("""
Decay D+
1.0 K- pi+ pi+ D_DALITZ;
Enddecay
End
""")
generator.read_user_decay_file(dalitz_file)
Reading the file prints EvtGen log output, which is hidden here. All \(D^+\) decays now have the same final state:
dalitz_momenta = final_state_momenta(generator.generate("D+", n=50_000))
dalitz_momenta.shape
(50000, 3, 4)
Loading another user decay file overrides the entry again. This time, the \(D^+\) decays uniformly over phase space with the PHSP model:
phsp_file = directory / "phsp.dec"
phsp_file.write_text("""
Decay D+
1.0 K- pi+ pi+ PHSP;
Enddecay
End
""")
generator.read_user_decay_file(phsp_file)
phsp_momenta = final_state_momenta(generator.generate("D+", n=50_000))
The Dalitz plots show the difference between the two models. With D_DALITZ, the \(\bar{K}^*(892)^0\) resonance shows up as a band in the \(K^-\pi^+\) invariant mass:
The projections onto the invariant masses make the difference more quantitative. Each event enters twice, once for each \(K^-\pi^+\) combination, because the two pions are identical:
Main decay tables#
The decay_file argument of Generator replaces the default table entirely, and accepts several files that are read in order. The particle_table argument does the same for the particle properties. Both can only be set when the generator is created.
Warning
EvtGen terminates the process when it encounters a malformed decay file or redefines an existing alias. Python cannot catch this as an exception.