Skip to content

Commit

Permalink
Merge pull request #311 from project8/feature/truthWriting
Browse files Browse the repository at this point in the history
Update recorded event properties
  • Loading branch information
pslocum authored Apr 18, 2024
2 parents 0af4ebc + f554672 commit 6488392
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 6488392

Please sign in to comment.