Skip to content

Commit

Permalink
Merge branch 'feature/codeUpdates' into feature/codeIntegration
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Jun 28, 2023
2 parents 70e9c12 + 0a71d1b commit a335444
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/Fields/LMCRectangularWaveguide.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace locust
}


std::vector<double> RectangularWaveguide::GetNormalizedModeField(int l, int m, int n, std::vector<double> tKassParticleXP, bool includeOtherPols)
std::vector<double> RectangularWaveguide::GetNormalizedModeField(int l, int m, int n, std::vector<double> tKassParticleXP, bool includeOtherPols, bool bTE)
{
// The l index is inert in the waveguide.
double tX = tKassParticleXP[0] * cos(tKassParticleXP[1]);
Expand Down
2 changes: 1 addition & 1 deletion Source/Fields/LMCRectangularWaveguide.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace locust
virtual double Z_TM(int l, int m, int n, double fcyc) const;
virtual double Integrate(int l, int m, int n, bool teMode, bool eField);
virtual std::vector<double> GetDopplerFrequency(int l, int m, int n, std::vector<double> tKassParticleXP);
virtual std::vector<double> GetNormalizedModeField(int l, int m, int n, std::vector<double> tKassParticleXP, bool includeOtherPols);
virtual std::vector<double> GetNormalizedModeField(int l, int m, int n, std::vector<double> tKassParticleXP, bool includeOtherPols, bool bTE);
virtual std::vector<std::vector<std::vector<double>>> CalculateNormFactors(int nModes, bool bTE);
virtual double CalculateDotProductFactor(int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> anE_normalized, double tThisEventNSamples);
virtual double GetDotProductFactor(std::vector<double> tKassParticleXP, std::vector<double> aTE_E_normalized, bool IntermediateFile);
Expand Down
7 changes: 5 additions & 2 deletions Source/Generators/LMCCavitySignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ namespace locust
// Calculate propagating E-field with J \dot E. cavityFIRSample units are [current]*[unitless].
excitationAmplitude = tAvgDotProductFactor * modeAmplitude * cavityFIRSample * fInterface->fField->Z_TE(l,m,n,tKassParticleXP[7]) * 2. * LMCConst::Pi() / LMCConst::C() / 1.e2;
tEFieldAtProbe = fInterface->fField->GetFieldAtProbe(l,m,n,1,tKassParticleXP,bTE);
}
}
else
{
// sqrt(4PIeps0) for Kass current si->cgs, sqrt(4PIeps0) for Jackson A_lambda coefficient cgs->si
Expand All @@ -386,7 +386,10 @@ namespace locust
{
// override one-way signal amplitude with direct Kass power:
unitConversion = 1.0; // Kass power is already in Watts.
excitationAmplitude = tAvgDotProductFactor*sqrt(tKassParticleXP[8]/2.); // sqrt( modeFraction*LarmorPower/2 )
std::vector<double> tTempKassParticleXP = {0.,0.,0.,0.,0.,0.,0.,tKassParticleXP[7],0.};
double modeMax = fInterface->fField->GetNormalizedModeField(l,m,n,tTempKassParticleXP,0,1).back();
double modeFrac = tE_normalized.back()/modeMax;
excitationAmplitude = tAvgDotProductFactor*modeFrac*sqrt(tKassParticleXP[8]/2.); // sqrt( modeFraction*LarmorPower/2 )
tEFieldAtProbe = std::vector<double> {excitationAmplitude};
}

Expand Down

0 comments on commit a335444

Please sign in to comment.