IAP GITLAB

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

use SecondaryView instad of SeoncdaryView::GetProjectile() as argument

for DoDecay()
parent b44993dd
No related branches found
No related tags found
1 merge request!254History
......@@ -265,7 +265,7 @@ namespace corsika::cascade {
interaction(vParticle, projectile);
} else {
assert(min_distance == distance_decay);
decay(vParticle, projectile);
decay(vParticle, secondaries);
// make sure particle actually did decay if it should have done so
if (secondaries.getSize() == 1 &&
projectile.GetPID() == secondaries.GetNextParticle().GetPID())
......@@ -314,7 +314,7 @@ namespace corsika::cascade {
}
auto decay(Particle& particle,
decltype(std::declval<TStackView>().GetProjectile()) projectile) {
TStackView& view) {
std::cout << "decay" << std::endl;
units::si::InverseTimeType const actual_decay_time =
fProcessSequence.GetTotalInverseLifetime(particle);
......
......@@ -22,7 +22,7 @@ using std::vector;
using namespace corsika;
using namespace corsika::setup;
using Projectile = corsika::setup::StackView::ParticleType;
using View = corsika::setup::StackView;
using Particle = corsika::setup::Stack::ParticleType;
using Track = Trajectory;
......@@ -184,21 +184,23 @@ namespace corsika::process::pythia {
}
template <>
void Decay::DoDecay(Projectile& vP) {
void Decay::DoDecay(View& view) {
using geometry::Point;
using namespace units;
using namespace units::si;
auto const& decayPoint = vP.GetPosition();
auto const t0 = vP.GetTime();
auto const projectile = view.GetProjectile();
auto const& labMomentum = vP.GetMomentum();
auto const& decayPoint = projectile.GetPosition();
auto const t0 = projectile.GetTime();
auto const& labMomentum = projectile.GetMomentum();
geometry::CoordinateSystem const& labCS = labMomentum.GetCoordinateSystem();
// define target kinematics in lab frame
// define boost to and from CoM frame
// CoM frame definition in Pythia projectile: +z
utl::COMBoost const boost(labMomentum, vP.GetMass());
utl::COMBoost const boost(labMomentum, projectile.GetMass());
auto const& rotatedCS = boost.GetRotatedCS();
fCount++;
......@@ -207,7 +209,7 @@ namespace corsika::process::pythia {
Pythia8::Event& event = fPythia.event;
event.reset();
auto const particleId = vP.GetPID();
auto const particleId = projectile.GetPID();
// set particle unstable
Decay::SetUnstable(particleId);
......@@ -218,7 +220,7 @@ namespace corsika::process::pythia {
double constexpr px = 0;
double constexpr py = 0;
double constexpr pz = 0;
double const en = vP.GetMass() / 1_GeV;
double const en = projectile.GetMass() / 1_GeV;
double const m = en;
// add particle to pythia stack
......@@ -248,7 +250,7 @@ namespace corsika::process::pythia {
<< fourMomLab.GetSpaceLikeComponents().GetComponents(labCS) / 1_GeV
<< " energy=" << fourMomLab.GetTimeLikeComponent() << endl;
vP.AddSecondary(
view.AddSecondary(
tuple<particles::Code, units::si::HEPEnergyType,
corsika::stack::MomentumVector, geometry::Point, units::si::TimeType>{
pyId, fourMomLab.GetTimeLikeComponent(),
......
......@@ -60,8 +60,8 @@ namespace corsika::process {
In this function PYTHIA is called to execute the decay of the input particle.
*/
template <typename TProjectile>
void DoDecay(TProjectile&);
template <typename TSecondaryView>
void DoDecay(TSecondaryView&);
private:
void SetUnstable(const corsika::particles::Code);
......
......@@ -176,10 +176,12 @@ namespace corsika::process::sibyll {
}
template <>
void Decay::DoDecay(SetupProjectile& vP) {
void Decay::DoDecay(SetupView& view) {
using geometry::Point;
using namespace units::si;
auto const projectile = view.GetProjectile();
const particles::Code pCode = vP.GetPID();
// check if sibyll is configured to handle this decay!
if (!IsDecayHandled(pCode))
......@@ -190,14 +192,14 @@ namespace corsika::process::sibyll {
ss.Clear();
// copy particle to sibyll stack
ss.AddParticle(process::sibyll::ConvertToSibyllRaw(pCode), vP.GetEnergy(),
vP.GetMomentum(),
ss.AddParticle(process::sibyll::ConvertToSibyllRaw(pCode), projectile.GetEnergy(),
projectile.GetMomentum(),
// setting particle mass with Corsika values, may be inconsistent
// with sibyll internal values
particles::GetMass(pCode));
// remember position
Point const decayPoint = vP.GetPosition();
TimeType const t0 = vP.GetTime();
Point const decayPoint = projectile.GetPosition();
TimeType const t0 = projectile.GetTime();
// remember if particles is unstable
// auto const priorIsUnstable = IsUnstable(pCode);
// switch on decay for this particle
......@@ -220,7 +222,7 @@ namespace corsika::process::sibyll {
// FOR NOW: skip particles that have decayed in Sibyll, move to iterator?
if (psib.HasDecayed()) continue;
// add to corsika stack
vP.AddSecondary(
view.AddSecondary(
tuple<particles::Code, units::si::HEPEnergyType, corsika::stack::MomentumVector,
geometry::Point, units::si::TimeType>{
process::sibyll::ConvertFromSibyll(psib.GetPID()), psib.GetEnergy(),
......
......@@ -52,8 +52,8 @@ namespace corsika::process {
In this function SIBYLL is called to produce to decay the input particle.
*/
template <typename TProjectile>
void DoDecay(TProjectile&);
template <typename TSecondaryView>
void DoDecay(TSecondaryView&);
template <typename TParticleView>
EProcessReturn DoSecondaries(TParticleView&);
......
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