IAP GITLAB

Skip to content
Snippets Groups Projects
Commit f8df4a62 authored by Andre Schmidt's avatar Andre Schmidt Committed by ralfulrich
Browse files

moved distance->steplength to TrackingLine

parent 44493c3f
No related branches found
No related tags found
1 merge request!278Magnetic Tracking
...@@ -408,6 +408,9 @@ namespace corsika::cascade { ...@@ -408,6 +408,9 @@ namespace corsika::cascade {
// determine steplength for the magnetic field // determine steplength for the magnetic field
// because Steplength should not be min_distance // because Steplength should not be min_distance
auto [position, direction, L2] = fTracking.MagneticStep(vParticle, min_distance);
int chargeNumber; int chargeNumber;
if (corsika::particles::IsNucleus(vParticle.GetPID())) { if (corsika::particles::IsNucleus(vParticle.GetPID())) {
...@@ -415,25 +418,6 @@ namespace corsika::cascade { ...@@ -415,25 +418,6 @@ namespace corsika::cascade {
} else { } else {
chargeNumber = corsika::particles::GetChargeNumber(vParticle.GetPID()); chargeNumber = corsika::particles::GetChargeNumber(vParticle.GetPID());
} }
auto const* currentLogicalVolumeNode = vParticle.GetNode();
auto magneticfield = currentLogicalVolumeNode->GetModelProperties().GetMagneticField(vParticle.GetPosition());
geometry::Vector<dimensionless_d> const directionBefore = vParticle.GetMomentum().normalized();
auto c = directionBefore.cross(magneticfield) * chargeNumber * corsika::units::constants::c * 1_eV /
(vParticle.GetMomentum().norm() * 1_V);
LengthType Steplength = min_distance;
if (chargeNumber != 0) {
Steplength = sqrt(2 / c.squaredNorm() * (sqrt(c.squaredNorm() * min_distance * min_distance + 1) -1));
std::cout << "Steplength " << Steplength << std::endl;
}
if (Steplength == 0_m) {
Steplength = min_distance;
}
// This formula hasnt been tested
//auto [position, direction, L2] = fTracking.MagneticStep(vParticle, min_distance);
auto [position, direction, L2] = fTracking.MagneticStep(vParticle, Steplength);
//histL2(L2); //histL2(L2);
histLlog2(L2); histLlog2(L2);
int pdg = static_cast<int>(particles::GetPDG(vParticle.GetPID())); int pdg = static_cast<int>(particles::GetPDG(vParticle.GetPID()));
......
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