IAP GITLAB

Commit 2443b757 authored by Ralf Ulrich's avatar Ralf Ulrich

coding guidelines

parent 22db345d
......@@ -29,8 +29,8 @@ namespace corsika {
Vector<dimensionless_d> const& axis) const {
if (vL == LengthType::zero()) { return GrammageType::zero(); }
auto const uDotA = line.NormalizedDirection().dot(axis).magnitude();
auto const rhoStart = getImplementation().getMassDensity(line.getR0());
auto const uDotA = line.getNormalizedDirection().dot(axis).magnitude();
auto const rhoStart = getImplementation().getMassDensity(line.getStartPoint());
if (uDotA == 0) {
return vL * rhoStart;
......@@ -43,8 +43,8 @@ namespace corsika {
LengthType BaseExponential<TDerived>::getArclengthFromGrammage(
Trajectory<Line> const& line, GrammageType grammage,
Vector<dimensionless_d> const& axis) const {
auto const uDotA = line.NormalizedDirection().dot(axis).magnitude();
auto const rhoStart = getImplementation().getMassDensity(line.getR0());
auto const uDotA = line.getNormalizedDirection().dot(axis).magnitude();
auto const rhoStart = getImplementation().getMassDensity(line.getStartPoint());
if (uDotA == 0) {
return grammage / rhoStart;
......
......@@ -16,7 +16,7 @@ namespace corsika {
template <typename IEnvironmentModel>
Environment<IEnvironmentModel>::Environment()
: coordinateSystem_{RootCoordinateSystem::getInstance().GetRootCoordinateSystem()}
: coordinateSystem_{get_root_CoordinateSystem()}
, universe_(std::make_unique<BaseNodeType>(
std::make_unique<Universe>(coordinateSystem_))) {}
......@@ -31,7 +31,7 @@ namespace corsika {
}
template <typename IEnvironmentModel>
CoordinateSystem const& Environment<IEnvironmentModel>::getCoordinateSystem() const {
CoordinateSystemPtr const& Environment<IEnvironmentModel>::getCoordinateSystem() const {
return coordinateSystem_;
}
......@@ -39,9 +39,9 @@ namespace corsika {
template <typename IEnvironmentModel>
template <class TVolumeType, typename... TVolumeArgs>
std::unique_ptr< VolumeTreeNode<IEnvironmentModel> > Environment<IEnvironmentModel>::createNode(TVolumeArgs&&... args) {
static_assert(std::is_base_of_v<corsika::Volume, TVolumeType>,
static_assert(std::is_base_of_v<IVolume, TVolumeType>,
"unusable type provided, needs to be derived from "
"\"corsika::Volume\"");
"\"Volume\"");
return std::make_unique<BaseNodeType>(
std::make_unique<TVolumeType>(std::forward<TVolumeArgs>(args)...));
......
......@@ -23,7 +23,7 @@ namespace corsika {
FlatExponential<T>::FlatExponential(Point const& point,
Vector<dimensionless_d> const& axis,
MassDensityType rho, LengthType lambda,
NuclearComposition nuclComp)
NuclearComposition const& nuclComp)
: BaseExponential<FlatExponential<T>>(point, rho, lambda)
, axis_(axis)
, nuclComp_(nuclComp) {}
......
......@@ -18,7 +18,7 @@ namespace corsika {
template <typename T>
HomogeneousMedium<T>::HomogeneousMedium(MassDensityType density,
NuclearComposition nuclComp)
NuclearComposition const& nuclComp)
: density_(density)
, nuclComp_(nuclComp) {}
......@@ -32,14 +32,14 @@ namespace corsika {
}
template <typename T>
GrammageType HomogeneousMedium<T>::integratedGrammage(
Trajectory<Line> const&, LengthType to) const {
GrammageType HomogeneousMedium<T>::getIntegratedGrammage(Trajectory<Line> const&,
LengthType to) const {
return to * density_;
}
template <typename T>
LengthType HomogeneousMedium<T>::getArclengthFromGrammage(
Trajectory<Line> const&, GrammageType grammage) const {
LengthType HomogeneousMedium<T>::getArclengthFromGrammage(Trajectory<Line> const&,
GrammageType grammage) const {
return grammage / density_;
}
} // namespace corsika
......@@ -43,7 +43,7 @@ namespace corsika {
auto const rho0 = b / c;
CORSIKA_LOG_INFO("rho0 = {}, c = {}", rho0, c);
node->SetModelProperties<SlidingPlanarExponential<IMediumModel>>(
node->setModelProperties<SlidingPlanarExponential<IMediumModel>>(
center_, rho0, -c, *composition_, seaLevel_);
layers_.push(std::move(node));
......@@ -62,7 +62,7 @@ namespace corsika {
auto node = std::make_unique<VolumeTreeNode<IMediumModel>>(
std::make_unique<Sphere>(center_, radius));
node->SetModelProperties<HomogeneousMedium<IMediumModel>>(rho0, *composition_);
node->setModelProperties<HomogeneousMedium<IMediumModel>>(rho0, *composition_);
layers_.push(std::move(node));
}
......@@ -80,7 +80,7 @@ namespace corsika {
while (!layers_.empty()) {
auto l = std::move(layers_.top());
auto* tmp = l.get();
outmost->AddChild(std::move(l));
outmost->addChild(std::move(l));
layers_.pop();
outmost = tmp;
}
......
......@@ -20,20 +20,20 @@ namespace corsika {
}
template <typename TDerived>
auto LinearApproximationIntegrator<TDerived>::integrateGrammage(
auto LinearApproximationIntegrator<TDerived>::getIntegrateGrammage(
Trajectory<Line> const& line, LengthType length) const {
auto const c0 = getImplementation().evaluateAt(line.getPosition(0));
auto const c1 = getImplementation().rho_.FirstDerivative(line.getPosition(0),
line.NormalizedDirection());
auto const c1 = getImplementation().rho_.getFirstDerivative(
line.getPosition(0), line.getNormalizedDirection());
return (c0 + 0.5 * c1 * length) * length;
}
template <typename TDerived>
auto LinearApproximationIntegrator<TDerived>::getArclengthFromGrammage(
Trajectory<Line> const& line, GrammageType grammage) const {
auto const c0 = getImplementation().rho_(line.GetPosition(0));
auto const c1 = getImplementation().rho_.FirstDerivative(line.GetPosition(0),
line.NormalizedDirection());
auto const c0 = getImplementation().rho_(line.getPosition(0));
auto const c1 = getImplementation().rho_.getFirstDerivative(
line.getPosition(0), line.getNormalizedDirection());
return (1 - 0.5 * grammage * c1 / (c0 * c0)) * grammage / c0;
}
......@@ -41,8 +41,8 @@ namespace corsika {
template <typename TDerived>
auto LinearApproximationIntegrator<TDerived>::getMaximumLength(
Trajectory<Line> const& line, [[maybe_unused]] double relError) const {
[[maybe_unused]] auto const c1 = getImplementation().rho_.SecondDerivative(
line.getPosition(0), line.NormalizedDirection());
[[maybe_unused]] auto const c1 = getImplementation().rho_.getSecondDerivative(
line.getPosition(0), line.getNormalizedDirection());
// todo: provide a real, working implementation
return 1_m * std::numeric_limits<double>::infinity();
......
......@@ -11,6 +11,8 @@
#include <corsika/framework/core/ParticleProperties.hpp>
#include <corsika/framework/core/PhysicalUnits.hpp>
#include <corsika/media/WeightProvider.hpp>
#include <cassert>
#include <functional>
#include <numeric>
......@@ -20,44 +22,6 @@
namespace corsika {
template <class AConstIterator, class BConstIterator>
NuclearComposition::WeightProviderIterator<
AConstIterator, BConstIterator>::WeightProviderIterator(AConstIterator a,
BConstIterator b)
: aIter_(a)
, bIter_(b) {}
template <class AConstIterator, class BConstIterator>
typename NuclearComposition::WeightProviderIterator<AConstIterator,
BConstIterator>::value_type
NuclearComposition::WeightProviderIterator<AConstIterator, BConstIterator>::operator*()
const {
return ((*aIter_) * (*bIter_)).magnitude();
}
template <class AConstIterator, class BConstIterator>
NuclearComposition::WeightProviderIterator<AConstIterator, BConstIterator>&
NuclearComposition::WeightProviderIterator<AConstIterator,
BConstIterator>::operator++() { // prefix ++
++aIter_;
++bIter_;
return *this;
}
template <class AConstIterator, class BConstIterator>
auto
NuclearComposition::WeightProviderIterator<AConstIterator, BConstIterator>::operator==(
WeightProviderIterator other) {
return aIter_ == other.aIter_;
}
template <class AConstIterator, class BConstIterator>
auto
NuclearComposition::WeightProviderIterator<AConstIterator, BConstIterator>::operator!=(
WeightProviderIterator other) {
return !(*this == other);
}
NuclearComposition::NuclearComposition(std::vector<corsika::Code> const& pComponents,
std::vector<float> const& pFractions)
: numberFractions_(pFractions)
......@@ -68,8 +32,7 @@ namespace corsika {
if (is_nucleus(compID)) {
return get_nucleus_A(compID) * fraction;
} else {
return get_mass(compID) / ConvertSIToHEP(constants::u) *
fraction;
return get_mass(compID) / convert_SI_to_HEP(constants::u) * fraction;
}
})) {
assert(pComponents.size() == pFractions.size());
......@@ -83,7 +46,7 @@ namespace corsika {
}
template <typename TFunction>
auto NuclearComposition::weightedSum(TFunction const& func) const {
double NuclearComposition::getWeightedSum(TFunction const& func) const {
using ResultQuantity = decltype(func(*components_.cbegin()));
auto const prod = [&](auto const compID, auto const fraction) {
......@@ -103,17 +66,17 @@ namespace corsika {
}
}
auto NuclearComposition::size() const { return numberFractions_.size(); }
size_t NuclearComposition::getSize() const { return numberFractions_.size(); }
std::vector<float> const& NuclearComposition::getFractions() const {
return numberFractions_;
}
std::vector<corsika::Code> const& NuclearComposition::getComponents() const {
return components_;
}
auto const NuclearComposition::getAverageMassNumber() const { return avgMassNumber_; }
double const NuclearComposition::getAverageMassNumber() const { return avgMassNumber_; }
template <class TRNG>
corsika::Code NuclearComposition::sampleTarget(
......@@ -135,7 +98,7 @@ namespace corsika {
// Note: when this class ever modifies its internal data, the hash
// must be updated, too!
size_t NuclearComposition::hash() const { return hash_; }
size_t NuclearComposition::getHash() const { return hash_; }
void NuclearComposition::updateHash() {
std::vector<std::size_t> hashes;
......
......@@ -78,10 +78,10 @@ namespace corsika {
assert(0 <= lambda && lambda <= 1.);
CORSIKA_LOG_TRACE("ShowerAxis::X l={} m, lower={}, lambda={}, upper={}", l / 1_m,
CORSIKA_LOG_TRACE("ShowerAxis::getX l={} m, lower={}, lambda={}, upper={}", l / 1_m,
lower, lambda, upper);
// linear interpolation between X[lower] and X[upper]
// linear interpolation between getX[lower] and X[upper]
return X_[upper] * lambda + X_[lower] * (1 - lambda);
}
......@@ -91,12 +91,12 @@ namespace corsika {
GrammageType ShowerAxis::getMinimumX() const { return GrammageType::zero(); }
GrammageType ShowerAxis::projectedX(Point const& p) const {
GrammageType ShowerAxis::getProjectedX(Point const& p) const {
auto const projectedLength = (p - pointStart_).dot(axis_normalized_);
return X(projectedLength);
return getX(projectedLength);
}
corsika::Vector<dimensionless_d> const& ShowerAxis::getDirection() const {
Vector<dimensionless_d> const& ShowerAxis::getDirection() const {
return axis_normalized_;
}
......
......@@ -17,16 +17,15 @@ namespace corsika {
template <typename T>
SlidingPlanarExponential<T>::SlidingPlanarExponential(
Point const& p0, MassDensityType rho0, LengthType lambda,
NuclearComposition nuclComp, LengthType referenceHeight)
NuclearComposition const& nuclComp, LengthType referenceHeight)
: BaseExponential<SlidingPlanarExponential<T>>(p0, rho0, lambda)
, nuclComp_(nuclComp)
, referenceHeight_(referenceHeight) {}
template <typename T>
MassDensityType SlidingPlanarExponential<T>::getMassDensity(
Point const& point) const {
MassDensityType SlidingPlanarExponential<T>::getMassDensity(Point const& point) const {
auto const height =
(point - BaseExponential<SlidingPlanarExponential<T>>::point_).norm() -
(point - BaseExponential<SlidingPlanarExponential<T>>::point_).getNorm() -
referenceHeight_;
return BaseExponential<SlidingPlanarExponential<T>>::rho0_ *
exp(BaseExponential<SlidingPlanarExponential<T>>::invLambda_ * height);
......@@ -38,20 +37,22 @@ namespace corsika {
}
template <typename T>
GrammageType SlidingPlanarExponential<T>::integratedGrammage(
GrammageType SlidingPlanarExponential<T>::getIntegratedGrammage(
Trajectory<Line> const& line, LengthType l) const {
auto const axis =
(line.getR0() - BaseExponential<SlidingPlanarExponential<T>>::point_).normalized();
return BaseExponential<SlidingPlanarExponential<T>>::integratedGrammage(line, l,
axis);
(line.getStartPoint() - BaseExponential<SlidingPlanarExponential<T>>::point_)
.normalized();
return BaseExponential<SlidingPlanarExponential<T>>::getIntegratedGrammage(line, l,
axis);
}
template <typename T>
LengthType SlidingPlanarExponential<T>::arclengthFromGrammage(
LengthType SlidingPlanarExponential<T>::getArclengthFromGrammage(
Trajectory<Line> const& line, GrammageType const grammage) const {
auto const axis =
(line.getR0() - BaseExponential<SlidingPlanarExponential<T>>::point_).normalized();
return BaseExponential<SlidingPlanarExponential<T>>::arclengthFromGrammage(
(line.getStartPoint() - BaseExponential<SlidingPlanarExponential<T>>::point_)
.normalized();
return BaseExponential<SlidingPlanarExponential<T>>::getArclengthFromGrammage(
line, grammage, axis);
}
......
......@@ -14,10 +14,10 @@
namespace corsika {
Universe::Universe(corsika::CoordinateSystem const& pCS)
: corsika::Sphere(corsika::Point{pCS, 0 * meter, 0 * meter, 0 * meter},
Universe::Universe(CoordinateSystemPtr const& pCS)
: corsika::Sphere(Point{pCS, 0 * meter, 0 * meter, 0 * meter},
meter * std::numeric_limits<double>::infinity()) {}
bool Universe::Contains(corsika::Point const&) const { return true; }
bool Universe::isInside(corsika::Point const&) const { return true; }
} // namespace corsika
\ No newline at end of file
......@@ -15,20 +15,20 @@
namespace corsika {
//! convenience function equivalent to Volume::Contains
//! convenience function equivalent to Volume::isInside
template <typename IModelProperties>
bool VolumeTreeNode<IModelProperties>::Contains(corsika::Point const& p) const {
return fGeoVolume->Contains(p);
bool VolumeTreeNode<IModelProperties>::isInside(Point const& p) const {
return geoVolume_->isInside(p);
}
template <typename IModelProperties>
inline VolumeTreeNode<IModelProperties> const*
VolumeTreeNode<IModelProperties>::Excludes(corsika::Point const& p) const {
VolumeTreeNode<IModelProperties>::isExcluded(Point const& p) const {
auto exclContainsIter =
std::find_if(fExcludedNodes.cbegin(), fExcludedNodes.cend(),
[&](auto const& s) { return bool(s->Contains(p)); });
std::find_if(excludedNodes_.cbegin(), excludedNodes_.cend(),
[&](auto const& s) { return bool(s->isInside(p)); });
return exclContainsIter != fExcludedNodes.cend() ? *exclContainsIter : nullptr;
return exclContainsIter != excludedNodes_.cend() ? *exclContainsIter : nullptr;
}
/** returns a pointer to the sub-VolumeTreeNode which is "responsible" for the given
......@@ -36,22 +36,22 @@ namespace corsika {
*/
template <typename IModelProperties>
VolumeTreeNode<IModelProperties> const*
VolumeTreeNode<IModelProperties>::GetContainingNode(corsika::Point const& p) const {
if (!Contains(p)) { return nullptr; }
VolumeTreeNode<IModelProperties>::getContainingNode(Point const& p) const {
if (!isInside(p)) { return nullptr; }
if (auto const childContainsIter =
std::find_if(fChildNodes.cbegin(), fChildNodes.cend(),
[&](auto const& s) { return bool(s->Contains(p)); });
childContainsIter == fChildNodes.cend()) // not contained in any of the children
std::find_if(childNodes_.cbegin(), childNodes_.cend(),
[&](auto const& s) { return bool(s->isInside(p)); });
childContainsIter == childNodes_.cend()) // not contained in any of the children
{
if (auto const exclContainsIter = Excludes(p)) // contained in any excluded nodes
if (auto const exclContainsIter = isExcluded(p)) // contained in any excluded nodes
{
return exclContainsIter->GetContainingNode(p);
return exclContainsIter->getContainingNode(p);
} else {
return this;
}
} else {
return (*childContainsIter)->GetContainingNode(p);
return (*childContainsIter)->getContainingNode(p);
}
}
......@@ -60,29 +60,31 @@ namespace corsika {
void VolumeTreeNode<IModelProperties>::walk(TCallable func) {
if constexpr (preorder) { func(*this); }
std::for_each(fChildNodes.begin(), fChildNodes.end(),
std::for_each(childNodes_.begin(), childNodes_.end(),
[&](auto& v) { v->walk(func); });
if constexpr (!preorder) { func(*this); };
}
template <typename IModelProperties>
void VolumeTreeNode<IModelProperties>::AddChild(typename VolumeTreeNode<IModelProperties>::VTNUPtr pChild) {
pChild->fParentNode = this;
fChildNodes.push_back(std::move(pChild));
void VolumeTreeNode<IModelProperties>::addChild(
typename VolumeTreeNode<IModelProperties>::VTNUPtr pChild) {
pChild->parentNode_ = this;
childNodes_.push_back(std::move(pChild));
// It is a bad idea to return an iterator to the inserted element
// because it might get invalidated when the vector needs to grow
// later and the caller won't notice.
}
template <typename IModelProperties>
void VolumeTreeNode<IModelProperties>::ExcludeOverlapWith(typename VolumeTreeNode<IModelProperties>::VTNUPtr const& pNode) {
fExcludedNodes.push_back(pNode.get());
void VolumeTreeNode<IModelProperties>::excludeOverlapWith(
typename VolumeTreeNode<IModelProperties>::VTNUPtr const& pNode) {
excludedNodes_.push_back(pNode.get());
}
template <typename IModelProperties>
template <class MediumType, typename... Args>
auto VolumeTreeNode<IModelProperties>::CreateMedium(Args&&... args) {
auto VolumeTreeNode<IModelProperties>::createMedium(Args&&... args) {
static_assert(std::is_base_of_v<IMediumModel, MediumType>,
"unusable type provided, needs to be derived from \"IMediumModel\"");
......
......@@ -161,7 +161,7 @@ namespace corsika::energy_loss {
if (p.GetChargeNumber() == 0) return corsika::EProcessReturn::eOk;
GrammageType const dX =
p.GetNode()->GetModelProperties().integratedGrammage(t, t.GetLength());
p.GetNode()->GetModelProperties().getIntegratedGrammage(t, t.GetLength());
std::cout << "BetheBlochPDG " << p.GetPID() << ", z=" << p.GetChargeNumber()
<< ", dX=" << dX / 1_g * square(1_cm) << "g/cm2" << std::endl;
HEPEnergyType dE = TotalEnergyLoss(p, dX);
......@@ -196,8 +196,9 @@ namespace corsika::energy_loss {
auto const maxLoss = 0.01 * vParticle.GetEnergy();
auto const maxGrammage = maxLoss / dE * dX;
return vParticle.GetNode()->GetModelProperties().arclengthFromGrammage(vTrack,
maxGrammage) *
return vParticle.GetNode()->GetModelProperties().getArclengthFromGrammage(
vTrack,
maxGrammage) *
1.0001; // to make sure particle gets absorbed when DoContinuous() is called
}
......@@ -223,11 +224,11 @@ namespace corsika::energy_loss {
SetupTrack const trajToEndBin(lineToEndBin, 1_s);
GrammageType const grammageStart =
vP.GetNode()->GetModelProperties().integratedGrammage(trajToStartBin,
trajToStartBin.GetLength());
vP.GetNode()->GetModelProperties().getIntegratedGrammage(
trajToStartBin, trajToStartBin.GetLength());
GrammageType const grammageEnd =
vP.GetNode()->GetModelProperties().integratedGrammage(trajToEndBin,
trajToEndBin.GetLength());
vP.GetNode()->GetModelProperties().getIntegratedGrammage(
trajToEndBin, trajToEndBin.GetLength());
const int binStart = grammageStart / dX_;
const int binEnd = grammageEnd / dX_;
......
......@@ -46,7 +46,7 @@ namespace corsika {
* \f]
*/
// clang-format on
units::si::GrammageType integratedGrammage(
units::si::GrammageType getIntegratedGrammage(
Trajectory<Line> const& line, units::si::LengthType vL,
Vector<units::si::dimensionless_d> const& axis) const;
......@@ -68,7 +68,7 @@ namespace corsika {
* \f]
*/
// clang-format on
units::si::LengthType arclengthFromGrammage(
units::si::LengthType getArclengthFromGrammage(
Trajectory<Line> const& line, units::si::GrammageType grammage,
Vector<units::si::dimensionless_d> const& axis) const;
......@@ -78,6 +78,6 @@ namespace corsika {
}; // class BaseExponential
} // namespace corsika
} // namespace corsika
#include <corsika/detail/media/BaseExponential.inl>
......@@ -45,7 +45,7 @@ namespace corsika {
*
* @retval Retuns a const reference to the CoordinateSystem used
**/
CoordinateSystem const& getCoordinateSystem() const;
CoordinateSystemPtr const& getCoordinateSystem() const;
/** Factory method for creation of VolumeTreeNodes
* @tparam TVolumeType Type of volume to be created
......@@ -57,7 +57,7 @@ namespace corsika {
static std::unique_ptr<BaseNodeType> createNode(TVolumeArgs&&... args);
private:
CoordinateSystem const& coordinateSystem_;
CoordinateSystemPtr const coordinateSystem_;
typename BaseNodeType::VTNUPtr universe_;
};
......
......@@ -30,25 +30,24 @@ namespace corsika {
// clang-format on
template <typename T>
class FlatExponential : public BaseExponential<FlatExponential<T>>, public T {
Vector<units::si::dimensionless_d> const axis_;
Vector<dimensionless_d> const axis_;
NuclearComposition const nuclComp_;
using Base = BaseExponential<FlatExponential<T>>;
public:
FlatExponential(Point const& point, Vector<units::si::dimensionless_d> const& axis,
units::si::MassDensityType rho, units::si::LengthType lambda,
NuclearComposition nuclComp);
FlatExponential(Point const& point, Vector<dimensionless_d> const& axis,
MassDensityType rho, LengthType lambda,
NuclearComposition const& nuclComp);
units::si::MassDensityType getMassDensity(Point const& point) const override;
MassDensityType getMassDensity(Point const& point) const override;
NuclearComposition const& getNuclearComposition() const override;
units::si::GrammageType integratedGrammage(Trajectory<Line> const& line,
units::si::LengthType to) const;
GrammageType getIntegratedGrammage(Trajectory<Line> const& line, LengthType to) const;
units::si::LengthType arclengthFromGrammage(Trajectory<Line> const& line,
units::si::GrammageType grammage) const;
LengthType getArclengthFromGrammage(Trajectory<Line> const& line,
GrammageType grammage) const;
};
} // namespace corsika
......
......@@ -22,23 +22,23 @@ namespace corsika {
template <typename T>
class HomogeneousMedium : public T {
units::si::MassDensityType const density_;
NuclearComposition const nuclComp_;
public:
HomogeneousMedium(units::si::MassDensityType density, NuclearComposition nuclComp);
HomogeneousMedium(MassDensityType density, NuclearComposition const& nuclComp);
units::si::MassDensityType getMassDensity(Point const&) const override;
MassDensityType getMassDensity(Point const&) const override;
NuclearComposition const& getNuclearComposition() const override;
units::si::GrammageType integratedGrammage(
Trajectory<Line> const&,
units::si::LengthType to) const override;
GrammageType getIntegratedGrammage(Trajectory<Line> const&,
LengthType to) const override;
units::si::LengthType arclengthFromGrammage(
Trajectory<Line> const&,
units::si::GrammageType grammage) const override;
LengthType getArclengthFromGrammage(Trajectory<Line> const&,
GrammageType grammage) const override;
private:
MassDensityType const density_;
NuclearComposition const nuclComp_;
};
} // namespace corsika
......
......@@ -25,7 +25,7 @@ namespace corsika {
// a type-alias for a magnetic field vector
using MagneticFieldVector =
corsika::geometry::Vector<corsika::phys::units::si::magnetic_flux_density_d>;
Vector<magnetic_flux_density_d>;
public:
/**
......@@ -34,7 +34,7 @@ namespace corsika {
* @param point The location to evaluate the field at.
* @returns The magnetic field vector at that point.
*/
virtual auto getMagneticField(corsika::geometry::Point const&) const
virtual auto getMagneticField(Point const&) const
-> MagneticFieldVector = 0;
/**
......
......@@ -20,15 +20,15 @@ namespace corsika {
public:
virtual ~IMediumModel() = default; // LCOV_EXCL_LINE
virtual units::si::MassDensityType getMassDensity(Point const&) const = 0;
virtual MassDensityType getMassDensity(Point const&) const = 0;
// todo: think about the mixin inheritance of the trajectory vs the BaseTrajectory
// approach; for now, only lines are supported
virtual units::si::GrammageType integratedGrammage(
Trajectory<Line> const&, units::si::LengthType) const = 0;
virtual GrammageType getIntegratedGrammage(Trajectory<Line> const&,
LengthType) const = 0;
virtual units::si::LengthType arclengthFromGrammage(
Trajectory<Line> const&, units::si::GrammageType) const = 0;
virtual LengthType getArclengthFromGrammage(Trajectory<Line> const&,
GrammageType) const = 0;
virtual NuclearComposition const& getNuclearComposition() const = 0;
};
......
......@@ -23,22 +23,24 @@ namespace corsika {
template <typename T, typename TDensityFunction>
class InhomogeneousMedium : public T {
NuclearComposition const nuclComp_;
TDensityFunction const densityFunction_;
public:
template <typename... TArgs>