From b4f5d5b1629e382d5b44b371485a8141947427da Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de> Date: Wed, 22 May 2019 16:24:00 -0300 Subject: [PATCH] K0Long to K0 K0Bar conversion in event generation --- Processes/UrQMD/UrQMD.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Processes/UrQMD/UrQMD.cc b/Processes/UrQMD/UrQMD.cc index 3efe905e3..7ab1e5a50 100644 --- a/Processes/UrQMD/UrQMD.cc +++ b/Processes/UrQMD/UrQMD.cc @@ -109,7 +109,7 @@ GrammageType UrQMD::GetInteractionLength(SetupParticle& vParticle) const { corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& vProjectile) { using namespace units::si; - auto const projectileCode = vProjectile.GetPID(); + auto projectileCode = vProjectile.GetPID(); auto const projectileEnergyLab = vProjectile.GetEnergy(); auto const& projectileMomentumLab = vProjectile.GetMomentum(); auto const& projectilePosition = vProjectile.GetPosition(); @@ -159,6 +159,13 @@ corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& vProjecti rsys_.bdist = nucrad_(targetA) + nucrad_(1) + 2 * options_.CTParam[30 - 1]; rsys_.ebeam = (projectileEnergyLab - vProjectile.GetMass()) * (1 / 1_GeV); + if (projectileCode == particles::Code::K0Long) { + std::uniform_int_distribution dist(0, 1); + projectileCode = (dist(fRNG) == 1) ? particles::Code::K0 : particles::Code::K0Bar; + } else if (projectileCode == particles::Code::K0Short) { + throw std::runtime_error("K0Short should not interact"); + } + auto const [ityp, iso3] = ConvertToUrQMD(projectileCode); // todo: conversion of K_long/short into strong eigenstates; inputs_.spityp[0] = ityp; -- GitLab