Skip to content

Commit

Permalink
Fix access to private members
Browse files Browse the repository at this point in the history
  • Loading branch information
austinschneider committed Feb 4, 2024
1 parent 162a283 commit e156a48
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions projects/dataclasses/private/InteractionRecord.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ ParticleID const & InteractionRecord::GetPrimaryID() const {
return primary_id;
}

ParticleType const & InteractionRecord::GetPrimaryType() const {
return signature.primary_type;
}

std::array<double, 3> const & InteractionRecord::GetPrimaryInitialPosition() const {
return primary_initial_position;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class InteractionRecord {

Particle GetPrimary() const;
ParticleID const & GetPrimaryID() const;
ParticleType const & GetPrimaryType() const;
std::array<double, 3> const & GetPrimaryInitialPosition() const;
double const & GetPrimaryMass() const;
std::array<double, 4> const & GetPrimaryMomentum() const;
Expand Down
6 changes: 4 additions & 2 deletions projects/interactions/private/Decay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<double, 4> 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<double, 4> 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;
}

Expand Down
2 changes: 1 addition & 1 deletion projects/interactions/private/InteractionCollection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e156a48

Please sign in to comment.