IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 88318806 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

use UrQMD's pdgid function instead of ours

parent 4a868297
No related branches found
No related tags found
1 merge request!116Some improvements here and there
...@@ -151,6 +151,7 @@ corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& projectil ...@@ -151,6 +151,7 @@ corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& projectil
1_GeV); 1_GeV);
momentum.rebase(originalCS); // transform back into standard lab frame momentum.rebase(originalCS); // transform back into standard lab frame
std::cout << i << " " << code << " " << momentum.GetComponents() << std::endl;
projectile.AddSecondary( projectile.AddSecondary(
std::tuple<particles::Code, HEPEnergyType, stack::MomentumVector, geometry::Point, std::tuple<particles::Code, HEPEnergyType, stack::MomentumVector, geometry::Point,
...@@ -161,6 +162,8 @@ corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& projectil ...@@ -161,6 +162,8 @@ corsika::process::EProcessReturn UrQMD::DoInteraction(SetupProjectile& projectil
if (sys_.npart > 0) // delete only in case of inelastic collision, otherwise keep if (sys_.npart > 0) // delete only in case of inelastic collision, otherwise keep
projectile.Delete(); projectile.Delete();
return process::EProcessReturn::eOk;
} }
/** /**
...@@ -175,59 +178,12 @@ double corsika::process::UrQMD::ranf_(int&) { ...@@ -175,59 +178,12 @@ double corsika::process::UrQMD::ranf_(int&) {
} }
corsika::particles::Code corsika::process::UrQMD::ConvertFromUrQMD(int vItyp, int vIso3) { corsika::particles::Code corsika::process::UrQMD::ConvertFromUrQMD(int vItyp, int vIso3) {
static const std::map<std::pair<int, int>, int> mapUrQMDToPDG{ int const pdgInt =
// data from github.com/afedynitch/ParticleDataTool pdgid_(vItyp, vIso3); // use the conversion function provided by UrQMD
{{100, 0}, 22}, // gamma if (pdgInt == 0) { // pdgid_ returns 0 on error
{{101, 0}, 111}, // pi0 throw std::runtime_error("UrQMD pdgid() returned 0");
{{101, 2}, 211}, // pi+ }
{{101, -2}, -211}, // pi- auto const pdg = static_cast<particles::PDGCode>(pdgInt);
{{106, 1}, 321}, // K+
{{106, -1}, -321}, // K-
{{1, 1}, 2212}, // p
{{1, -1}, 2112}, // n
{{102, 0}, 221}, // eta
{{104, 2}, 213}, // rho+
{{104, -2}, -213}, // rho-
{{104, 0}, 113}, // rho0
{{108, 2}, 323}, // K*+
{{108, -2}, -323}, // K*-
{{108, 0}, 313}, // K*0
{{-108, 0}, -313}, // K*0-bar
{{103, 0}, 223}, // omega
{{109, 0}, 333}, // phi
{{40, 2}, 3222}, // Sigma+
{{40, 0}, 3212}, // Sigma0
{{40, -2}, 3112}, // Sigma-
{{49, 0}, 3322}, // Xi0
{{49, -1}, 3312}, // Xi-
{{27, 0}, 3122}, // Lambda0
{{17, 4}, 2224}, // Delta++
{{17, 2}, 2214}, // Delta+
{{17, 0}, 2114}, // Delta0
{{17, -2}, 1114}, // Delta-
{{41, 2}, 3224}, // Sigma*+
{{41, 0}, 3214}, // Sigma*0
{{41, -2}, 3114}, // Sigma*-
{{50, 0}, 3324}, // Xi*0
{{50, -1}, 3314}, // Xi*-
{{55, 0}, 3334}, // Omega-
{{133, 2}, 411}, // D+
{{133, -2}, -411}, // D-
{{133, 0}, 421}, // D0
{{-133, 0}, -421}, // D0-bar
{{107, 0}, 441}, // etaC
{{138, 1}, 431}, // Ds+
{{138, -1}, -431}, // Ds-
{{139, 1}, 433}, // Ds*+
{{139, -1}, -433}, // Ds*-
{{134, 1}, 413}, // D*+
{{134, -1}, -413}, // D*-
{{134, 0}, 10421}, // D*0
{{-134, 0}, -10421}, // D*0-bar
{{135, 0}, 443}, // jpsi
};
auto const pdg = static_cast<particles::PDGCode>(mapUrQMDToPDG.at({vItyp, vIso3}));
return particles::ConvertFromPDG(pdg); return particles::ConvertFromPDG(pdg);
} }
......
...@@ -54,6 +54,7 @@ namespace corsika::process::UrQMD { ...@@ -54,6 +54,7 @@ namespace corsika::process::UrQMD {
void cascinit_(int const&, int const&, int const&); void cascinit_(int const&, int const&, int const&);
double nucrad_(int const&); double nucrad_(int const&);
void urqmd_(int&); void urqmd_(int&);
int pdgid_(int&, int&);
// defined in coms.f // defined in coms.f
extern struct { extern struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment