Added a tiny bit of user function documentation

This commit is contained in:
Bastian M. Wojek 2010-08-15 14:00:08 +00:00
parent f4d219a367
commit 5fba77fe72
11 changed files with 331 additions and 599 deletions

View File

@ -526,94 +526,6 @@ vector< pair<double, double> > TProximity1D_1LHS::GetInverseAndDerivative(double
return inv;
}
//------------------
// Constructor of the TProximity1D_1LHSGss class
// 1D-Proximity screening in a thin superconducting film, 1layer+bulk, linear + exponential decay
// Parameters: Bext[G], B1[G], deadlayer[nm], thickness1[nm], sigma[nm]
//------------------
TProximity1D_1LHSGss::TProximity1D_1LHSGss(const vector<double> &param, unsigned int steps)
{
fSteps = steps;
fDZ = 200./double(steps);
fMinTag = -1;
fMinZ = -1.0;
fMinB = -1.0;
// replaced the former assertions of positive lengths by fixed parameter limits
fParam.resize(param.size());
fParam[0] = param[0]; // Bext
(param[0] != param[1]) ? fParam[1] = param[1] : fParam[1] = param[1]-0.01; // B1
(param[2] >= 0.) ? fParam[2] = param[2] : fParam[2] = 0.; // deadlayer
(param[3] >= 0.) ? fParam[3] = param[3] : fParam[3] = 0.; // thickness1
(param[3] >= 1.) ? fParam[4] = param[4] : fParam[4] = 1.; // sigma
fInterfaces[0]=fParam[2];
fInterfaces[1]=fParam[2]+fParam[3];
SetBmin();
}
double TProximity1D_1LHSGss::GetBofZ(double ZZ) const
{
if(ZZ < fInterfaces[0])
return fParam[0];
if (ZZ < fInterfaces[1]) {
return fParam[0]-(fParam[0]-fParam[1])/fParam[3]*(ZZ-fParam[2]);
} else {
return fParam[1]*exp(-(ZZ-fParam[2]-fParam[3])*(ZZ-fParam[2]-fParam[3])/(4.0*fParam[4]*fParam[4]));
}
}
double TProximity1D_1LHSGss::GetBmax() const
{
// return applied field
return fParam[0];
}
double TProximity1D_1LHSGss::GetBmin() const
{
// return field minimum
return fMinB;
}
void TProximity1D_1LHSGss::SetBmin()
{
fMinTag = 2;
fMinZ = 200.;
fMinB = GetBofZ(fMinZ);
return;
}
vector< pair<double, double> > TProximity1D_1LHSGss::GetInverseAndDerivative(double BB) const
{
vector< pair<double, double> > inv;
if(BB <= fMinB || BB > fParam[0])
return inv;
double inverse[2];
pair<double, double> invAndDerivative;
inverse[0]=(fParam[0]*(fParam[2]+fParam[3])-fParam[1]*fParam[2]-BB*fParam[3])/(fParam[0]-fParam[1]);
inverse[1]=fParam[2]+fParam[3]+fParam[4]*sqrt(2.0*log(fParam[1]/BB));
if(inverse[0] > fInterfaces[0] && inverse[0] <= fInterfaces[1]) {
invAndDerivative.first = inverse[0];
invAndDerivative.second = fParam[3]/(fParam[1]-fParam[0]);
inv.push_back(invAndDerivative);
}
if(inverse[1] > fInterfaces[1]) {
invAndDerivative.first = inverse[1];
invAndDerivative.second = -fParam[4]/(BB*sqrt(2.0*log(fParam[1]/BB)));
inv.push_back(invAndDerivative);
}
return inv;
}
//------------------
// Constructor of the TLondon1D_3L class
// 1D-London screening in a thin superconducting film, three layers, three lambdas

View File

@ -42,13 +42,10 @@ ClassImp(TLondon1DHS)
ClassImp(TLondon1D1L)
ClassImp(TLondon1D2L)
ClassImp(TProximity1D1LHS)
ClassImp(TProximity1D1LHSGss)
ClassImp(TLondon1D3L)
ClassImp(TLondon1D3LS)
// ClassImp(TLondon1D4L)
ClassImp(TLondon1D3Lestimate)
//------------------
@ -107,19 +104,6 @@ TProximity1D1LHS::~TProximity1D1LHS() {
fPofT = 0;
}
TProximity1D1LHSGss::~TProximity1D1LHSGss() {
fPar.clear();
fParForBofZ.clear();
fParForPofB.clear();
fParForPofT.clear();
delete fImpProfile;
fImpProfile = 0;
delete fPofB;
fPofB = 0;
delete fPofT;
fPofT = 0;
}
TLondon1D3L::~TLondon1D3L() {
fPar.clear();
fParForBofZ.clear();
@ -310,7 +294,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
//------------------
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true), fCallCounter(0) {
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
// read startup file
string startup_path_name("TFitPofB_startup.xml");
@ -806,154 +790,6 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
}
//------------------
// Constructor of the TProximity1D1LHSGss class -- reading available implantation profiles and
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
//------------------
TProximity1D1LHSGss::TProximity1D1LHSGss() : fCalcNeeded(true), fFirstCall(true) {
// read startup file
string startup_path_name("TFitPofB_startup.xml");
TSAXParser *saxParser = new TSAXParser();
TFitPofBStartupHandler *startupHandler = new TFitPofBStartupHandler();
saxParser->ConnectToHandler("TFitPofBStartupHandler", startupHandler);
int status (saxParser->ParseFile(startup_path_name.c_str()));
// check for parse errors
if (status) { // error
cerr << endl << "**ERROR** reading/parsing TFitPofB_startup.xml failed." \
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
<< endl;
assert(false);
}
fNSteps = startupHandler->GetNSteps();
fWisdom = startupHandler->GetWisdomFile();
string rge_path(startupHandler->GetDataPath());
map<double, string> energy_vec(startupHandler->GetEnergies());
fParForPofT.push_back(0.0);
fParForPofT.push_back(startupHandler->GetDeltat());
fParForPofT.push_back(startupHandler->GetDeltaB());
fParForPofB.push_back(startupHandler->GetDeltat());
fParForPofB.push_back(startupHandler->GetDeltaB());
fParForPofB.push_back(0.0);
fParForPofB.push_back(0.0); // Bkg-Field
fParForPofB.push_back(0.01); // Bkg-width
fParForPofB.push_back(0.0); // Bkg-weight
fImpProfile = new TTrimSPData(rge_path, energy_vec);
fPofB = new TPofBCalc(fParForPofB);
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = 0;
}
}
//------------------
// TProximity1D1LHS-Method that calls the procedures to create B(z), p(B) and P(t)
// It finally returns P(t) for a given t.
// Parameters: all the parameters for the function to be fitted through TProximity1D1LHSGss
//------------------
double TProximity1D1LHSGss::operator()(double t, const vector<double> &par) const {
assert(par.size() == 7);
if(t<0.0)
return cos(par[0]*0.017453293);
// check if the function is called the first time and if yes, read in parameters
bool dead_layer_changed(false);
if(fFirstCall){
fPar = par;
for (unsigned int i(2); i<fPar.size(); i++){
fParForBofZ.push_back(fPar[i]);
}
fFirstCall = false;
dead_layer_changed = true;
}
// check if any parameter has changed
bool par_changed(false);
bool only_phase_changed(false);
for (unsigned int i(0); i<fPar.size(); i++) {
if( fPar[i]-par[i] ) {
fPar[i] = par[i];
par_changed = true;
if (i == 0) {
only_phase_changed = true;
} else {
only_phase_changed = false;
if (i == 4){
dead_layer_changed = true;
}
}
}
}
if (par_changed)
fCalcNeeded = true;
// if model parameters have changed, recalculate B(z), P(B) and P(t)
if (fCalcNeeded) {
fParForPofT[0] = par[0]; // phase
if(!only_phase_changed) {
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
for (unsigned int i(2); i<fPar.size(); i++)
fParForBofZ[i-2] = par[i];
fParForPofB[2] = par[1]; // energy
fParForPofB[3] = par[2]; // Bkg-Field
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
if(dead_layer_changed){
vector<double> interfaces;
interfaces.push_back(par[4]);// dead layer
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
interfaces.clear();
}
TProximity1D_1LHSGss BofZ(fParForBofZ);
fPofB->UnsetPBExists();
fPofB->Calculate(&BofZ, fImpProfile, fParForPofB);
fPofT->DoFFT();
}/* else {
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
}*/
fPofT->CalcPol(fParForPofT);
fCalcNeeded = false;
}
return fPofT->Eval(t);
}
//------------------
// Constructor of the TLondon1D3L class -- reading available implantation profiles and
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
@ -1451,12 +1287,3 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
// }
double TLondon1D3Lestimate::operator()(double z, const vector<double>& par) const {
TLondon1D_3L BofZ(par);
return BofZ.GetBofZ(z);
}

View File

@ -35,10 +35,9 @@
#include <vector>
using namespace std;
//--------------------
// Base class for any kind of theory function B(z)
//--------------------
/**
* <p>Base class for any kind of theory function B(z)
*/
class TBofZCalc {
public:
@ -60,17 +59,16 @@ public:
double GetDZ() const {return fDZ;}
protected:
int fSteps;
double fDZ;
vector<double> fParam;
mutable vector<double> fZ;
mutable vector<double> fBZ;
int fSteps; ///< number of discrete points where B(z) is calculated
double fDZ; ///< resolution in z (spacing between two neighboring discrete B(z) points)
vector<double> fParam; ///< parameters of the B(z) function
mutable vector<double> fZ; ///< vector holding all z-values
mutable vector<double> fBZ; ///< vector holding all B(z)-values
};
//--------------------
// Base class for any kind of theory function B(z) where the inverse and its derivative are given analytically
//--------------------
/**
* <p>Base class for any kind of theory function B(z) where the inverse and its derivative are given analytically
*/
class TBofZCalcInverse : public TBofZCalc {
public:
@ -81,10 +79,9 @@ public:
virtual vector< pair<double, double> > GetInverseAndDerivative(double) const = 0;
};
//--------------------
// Class "for Meissner screening" in a superconducting half-space
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a superconducting half-space
*/
class TLondon1D_HS : public TBofZCalcInverse {
public:
@ -97,10 +94,9 @@ public:
};
//--------------------
// Class "for Meissner screening" in a thin superconducting film
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a thin superconducting film
*/
class TLondon1D_1L : public TBofZCalcInverse {
public:
@ -114,16 +110,16 @@ public:
private:
void SetBmin();
double fMinZ;
double fMinB;
double fCoeff[2];
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fCoeff[2]; ///< array holding the results of two intermediate steps of the involved calculations
};
//--------------------
// Class "for Meissner screening" in a thin superconducting film - bilayer with two different lambdas
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a thin superconducting film
* consisting of two layers with different magnetic penetration depths
*/
class TLondon1D_2L : public TBofZCalcInverse {
public:
@ -137,18 +133,17 @@ public:
private:
void SetBmin();
int fMinTag;
double fMinZ;
double fMinB;
double fInterfaces[3];
double fCoeff[4];
int fMinTag; ///< tag specifying which layer contains the minimum value of B(z)
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fInterfaces[3]; ///< positions of the interfaces between monotonous parts of B(z) or where the function changes
double fCoeff[4]; ///< array holding the results of four intermediate steps of the involved calculations
};
//--------------------
// Class "for proximity screening" in a thin superconducting film - one layer + superconducting half space
//--------------------
/**
* <p>Class calculating the Meissner screening in a conventionally proximated system
* consisting of one metal layer and an underlying (London) superconducting half-space
*/
class TProximity1D_1LHS : public TBofZCalcInverse {
public:
@ -162,39 +157,16 @@ public:
private:
void SetBmin();
int fMinTag;
double fMinZ;
double fMinB;
double fInterfaces[2];
int fMinTag; ///< tag specifying which layer contains the minimum value of B(z)
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fInterfaces[2]; ///< positions of the interfaces between a dead layer, the metallic region and the superconducting region
};
//--------------------
// Class "for proximity screening" in a thin superconducting film - one layer + superconducting half space
//--------------------
class TProximity1D_1LHSGss : public TBofZCalcInverse {
public:
TProximity1D_1LHSGss(const vector<double>&, unsigned int steps = 3000);
double GetBofZ(double) const;
double GetBmin() const;
double GetBmax() const;
vector< pair<double, double> > GetInverseAndDerivative(double) const;
private:
void SetBmin();
int fMinTag;
double fMinZ;
double fMinB;
double fInterfaces[2];
};
//--------------------
// Class "for Meissner screening" in a thin superconducting film - tri-layer with three different lambdas
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a thin superconducting film
* consisting of three layers with different magnetic penetration depths
*/
class TLondon1D_3L : public TBofZCalcInverse {
public:
@ -208,17 +180,17 @@ public:
private:
void SetBmin();
int fMinTag;
double fMinZ;
double fMinB;
double fInterfaces[4];
double fCoeff[6];
int fMinTag; ///< tag specifying which layer contains the minimum value of B(z)
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fInterfaces[4]; ///< positions of the interfaces between monotonous parts of B(z) or where the function changes
double fCoeff[6]; ///< array holding the results of six intermediate steps of the involved calculations
};
//--------------------
// Class "for Meissner screening" in a thin superconducting film - tri-layer with two different lambdas
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a thin superconducting film
* consisting of three layers with different magnetic penetration depths (where lambda is the same for the two outer layers)
*/
class TLondon1D_3LS : public TBofZCalcInverse {
public:
@ -232,17 +204,17 @@ public:
private:
void SetBmin();
int fMinTag;
double fMinZ;
double fMinB;
double fInterfaces[4];
double fCoeff[6];
int fMinTag; ///< tag specifying which layer contains the minimum value of B(z)
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fInterfaces[4]; ///< positions of the interfaces between monotonous parts of B(z) or where the function changes
double fCoeff[6]; ///< array holding the results of six intermediate steps of the involved calculations
};
//--------------------
// Class "for Meissner screening" in a thin superconducting film - tri-layer with insulating buffer layer, two lambda
//--------------------
/**
* <p>Class using the 1D London model to calculate Meissner screening in a thin superconducting film
* consisting of three layers with two different magnetic penetration depths and the central layer being insulating
*/
class TLondon1D_3LwInsulator : public TBofZCalc {
public:
@ -255,9 +227,9 @@ public:
private:
void SetBmin();
double fMinZ;
double fMinB;
double fCoeff[4];
double fMinZ; ///< position of the minimum of B(z)
double fMinB; ///< miniumum value of B(z)
double fCoeff[4]; ///< array holding the results of four intermediate steps of the involved calculations
};
#endif // _BofZCalc_H_

View File

@ -2,7 +2,7 @@
TBulkTriVortexFieldCalc.h
Author: Bastian M. Wojek, Alexander Maisuradze
Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch
2009/10/17
@ -38,10 +38,9 @@ using namespace std;
#include "fftw3.h"
//--------------------
// Base class for any kind of vortex symmetry
//--------------------
/**
* <p>Base class for the calculation of the spatial field distribution B(x,y) within a 2D vortex lattice of arbitrary symmetry
*/
class TBulkVortexFieldCalc {
public:
@ -61,20 +60,20 @@ public:
virtual bool IsTriangular() const = 0;
protected:
vector<double> fParam;
unsigned int fSteps; // number of steps, the "unit cell" of the vortex lattice is devided in (in x- and y- direction)
mutable fftw_complex *fFFTin; // Fourier components of the field
mutable double *fFFTout; // fields in a "unit cell" of the vortex lattice
fftw_plan fFFTplan;
bool fUseWisdom;
string fWisdom;
mutable bool fGridExists;
vector<double> fParam; ///< parameters used to calculate B(x,y)
unsigned int fSteps; ///< number of steps in which the "unit cell" of the vortex lattice is devided in (in each direction)
mutable fftw_complex *fFFTin; ///< Fourier components of the field
mutable double *fFFTout; ///< spatial field distribution B(x,y) in a "unit cell" of the vortex lattice
fftw_plan fFFTplan; ///< FFTW plan for the 2D-Fourier transform from Fourier space to real space
bool fUseWisdom; ///< tag determining if FFTW wisdom is used
string fWisdom; ///< file name of the FFTW wisdom-file
mutable bool fGridExists; ///< tag determining if B(x,y) has been calculated for the given set of parameters
};
//--------------------
// Class for triangular vortex lattice, London model with Gaussian Cutoff
//--------------------
/**
* <p>Class for the calculation of the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* using the London model with a Gaussian cutoff
*/
class TBulkTriVortexLondonFieldCalc : public TBulkVortexFieldCalc {
public:
@ -87,10 +86,10 @@ public:
};
//--------------------
// Class for square vortex lattice, London model with Gaussian Cutoff
//--------------------
/**
* <p>Class for the calculation of the spatial field distribution B(x,y) within a 2D square vortex lattice
* using the London model with a Gaussian cutoff
*/
class TBulkSqVortexLondonFieldCalc : public TBulkVortexFieldCalc {
public:
@ -103,10 +102,10 @@ public:
};
//--------------------
// Class for triangular vortex lattice, modified London model
//--------------------
/**
* <p>Class for the calculation of the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* using the modified London model with a Gaussian cutoff
*/
class TBulkTriVortexMLFieldCalc : public TBulkVortexFieldCalc {
public:
@ -119,10 +118,10 @@ public:
};
//--------------------
// Class for triangular vortex lattice, analytical GL approximation
//--------------------
/**
* <p>Class for the calculation of the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* using the analytical Ginzburg-Landau approximation
*/
class TBulkTriVortexAGLFieldCalc : public TBulkVortexFieldCalc {
public:
@ -135,10 +134,10 @@ public:
};
//--------------------
// Class for triangular vortex lattice, Minimisation of the GL free energy à la Brandt
//--------------------
/**
* <p>Class for the calculation of the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* using an iterative minimization of the Ginzburg-Landau free energy after E.H. Brandt
*/
class TBulkTriVortexNGLFieldCalc : public TBulkVortexFieldCalc {
public:
@ -166,24 +165,24 @@ private:
void ManipulateFourierCoefficientsForQx() const;
void ManipulateFourierCoefficientsForQy() const;
mutable double *fOmegaMatrix;
mutable fftw_complex *fOmegaDiffMatrix;
mutable fftw_complex *fBkMatrix;
mutable fftw_complex *fRealSpaceMatrix;
mutable fftw_complex *fQMatrix;
mutable fftw_complex *fQMatrixA;
mutable double *fOmegaMatrix; ///< spatial distribution of the superconducting order parameter omega(x,y)
mutable fftw_complex *fOmegaDiffMatrix; ///< complex matrix holding the gradient of omega(x,y): real -> d/dx, imaginary -> d/dy
mutable fftw_complex *fBkMatrix; ///< complex matrix holding the Fourier coefficients of the field
mutable fftw_complex *fRealSpaceMatrix; ///< complex matrix holding intermediate results of the calculations
mutable fftw_complex *fQMatrix; ///< complex matrix holding the two components of the supervelocity
mutable fftw_complex *fQMatrixA; ///< complex matrix for the two components of the supervelocity for Abrikosov's vortex lattice
mutable double *fCheckAkConvergence;
mutable double *fCheckBkConvergence;
mutable double *fCheckAkConvergence; ///< array used for a convergence check in the calculation of the order parameter
mutable double *fCheckBkConvergence; ///< array used for a convergence check in the calculation of the spatial field distribution
mutable double fLatticeConstant;
mutable double fKappa;
mutable double fSumAk;
mutable double fSumOmegaSq;
mutable double fSumSum;
fftw_plan fFFTplanBkToBandQ;
fftw_plan fFFTplanOmegaToAk;
fftw_plan fFFTplanOmegaToBk;
mutable double fLatticeConstant; ///< inter-vortex distance
mutable double fKappa; ///< Ginzburg-Landau parameter kappa=lambda/xi
mutable double fSumAk; ///< sum of the Fourier components of the superconducting order parameter
mutable double fSumOmegaSq; ///< average of the square of the superconducting order parameter
mutable double fSumSum; ///< variable holding intermediate results
fftw_plan fFFTplanBkToBandQ; ///< FFTW plan for the 2D-Fourier transform from Fourier space to real space
fftw_plan fFFTplanOmegaToAk; ///< FFTW plan for the 2D-Fourier transform from real space to Fourier space
fftw_plan fFFTplanOmegaToBk; ///< FFTW plan for the 2D-Fourier transform from real space to Fourier space
};

View File

@ -35,6 +35,10 @@
#include "PUserFcnBase.h"
#include "TPofTCalc.h"
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the 1D London model for Meissner screening in a superconducting half-space
*/
class TLondon1DHS : public PUserFcnBase {
public:
@ -45,21 +49,25 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
ClassDef(TLondon1DHS,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the 1D London model for Meissner screening in a thin superconducting film
*/
class TLondon1D1L : public PUserFcnBase {
public:
@ -70,22 +78,27 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable unsigned int fCallCounter;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
//mutable unsigned int fCallCounter;
ClassDef(TLondon1D1L,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the 1D London model for Meissner screening in a thin superconducting film
* consisting of two layers with different magnetic penetration depths
*/
class TLondon1D2L : public PUserFcnBase {
public:
@ -96,21 +109,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
ClassDef(TLondon1D2L,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the model for Meissner screening in a conventionally proximated system
* consisting of one metal layer and an underlying (London) superconducting half-space
*/
class TProximity1D1LHS : public PUserFcnBase {
public:
@ -121,47 +139,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
ClassDef(TProximity1D1LHS,1)
};
class TProximity1D1LHSGss : public PUserFcnBase {
public:
// default constructor
TProximity1D1LHSGss();
~TProximity1D1LHSGss();
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
ClassDef(TProximity1D1LHSGss,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the 1D London model for Meissner screening in a thin superconducting film
* consisting of three layers with different magnetic penetration depths
*/
class TLondon1D3L : public PUserFcnBase {
public:
@ -172,22 +169,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
ClassDef(TLondon1D3L,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating low energy muon spin depolarization functions
* using the 1D London model for Meissner screening in a thin superconducting film
* consisting of three layers with different magnetic penetration depths (where lambda is the same for the two outer layers)
*/
class TLondon1D3LS : public PUserFcnBase {
public:
@ -198,17 +199,17 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TTrimSPData *fImpProfile;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForBofZ;
mutable vector<double> fParForPofB;
string fWisdom;
unsigned int fNSteps;
mutable vector<double> fPar; ///< parameters of the model
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
TPofBCalc *fPofB; ///< static field distribution P(B
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fNSteps; ///< number of points for which B(z) is calculated
ClassDef(TLondon1D3LS,1)
};
@ -238,18 +239,4 @@ private:
// ClassDef(TLondon1D4L,1)
// };
// Class for fitting directly B(z) without any P(B)-calculation
class TLondon1D3Lestimate : public PUserFcnBase {
public:
// default constructor
TLondon1D3Lestimate() {}
~TLondon1D3Lestimate() {}
double operator()(double, const vector<double>&) const;
ClassDef(TLondon1D3Lestimate,1)
};
#endif //_TLondon1D_H_

View File

@ -40,13 +40,10 @@
#pragma link C++ class TLondon1D1L+;
#pragma link C++ class TLondon1D2L+;
#pragma link C++ class TProximity1D1LHS+;
#pragma link C++ class TProximity1D1LHSGss+;
#pragma link C++ class TLondon1D3L+;
#pragma link C++ class TLondon1D3LS+;
//#pragma link C++ class TLondon1D4L+;
#pragma link C++ class TLondon1D3Lestimate;
#endif //__CINT__
// root dictionary stuff --------------------------------------------------

View File

@ -39,6 +39,9 @@
#define gBar 0.0135538817
#define pi 3.14159265358979323846
/**
* <p>Class used to calculate static magnetic field distributions
*/
class TPofBCalc {
public:
@ -68,14 +71,14 @@ public:
void UnsetPBExists();
private:
double *fB;
mutable double *fPB;
double fBmin;
double fBmax;
double fDT;
double fDB;
mutable bool fPBExists;
unsigned int fPBSize;
double *fB; ///< array of discrete points in the field domain
mutable double *fPB; ///< array of discrete values of the field distribution P(B)
double fBmin; ///< minimum field contributing to the distribution
double fBmax; ///< maximum field contributing to the distribution
double fDT; ///< time resolution (needed for convolutions)
double fDB; ///< field resolution (spacing of neighboring fields for which P(B) is calculated)
mutable bool fPBExists; ///< tag indicating if P(B) has been calculated for a set of given parameters
unsigned int fPBSize; ///< length of the P(B) array
};
#endif // _TPofBCalc_H_

View File

@ -39,6 +39,9 @@
#define PI 3.14159265358979323846
#define tauMu 2.197147
/**
* <p>Class used to calculate a muon spin depolarization function from a static magnetic field distribution
*/
class TPofTCalc {
public:
@ -54,15 +57,15 @@ public:
double Eval(double) const;
private:
fftw_plan fFFTplan;
double *fFFTin;
fftw_complex *fFFTout;
double *fT;
double *fPT;
double fTBin;
int fNFFT;
const string fWisdom;
bool fUseWisdom;
fftw_plan fFFTplan; ///< FFTW plan for the 1D Fourier transform from field domain to time domain
double *fFFTin; ///< input array of the Fourier transform in the field domain
fftw_complex *fFFTout; ///< output array of the Fourier transform in the time domain
double *fT; ///< array containing the discrete times for which the polarization p(t) is calculated
double *fPT; ///< array containing the discrete values of the polarization p(t)
double fTBin; ///< time resolution
int fNFFT; ///< length of the discrete 1D Fourier transform
const string fWisdom; ///< file name of the FFTW wisdom file
bool fUseWisdom; ///< tag determining if a FFTW wisdom file is used
};

View File

@ -35,6 +35,10 @@
#include "PUserFcnBase.h"
#include "TPofTCalc.h"
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* from a skewed Gaussian static field distribution
*/
class TSkewedGss : public PUserFcnBase {
public:
@ -45,14 +49,14 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForPofT;
mutable vector<double> fParForPofB;
string fWisdom;
mutable vector<double> fPar; ///< parameters of the model
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
string fWisdom; ///< file name of the FFTW wisdom file
ClassDef(TSkewedGss,1)
};

View File

@ -37,6 +37,9 @@
#include <map>
using namespace std;
/**
* <p>Class used to handle a set of low energy muon implantation profiles
*/
class TTrimSPData {
public:
@ -67,13 +70,13 @@ public:
double PeakRange(double) const;
private:
vector<double> fEnergy;
vector<double> fDZ;
vector< vector<double> > fDataZ;
mutable vector< vector<double> > fDataNZ;
vector< vector<double> > fOrigDataNZ;
mutable vector<bool> fIsNormalized;
mutable vector<double>::const_iterator fEnergyIter;
vector<double> fEnergy; ///< vector holding all available muon energies
vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
vector< vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
mutable vector< vector<double> > fDataNZ; ///< n(z) for all energies
vector< vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
mutable vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
mutable vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
};
#endif // _TTrimSPDataHandler_H_

View File

@ -35,6 +35,11 @@
#include "PUserFcnBase.h"
#include "TPofTCalc.h"
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* originating from the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* calculated using the London model with a Gaussian cutoff
*/
class TBulkTriVortexLondon : public PUserFcnBase {
public:
@ -44,21 +49,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TBulkTriVortexLondonFieldCalc *fVortex;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForVortex;
mutable vector<double> fParForPofB;
mutable vector<double> fParForPofT;
string fWisdom;
unsigned int fGridSteps;
mutable vector<double> fPar; ///< parameters of the model
TBulkTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
ClassDef(TBulkTriVortexLondon,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* originating from the spatial field distribution B(x,y) within a 2D square vortex lattice
* calculated using the London model with a Gaussian cutoff
*/
class TBulkSqVortexLondon : public PUserFcnBase {
public:
@ -68,21 +78,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TBulkSqVortexLondonFieldCalc *fVortex;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForVortex;
mutable vector<double> fParForPofB;
mutable vector<double> fParForPofT;
string fWisdom;
unsigned int fGridSteps;
mutable vector<double> fPar; ///< parameters of the model
TBulkSqVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
ClassDef(TBulkSqVortexLondon,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* originating from the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* calculated using the modified London model with a Gaussian cutoff
*/
class TBulkTriVortexML : public PUserFcnBase {
public:
@ -92,21 +107,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TBulkTriVortexMLFieldCalc *fVortex;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForVortex;
mutable vector<double> fParForPofB;
mutable vector<double> fParForPofT;
string fWisdom;
unsigned int fGridSteps;
mutable vector<double> fPar; ///< parameters of the model
TBulkTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
ClassDef(TBulkTriVortexML,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* originating from the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* calculated using the analytical Ginzburg-Landau approximation
*/
class TBulkTriVortexAGL : public PUserFcnBase {
public:
@ -116,21 +136,26 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TBulkTriVortexAGLFieldCalc *fVortex;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForVortex;
mutable vector<double> fParForPofB;
mutable vector<double> fParForPofT;
string fWisdom;
unsigned int fGridSteps;
mutable vector<double> fPar; ///< parameters of the model
TBulkTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
ClassDef(TBulkTriVortexAGL,1)
};
/**
* <p>Class implementing the musrfit user function interface for calculating muon spin depolarization functions
* originating from the spatial field distribution B(x,y) within a 2D triangular vortex lattice
* calculated using the iterative minimization of the Ginzburg-Landau free energy after E.H. Brandt
*/
class TBulkTriVortexNGL : public PUserFcnBase {
public:
@ -140,17 +165,17 @@ public:
double operator()(double, const vector<double>&) const;
private:
mutable vector<double> fPar;
TBulkTriVortexNGLFieldCalc *fVortex;
TPofBCalc *fPofB;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
mutable bool fFirstCall;
mutable vector<double> fParForVortex;
mutable vector<double> fParForPofB;
mutable vector<double> fParForPofT;
string fWisdom;
unsigned int fGridSteps;
mutable vector<double> fPar; ///< parameters of the model
TBulkTriVortexNGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
TPofBCalc *fPofB; ///< static field distribution P(B)
TPofTCalc *fPofT; ///< muon spin polarization p(t)
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
string fWisdom; ///< file name of the FFTW wisdom file
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
ClassDef(TBulkTriVortexNGL,1)
};