## Mass-dependent hadron widths

This page describes a model for mass-dependent hadron widths. This includes mass-dependent branching ratios for hadrons produced off-shell, and is a, important component of the rescattering framework.

The mass-dependent widths are handled by the `HadronWidths` class. When running the program, the widths are precalculated and tabulated in order to improve efficiency, which is particularly important for rescattering. These precalculated values can be found in the `HadronWidths.dat` file.

A prerequisite is that the space-time production vertices of hadrons from string fragmentation are known. This was implemented in [Fer18], and is described separately on the Hadron Vertex Information page. A smaller further smearing is obtained from the Parton Vertex Information transverse displacement of separate MPI vertices.

### The `HadronWidths` class

The following methods are found in the `HadronWidths` class.

bool HadronWidths::check()
run a check to validate the loaded hadron widths data. Returns whether successful.

vector<int> HadronWidths::getResonances()
gets a list of the implemented resonance particles.

vector<int> HadronWidths::hasResonances(int idA, int idB)
returns whether the two specified incoming particles can form resonances.

vector<int> HadronWidths::getPossibleResonances(int idA, int idB)
gets a list of resonances that could possibly be formed by the specified incoming particles. That is, all resonance particles that has data and can decay into those particles.

bool HadronWidths::hasData(int id)
returns whether mass-dependent widths have been parameterized for the specified particle. If `id` is negative, it instead returns whether data exists for the corresponding absolute value.

bool HadronWidths::canDecay(int idR, int prodA, int prodB)
returns whether data exists for the decay R → A + B.

double HadronWidths::width(int id, double m)
returns the mass-dependent width of the specified particle at the given mass. If parameterized data does not exist for that particle, its nominal width is returned instead.

double HadronWidths::partialWidth(int idR, int prodA, int prodB, double m)
double HadronWidths::br(int id, int prodA, int prodB, double m)
returns the mass-dependent partial width or branching ratio of the decay R → A + B. If parameterized data does not exist for that decay channel, both methods will return zero.

double HadronWidths::mDistr(int id, double m)
gives the mass distribution density for the specified particle. This is given by a Breit-Wigner function, using the mass-dependent width. If the mass-dependent width is not available, it uses the nominal width instead.

bool HadronWidths::pickMasses(int idA, int idB, double eCM, double& mAOut, double& mBOut, int lType = 1)
given two particles produced at the specified CM energy, this method samples the masses of those two particles, according to their mass distributions and available phase space. If successful, the resulting masses are written to `mAOut` and `mBOut`, and the method returns true. The `lType` parameter is 2l+1, where l is the angular momentum of the outgoing two-body system.

bool HadronWidths::pickDecay(int idDec, double m, int& idAOut, int& iBOut, double& mAOut, double& mBOut)
pick a decay channel for the `idDec` particle with the specified mass, using mass-dependent branching ratios. If successful, the outgoing particle ids are written to `idAOut` and `idBOut`, and their corresponding masses are written to `mAOut` and `mBOut`. Returns whether successful.

In some cases, parameterized hadron widths are not available. This could happen for example if the user defines new particles or changes properties of existing resonance hadrons. In these cases, the following methods can be used to calculate new widths and generate parameterization data.

double HadronWidths::widthCalc(int id, double m)
double HadronWidths::widthCalc(int idR, int prodA, int prodB, double m)
calculate the mass-dependent width of the particle at the specified mass, or the partial width of the decay R → A + B. This does not use the parameterized mass-dependent width for the resonance particle, even if it is defined. However, this is dependent on the mass distributions of the decay products, and these will be calculated using mass-dependent widths if they have been parameterized for those particles.

bool HadronWidths::parameterize(int id, int precision)
void HadronWidths::parameterizeAll(int precision)
the `parameterize` method recalculates the widths of the specified particle. The widths are calculated at `precision` number of points, evenly spaced between the minimum and maxium mass of that particle. Note that this will use existing parameterizations for decay products, if available. The `parametizeAll` method clears all parameterized data and recalculates it for all particles in the event record that set `varWidth = on`. This is done in a way that ensures that if such a hadron decays into other hadrons with mass-dependent widths, then the widths of the decay products are parameterized first.

bool HadronWidths::save(ostream& stream)
bool HadronWidths::save(string file = "HadronWidths.dat")
write all parameterized mass-dependent widths in an xml format to the specified stream or file.