IAP GITLAB

Commit 96339351 authored by Ralf Ulrich's avatar Ralf Ulrich

format

parent cf2d0c5f
Pipeline #3480 passed with stages
in 62 minutes and 48 seconds
......@@ -225,7 +225,6 @@ namespace corsika {
return Intersections(d_enter / absVelocity, d_exit / absVelocity);
}
template <typename TParticle, typename TMedium>
Intersections Tracking::intersect(TParticle const& particle, Plane const& plane,
TMedium const& medium) {
......@@ -237,7 +236,8 @@ namespace corsika {
chargeNumber = get_charge_number(particle.getPID());
}
auto const* currentLogicalVolumeNode = particle.getNode();
auto magneticfield = currentLogicalVolumeNode->getModelProperties().getMagneticField(
auto magneticfield =
currentLogicalVolumeNode->getModelProperties().getMagneticField(
particle.getPosition());
VelocityVector const velocity =
particle.getMomentum() / particle.getEnergy() * constants::c;
......@@ -247,14 +247,15 @@ namespace corsika {
Point const position = particle.getPosition();
if (chargeNumber != 0 &&
abs(plane.getNormal().dot(velocity.cross(magneticfield))) *
1_s / 1_m / 1_T > 1e-6) {
abs(plane.getNormal().dot(velocity.cross(magneticfield))) * 1_s / 1_m / 1_T >
1e-6) {
auto const* currentLogicalVolumeNode = particle.getNode();
auto magneticfield = currentLogicalVolumeNode->getModelProperties().getMagneticField(
auto magneticfield =
currentLogicalVolumeNode->getModelProperties().getMagneticField(
particle.getPosition());
auto k = chargeNumber * constants::c * 1_eV /
(particle.getMomentum().getNorm() * 1_V);
auto k =
chargeNumber * constants::c * 1_eV / (particle.getMomentum().getNorm() * 1_V);
if (direction.dot(plane.getNormal()) * direction.dot(plane.getNormal()) -
(plane.getNormal().dot(position - plane.getCenter()) *
......@@ -271,8 +272,7 @@ namespace corsika {
(plane.getNormal().dot(direction.cross(magneticfield)) * k);
LengthType const MaxStepLength2 =
(-sqrt(
direction.dot(plane.getNormal()) * direction.dot(plane.getNormal()) -
(-sqrt(direction.dot(plane.getNormal()) * direction.dot(plane.getNormal()) -
(plane.getNormal().dot(position - plane.getCenter()) *
plane.getNormal().dot(direction.cross(magneticfield)) * 2 * k)) -
direction.dot(plane.getNormal()) / direction.getNorm()) /
......@@ -282,14 +282,18 @@ namespace corsika {
return Intersections(std::numeric_limits<double>::infinity() * 1_s);
} else if (MaxStepLength1 <= 0_m || MaxStepLength2 < MaxStepLength1) {
CORSIKA_LOG_TRACE(" steplength to obs plane 2: {} ", MaxStepLength2);
return Intersections(MaxStepLength2 *
return Intersections(
MaxStepLength2 *
(direction + direction.cross(magneticfield) * MaxStepLength2 * k / 2)
.getNorm() / absVelocity);
.getNorm() /
absVelocity);
} else if (MaxStepLength2 <= 0_m || MaxStepLength1 < MaxStepLength2) {
CORSIKA_LOG_TRACE(" steplength to obs plane 2: {} ", MaxStepLength1);
return Intersections(MaxStepLength1 *
return Intersections(
MaxStepLength1 *
(direction + direction.cross(magneticfield) * MaxStepLength2 * k / 2)
.getNorm() / absVelocity);
.getNorm() /
absVelocity);
}
CORSIKA_LOG_WARN("Particle wasn't tracked with curved trajectory -> straight");
......@@ -299,7 +303,6 @@ namespace corsika {
return tracking_line::Tracking::intersect(particle, plane, medium);
}
template <typename TParticle, typename TBaseNodeType>
inline Intersections Tracking::intersect(const TParticle& particle,
const TBaseNodeType& volumeNode) {
......
......@@ -189,6 +189,16 @@ namespace corsika {
// NOTE: 0 is special marker here for PROJECTILE, see getIndexFromIterator
return stack_view_iterator(*this, 0);
}
/**
* This return a projectile of this SecondaryView, which can be
* used to modify the SecondaryView
*/
inline const_stack_view_iterator getProjectile() const {
// NOTE: 0 is special marker here for PROJECTILE, see getIndexFromIterator
return const_stack_view_iterator(*this, 0);
}
/**
* Method to add a new secondary particle on this SecondaryView
*/
......
......@@ -166,7 +166,7 @@
<channel onMode="1" bRatio="0.1081660" products="-13 14"/>
<channel onMode="1" bRatio="0.1080870" products="-15 16"/>
</particle>
-->
<particle id="25" name="h0" spinType="1" chargeType="0" colType="0"
m0="125.00000" mWidth="0.00374" mMin="50.00000" mMax="0.00000">
<channel onMode="1" bRatio="0.0000009" products="1 -1"/>
......@@ -246,7 +246,7 @@
<channel onMode="1" bRatio="0.0000000" meMode="103" products="1000016 -2000016"/>
<channel onMode="1" bRatio="0.0000000" meMode="103" products="-1000016 2000016"/>
</particle>
<!--
<particle id="32" name="Z'0" spinType="3" chargeType="0" colType="0"
m0="500.00000" mWidth="14.54029" mMin="10.00000" mMax="0.00000">
<channel onMode="1" bRatio="0.1458350" products="1 -1"/>
......
......@@ -17,12 +17,13 @@
//#include <corsika/modules/TrackingLine.hpp>
//#include <corsika/modules/TrackingCurved.hpp> // simple leap-frog implementation
//#include <corsika/modules/TrackingLeapFrog.hpp> // more complete leap-frog
// implementation
// implementation
namespace corsika::setup::testing {
template <typename TTrack>
TTrack make_track(Line const line,
TTrack make_track(
Line const line,
TimeType const tEnd = std::numeric_limits<TimeType::value_type>::infinity() * 1_s);
template <>
......@@ -38,8 +39,8 @@ namespace corsika::setup::testing {
auto const k = square(0_m) / (square(1_s) * 1_V);
return LeapFrogTrajectory(
line.getStartPoint(), line.getVelocity(),
MagneticFieldVector{line.getStartPoint().getCoordinateSystem(), 0_T, 0_T, 0_T},
k, tEnd);
MagneticFieldVector{line.getStartPoint().getCoordinateSystem(), 0_T, 0_T, 0_T}, k,
tEnd);
}
} // namespace corsika::setup::testing
......@@ -101,7 +101,8 @@ TEST_CASE("MediumPropertyModel w/ Homogeneous") {
auto const tEnd = 1_s;
// and the associated trajectory
setup::Trajectory const trajectory = corsika::setup::testing::make_track<setup::Trajectory>(line, tEnd);
setup::Trajectory const trajectory =
corsika::setup::testing::make_track<setup::Trajectory>(line, tEnd);
// and check the integrated grammage
CHECK((medium.getIntegratedGrammage(trajectory, 3_m) / (density * 3_m)) == Approx(1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment