diff --git a/projects/dataclasses/private/InteractionRecord.cxx b/projects/dataclasses/private/InteractionRecord.cxx index 3000d82b..51d5e2d7 100644 --- a/projects/dataclasses/private/InteractionRecord.cxx +++ b/projects/dataclasses/private/InteractionRecord.cxx @@ -21,6 +21,10 @@ ParticleID const & InteractionRecord::GetPrimaryID() const { return primary_id; } +ParticleType const & InteractionRecord::GetPrimaryType() const { + return signature.primary_type; +} + std::array const & InteractionRecord::GetPrimaryInitialPosition() const { return primary_initial_position; } diff --git a/projects/dataclasses/public/LeptonInjector/dataclasses/InteractionRecord.h b/projects/dataclasses/public/LeptonInjector/dataclasses/InteractionRecord.h index a489645e..bdeb1146 100644 --- a/projects/dataclasses/public/LeptonInjector/dataclasses/InteractionRecord.h +++ b/projects/dataclasses/public/LeptonInjector/dataclasses/InteractionRecord.h @@ -65,6 +65,7 @@ class InteractionRecord { Particle GetPrimary() const; ParticleID const & GetPrimaryID() const; + ParticleType const & GetPrimaryType() const; std::array const & GetPrimaryInitialPosition() const; double const & GetPrimaryMass() const; std::array const & GetPrimaryMomentum() const; diff --git a/projects/interactions/private/Decay.cxx b/projects/interactions/private/Decay.cxx index f9655667..7234649b 100644 --- a/projects/interactions/private/Decay.cxx +++ b/projects/interactions/private/Decay.cxx @@ -22,13 +22,15 @@ bool Decay::operator==(Decay const & other) const { double Decay::TotalDecayLength(dataclasses::InteractionRecord const & interaction) const { double tau = 1./TotalDecayWidth(interaction); // in inverse GeV - rk::P4 p1(geom3::Vector3(interaction.primary_momentum[1], interaction.primary_momentum[2], interaction.primary_momentum[3]), interaction.primary_mass); + std::array p4 = interaction.GetPrimaryMomentum(); + rk::P4 p1(geom3::Vector3(p4[1], p4[2], p4[3]), interaction.GetPrimaryMass()); return p1.beta() * p1.gamma() * tau * LI::utilities::Constants::hbarc; } double Decay::TotalDecayLengthForFinalState(dataclasses::InteractionRecord const & interaction) const { double tau = 1./TotalDecayWidthForFinalState(interaction); // in inverse GeV - rk::P4 p1(geom3::Vector3(interaction.primary_momentum[1], interaction.primary_momentum[2], interaction.primary_momentum[3]), interaction.primary_mass); + std::array p4 = interaction.GetPrimaryMomentum(); + rk::P4 p1(geom3::Vector3(p4[1], p4[2], p4[3]), interaction.GetPrimaryMass()); return p1.beta() * p1.gamma() * tau * LI::utilities::Constants::hbarc; } diff --git a/projects/interactions/private/InteractionCollection.cxx b/projects/interactions/private/InteractionCollection.cxx index 4747f8e0..2ce86bbe 100644 --- a/projects/interactions/private/InteractionCollection.cxx +++ b/projects/interactions/private/InteractionCollection.cxx @@ -95,7 +95,7 @@ double InteractionCollection::TotalDecayLength(dataclasses::InteractionRecord co } bool InteractionCollection::MatchesPrimary(dataclasses::InteractionRecord const & record) const { - return primary_type == record.signature.primary_type; + return primary_type == record.GetPrimaryType(); } } // namespace interactions diff --git a/projects/interactions/public/LeptonInjector/interactions/CrossSection.h b/projects/interactions/public/LeptonInjector/interactions/CrossSection.h index 6a1ea388..12c6afa3 100644 --- a/projects/interactions/public/LeptonInjector/interactions/CrossSection.h +++ b/projects/interactions/public/LeptonInjector/interactions/CrossSection.h @@ -16,7 +16,7 @@ #include "LeptonInjector/dataclasses/Particle.h" // for Particle -namespace LI { namespace dataclasses { struct InteractionRecord; } } +namespace LI { namespace dataclasses { class InteractionRecord; } } namespace LI { namespace dataclasses { struct InteractionSignature; } } namespace LI { namespace utilities { class LI_random; } } diff --git a/projects/interactions/public/LeptonInjector/interactions/Decay.h b/projects/interactions/public/LeptonInjector/interactions/Decay.h index c5d1de34..a42a6ec7 100644 --- a/projects/interactions/public/LeptonInjector/interactions/Decay.h +++ b/projects/interactions/public/LeptonInjector/interactions/Decay.h @@ -16,7 +16,7 @@ #include "LeptonInjector/dataclasses/Particle.h" // for Particle -namespace LI { namespace dataclasses { struct InteractionRecord; } } +namespace LI { namespace dataclasses { class InteractionRecord; } } namespace LI { namespace dataclasses { struct InteractionSignature; } } namespace LI { namespace utilities { class LI_random; } } diff --git a/projects/interactions/public/LeptonInjector/interactions/DipoleFromTable.h b/projects/interactions/public/LeptonInjector/interactions/DipoleFromTable.h index 1d57dafe..0d6d5b9e 100644 --- a/projects/interactions/public/LeptonInjector/interactions/DipoleFromTable.h +++ b/projects/interactions/public/LeptonInjector/interactions/DipoleFromTable.h @@ -23,7 +23,7 @@ #include "LeptonInjector/dataclasses/Particle.h" // for Particle #include "LeptonInjector/utilities/Interpolator.h" // for Interpolator1D -namespace LI { namespace dataclasses { struct InteractionRecord; } } +namespace LI { namespace dataclasses { class InteractionRecord; } } namespace LI { namespace dataclasses { struct InteractionSignature; } } namespace LI { namespace utilities { class LI_random; } } diff --git a/projects/interactions/public/LeptonInjector/interactions/InteractionCollection.h b/projects/interactions/public/LeptonInjector/interactions/InteractionCollection.h index ca57cf84..9c5278ea 100644 --- a/projects/interactions/public/LeptonInjector/interactions/InteractionCollection.h +++ b/projects/interactions/public/LeptonInjector/interactions/InteractionCollection.h @@ -27,7 +27,7 @@ namespace LI { namespace interactions { class CrossSection; } } namespace LI { namespace interactions { class Decay; } } -namespace LI { namespace dataclasses { struct InteractionRecord; } } +namespace LI { namespace dataclasses { class InteractionRecord; } } namespace LI { namespace interactions {