-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/etalon cavity #323
base: develop
Are you sure you want to change the base?
Changes from all commits
3ebbf77
b30a0e0
0e81db4
2f589a4
5083b1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,9 @@ namespace locust | |
fProbeGain( {1., 1., 1.}), | ||
fCavityProbeZ( {0., 0., 0.} ), | ||
fCavityProbeRFrac( {0.5, 0.5, 0.5} ), | ||
fCavityProbeTheta( {0.0, 0.0, 0.0} ) | ||
fCavityProbeTheta( {0.0, 0.0, 0.0} ), | ||
fCaterpillarCavity( false ), | ||
fApplyDopplerShift( true ) | ||
{} | ||
|
||
CylindricalCavity::~CylindricalCavity() {} | ||
|
@@ -33,6 +35,16 @@ namespace locust | |
return false; | ||
} | ||
|
||
if( aParam.has( "caterpillar-cavity" ) ) | ||
{ | ||
fCaterpillarCavity = aParam["caterpillar-cavity"]().as_bool(); | ||
} | ||
|
||
if( aParam.has( "apply-doppler-shift" ) ) | ||
{ | ||
fApplyDopplerShift = aParam["apply-doppler-shift"]().as_bool(); | ||
} | ||
|
||
if( aParam.has( "cavity-radius" ) ) | ||
{ | ||
SetDimR( aParam["cavity-radius"]().as_double() ); | ||
|
@@ -227,11 +239,16 @@ namespace locust | |
double vz = tKassParticleXP[5]; | ||
double term1 = fFieldCore->GetBesselNKPrimeZeros(l,m) / GetDimR(); | ||
double term2 = n * LMCConst::Pi() / GetDimL(); | ||
if ( fCaterpillarCavity ) | ||
{ | ||
// Assume n-channels is the same as the number of etalon sections: | ||
term2 *= GetNChannels(); | ||
} | ||
double lambda = 1. / pow( 1. / 4. / LMCConst::Pi() / LMCConst::Pi() * ( term1*term1 + term2*term2 ), 0.5); | ||
double lambda_c = 2 * LMCConst::Pi() * GetDimR() / fFieldCore->GetBesselNKPrimeZeros(l,m); | ||
double vp = LMCConst::C() / pow( 1. - lambda*lambda/lambda_c/lambda_c, 0.5 ); | ||
double dopplerShift = 0.; | ||
if (vp > 0.) dopplerShift = vz / vp; | ||
if ((vp > 0.) && (fApplyDopplerShift)) dopplerShift = vz / vp; | ||
freqPrime.push_back( ( 1. + dopplerShift ) * tKassParticleXP[7] ); | ||
return freqPrime; | ||
} | ||
|
@@ -325,7 +342,23 @@ namespace locust | |
std::vector<double> tEFieldAtProbe; | ||
for (unsigned index=0; index<GetNChannels(); index++) | ||
{ | ||
tEFieldAtProbe.push_back( NormalizedEFieldMag(GetNormalizedModeField(l,m,n,tProbeLocation[index],0,teMode)) ); | ||
if ( !fCaterpillarCavity ) | ||
{ | ||
tEFieldAtProbe.push_back( NormalizedEFieldMag(GetNormalizedModeField(l,m,n,tProbeLocation[index],0,teMode)) ); | ||
} | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little worried about the current implementation. First, I do believe it's internally consistent. Because the probes are all in the longitudinal center of their respective subcavities, and because we're always normalizing the modes anyway, there's no numerical difference between what you're doing and just setting up three separate ideal modes. One issue, though, would be if you move the probes off center (e.g. z=0.1 in some systematic study), where the L/D ratio in your doppler calculation would be different by a factor of 3 from this EfieldAtProbe part. Thus displacing your probe from the center could have an improperly scaled effect (e.g. partial effect from z=0.03 or z=0.3 rather than z=0.1, depending on how you define your displacement). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the read. For a test with a probe at e.g. z=0.1, should the Doppler shift (as implemented) be affected? In general, it looks like we have not been doing that. Or is there a different interpretation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's take an example where the total cavity length is 12m, with each segment being 4m long. The doppler frequency is properly getting adjusted to use L=4m in the linked reference. But since tProbeLocation stores the z-coordinate in real units, and GetNormalizedModeField works in the units of the full cavity (L=12m in this case), setting tProbeLocation = (r,theta,z=0.1) would effectively only be using tProbeLocation = (r, theta, z=0.033) if you're interpreting it as being the position in the segment rather than the whole cavity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aha, thanks. so I was thinking that the probe z-locations should be defined in terms of the whole cavity length, as in e.g. and that |
||
{ | ||
// Assume 1 channel per etalon section: | ||
int indexSubCavity = (int)(( tKassParticleXP[2] + GetDimL()/2. ) * GetNChannels() / GetDimL()); | ||
if ( indexSubCavity == index ) // If the electron is in the etalon section where the probe is: | ||
{ | ||
tEFieldAtProbe.push_back( NormalizedEFieldMag(GetNormalizedModeField(l,m,n,tProbeLocation[index],0,teMode)) ); | ||
} | ||
else | ||
{ | ||
tEFieldAtProbe.push_back( 0. ); | ||
} | ||
} | ||
} | ||
|
||
return {fProbeGain[0] * tEFieldAtProbe[0], fProbeGain[1] * tEFieldAtProbe[1], fProbeGain[2] * tEFieldAtProbe[2]}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation should work consistently internal to this class, but may run into other issues when called with the CavitySignalGenerator class. See further comments around (new) line 343.