Added the number of steps of the theory function to the XML-startup-file
This commit is contained in:
34
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
34
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/30
|
||||
2008/06/03
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -67,16 +67,14 @@ double TBofZCalc::GetBofZ(double zz) const {
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness[nm], lambda[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_1L::TLondon1D_1L(const vector<double> ¶m) {
|
||||
|
||||
unsigned int n(5000); // number of steps for the calculation
|
||||
TLondon1D_1L::TLondon1D_1L(unsigned int steps, const vector<double> ¶m) {
|
||||
|
||||
double N(cosh(param[2]/2.0/param[3]));
|
||||
|
||||
fDZ = param[2]/double(n);
|
||||
fDZ = param[2]/double(steps);
|
||||
double ZZ, BBz;
|
||||
|
||||
for (unsigned int j(0); j<n; j++) {
|
||||
for (unsigned int j(0); j<steps; j++) {
|
||||
ZZ = param[1] + (double)j*fDZ;
|
||||
fZ.push_back(ZZ);
|
||||
BBz = param[0]*cosh((param[2]/2.0-(ZZ-param[1]))/param[3])/N;
|
||||
@ -91,17 +89,15 @@ TLondon1D_1L::TLondon1D_1L(const vector<double> ¶m) {
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], lambda1[nm], lambda2[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_2L::TLondon1D_2L(const vector<double> ¶m) {
|
||||
|
||||
unsigned int n(5000); // number of steps for the calculation
|
||||
TLondon1D_2L::TLondon1D_2L(unsigned int steps, const vector<double> ¶m) {
|
||||
|
||||
double N1(param[5]*cosh(param[3]/param[5])*sinh(param[2]/param[4]) + param[4]*cosh(param[2]/param[4])*sinh(param[3]/param[5]));
|
||||
double N2(4.0*N1);
|
||||
|
||||
fDZ = (param[2]+param[3])/double(n);
|
||||
fDZ = (param[2]+param[3])/double(steps);
|
||||
double ZZ, BBz;
|
||||
|
||||
for (unsigned int j(0); j<n; j++) {
|
||||
for (unsigned int j(0); j<steps; j++) {
|
||||
ZZ = param[1] + (double)j*fDZ;
|
||||
fZ.push_back(ZZ);
|
||||
if (ZZ < param[1]+param[2]) {
|
||||
@ -120,9 +116,7 @@ TLondon1D_2L::TLondon1D_2L(const vector<double> ¶m) {
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], thickness3[nm], lambda1[nm], lambda2[nm], lambda3[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_3L::TLondon1D_3L(const vector<double> ¶m) {
|
||||
|
||||
unsigned int n(5000); // number of steps for the calculation
|
||||
TLondon1D_3L::TLondon1D_3L(unsigned int steps, const vector<double> ¶m) {
|
||||
|
||||
double N1(param[7]*cosh(param[4]/param[7])*((exp(2.0*param[2]/param[5])-1.0)*param[6]*cosh(param[3]/param[6]) + (1.0+exp(2.0*param[2]/param[5]))*param[5]*sinh(param[3]/param[6])) + 2.0*exp(param[2]/param[5])*param[6]*(param[5]*cosh(param[2]/param[5])*cosh(param[3]/param[6]) + param[6]*sinh(param[2]/param[5])*sinh(param[3]/param[6]))*sinh(param[4]/param[7]));
|
||||
|
||||
@ -132,10 +126,10 @@ TLondon1D_3L::TLondon1D_3L(const vector<double> ¶m) {
|
||||
|
||||
double N3(4.0*((1.0+exp(2.0*param[2]/param[5]))*param[5]*(param[7]*cosh(param[4]/param[7])*sinh(param[3]/param[6]) + param[6]*cosh(param[3]/param[6])*sinh(param[4]/param[7])) + (-1.0+exp(2.0*param[2]/param[5]))*param[6]*(param[7]*cosh(param[3]/param[6])*cosh(param[4]/param[7]) + param[6]*sinh(param[3]/param[6])*sinh(param[4]/param[7]))));
|
||||
|
||||
fDZ = (param[2]+param[3]+param[4])/double(n);
|
||||
fDZ = (param[2]+param[3]+param[4])/double(steps);
|
||||
double ZZ, BBz;
|
||||
|
||||
for (unsigned int j(0); j<n; j++) {
|
||||
for (unsigned int j(0); j<steps; j++) {
|
||||
ZZ = param[1] + (double)j*fDZ;
|
||||
fZ.push_back(ZZ);
|
||||
if (ZZ < param[1]+param[2]) {
|
||||
@ -156,9 +150,7 @@ TLondon1D_3L::TLondon1D_3L(const vector<double> ¶m) {
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], thickness3[nm], lambda1[nm], lambda2[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_3LS::TLondon1D_3LS(const vector<double> ¶m) {
|
||||
|
||||
unsigned int n(5000); // number of steps for the calculation
|
||||
TLondon1D_3LS::TLondon1D_3LS(unsigned int steps, const vector<double> ¶m) {
|
||||
|
||||
double N1(8.0*(param[5]*param[6]*cosh(param[3]/param[6])*sinh((param[2]+param[4])/param[5]) + ((param[5]*param[5]*cosh(param[2]/param[5])*cosh(param[4]/param[5])) + (param[6]*param[6]*sinh(param[2]/param[5])*sinh(param[4]/param[5])))*sinh(param[3]/param[6])));
|
||||
|
||||
@ -166,10 +158,10 @@ TLondon1D_3LS::TLondon1D_3LS(const vector<double> ¶m) {
|
||||
|
||||
double N3(8.0*(param[5]*param[6]*cosh(param[3]/param[6])*sinh((param[2]+param[4])/param[5]) + (param[5]*param[5]*cosh(param[2]/param[5])*cosh(param[4]/param[5]) + param[6]*param[6]*sinh(param[2]/param[5])*sinh(param[4]/param[5]))*sinh(param[3]/param[6])));
|
||||
|
||||
fDZ = (param[2]+param[3]+param[4])/double(n);
|
||||
fDZ = (param[2]+param[3]+param[4])/double(steps);
|
||||
double ZZ, BBz;
|
||||
|
||||
for (unsigned int j(0); j<n; j++) {
|
||||
for (unsigned int j(0); j<steps; j++) {
|
||||
ZZ = param[1] + (double)j*fDZ;
|
||||
fZ.push_back(ZZ);
|
||||
if (ZZ < param[1]+param[2]) {
|
||||
|
@ -46,7 +46,7 @@ ClassImpQ(TFitPofBStartupHandler)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TFitPofBStartupHandler::TFitPofBStartupHandler() : fDeltat(0.), fDeltaB(0.)
|
||||
TFitPofBStartupHandler::TFitPofBStartupHandler() : fDeltat(0.), fDeltaB(0.), fNSteps(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -106,6 +106,8 @@ void TFitPofBStartupHandler::OnStartElement(const char *str, const TList *attrib
|
||||
fKey = eDeltaB;
|
||||
} else if (!strcmp(str, "wisdom")) {
|
||||
fKey = eWisdomFile;
|
||||
} if (!strcmp(str, "N_theory")) {
|
||||
fKey = eNSteps;
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,6 +155,10 @@ void TFitPofBStartupHandler::OnCharacters(const char *str)
|
||||
// set the wisdom file to the given name
|
||||
fWisdomFile = str;
|
||||
break;
|
||||
case eNSteps:
|
||||
// convert str to int and assign it to the deltat-member
|
||||
fNSteps = atoi(str);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -278,6 +284,13 @@ void TFitPofBStartupHandler::CheckLists()
|
||||
fWisdomFile = "WordsOfWisdom.dat";
|
||||
}
|
||||
|
||||
// check if any number of steps for the theory function is specified
|
||||
cout << endl << ">> check number of steps for theory ..." << endl;
|
||||
if (!fNSteps) {
|
||||
cout << endl << ">> You did not specify the number of steps for the theory. Setting the default." << endl;
|
||||
fNSteps = 3000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// end ---------------------------------------------------------------------
|
||||
|
12
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
12
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
@ -60,6 +60,7 @@ TLondon1D1L::TLondon1D1L(const vector<unsigned int> &parNo, const vector<double>
|
||||
cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl;
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
@ -140,7 +141,7 @@ double TLondon1D1L::Eval(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofB[2] = par[1]; // energy
|
||||
|
||||
TLondon1D_1L BofZ1(fParForBofZ);
|
||||
TLondon1D_1L BofZ1(fNSteps, fParForBofZ);
|
||||
TPofBCalc PofB1(BofZ1, *fImpProfile, fParForPofB);
|
||||
fPofT->DoFFT(PofB1);
|
||||
|
||||
@ -181,6 +182,7 @@ TLondon1D2L::TLondon1D2L(const vector<unsigned int> &parNo, const vector<double>
|
||||
cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl;
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
@ -274,7 +276,7 @@ double TLondon1D2L::Eval(double t, const vector<double> &par) const {
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
}
|
||||
|
||||
TLondon1D_2L BofZ2(fParForBofZ);
|
||||
TLondon1D_2L BofZ2(fNSteps, fParForBofZ);
|
||||
TPofBCalc PofB2(BofZ2, *fImpProfile, fParForPofB);
|
||||
fPofT->DoFFT(PofB2);
|
||||
|
||||
@ -316,6 +318,7 @@ TLondon1D3L::TLondon1D3L(const vector<unsigned int> &parNo, const vector<double>
|
||||
cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl;
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
@ -425,7 +428,7 @@ double TLondon1D3L::Eval(double t, const vector<double> &par) const {
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
}
|
||||
|
||||
TLondon1D_3L BofZ3(fParForBofZ);
|
||||
TLondon1D_3L BofZ3(fNSteps, fParForBofZ);
|
||||
TPofBCalc PofB3(BofZ3, *fImpProfile, fParForPofB);
|
||||
fPofT->DoFFT(PofB3);
|
||||
|
||||
@ -467,6 +470,7 @@ TLondon1D3LS::TLondon1D3LS(const vector<unsigned int> &parNo, const vector<doubl
|
||||
cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl;
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
@ -562,7 +566,7 @@ double TLondon1D3LS::Eval(double t, const vector<double> &par) const {
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
}
|
||||
|
||||
TLondon1D_3LS BofZ3S(fParForBofZ);
|
||||
TLondon1D_3LS BofZ3S(fNSteps, fParForBofZ);
|
||||
TPofBCalc PofB3S(BofZ3S, *fImpProfile, fParForPofB);
|
||||
fPofT->DoFFT(PofB3S);
|
||||
|
||||
|
10
src/external/TFitPofB-lib/include/TBofZCalc.h
vendored
10
src/external/TFitPofB-lib/include/TBofZCalc.h
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/30
|
||||
2008/06/03
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -52,7 +52,7 @@ class TLondon1D_1L : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_1L( const vector<double>& );
|
||||
TLondon1D_1L(unsigned int, const vector<double>& );
|
||||
|
||||
};
|
||||
|
||||
@ -64,7 +64,7 @@ class TLondon1D_2L : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_2L( const vector<double>& );
|
||||
TLondon1D_2L(unsigned int, const vector<double>& );
|
||||
|
||||
};
|
||||
|
||||
@ -76,7 +76,7 @@ class TLondon1D_3L : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3L( const vector<double>& );
|
||||
TLondon1D_3L(unsigned int, const vector<double>& );
|
||||
|
||||
};
|
||||
|
||||
@ -88,7 +88,7 @@ class TLondon1D_3LS : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3LS( const vector<double>& );
|
||||
TLondon1D_3LS(unsigned int, const vector<double>& );
|
||||
|
||||
};
|
||||
|
||||
|
@ -64,9 +64,10 @@ class TFitPofBStartupHandler : public TQObject {
|
||||
virtual const double GetDeltat() const { return fDeltat; }
|
||||
virtual const double GetDeltaB() const { return fDeltaB; }
|
||||
virtual const string GetWisdomFile() const { return fWisdomFile; }
|
||||
virtual const unsigned int GetNSteps() const { return fNSteps; }
|
||||
|
||||
private:
|
||||
enum EKeyWords {eEmpty, eComment, eDataPath, eEnergy, eEnergyList, eDeltat, eDeltaB, eWisdomFile};
|
||||
enum EKeyWords {eEmpty, eComment, eDataPath, eEnergy, eEnergyList, eDeltat, eDeltaB, eWisdomFile, eNSteps};
|
||||
|
||||
EKeyWords fKey;
|
||||
|
||||
@ -75,6 +76,7 @@ class TFitPofBStartupHandler : public TQObject {
|
||||
double fDeltat;
|
||||
double fDeltaB;
|
||||
string fWisdomFile;
|
||||
unsigned int fNSteps;
|
||||
|
||||
ClassDef(TFitPofBStartupHandler, 1)
|
||||
};
|
||||
|
@ -33,6 +33,7 @@ protected:
|
||||
mutable vector<double> fParForBofZ;
|
||||
mutable vector<double> fParForPofB;
|
||||
string fWisdom;
|
||||
unsigned int fNSteps;
|
||||
|
||||
ClassDef(TLondon1D,1)
|
||||
};
|
||||
|
@ -2,12 +2,15 @@
|
||||
<TFitPofB>
|
||||
<comment>
|
||||
TFitPofB_startup.xml
|
||||
Defines path and energies (keV, format: %02u_%1u) of TrimSP-rge-files, path to the FFTW-wisdom-file and time/field binning (us/G)
|
||||
Defines path/prefix and energies (keV, format: %02u_%1u) of TrimSP-rge-files,
|
||||
path/name to the FFTW-wisdom-file and time/field binning (us/G)
|
||||
N_theory determines the number of points in "real space" where the theory function will be calculated
|
||||
</comment>
|
||||
<data_path>/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-</data_path>
|
||||
<wisdom>WordsOfWisdom.dat</wisdom>
|
||||
<delta_t>0.01</delta_t>
|
||||
<delta_B>0.01</delta_B>
|
||||
<N_theory>5000</N_theory>
|
||||
<energy_list>
|
||||
<energy>04_6</energy>
|
||||
<energy>09_6</energy>
|
||||
|
Reference in New Issue
Block a user