Commented some debugging code.

This commit is contained in:
Bastian M. Wojek 2008-08-28 10:38:27 +00:00
parent 3b07144c8a
commit f29c0f92d5
7 changed files with 91 additions and 57 deletions

View File

@ -62,7 +62,7 @@ double TBofZCalc::GetBofZ(double zz) const {
} }
//------------------ //------------------
// Constructor of the TLondon1D_1L class // Constructor of the TLondon1D_HS class
// 1D-London screening in a superconducting half-space // 1D-London screening in a superconducting half-space
// Parameters: Bext[G], deadlayer[nm], lambda[nm] // Parameters: Bext[G], deadlayer[nm], lambda[nm]
//------------------ //------------------

View File

@ -5,7 +5,7 @@
Author: Bastian M. Wojek Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch e-mail: bastian.wojek@psi.ch
2008/06/30 2008/08/28
***************************************************************************/ ***************************************************************************/
@ -28,7 +28,6 @@ ClassImp(TLondon1D3LS)
//------------------ //------------------
TLondon1DHS::~TLondon1DHS() { TLondon1DHS::~TLondon1DHS() {
cout << "This is the TLondon1DHS-destructor. Jippieh!" << endl;
fPar.clear(); fPar.clear();
fParForBofZ.clear(); fParForBofZ.clear();
fParForPofB.clear(); fParForPofB.clear();
@ -40,7 +39,6 @@ TLondon1DHS::~TLondon1DHS() {
} }
TLondon1D1L::~TLondon1D1L() { TLondon1D1L::~TLondon1D1L() {
cout << "This is the TLondon1D1L-destructor. Jippieh!" << endl;
fPar.clear(); fPar.clear();
fParForBofZ.clear(); fParForBofZ.clear();
fParForPofB.clear(); fParForPofB.clear();
@ -52,7 +50,6 @@ TLondon1D1L::~TLondon1D1L() {
} }
TLondon1D2L::~TLondon1D2L() { TLondon1D2L::~TLondon1D2L() {
cout << "This is the TLondon1D2L-destructor. Jippieh!" << endl;
fPar.clear(); fPar.clear();
fParForBofZ.clear(); fParForBofZ.clear();
fParForPofB.clear(); fParForPofB.clear();
@ -64,7 +61,6 @@ TLondon1D2L::~TLondon1D2L() {
} }
TLondon1D3L::~TLondon1D3L() { TLondon1D3L::~TLondon1D3L() {
cout << "This is the TLondon1D3L-destructor. Jippieh!" << endl;
fPar.clear(); fPar.clear();
fParForBofZ.clear(); fParForBofZ.clear();
fParForPofB.clear(); fParForPofB.clear();
@ -76,7 +72,6 @@ TLondon1D3L::~TLondon1D3L() {
} }
TLondon1D3LS::~TLondon1D3LS() { TLondon1D3LS::~TLondon1D3LS() {
cout << "This is the TLondon1D3LS-destructor. Jippieh!" << endl;
fPar.clear(); fPar.clear();
fParForBofZ.clear(); fParForBofZ.clear();
fParForPofB.clear(); fParForPofB.clear();
@ -93,7 +88,6 @@ TLondon1D3LS::~TLondon1D3LS() {
//------------------ //------------------
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) { TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
cout << "This is the TLondon1DHS-constructor. Juhu!" << endl;
// read startup file // read startup file
string startup_path_name("TFitPofB_startup.xml"); string startup_path_name("TFitPofB_startup.xml");
@ -156,16 +150,16 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
if(fFirstCall){ if(fFirstCall){
fPar = par; fPar = par;
for (unsigned int i(0); i<fPar.size(); i++){ // for (unsigned int i(0); i<fPar.size(); i++){
cout << "fPar[" << i << "] = " << fPar[i] << endl; // cout << "fPar[" << i << "] = " << fPar[i] << endl;
} // }
for (unsigned int i(2); i<fPar.size(); i++){ for (unsigned int i(2); i<fPar.size(); i++){
fParForBofZ.push_back(fPar[i]); fParForBofZ.push_back(fPar[i]);
cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl; // cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
} }
fFirstCall=false; fFirstCall=false;
cout << this << endl; // cout << this << endl;
} }
// check if any parameter has changed // check if any parameter has changed
@ -227,7 +221,6 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
//------------------ //------------------
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) { TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
cout << "This is the TLondon1D1L-constructor. Juhu!" << endl;
// read startup file // read startup file
string startup_path_name("TFitPofB_startup.xml"); string startup_path_name("TFitPofB_startup.xml");

View File

@ -58,7 +58,7 @@ TPofBCalc::TPofBCalc( const TBofZCalc &BofZ, const TTrimSPData &dataTrimSP, cons
if (n > 0) { if (n > 0) {
ofstream of(debugfile); ofstream of(debugfile);
assure(of, debugfile); // assure(of, debugfile);
for (unsigned int i(0); i<bofzZ.size(); i++) { for (unsigned int i(0); i<bofzZ.size(); i++) {
of << bofzZ[i] << " " << bofzBZ[i] << endl; of << bofzZ[i] << " " << bofzBZ[i] << endl;
@ -71,7 +71,7 @@ TPofBCalc::TPofBCalc( const TBofZCalc &BofZ, const TTrimSPData &dataTrimSP, cons
if (n1 > 0) { if (n1 > 0) {
ofstream of1(debugfile1); ofstream of1(debugfile1);
assure(of1, debugfile1); // assure(of1, debugfile1);
for (unsigned int i(0); i<dataTrimSP.DataZ(para[2]).size(); i++) { for (unsigned int i(0); i<dataTrimSP.DataZ(para[2]).size(); i++) {
of1 << dataTrimSP.DataZ(para[2])[i] << " " << dataTrimSP.DataNZ(para[2])[i] << " " << dataTrimSP.OrigDataNZ(para[2])[i] << endl; of1 << dataTrimSP.DataZ(para[2])[i] << " " << dataTrimSP.DataNZ(para[2])[i] << " " << dataTrimSP.OrigDataNZ(para[2])[i] << endl;

View File

@ -5,7 +5,7 @@
Author: Bastian M. Wojek Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch e-mail: bastian.wojek@psi.ch
2008/06/03 2008/08/28
***************************************************************************/ ***************************************************************************/
@ -53,7 +53,8 @@ TPofTCalc::TPofTCalc (const string &wisdom, const vector<double> &par) : fWisdom
} }
fFFTplan = fftw_plan_dft_r2c_1d(fNFFT, fFFTin, fFFTout, FFTW_EXHAUSTIVE); fFFTplan = fftw_plan_dft_r2c_1d(fNFFT, fFFTin, fFFTout, FFTW_EXHAUSTIVE);
cout << &fFFTplan << endl;
// cout << &fFFTplan << endl;
} }
//-------------- //--------------

View File

@ -12,14 +12,14 @@ LOCALINCLUDE = ../include
ROOTINCLUDE = $(ROOTSYS)/include ROOTINCLUDE = $(ROOTSYS)/include
INCLUDES = -I$(LOCALINCLUDE) -I$(ROOTINCLUDE) INCLUDES = -I$(LOCALINCLUDE) -I$(ROOTINCLUDE)
LD = g++ LD = g++
LDFLAGS = -g -L../classes -lTFitPofB -lfftw3 -lm LDFLAGS = -g -L../classes -lTFitPofB -lfftw3 -lm -L/apps/cern/root/lib -lPMusr
# the output from the root-config script: # the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS) CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS += LDFLAGS +=
# the ROOT libraries # the ROOT libraries
LIBS = $(ROOTLIBS) -lXMLParser LIBS = $(ROOTLIBS) -lXMLParser -lMathMore
EXEC = test EXEC = test

View File

@ -6,18 +6,31 @@
path/name to the FFTW-wisdom-file and time/field binning (us/G) 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 N_theory determines the number of points in "real space" where the theory function will be calculated
</comment> </comment>
<data_path>/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-</data_path> <data_path>/home/l_wojek/TrimSP/YBCOxtal/YBCOxtal-500000-</data_path>
<wisdom>WordsOfWisdom.dat</wisdom> <wisdom>/home/l_wojek/analysis/WordsOfWisdom.dat</wisdom>
<delta_t>0.01</delta_t> <delta_t>0.01</delta_t>
<delta_B>0.01</delta_B> <delta_B>0.1</delta_B>
<N_theory>5000</N_theory> <N_theory>5000</N_theory>
<energy_list> <energy_list>
<energy>04_6</energy> <energy>03_0</energy>
<energy>09_6</energy> <energy>03_6</energy>
<energy>14_6</energy> <energy>05_0</energy>
<energy>18_6</energy> <energy>05_3</energy>
<energy>21_6</energy> <energy>07_0</energy>
<energy>07_7</energy>
<energy>08_0</energy>
<energy>09_0</energy>
<energy>10_0</energy>
<energy>10_2</energy>
<energy>12_0</energy>
<energy>14_1</energy>
<energy>16_0</energy>
<energy>16_4</energy>
<energy>18_0</energy>
<energy>19_7</energy>
<energy>20_0</energy>
<energy>22_0</energy>
<energy>24_0</energy>
<energy>24_6</energy> <energy>24_6</energy>
<energy>28_7</energy>
</energy_list> </energy_list>
</TFitPofB> </TFitPofB>

View File

@ -97,6 +97,24 @@ int main(){
of8.close(); of8.close();
*/ */
/**************** Test TLondon1DHS *********************************/
// unsigned int parNo_arr[] = {1, 2, 5, 7, 9, 10, 11, 12};
double par_arr[] = {20.0, 24.6, 100.0, 15.0, 140.0};
// vector<unsigned int> parNo_vec(parNo_arr, parNo_arr+(sizeof(parNo_arr)/sizeof(parNo_arr[0])));
vector<double> par_vec(par_arr, par_arr+(sizeof(par_arr)/sizeof(par_arr[0])));
// vector<double> par_vec_sub;
// for(unsigned int i(0); i<parNo_vec.size(); i++) {
// par_vec_sub.push_back(par_vec[parNo_vec[i]-1]);
// }
TLondon1DHS fitter;
/************************************************************************/
/**************** Test TLondon1D1L ********************************* /**************** Test TLondon1D1L *********************************
@ -134,7 +152,7 @@ int main(){
************************************************************************/ ************************************************************************/
/**************** Test TLondon1D3L *********************************/ /**************** Test TLondon1D3L ********************************
unsigned int parNo_arr[] = {1, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; unsigned int parNo_arr[] = {1, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
double par_arr[] = {0.0, 999.0, 0.01, 999.0, 0.01, 999.0, 4.6, 999.0, 100.0, 5.0, 70.0, 50.0, 70.0, 180.0, 180.0, 180.0, 1.0, 1.0, 1.0}; double par_arr[] = {0.0, 999.0, 0.01, 999.0, 0.01, 999.0, 4.6, 999.0, 100.0, 5.0, 70.0, 50.0, 70.0, 180.0, 180.0, 180.0, 1.0, 1.0, 1.0};
@ -150,7 +168,7 @@ int main(){
TLondon1D3L fitter(parNo_vec, par_vec); TLondon1D3L fitter(parNo_vec, par_vec);
/************************************************************************/ ************************************************************************/
/**************** Test TLondon1D3LS ********************************* /**************** Test TLondon1D3LS *********************************
@ -179,66 +197,76 @@ int main(){
ofstream of06("test_fitter06.dat"); ofstream of06("test_fitter06.dat");
ofstream of07("test_fitter07.dat"); ofstream of07("test_fitter07.dat");
ofstream of08("test_fitter08.dat"); ofstream of08("test_fitter08.dat");
ofstream of09("test_fitter09.dat"); // ofstream of09("test_fitter09.dat");
ofstream of10("test_fitter10.dat"); // ofstream of10("test_fitter10.dat");
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of01 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of01 << i << " " << fitter(i, par_vec) << endl;
} }
of01.close(); of01.close();
par_vec_sub[1] = 9.6; par_vec[1] = 7.7;
par_vec_sub[8] = 300.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of02 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of02 << i << " " << fitter(i, par_vec) << endl;
} }
of02.close(); of02.close();
par_vec_sub[0] = 40.6; par_vec[0] = 0.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of03 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of03 << i << " " << fitter(i, par_vec) << endl;
} }
of03.close(); of03.close();
par_vec_sub[11] = 0.3; par_vec[2] = 200.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of04 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of04 << i << " " << fitter(i, par_vec) << endl;
} }
of04.close(); of04.close();
par_vec_sub[9] = 500.0; par_vec[4] = 100.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of05 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of05 << i << " " << fitter(i, par_vec) << endl;
} }
of05.close(); of05.close();
/*
par_vec_sub[3] = 24.6; par_vec[0] = 20.0;
par_vec_sub[7] -= 10.0; par_vec[1] = 24.6;
par_vec[2] = 96.5;
par_vec[3] = 15.0;
par_vec[4] = 130.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of06 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of06 << i << " " << fitter(i, par_vec) << endl;
} }
of06.close(); of06.close();
par_vec_sub[3] = 28.7; par_vec[0] = 20.0;
par_vec[1] = 24.6;
par_vec[2] = 96.5;
par_vec[3] = 15.0;
par_vec[4] = 140.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of07 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of07 << i << " " << fitter(i, par_vec) << endl;
} }
of07.close(); of07.close();
par_vec_sub[0] += 10.0; par_vec[0] = 20.0;
par_vec[1] = 24.6;
par_vec[2] = 96.5;
par_vec[3] = 20.0;
par_vec[4] = 130.0;
for (double i(0.); i<12.0; i+=0.003) { for (double i(0.); i<12.0; i+=0.003) {
of08 << i << " " << fitter.Eval(i, par_vec_sub) << endl; of08 << i << " " << fitter(i, par_vec) << endl;
} }
of08.close(); of08.close();
/*
par_vec_sub[0] = 0.0; par_vec_sub[0] = 0.0;
par_vec_sub[7] = 1000.0; par_vec_sub[7] = 1000.0;
@ -318,9 +346,8 @@ int main(){
*/ */
parNo_vec.clear();
par_vec.clear(); par_vec.clear();
par_vec_sub.clear();