IAP GITLAB

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

included changes from master

parent e8d59b1d
No related branches found
No related tags found
No related merge requests found
Showing
with 138 additions and 143 deletions
...@@ -118,13 +118,13 @@ public: ...@@ -118,13 +118,13 @@ public:
} }
template <typename Particle> template <typename Particle>
double MaxStepLength(Particle& p, setup::Trajectory&) const { LengthType MaxStepLength(Particle& p, setup::Trajectory&) const {
const Code pid = p.GetPID(); const Code pid = p.GetPID();
if (isEmParticle(pid) || isInvisible(pid)) { if (isEmParticle(pid) || isInvisible(pid)) {
cout << "ProcessCut: MinStep: next cut: " << 0. << endl; cout << "ProcessCut: MinStep: next cut: " << 0. << endl;
return 0.; return 0_m;
} else { } else {
double next_step = std::numeric_limits<double>::infinity(); LengthType next_step = 1_m * std::numeric_limits<double>::infinity();
cout << "ProcessCut: MinStep: next cut: " << next_step << endl; cout << "ProcessCut: MinStep: next cut: " << next_step << endl;
return next_step; return next_step;
} }
...@@ -199,9 +199,9 @@ private: ...@@ -199,9 +199,9 @@ private:
}; };
int main() { int main() {
corsika::random::RNGManager::GetInstance().RegisterRandomStream("cascade"); corsika::random::RNGManager::GetInstance().RegisterRandomStream("cascade");
corsika::environment::Environment env; // dummy environment corsika::environment::Environment env; // dummy environment
auto& universe = *(env.GetUniverse()); auto& universe = *(env.GetUniverse());
...@@ -219,22 +219,17 @@ int main() { ...@@ -219,22 +219,17 @@ int main() {
universe.AddChild(std::move(theMedium)); universe.AddChild(std::move(theMedium));
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
tracking_line::TrackingLine<setup::Stack> tracking(env); tracking_line::TrackingLine<setup::Stack> tracking(env);
stack_inspector::StackInspector<setup::Stack> p0(true); stack_inspector::StackInspector<setup::Stack> p0(true);
<<<<<<< HEAD
corsika::process::sibyll::Interaction /*<setup::Stack>,setup::Trajectory>*/ p1;
corsika::process::sibyll::Decay p2;
ProcessEMCut p3;
const auto sequence = /*p0 +*/ p1 + p2 + p3;
=======
corsika::process::sibyll::Interaction sibyll; corsika::process::sibyll::Interaction sibyll;
corsika::process::sibyll::Decay decay; corsika::process::sibyll::Decay decay;
ProcessEMCut cut; ProcessEMCut cut;
const auto sequence = /*p0 +*/ sibyll + decay + cut; const auto sequence = /*p0 +*/ sibyll + decay + cut;
>>>>>>> master
setup::Stack stack; setup::Stack stack;
corsika::cascade::Cascade EAS(env, tracking, sequence, stack); corsika::cascade::Cascade EAS(env, tracking, sequence, stack);
......
...@@ -35,8 +35,9 @@ namespace corsika::environment { ...@@ -35,8 +35,9 @@ namespace corsika::environment {
class Environment { class Environment {
public: public:
Environment() Environment()
: fCoordinateSystem{corsika::geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem()}, : fCoordinateSystem{corsika::geometry::RootCoordinateSystem::GetInstance()
fUniverse(std::make_unique<VolumeTreeNode<IEnvironmentModel>>( .GetRootCoordinateSystem()}
, fUniverse(std::make_unique<VolumeTreeNode<IEnvironmentModel>>(
std::make_unique<Universe>(fCoordinateSystem))) {} std::make_unique<Universe>(fCoordinateSystem))) {}
using IEnvironmentModel = corsika::setup::IEnvironmentModel; using IEnvironmentModel = corsika::setup::IEnvironmentModel;
......
...@@ -117,7 +117,8 @@ TEST_CASE("Cascade", "[Cascade]") { ...@@ -117,7 +117,8 @@ TEST_CASE("Cascade", "[Cascade]") {
setup::Stack stack; setup::Stack stack;
corsika::cascade::Cascade EAS(env, tracking, sequence, stack); corsika::cascade::Cascade EAS(env, tracking, sequence, stack);
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCS(); CoordinateSystem const& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
stack.Clear(); stack.Clear();
auto particle = stack.NewParticle(); auto particle = stack.NewParticle();
......
...@@ -22,7 +22,9 @@ namespace corsika::geometry { ...@@ -22,7 +22,9 @@ namespace corsika::geometry {
public: public:
corsika::geometry::CoordinateSystem& GetRootCoordinateSystem() { return fRootCS; } corsika::geometry::CoordinateSystem& GetRootCoordinateSystem() { return fRootCS; }
const corsika::geometry::CoordinateSystem& GetRootCoordinateSystem() const { return fRootCS; } const corsika::geometry::CoordinateSystem& GetRootCoordinateSystem() const {
return fRootCS;
}
private: private:
corsika::geometry::CoordinateSystem fRootCS; // THIS IS IT corsika::geometry::CoordinateSystem fRootCS; // THIS IS IT
......
...@@ -29,7 +29,8 @@ using namespace corsika::units::si; ...@@ -29,7 +29,8 @@ using namespace corsika::units::si;
double constexpr absMargin = 1.0e-8; double constexpr absMargin = 1.0e-8;
TEST_CASE("transformations between CoordinateSystems") { TEST_CASE("transformations between CoordinateSystems") {
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
REQUIRE(CoordinateSystem::GetTransformation(rootCS, rootCS) REQUIRE(CoordinateSystem::GetTransformation(rootCS, rootCS)
.isApprox(EigenTransform::Identity())); .isApprox(EigenTransform::Identity()));
...@@ -128,7 +129,8 @@ TEST_CASE("transformations between CoordinateSystems") { ...@@ -128,7 +129,8 @@ TEST_CASE("transformations between CoordinateSystems") {
} }
TEST_CASE("Sphere") { TEST_CASE("Sphere") {
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
Point center(rootCS, {0_m, 3_m, 4_m}); Point center(rootCS, {0_m, 3_m, 4_m});
Sphere sphere(center, 5_m); Sphere sphere(center, 5_m);
...@@ -147,7 +149,8 @@ TEST_CASE("Sphere") { ...@@ -147,7 +149,8 @@ TEST_CASE("Sphere") {
} }
TEST_CASE("Trajectories") { TEST_CASE("Trajectories") {
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
Point r0(rootCS, {0_m, 0_m, 0_m}); Point r0(rootCS, {0_m, 0_m, 0_m});
SECTION("Line") { SECTION("Line") {
......
...@@ -54,7 +54,7 @@ namespace corsika::particles { ...@@ -54,7 +54,7 @@ namespace corsika::particles {
bool constexpr IsNucleus(Code const); bool constexpr IsNucleus(Code const);
int constexpr GetNucleusA(Code const); int constexpr GetNucleusA(Code const);
int constexpr GetNucleusZ(Code const); int constexpr GetNucleusZ(Code const);
#include <corsika/particles/GeneratedParticleProperties.inc> #include <corsika/particles/GeneratedParticleProperties.inc>
/*! /*!
...@@ -84,7 +84,8 @@ namespace corsika::particles { ...@@ -84,7 +84,8 @@ namespace corsika::particles {
} }
corsika::units::si::TimeType constexpr GetLifetime(Code const p) { corsika::units::si::TimeType constexpr GetLifetime(Code const p) {
return detail::lifetime[static_cast<CodeIntType const>(p)] * corsika::units::si::second; return detail::lifetime[static_cast<CodeIntType const>(p)] *
corsika::units::si::second;
} }
bool constexpr IsNucleus(Code const p) { bool constexpr IsNucleus(Code const p) {
...@@ -92,14 +93,13 @@ namespace corsika::particles { ...@@ -92,14 +93,13 @@ namespace corsika::particles {
} }
int constexpr GetNucleusA(Code const p) { int constexpr GetNucleusA(Code const p) {
return detail::nucleusA[static_cast<CodeIntType const>(p)]; return detail::nucleusA[static_cast<CodeIntType const>(p)];
} }
int constexpr GetNucleusZ(Code const p) { int constexpr GetNucleusZ(Code const p) {
return detail::nucleusZ[static_cast<CodeIntType const>(p)]; return detail::nucleusZ[static_cast<CodeIntType const>(p)];
} }
namespace io { namespace io {
std::ostream& operator<<(std::ostream& stream, Code const p); std::ostream& operator<<(std::ostream& stream, Code const p);
......
...@@ -58,12 +58,12 @@ TEST_CASE("ParticleProperties", "[Particles]") { ...@@ -58,12 +58,12 @@ TEST_CASE("ParticleProperties", "[Particles]") {
REQUIRE(GetLifetime(Code::Electron) == REQUIRE(GetLifetime(Code::Electron) ==
std::numeric_limits<double>::infinity() * corsika::units::si::second); std::numeric_limits<double>::infinity() * corsika::units::si::second);
REQUIRE(GetLifetime(Code::DPlus) < GetLifetime(Code::Gamma)); REQUIRE(GetLifetime(Code::DPlus) < GetLifetime(Code::Gamma));
REQUIRE(GetLifetime(Code::RhoPlus)/corsika::units::si::second == REQUIRE(GetLifetime(Code::RhoPlus) / corsika::units::si::second ==
(Approx(4.414566727909413e-24).epsilon(1e-3))); (Approx(4.414566727909413e-24).epsilon(1e-3)));
REQUIRE(GetLifetime(Code::SigmaMinusBar)/corsika::units::si::second == REQUIRE(GetLifetime(Code::SigmaMinusBar) / corsika::units::si::second ==
(Approx(8.018880848563575e-11).epsilon(1e-5))); (Approx(8.018880848563575e-11).epsilon(1e-5)));
REQUIRE(GetLifetime(Code::MuPlus)/corsika::units::si::second == REQUIRE(GetLifetime(Code::MuPlus) / corsika::units::si::second ==
(Approx(2.1970332555864364e-06).epsilon(1e-5))); (Approx(2.1970332555864364e-06).epsilon(1e-5)));
} }
SECTION("Nuclei") { SECTION("Nuclei") {
...@@ -78,8 +78,5 @@ TEST_CASE("ParticleProperties", "[Particles]") { ...@@ -78,8 +78,5 @@ TEST_CASE("ParticleProperties", "[Particles]") {
REQUIRE(GetNucleusA(Code::Tritium) == 3); REQUIRE(GetNucleusA(Code::Tritium) == 3);
REQUIRE(Hydrogen::GetNucleusZ() == 1); REQUIRE(Hydrogen::GetNucleusZ() == 1);
REQUIRE(Tritium::GetNucleusA() == 3); REQUIRE(Tritium::GetNucleusA() == 3);
} }
} }
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <corsika/process/null_model/NullModel.h> #include <corsika/process/null_model/NullModel.h>
#include <corsika/logging/Logger.h> #include <corsika/logging/Logger.h>
#include <corsika/setup/SetupTrajectory.h> #include <corsika/setup/SetupTrajectory.h>
...@@ -31,7 +30,7 @@ NullModel<Stack>::~NullModel() {} ...@@ -31,7 +30,7 @@ NullModel<Stack>::~NullModel() {}
template <typename Stack> template <typename Stack>
process::EProcessReturn NullModel<Stack>::DoContinuous(Particle&, setup::Trajectory&, process::EProcessReturn NullModel<Stack>::DoContinuous(Particle&, setup::Trajectory&,
Stack& ) const { Stack&) const {
return EProcessReturn::eOk; return EProcessReturn::eOk;
} }
...@@ -41,10 +40,8 @@ double NullModel<Stack>::MaxStepLength(Particle&, setup::Trajectory&) const { ...@@ -41,10 +40,8 @@ double NullModel<Stack>::MaxStepLength(Particle&, setup::Trajectory&) const {
} }
template <typename Stack> template <typename Stack>
void NullModel<Stack>::Init() { void NullModel<Stack>::Init() {}
}
#include <corsika/setup/SetupStack.h> #include <corsika/setup/SetupStack.h>
template class process::null_model::NullModel<setup::Stack>; template class process::null_model::NullModel<setup::Stack>;
...@@ -31,7 +31,6 @@ namespace corsika::process { ...@@ -31,7 +31,6 @@ namespace corsika::process {
void Init(); void Init();
EProcessReturn DoContinuous(Particle&, corsika::setup::Trajectory&, Stack& s) const; EProcessReturn DoContinuous(Particle&, corsika::setup::Trajectory&, Stack& s) const;
double MaxStepLength(Particle&, corsika::setup::Trajectory&) const; double MaxStepLength(Particle&, corsika::setup::Trajectory&) const;
}; };
} // namespace null_model } // namespace null_model
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <corsika/process/null_model/NullModel.h> #include <corsika/process/null_model/NullModel.h>
#include <corsika/geometry/Point.h> #include <corsika/geometry/Point.h>
#include <corsika/geometry/Vector.h>
#include <corsika/geometry/RootCoordinateSystem.h> #include <corsika/geometry/RootCoordinateSystem.h>
#include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
...@@ -30,24 +30,24 @@ using namespace corsika; ...@@ -30,24 +30,24 @@ using namespace corsika;
TEST_CASE("NullModel", "[processes]") { TEST_CASE("NullModel", "[processes]") {
auto const& cs = geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); auto const& cs =
geometry::Point const origin(cs, {0_m, 0_m, 0_m}); geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(cs, 0_m / second, geometry::Point const origin(cs, {0_m, 0_m, 0_m});
0_m / second, 1_m / second); geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(
cs, 0_m / second, 0_m / second, 1_m / second);
geometry::Line line(origin, v); geometry::Line line(origin, v);
geometry::Trajectory<geometry::Line> track(line, 10_s); geometry::Trajectory<geometry::Line> track(line, 10_s);
setup::Stack stack; setup::Stack stack;
auto particle = stack.NewParticle(); auto particle = stack.NewParticle();
SECTION("interface") { SECTION("interface") {
NullModel<setup::Stack> model; NullModel<setup::Stack> model;
model.Init(); model.Init();
[[maybe_unused]] const process::EProcessReturn ret = model.DoContinuous(particle, track, stack); [[maybe_unused]] const process::EProcessReturn ret =
model.DoContinuous(particle, track, stack);
[[maybe_unused]] const double length = model.MaxStepLength(particle, track); [[maybe_unused]] const double length = model.MaxStepLength(particle, track);
} }
} }
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <corsika/process/DecayProcess.h> #include <corsika/process/DecayProcess.h>
#include <corsika/process/sibyll/ParticleConversion.h> #include <corsika/process/sibyll/ParticleConversion.h>
#include <corsika/process/sibyll/SibStack.h> #include <corsika/process/sibyll/SibStack.h>
#include <corsika/setup/SetupTrajectory.h>
#include <corsika/setup/SetupStack.h> #include <corsika/setup/SetupStack.h>
#include <corsika/setup/SetupTrajectory.h>
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
......
...@@ -20,7 +20,7 @@ using namespace corsika::units::si; ...@@ -20,7 +20,7 @@ using namespace corsika::units::si;
namespace corsika::process::sibyll { namespace corsika::process::sibyll {
class Interaction : public corsika::process::InteractionProcess<Interaction> { class Interaction : public corsika::process::InteractionProcess<Interaction> {
public: public:
Interaction() {} Interaction() {}
...@@ -45,7 +45,8 @@ namespace corsika::process::sibyll { ...@@ -45,7 +45,8 @@ namespace corsika::process::sibyll {
template <typename Particle, typename Track> template <typename Particle, typename Track>
corsika::units::si::GrammageType GetInteractionLength(Particle& p, Track&) const { corsika::units::si::GrammageType GetInteractionLength(Particle& p, Track&) const {
// coordinate system, get global frame of reference // coordinate system, get global frame of reference
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
const particles::Code corsikaBeamId = p.GetPID(); const particles::Code corsikaBeamId = p.GetPID();
...@@ -121,7 +122,8 @@ namespace corsika::process::sibyll { ...@@ -121,7 +122,8 @@ namespace corsika::process::sibyll {
if (process::sibyll::CanInteract(p.GetPID())) { if (process::sibyll::CanInteract(p.GetPID())) {
cout << "defining coordinates" << endl; cout << "defining coordinates" << endl;
// coordinate system, get global frame of reference // coordinate system, get global frame of reference
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCS(); CoordinateSystem& rootCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
QuantityVector<length_d> const coordinates{0_m, 0_m, 0_m}; QuantityVector<length_d> const coordinates{0_m, 0_m, 0_m};
Point pOrig(rootCS, coordinates); Point pOrig(rootCS, coordinates);
......
...@@ -24,66 +24,66 @@ namespace corsika::process::sibyll { ...@@ -24,66 +24,66 @@ namespace corsika::process::sibyll {
int GetSize() const { return s_plist_.np; } int GetSize() const { return s_plist_.np; }
#warning check actual capacity of sibyll stack #warning check actual capacity of sibyll stack
int GetCapacity() const { return 8000; } int GetCapacity() const { return 8000; }
void SetId(const int i, const int v) { s_plist_.llist[i] = v; } void SetId(const int i, const int v) { s_plist_.llist[i] = v; }
void SetEnergy(const int i, const EnergyType v) { s_plist_.p[3][i] = v / 1_GeV; } void SetEnergy(const int i, const EnergyType v) { s_plist_.p[3][i] = v / 1_GeV; }
void SetMomentum(const int i, const super_stupid::MomentumVector& v) { void SetMomentum(const int i, const super_stupid::MomentumVector& v) {
auto tmp = v.GetComponents(); auto tmp = v.GetComponents();
for (int idx = 0; idx < 3; ++idx) for (int idx = 0; idx < 3; ++idx)
s_plist_.p[idx][i] = tmp[idx] / 1_GeV * constants::c; s_plist_.p[idx][i] = tmp[idx] / 1_GeV * constants::c;
} }
int GetId(const int i) const { return s_plist_.llist[i]; } int GetId(const int i) const { return s_plist_.llist[i]; }
EnergyType GetEnergy(const int i) const { return s_plist_.p[3][i] * 1_GeV; } EnergyType GetEnergy(const int i) const { return s_plist_.p[3][i] * 1_GeV; }
super_stupid::MomentumVector GetMomentum(const int i) const { super_stupid::MomentumVector GetMomentum(const int i) const {
CoordinateSystem& rootCS = RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); CoordinateSystem& rootCS =
corsika::geometry::QuantityVector<momentum_d> components{ RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
s_plist_.p[0][i] * 1_GeV / constants::c, corsika::geometry::QuantityVector<momentum_d> components{
s_plist_.p[1][i] * 1_GeV / constants::c, s_plist_.p[0][i] * 1_GeV / constants::c,
s_plist_.p[2][i] * 1_GeV / constants::c}; s_plist_.p[1][i] * 1_GeV / constants::c,
super_stupid::MomentumVector v1(rootCS, components); s_plist_.p[2][i] * 1_GeV / constants::c};
return v1; super_stupid::MomentumVector v1(rootCS, components);
} return v1;
}
void Copy(const int i1, const int i2) {
s_plist_.llist[i1] = s_plist_.llist[i2]; void Copy(const int i1, const int i2) {
s_plist_.p[3][i1] = s_plist_.p[3][i2]; s_plist_.llist[i1] = s_plist_.llist[i2];
} s_plist_.p[3][i1] = s_plist_.p[3][i2];
}
protected:
void IncrementSize() { s_plist_.np++; } protected:
void DecrementSize() { void IncrementSize() { s_plist_.np++; }
if (s_plist_.np > 0) { s_plist_.np--; } void DecrementSize() {
} if (s_plist_.np > 0) { s_plist_.np--; }
}; }
};
template <typename StackIteratorInterface>
class ParticleInterface : public ParticleBase<StackIteratorInterface> { template <typename StackIteratorInterface>
using ParticleBase<StackIteratorInterface>::GetStackData; class ParticleInterface : public ParticleBase<StackIteratorInterface> {
using ParticleBase<StackIteratorInterface>::GetIndex; using ParticleBase<StackIteratorInterface>::GetStackData;
using ParticleBase<StackIteratorInterface>::GetIndex;
public:
void SetEnergy(const EnergyType v) { GetStackData().SetEnergy(GetIndex(), v); } public:
EnergyType GetEnergy() const { return GetStackData().GetEnergy(GetIndex()); } void SetEnergy(const EnergyType v) { GetStackData().SetEnergy(GetIndex(), v); }
void SetPID(const int v) { GetStackData().SetId(GetIndex(), v); } EnergyType GetEnergy() const { return GetStackData().GetEnergy(GetIndex()); }
corsika::process::sibyll::SibyllCode GetPID() const { void SetPID(const int v) { GetStackData().SetId(GetIndex(), v); }
return static_cast<corsika::process::sibyll::SibyllCode>( corsika::process::sibyll::SibyllCode GetPID() const {
GetStackData().GetId(GetIndex())); return static_cast<corsika::process::sibyll::SibyllCode>(
} GetStackData().GetId(GetIndex()));
super_stupid::MomentumVector GetMomentum() const { }
return GetStackData().GetMomentum(GetIndex()); super_stupid::MomentumVector GetMomentum() const {
} return GetStackData().GetMomentum(GetIndex());
void SetMomentum(const super_stupid::MomentumVector& v) { }
GetStackData().SetMomentum(GetIndex(), v); void SetMomentum(const super_stupid::MomentumVector& v) {
} GetStackData().SetMomentum(GetIndex(), v);
}; }
};
typedef Stack<SibStackData, ParticleInterface> SibStack;
typedef Stack<SibStackData, ParticleInterface> SibStack;
}
>>>>>>> master } // namespace corsika::process::sibyll
#endif #endif
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* the license. * the license.
*/ */
#include <corsika/process/sibyll/Interaction.h>
#include <corsika/process/sibyll/Decay.h> #include <corsika/process/sibyll/Decay.h>
#include <corsika/process/sibyll/Interaction.h>
#include <corsika/process/sibyll/ParticleConversion.h> #include <corsika/process/sibyll/ParticleConversion.h>
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
...@@ -58,12 +58,12 @@ TEST_CASE("Sibyll", "[processes]") { ...@@ -58,12 +58,12 @@ TEST_CASE("Sibyll", "[processes]") {
REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::K0Long) == 3); REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::K0Long) == 3);
REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::SigmaPlus) == 1); REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::SigmaPlus) == 1);
REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::PiMinus) == 2); REQUIRE(process::sibyll::GetSibyllXSCode(corsika::particles::Code::PiMinus) == 2);
} }
} }
#include <corsika/geometry/Point.h> #include <corsika/geometry/Point.h>
#include <corsika/geometry/Vector.h>
#include <corsika/geometry/RootCoordinateSystem.h> #include <corsika/geometry/RootCoordinateSystem.h>
#include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
...@@ -74,24 +74,26 @@ using namespace corsika::units::si; ...@@ -74,24 +74,26 @@ using namespace corsika::units::si;
TEST_CASE("SibyllInterface", "[processes]") { TEST_CASE("SibyllInterface", "[processes]") {
auto const& cs = geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); auto const& cs =
geometry::Point const origin(cs, {0_m, 0_m, 0_m}); geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(cs, 0_m / second, geometry::Point const origin(cs, {0_m, 0_m, 0_m});
0_m / second, 1_m / second); geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(
cs, 0_m / second, 0_m / second, 1_m / second);
geometry::Line line(origin, v); geometry::Line line(origin, v);
geometry::Trajectory<geometry::Line> track(line, 10_s); geometry::Trajectory<geometry::Line> track(line, 10_s);
setup::Stack stack; setup::Stack stack;
auto particle = stack.NewParticle(); auto particle = stack.NewParticle();
SECTION("InteractionInterface") { SECTION("InteractionInterface") {
Interaction model; Interaction model;
model.Init(); model.Init();
[[maybe_unused]] const process::EProcessReturn ret = model.DoInteraction(particle, stack); [[maybe_unused]] const process::EProcessReturn ret =
[[maybe_unused]] const double length = model.GetInteractionLength(particle, track); model.DoInteraction(particle, stack);
[[maybe_unused]] const GrammageType length =
model.GetInteractionLength(particle, track);
} }
SECTION("DecayInterface") { SECTION("DecayInterface") {
...@@ -99,10 +101,8 @@ TEST_CASE("SibyllInterface", "[processes]") { ...@@ -99,10 +101,8 @@ TEST_CASE("SibyllInterface", "[processes]") {
Decay model; Decay model;
model.Init(); model.Init();
/*[[maybe_unused]] const process::EProcessReturn ret =*/ model.DoDecay(particle, stack); /*[[maybe_unused]] const process::EProcessReturn ret =*/model.DoDecay(particle,
[[maybe_unused]] const double length = model.GetLifetime(particle); stack);
[[maybe_unused]] const TimeType time = model.GetLifetime(particle);
} }
} }
...@@ -44,8 +44,8 @@ process::EProcessReturn StackInspector<Stack>::DoContinuous(Particle&, setup::Tr ...@@ -44,8 +44,8 @@ process::EProcessReturn StackInspector<Stack>::DoContinuous(Particle&, setup::Tr
for (auto& iterP : s) { for (auto& iterP : s) {
EnergyType E = iterP.GetEnergy(); EnergyType E = iterP.GetEnergy();
Etot += E; Etot += E;
geometry::CoordinateSystem& rootCS = geometry::CoordinateSystem& rootCS = geometry::RootCoordinateSystem::GetInstance()
geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); // for printout .GetRootCoordinateSystem(); // for printout
auto pos = iterP.GetPosition().GetCoordinates(rootCS); auto pos = iterP.GetPosition().GetCoordinates(rootCS);
cout << "StackInspector: i=" << setw(5) << fixed << (i++) << ", id=" << setw(30) cout << "StackInspector: i=" << setw(5) << fixed << (i++) << ", id=" << setw(30)
<< iterP.GetPID() << " E=" << setw(15) << scientific << (E / 1_GeV) << " GeV, " << iterP.GetPID() << " E=" << setw(15) << scientific << (E / 1_GeV) << " GeV, "
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <corsika/process/stack_inspector/StackInspector.h> #include <corsika/process/stack_inspector/StackInspector.h>
#include <corsika/geometry/Point.h> #include <corsika/geometry/Point.h>
#include <corsika/geometry/Vector.h>
#include <corsika/geometry/RootCoordinateSystem.h> #include <corsika/geometry/RootCoordinateSystem.h>
#include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
...@@ -28,28 +28,26 @@ using namespace corsika::units::si; ...@@ -28,28 +28,26 @@ using namespace corsika::units::si;
using namespace corsika::process::stack_inspector; using namespace corsika::process::stack_inspector;
using namespace corsika; using namespace corsika;
TEST_CASE("StackInspector", "[processes]") { TEST_CASE("StackInspector", "[processes]") {
auto const& cs = geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); auto const& cs =
geometry::Point const origin(cs, {0_m, 0_m, 0_m}); geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(cs, 0_m / second, geometry::Point const origin(cs, {0_m, 0_m, 0_m});
0_m / second, 1_m / second); geometry::Vector<corsika::units::si::SpeedType::dimension_type> v(
cs, 0_m / second, 0_m / second, 1_m / second);
geometry::Line line(origin, v); geometry::Line line(origin, v);
geometry::Trajectory<geometry::Line> track(line, 10_s); geometry::Trajectory<geometry::Line> track(line, 10_s);
setup::Stack stack; setup::Stack stack;
auto particle = stack.NewParticle(); auto particle = stack.NewParticle();
SECTION("interface") { SECTION("interface") {
StackInspector<setup::Stack> model(true); StackInspector<setup::Stack> model(true);
model.Init(); model.Init();
[[maybe_unused]] const process::EProcessReturn ret = model.DoContinuous(particle, track, stack); [[maybe_unused]] const process::EProcessReturn ret =
[[maybe_unused]] const double length = model.MaxStepLength(particle, track); model.DoContinuous(particle, track, stack);
[[maybe_unused]] const LengthType length = model.MaxStepLength(particle, track);
} }
} }
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