From f554672c002704c8cc14d6bd498b186345b7b6a0 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Wed, 10 Apr 2024 13:51:54 -0400 Subject: [PATCH] Collect both start and end frequency at the trap minimum. --- Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc index 4b27c1bf..6f04af21 100644 --- a/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc +++ b/Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc @@ -62,7 +62,6 @@ namespace locust { fStartingIndex = index; fInterface->aTrack.StartTime = tTime; - fInterface->aTrack.StartFrequency = aFinalParticle.GetCyclotronFrequency(); double tX = aFinalParticle.GetPosition().X(); double tY = aFinalParticle.GetPosition().Y(); fInterface->aTrack.Radius = pow(tX*tX + tY*tY, 0.5); @@ -72,7 +71,6 @@ namespace locust else { fInterface->aTrack.EndTime = tTime; - fInterface->aTrack.EndFrequency = aFinalParticle.GetCyclotronFrequency(); unsigned nElapsedSamples = index - fStartingIndex; fInterface->aTrack.AvgFrequency = ( fInterface->aTrack.AvgFrequency * nElapsedSamples + aFinalParticle.GetCyclotronFrequency() ) / ( nElapsedSamples + 1); fInterface->aTrack.TrackLength = tTime - fInterface->aTrack.StartTime; @@ -129,12 +127,17 @@ namespace locust aNewParticle.SetKinematicProperties(); - if (fPitchAngle == -99.) // first crossing of center + if (anInitialParticle.GetPosition().GetZ()/aFinalParticle.GetPosition().GetZ() < 0.) // trap center { - if (anInitialParticle.GetPosition().GetZ()/aFinalParticle.GetPosition().GetZ() < 0.) // trap center + if (fPitchAngle == -99.) // first crossing of center { fPitchAngle = aFinalParticle.GetPolarAngleToB(); fInterface->aTrack.PitchAngle = aFinalParticle.GetPolarAngleToB(); + fInterface->aTrack.StartFrequency = aFinalParticle.GetCyclotronFrequency(); + } + else + { + fInterface->aTrack.EndFrequency = aFinalParticle.GetCyclotronFrequency(); } } aNewParticle.SetPitchAngle(fPitchAngle);