Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required( VERSION 3.2 )

# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
project( locust_mc VERSION 3.5.1)
project( locust_mc VERSION 3.5.2)

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake )
include( PackageBuilder )
Expand Down
2 changes: 2 additions & 0 deletions Source/IO/LMCTrack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ namespace locust
StartGuidingCenterX = -99.;
StartGuidingCenterY = -99.;
StartGuidingCenterZ = -99.;
NCrossings = 0;
T0trapMin = 0.;

return true;

Expand Down
2 changes: 2 additions & 0 deletions Source/IO/LMCTrack.hh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace locust
double StartGuidingCenterX = -99.;
double StartGuidingCenterY = -99.;
double StartGuidingCenterZ = -99.;
int NCrossings = 0;
double T0trapMin = 0.;

ClassDef(Track,1) // Root syntax.

Expand Down
26 changes: 7 additions & 19 deletions Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ namespace locust
CyclotronRadiationExtractor::CyclotronRadiationExtractor() :
fNewParticleHistory(),
fFieldCalculator( NULL ),
fPitchAngle( -99. ),
fT0trapMin( 0. ),
fNCrossings( 0 ),
fSampleIndex( 0 ),
fInterface( KLInterfaceBootstrapper::get_instance()->GetInterface() )
{
Expand All @@ -23,9 +20,6 @@ namespace locust
CyclotronRadiationExtractor::CyclotronRadiationExtractor(const CyclotronRadiationExtractor &aCopy) : KSComponent(),
fNewParticleHistory(),
fFieldCalculator( NULL ),
fPitchAngle( aCopy.fPitchAngle ),
fT0trapMin( aCopy.fT0trapMin ),
fNCrossings( aCopy.fNCrossings ),
fSampleIndex( aCopy.fSampleIndex ),
fInterface( aCopy.fInterface )
{
Expand Down Expand Up @@ -147,33 +141,28 @@ namespace locust
aNewParticle.SetCyclotronFrequency(2.*LMCConst::Pi()*tCyclotronFrequency);
aNewParticle.SetKinematicProperties();


#ifdef ROOT_FOUND
if (anInitialParticle.GetPosition().GetZ()/aFinalParticle.GetPosition().GetZ() < 0.) // trap center
{
fNCrossings += 1;
if (fPitchAngle == -99.) // first crossing of center
fInterface->aTrack->NCrossings += 1;
if (fInterface->aTrack->PitchAngle == -99.) // first crossing of center
{
fPitchAngle = aFinalParticle.GetPolarAngleToB();
fT0trapMin = aFinalParticle.GetTime();
#ifdef ROOT_FOUND
fInterface->aTrack->PitchAngle = aFinalParticle.GetPolarAngleToB();
fInterface->aTrack->T0trapMin = aFinalParticle.GetTime();
fInterface->aTrack->StartFrequency = aFinalParticle.GetCyclotronFrequency();
double tLOfrequency = fInterface->aRunParameter->fLOfrequency; // Hz
double tSamplingRate = fInterface->aRunParameter->fSamplingRateMHz; // MHz
double tOffset = -tLOfrequency + tSamplingRate * 1.e6 / 2.; // Hz
fInterface->aTrack->OutputStartFrequency = aFinalParticle.GetCyclotronFrequency() + tOffset; // Hz
#endif
}
else
{
#ifdef ROOT_FOUND
fInterface->aTrack->EndFrequency = aFinalParticle.GetCyclotronFrequency();
fInterface->aTrack->AvgAxialFrequency = fNCrossings / 2. / ( aFinalParticle.GetTime() - fT0trapMin );
#endif
fInterface->aTrack->AvgAxialFrequency = fInterface->aTrack->NCrossings / 2. / ( aFinalParticle.GetTime() - fInterface->aTrack->T0trapMin );
}
}
aNewParticle.SetPitchAngle(fPitchAngle);

aNewParticle.SetPitchAngle(fInterface->aTrack->PitchAngle);
#endif
return aNewParticle;

}
Expand Down Expand Up @@ -230,7 +219,6 @@ namespace locust
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
fInterface->fNewTrackStarting = false;
aFinalParticle.SetParentTrackId( aFinalParticle.GetParentTrackId() + 1 );
fPitchAngle = -99.; // new track needs central pitch angle reset.
double dt = aFinalParticle.GetTime() - anInitialParticle.GetTime();
fFieldCalculator->SetNFilterBinsRequired( dt );
UpdateTrackProperties( aFinalParticle, fInterface->fSampleIndex, 1 );
Expand Down
3 changes: 0 additions & 3 deletions Source/Kassiopeia/LMCCyclotronRadiationExtractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ namespace locust

private:
std::deque<locust::Particle> fNewParticleHistory;
double fPitchAngle;
double fT0trapMin;
int fNCrossings;
FieldCalculator* fFieldCalculator;
kl_interface_ptr_t fInterface;
unsigned fSampleIndex;
Expand Down