Skip to content
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/MultiMode #295

Merged
merged 62 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d69cf54
update of array parameters, still implementing FIRBuffer as array
jkgaison65 May 8, 2023
c88ee74
intermediate update
jkgaison65 May 17, 2023
1743c65
working for TE111 mode with hard coded values in array, need to gener…
jkgaison65 May 19, 2023
5f73abc
cleanup to get full array of params working
jkgaison65 Jun 5, 2023
85c2aef
merge with field consolidation work
jkgaison65 Jun 9, 2023
7303aae
merging in most recent develop changes
jkgaison65 Jul 6, 2023
71da8b9
minor cleanup after develop merge
jkgaison65 Jul 6, 2023
fd8ca02
scaled up arrays for multimode (TE only)
jkgaison65 Jul 11, 2023
19a1961
Compiling with full arrays, need to double check scales
jkgaison65 Jul 17, 2023
6088ddf
merge in develop
jkgaison65 Aug 21, 2023
5bd2e9e
First level mode array working. Tuning and configuration needed
jkgaison65 Aug 31, 2023
b5b06eb
minor cleanups
jkgaison65 Sep 14, 2023
63c980d
updated FIR printout function to work with multiple modes
jkgaison65 Sep 18, 2023
f08add2
cleanup after tests with printFIR merge
jkgaison65 Sep 19, 2023
6604446
Merge develop into feature/MultiMode.
pslocum Nov 13, 2023
1d41169
Update Kassiopeia submodule to v4.0.0
pslocum Nov 13, 2023
cbc6972
Update cavity unit test to allow compatibility with multimode.
pslocum Nov 13, 2023
6eb2ab2
updated with current develop branch
jkgaison65 Apr 2, 2024
2b1154c
implementation of multimode array parameters for Q, freq, threshold, …
jkgaison65 May 2, 2024
ee9d18d
incorporated most recent develop updates
jkgaison65 May 2, 2024
1ee6098
Update unit tests for compatilibity with new array formats.
pslocum May 7, 2024
17d7202
Make unit test more configurable.
pslocum May 8, 2024
f3b99c2
Intermediate step for testing: preserve antenna workflow without ref…
pslocum May 8, 2024
88b6450
Revert field file to develop to retain normalizations and narrow scop…
pslocum May 9, 2024
8348ca3
Progress merging single-mode without indices, and multimode.
pslocum May 9, 2024
27572c8
Restore LMCFields and LMCPowerCombiners to develop, for merge study.
pslocum May 10, 2024
f32ab0f
Remove commented line.
pslocum May 10, 2024
f0aed56
Remove some infrequently used functionality, and use the multimode sy…
pslocum May 10, 2024
5b79c08
Use the multimode syntax in TFReceiverHandler. Otherwise no change f…
pslocum May 10, 2024
9c9c928
Use the multimode syntax in TFReceiverHandler. Otherwise no change f…
pslocum May 10, 2024
8a45856
Use the multimode syntax in TFReceiverHandler. Otherwise no change f…
pslocum May 10, 2024
c737172
Dimension multimode vectors separately from main workflow.
pslocum May 10, 2024
bc6710e
Work in progress to populate mode parameters separately.
pslocum May 10, 2024
a74cd41
Propagate in-progress syntax changes to generator and unit test.
pslocum May 10, 2024
71235ce
Write intermediate histos and txt files for all modes, if print-fir-d…
pslocum May 11, 2024
faa4ee9
Deprecate transmitter that is infrequently used. To reintegrate, the…
pslocum May 12, 2024
36934d9
Progress unifying LTI handling.
pslocum May 12, 2024
cb78ed1
Apply new LTI syntax. Still need to make mode selection more flexible.
pslocum May 12, 2024
f90cf37
Remove some more infrequently used code.
pslocum May 12, 2024
c807034
Update free space workflow and unit test with unified LTI syntax.
pslocum May 13, 2024
5f0eefe
Update cavity/waveguide workflow with unified LTI syntax. Still need…
pslocum May 13, 2024
6b3bb6b
Move ModeSelect out of LMCFieldCalculator and into LMCField. It now …
pslocum May 19, 2024
e9fb4fe
Update unit test to reference vector of modes instead of just one mode.
pslocum May 19, 2024
4dcc358
Update syntax to use vector of modes.
pslocum May 19, 2024
9b5382b
Use new syntax for vector of modes, and make it a class variable. Mi…
pslocum May 19, 2024
a2203da
Update to new syntax for vector set of mode(s).
pslocum May 19, 2024
7f4ee49
Merge pull request #315 from project8/feature/MultiMode_pls
pslocum May 22, 2024
d418b59
Merge develop into feature branch.
pslocum Jun 5, 2024
a77629f
Remove some infrequently used functionality.
pslocum Jun 19, 2024
ecb8557
Make logging messages more descriptive.
pslocum Jun 19, 2024
0c84c22
Remove extra std::vector.resize() .
pslocum Jun 19, 2024
5549561
Make Green's function identical to previous iteration, for no change …
pslocum Jun 19, 2024
7215706
Remove commented lines left over from testing.
pslocum Jun 19, 2024
8dfc701
Rectangular waveguide scaling for power flowing in +/- z.
pslocum Jun 19, 2024
c573f1a
Finish moving parameters for mode selection into LMCField.
pslocum Jun 21, 2024
ca1b1ba
Remove some infrequently used functionality, and fix some indenting.
pslocum Jun 21, 2024
169b745
For compatibility with previous releases, restrict feedback field pha…
pslocum Jun 22, 2024
c4b5da9
fix typo.
pslocum Jun 22, 2024
f47adbb
Mode selection in same order as previous releases.
pslocum Jun 24, 2024
b047513
re-implemented generalized configuration of different modes for DHO m…
jkgaison65 Jun 24, 2024
f685054
Write new function for individual mode configuration.
pslocum Jun 24, 2024
8eeafad
Add option to run with tm111 only.
pslocum Jun 25, 2024
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
93 changes: 72 additions & 21 deletions Source/Core/LMCHFSSResponseFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace locust
fResolution(1e-12),
fCharacteristicImpedance(1.0),
fNSkips(1),
fNModes(2),
fComplexFFT(),
fHFSSFiletype(""),
fIsFIRCreated(false),
Expand All @@ -41,12 +42,40 @@ namespace locust

bool HFSSResponseFileHandlerCore::Configure(const scarab::param_node& aParam)
{

if( aParam.has( "print-fir-debug" ) )
{
fPrintFIR = aParam["print-fir-debug"]().as_bool();
{
fPrintFIR = aParam["print-fir-debug"]().as_bool();
}
if( aParam.has( "n-modes" ) )
{
fNModes = aParam["n-modes"]().as_int();
}

fFilterComplexArray.resize(2);
fFIRNBinsArray.resize(2);
fResolutionArray.resize(2);
fIsFIRCreatedArray.resize(2);
for ( unsigned bTE=0; bTE<2; bTE++)
{
fFilterComplexArray[bTE].resize(fNModes);
fFIRNBinsArray[bTE].resize(fNModes);
fResolutionArray[bTE].resize(fNModes);
fIsFIRCreatedArray[bTE].resize(fNModes);
for (unsigned l=0; l<fNModes; l++)
{
fFilterComplexArray[bTE][l].resize(fNModes);
fFIRNBinsArray[bTE][l].resize(fNModes);
fResolutionArray[bTE][l].resize(fNModes);
fIsFIRCreatedArray[bTE][l].resize(fNModes);
for (unsigned m=0; m<fNModes; m++)
{
fFilterComplexArray[bTE][l][m].resize(fNModes);
fFIRNBinsArray[bTE][l][m].resize(fNModes);
fResolutionArray[bTE][l][m].resize(fNModes);
fIsFIRCreatedArray[bTE][l][m].resize(fNModes);
}
}
}
if( aParam.has( "convert-sparams-to-z"))
{
fConvertStoZ = aParam["convert-sparams-to-z"]().as_bool();
Expand Down Expand Up @@ -108,13 +137,13 @@ namespace locust
}
int firBinNumber=0;

int inputBufferSize = inputBuffer.size();
for (auto it = inputBuffer.begin();it!=inputBuffer.end(); ++it)
{
convolutionValueReal += *(it)*fFilterComplex[firBinNumber][0];
convolutionValueImag += *(it)*fFilterComplex[firBinNumber][1];
firBinNumber++;
}

std::pair<double,double> complexConvolution;
double complexPhase = atan(convolutionValueImag/convolutionValueReal);
double complexMag = pow(convolutionValueReal*convolutionValueReal + convolutionValueImag*convolutionValueImag, 0.5);
Expand All @@ -134,6 +163,31 @@ namespace locust
return complexConvolution;
}

std::pair<double,double> HFSSResponseFileHandlerCore::ConvolveWithComplexFIRFilterArray(int bTE, int l, int m, int n, std::deque<double> inputBuffer)
{
double convolutionMag = 0.0;
double convolutionValueReal = 0.0;
double convolutionValueImag = 0.0;

if(fFIRNBinsArray[bTE][l][m][n]<=0)
{
LERROR(lmclog,"Number of bins in the filter should be positive");
}
int firBinNumber=0;

int inputBufferSize = inputBuffer.size();
for (auto it = inputBuffer.begin();it!=inputBuffer.end(); ++it)
{
convolutionValueReal += *(it)*fFilterComplexArray[bTE][l][m][n][firBinNumber][0];
convolutionValueImag += *(it)*fFilterComplexArray[bTE][l][m][n][firBinNumber][1];
firBinNumber++;
}
//std::pair<double,double> complexConvolution;
double complexPhase = atan(convolutionValueImag/convolutionValueReal);
double complexMag = pow(convolutionValueReal*convolutionValueReal + convolutionValueImag*convolutionValueImag, 0.5);
return std::make_pair(complexMag, complexPhase);
//return complexConvolution;
}

TFFileHandlerCore::TFFileHandlerCore():HFSSResponseFileHandlerCore(),
fTFComplex(NULL),
Expand All @@ -157,7 +211,6 @@ namespace locust
fFIRComplex = NULL;
}
}

bool TFFileHandlerCore::Configure(const scarab::param_node& aParam)
{
return true;
Expand Down Expand Up @@ -291,7 +344,6 @@ namespace locust
}

fIsFIRCreated=true;

if (fPrintFIR)
{
scarab::path dataDir = TOSTRING(PB_DATA_INSTALL_DIR);
Expand Down Expand Up @@ -371,36 +423,35 @@ namespace locust
return true;
}

bool TFFileHandlerCore::ConvertAnalyticGFtoFIR(std::vector<std::pair<double,std::pair<double,double> > > gfArray)
bool TFFileHandlerCore::ConvertAnalyticGFtoFIR(int bTE, int l, int m, int n, std::vector<std::pair<double,std::pair<double,double> > > gfArray)
{

if(fIsFIRCreated)
if(fIsFIRCreatedArray[bTE][l][m][n])
{
return true;
}

fFIRNBins = gfArray.size();
fResolution = gfArray[0].first;

fFilterComplex=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fFIRNBins);
fFIRNBinsArray[bTE][l][m][n] = gfArray.size();
fResolutionArray[bTE][l][m][n] = gfArray[0].first;

for (int i = 0; i < fFIRNBins; i++)
fFilterComplexArray[bTE][l][m][n]=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fFIRNBinsArray[bTE][l][m][n]);
for (int i = 0; i < fFIRNBinsArray[bTE][l][m][n]; i++)
{
fFilterComplex[i][0] = gfArray[i].second.first;
fFilterComplex[i][1] = gfArray[i].second.second;
fFilterComplexArray[bTE][l][m][n][i][0] = gfArray[i].second.first;
fFilterComplexArray[bTE][l][m][n][i][1] = gfArray[i].second.second;
}

if (fPrintFIR)
{

scarab::path dataDir = TOSTRING(PB_DATA_INSTALL_DIR);

PrintFIR( fFilterComplex, fFIRNBins, (dataDir / "../output/FIRhisto.root").string() );
LPROG( lmclog, "Finished writing histos to output/FIRhisto.root");
std::string modeIndexStr = std::to_string(bTE) + std::to_string(l) + std::to_string(m) + std::to_string(n);
std::string fileName = (dataDir / "../output/FIRhisto").string() + modeIndexStr + ".root";
PrintFIR( fFilterComplexArray[bTE][l][m][n], fFIRNBinsArray[bTE][l][m][n], fileName );

LPROG( lmclog, "Finished writing histos to output/FIRhisto"+modeIndexStr+".root");
LPROG( lmclog, "Press Return to continue, or Cntrl-C to quit.");
getchar();
}

fIsFIRCreatedArray[bTE][l][m][n]=true;
LDEBUG( lmclog, "Finished populating FIR filter with Green's function.");

return true;
Expand Down
22 changes: 19 additions & 3 deletions Source/Core/LMCHFSSResponseFileHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,36 @@ namespace locust
virtual bool Configure( const scarab::param_node& aNode);
virtual bool ReadHFSSFile();
virtual double ConvolveWithFIRFilter(std::deque<double>);// Convolve input signal (voltage or field) with FIR
virtual std::pair<double,double> ConvolveWithComplexFIRFilterArray(int bTE, int l, int m, int n, std::deque<double> inputBuffer);
virtual std::pair<double,double> ConvolveWithComplexFIRFilter(std::deque<double> inputBuffer);
int GetFilterSize() const;//Number of entries in the filter
int GetFilterSizeArray(int bTE, int l, int m, int n) const;//Number of entries in the filter
double GetFilterResolution() const;//Get the resolution of the filter
double GetFilterResolutionArray(int bTE, int l, int m, int n) const;//Get the resolution of the filter
void PrintFIR( std::vector<double>, int nBins, std::string filename );
void PrintFIR( fftw_complex* aFilter, int nBins, std::string filename );
bool WriteRootHisto( std::vector<double> aFilter, int nBins, bool bIQ );


protected:

// Member variables
std::string fHFSSFilename;
std::vector<double> fFilter;
fftw_complex* fFilterComplex;
std::vector< std::vector< std::vector < std::vector< fftw_complex*>>>> fFilterComplexArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I am wondering if we could possibly just upgrade to your fFilterComplexArray, and delete references to the existing fFilterComplex.

int fTFNBins;
int fFIRNBins;
int fCropIndex;
std::vector < std::vector < std::vector < std::vector < int >>>> fFIRNBinsArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is fFIRNBins allowed to be different for each mode lmn? if not, I am wondering if we could use fFIRNBins to replace fFIRNBinsArray.

int fNModes;
double fResolution;
std::vector < std::vector < std::vector < std::vector < double >>>> fResolutionArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is fResolution allowed to be different for each mode lmn? if not, I am wondering if we could use fResolution to replace fResolutionArray.

int fCropIndex;
double fCharacteristicImpedance;
int fNSkips;
bool fHFSSFiletype;
ComplexFFT fComplexFFT;
bool fIsFIRCreated;
std::vector < std::vector < std::vector < std::vector < bool >>>> fIsFIRCreatedArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is fIsFIRCreated allowed to be different for each mode lmn? if not, I am wondering if we could use fIsFIRCreated to replace fFIRCreatedArray.

std::string fWindowName;
double fWindowParam;
bool fPrintFIR;
Expand All @@ -74,11 +81,20 @@ namespace locust
return fFIRNBins;
}

inline int HFSSResponseFileHandlerCore::GetFilterSizeArray(int bTE, int l, int m, int n) const
{
return fFIRNBinsArray[bTE][l][m][n];
}

inline double HFSSResponseFileHandlerCore::GetFilterResolution() const
{
return fResolution;
}

inline double HFSSResponseFileHandlerCore::GetFilterResolutionArray(int bTE, int l, int m, int n) const
{
return fResolutionArray[bTE][l][m][n];
}

/*!
@class TFFileHandlerCore
Expand All @@ -97,7 +113,7 @@ namespace locust
virtual bool Configure( const scarab::param_node& aNode) override;
bool ReadHFSSFile() override;
bool ConvertAnalyticTFtoFIR(double initialFreq, std::vector<std::complex<double>> tfArray);
bool ConvertAnalyticGFtoFIR(std::vector<std::pair<double,std::pair<double,double> > > gfArray);
bool ConvertAnalyticGFtoFIR(int bTE, int l, int m, int n, std::vector<std::pair<double,std::pair<double,double> > > gfArray);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to the above, can we just upgrade to your new implementation, and remove the old implementation altogether?



private:
Expand Down
31 changes: 24 additions & 7 deletions Source/Fields/LMCCylindricalCavity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,18 @@ namespace locust
return tIntegral;
}

std::vector<double> CylindricalCavity::GetDopplerFrequency(int l, int m, int n, std::vector<double> tKassParticleXP)
std::vector<double> CylindricalCavity::GetDopplerFrequency(int bTE, int l, int m, int n, std::vector<double> tKassParticleXP)
{
std::vector<double> freqPrime;
double vz = tKassParticleXP[5];
double term1 = fFieldCore->GetBesselNKPrimeZeros(l,m) / GetDimR();
double term1 = 0;
if(bTE==1) term1 = fFieldCore->GetBesselNKPrimeZeros(l,m) / GetDimR();
else term1 = fFieldCore->GetBesselNKZeros(l,m) / GetDimR();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the full {} syntax for the if () {} else {} ? (The shorthand notation here has been a gotcha for me in the past.)

double term2 = n * LMCConst::Pi() / GetDimL();
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 lambda_c = 0.;
if(bTE==1)lambda_c = 2 * LMCConst::Pi() * GetDimR() / fFieldCore->GetBesselNKPrimeZeros(l,m);
else lambda_c = 2 * LMCConst::Pi() * GetDimR() / fFieldCore->GetBesselNKZeros(l,m);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the full {} syntax for the if () {} else {} ?

double vp = LMCConst::C() / pow( 1. - lambda*lambda/lambda_c/lambda_c, 0.5 );
double dopplerShift = 0.;
if (vp > 0.) dopplerShift = vz / vp;
Expand Down Expand Up @@ -362,12 +366,25 @@ namespace locust
return tField; // return normalized field.
}

double CylindricalCavity::CalculateDotProductFactor(int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> anE_normalized, double tThisEventNSamples)
/*
double CylindricalCavity::TotalFieldNorm(std::vector<double> field)
{
double norm = 0;
auto it = field.begin();
while (it != field.end())
{
if (!isnan(*it)) norm += (*it)*(*it);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is TotalFieldNorm not needed any more?

*it++;
}
return sqrt(norm);
}
*/
double CylindricalCavity::CalculateDotProductFactor(int bTE, int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> anE_normalized, double tThisEventNSamples)
{
std::vector<std::vector<std::vector<double>>> tAvgDotProductFactor = GetAvgDotProductFactor();
tAvgDotProductFactor[l][m][n] = 1. / ( tThisEventNSamples + 1 ) * ( tAvgDotProductFactor[l][m][n] * tThisEventNSamples + GetDotProductFactor(tKassParticleXP, anE_normalized, 0) ); // unit velocity \dot unit theta
std::vector<std::vector<std::vector<std::vector<double>>>> tAvgDotProductFactor = GetAvgDotProductFactor();
tAvgDotProductFactor[bTE][l][m][n] = 1. / ( tThisEventNSamples + 1 ) * ( tAvgDotProductFactor[bTE][l][m][n] * tThisEventNSamples + GetDotProductFactor(tKassParticleXP, anE_normalized, 0) ); // unit velocity \dot unit theta
SetAvgDotProductFactor(tAvgDotProductFactor);
return tAvgDotProductFactor[l][m][n];
return tAvgDotProductFactor[bTE][l][m][n];
}


Expand Down
5 changes: 3 additions & 2 deletions Source/Fields/LMCCylindricalCavity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ namespace locust
virtual double Z_TE(int l, int m, int n, double fcyc) const;
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> GetDopplerFrequency(int bTE, 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, bool teMode);
virtual std::vector<std::vector<std::vector<double>>> CalculateNormFactors(int nModes, bool bTE);
virtual std::vector<double> GetTE_E(int l, int m, int n, double r, double theta, double z, bool includeOtherPols);
virtual std::vector<double> GetTM_E(int l, int m, int n, double r, double theta, double z, bool includeOtherPols);
virtual double CalculateDotProductFactor(int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> anE_normalized, double tThisEventNSamples);
//double TotalFieldNorm(std::vector<double> field);
virtual double CalculateDotProductFactor(int bTE, 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> anE_normalized, bool IntermediateFile);
virtual bool InVolume(std::vector<double> tKassParticleXP);
virtual void CheckNormalization(int nModes);
Expand Down
36 changes: 20 additions & 16 deletions Source/Fields/LMCField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace locust
Field::Field():
fnPixels( 100 ),
fCentralFrequency(1.63e11),
fAvgDotProductFactor( 0. ),
fAvgDotProductFactor( {{{{0.}}}} ),
fNModes( 2 ),
fR( 0.18 ),
fL( 3.0 ),
Expand Down Expand Up @@ -45,19 +45,23 @@ namespace locust
SetNPixels(aParam["n-pixels"]().as_int());
}

if( aParam.has( "plot-mode-maps" ) )
{
SetPlotModeMaps(aParam["plot-mode-maps"]().as_bool());
}

fAvgDotProductFactor.resize(fNModes);
for (unsigned m=0; m<fNModes; m++)
{
fAvgDotProductFactor[m].resize(fNModes);
for (unsigned n=0; n<fNModes; n++)
{
fAvgDotProductFactor[m][n].resize(fNModes);
}
if( aParam.has( "plot-mode-maps" ) )
{
SetPlotModeMaps(aParam["plot-mode-maps"]().as_bool());
}

fAvgDotProductFactor.resize(2);
for (unsigned bTE=0; bTE<2; bTE++)
{
fAvgDotProductFactor[bTE].resize(fNModes);
for(unsigned l=0; l<fNModes; l++)
{
fAvgDotProductFactor[bTE][l].resize(fNModes);
for (unsigned m=0; m<fNModes; m++)
{
fAvgDotProductFactor[bTE][l][m].resize(fNModes);
}
}
}


Expand Down Expand Up @@ -87,12 +91,12 @@ namespace locust
fModeNormFactorTM = aNormFactor;
}

std::vector<std::vector<std::vector<double>>> Field::GetAvgDotProductFactor()
std::vector<std::vector<std::vector<std::vector<double>>>> Field::GetAvgDotProductFactor()
{
return fAvgDotProductFactor;
}

void Field::SetAvgDotProductFactor(std::vector<std::vector<std::vector<double>>> aFactor)
void Field::SetAvgDotProductFactor(std::vector<std::vector<std::vector<std::vector<double>>>> aFactor)
{
fAvgDotProductFactor = aFactor;
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Fields/LMCField.hh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ namespace locust
virtual double Z_TM(int l, int m, int n, double fcyc) const {return {0.};};
virtual double Z_TE(int l, int m, int n, double fcyc) const {return {0.};};
virtual double Integrate(int l, int m, int n, bool teMode, bool eField){return 0.;};
virtual std::vector<double> GetDopplerFrequency(int l, int m, int n, std::vector<double> tKassParticleXP) {return {0.};};
virtual std::vector<double> GetDopplerFrequency(int bTE, int l, int m, int n, std::vector<double> tKassParticleXP) {return {0.};};
virtual std::vector<double> GetNormalizedModeField(int l, int m, int n, std::vector<double> tKassParticleXP, bool includeOtherPols, bool teMode) {return {0.};};
double NormalizedEFieldMag(std::vector<double> field);
virtual std::vector<std::vector<std::vector<double>>> CalculateNormFactors(int nModes, bool bTE) {return {{{0.}}};};
virtual std::vector<double> GetTE_E(int l, int m, int n, double r, double theta, double z, bool includeOtherPols) {return {0.};};
virtual std::vector<double> GetTM_E(int l, int m, int n, double r, double theta, double z, bool includeOtherPols) {return {0.};};
virtual double CalculateDotProductFactor(int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> aTE_E_normalized, double tThisEventNSamples) {return {0.};};
virtual double CalculateDotProductFactor(int bTE, int l, int m, int n, std::vector<double> tKassParticleXP, std::vector<double> aTE_E_normalized, double tThisEventNSamples) {return {0.};};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the bTE required for the dot product calculation, given that the E-field and e- velocity are inputs? lmk your thoughts.

virtual double GetDotProductFactor(std::vector<double> tKassParticleXP, std::vector<double> aTE_E_normalized, bool IntermediateFile) {return {0.};};
virtual bool InVolume(std::vector<double> tKassParticleXP){return false;};
virtual void CheckNormalization(int nModes){};
Expand All @@ -92,8 +92,8 @@ namespace locust
void SetNormFactorsTE(std::vector<std::vector<std::vector<double>>> aNormFactor);
std::vector<std::vector<std::vector<double>>> GetNormFactorsTM();
void SetNormFactorsTM(std::vector<std::vector<std::vector<double>>> aNormFactor);
std::vector<std::vector<std::vector<double>>> GetAvgDotProductFactor();
void SetAvgDotProductFactor(std::vector<std::vector<std::vector<double>>> aFactor);
std::vector<std::vector<std::vector<std::vector<double>>>> GetAvgDotProductFactor();
void SetAvgDotProductFactor(std::vector<std::vector<std::vector<std::vector<double>>>> aFactor);
double GetCentralFrequency();
void SetCentralFrequency( double aCentralFrequency );
int GetNPixels();
Expand Down Expand Up @@ -129,7 +129,7 @@ namespace locust
double fY;
double fCENTER_TO_SHORT;
double fCENTER_TO_ANTENNA;
std::vector<std::vector<std::vector<double>>> fAvgDotProductFactor;
std::vector<std::vector<std::vector<std::vector<double>>>> fAvgDotProductFactor;
bool fPlotModeMaps;


Expand Down
Loading