Skip to content

Commit

Permalink
Collect both start and end frequency at the trap minimum.
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Apr 10, 2024
1 parent 0af4ebc commit f554672
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f554672

Please sign in to comment.