diff --git a/src/external/TFitPofB-lib/classes/TBofZCalc.cpp b/src/external/TFitPofB-lib/classes/TBofZCalc.cpp index c3a725cd..d7a8f542 100644 --- a/src/external/TFitPofB-lib/classes/TBofZCalc.cpp +++ b/src/external/TFitPofB-lib/classes/TBofZCalc.cpp @@ -5,7 +5,7 @@ Author: Bastian M. Wojek e-mail: bastian.wojek@psi.ch - 2008/06/03 + 2008/06/30 ***************************************************************************/ @@ -61,6 +61,26 @@ double TBofZCalc::GetBofZ(double zz) const { } +//------------------ +// Constructor of the TLondon1D_1L class +// 1D-London screening in a superconducting half-space +// Parameters: Bext[G], deadlayer[nm], lambda[nm] +//------------------ + +TLondon1D_HS::TLondon1D_HS(unsigned int steps, const vector ¶m) { + + fDZ = 200.0/double(steps); + double ZZ, BBz; + + for (unsigned int j(0); j #include "TFitPofBStartupHandler.h" +ClassImp(TLondon1DHS) ClassImp(TLondon1D1L) ClassImp(TLondon1D2L) ClassImp(TLondon1D3L) @@ -23,9 +24,21 @@ ClassImp(TLondon1D3LS) //------------------ -// Destructor of the TLondon1D1L/2L/3L/3LS classes -- cleaning up +// Destructor of the TLondon1DHS/1L/2L/3L/3LS classes -- cleaning up //------------------ +TLondon1DHS::~TLondon1DHS() { + cout << "This is the TLondon1DHS-destructor. Jippieh!" << endl; + fPar.clear(); + fParForBofZ.clear(); + fParForPofB.clear(); + fParForPofT.clear(); + delete fImpProfile; + fImpProfile = 0; + delete fPofT; + fPofT = 0; +} + TLondon1D1L::~TLondon1D1L() { cout << "This is the TLondon1D1L-destructor. Jippieh!" << endl; fPar.clear(); @@ -74,6 +87,140 @@ TLondon1D3LS::~TLondon1D3LS() { fPofT = 0; } +//------------------ +// Constructor of the TLondon1DHS class -- reading available implantation profiles and +// creates (a pointer to) the TPofTCalc object (with the FFT plan) +//------------------ + +TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) { + cout << "This is the TLondon1DHS-constructor. Juhu!" << endl; + + // 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 + cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl; + } + + fNSteps = startupHandler->GetNSteps(); + fWisdom = startupHandler->GetWisdomFile(); + string rge_path(startupHandler->GetDataPath()); + vector energy_vec(startupHandler->GetEnergyList()); + + 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); + + TTrimSPData *x = new TTrimSPData(rge_path, energy_vec); + fImpProfile = x; + x = 0; + delete x; + + TPofTCalc *y = new TPofTCalc(fWisdom, fParForPofT); + fPofT = y; + y = 0; + delete y; + + // clean up + if (saxParser) { + delete saxParser; + saxParser = 0; + } + if (startupHandler) { + delete startupHandler; + startupHandler = 0; + } +} + +//------------------ +// TLondon1DHS-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 TLondon1DHS +//------------------ + +double TLondon1DHS::operator()(double t, const vector &par) const { + if(t<0.0) + return 0.0; + + // check if the function is called the first time and if yes, read in parameters + + if(fFirstCall){ + fPar = par; + + for (unsigned int i(0); iDoFFT(PofB); + + }/* 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 TLondon1D1L class -- reading available implantation profiles and // creates (a pointer to) the TPofTCalc object (with the FFT plan) diff --git a/src/external/TFitPofB-lib/include/TBofZCalc.h b/src/external/TFitPofB-lib/include/TBofZCalc.h index dc0b4a58..bf30ce8f 100644 --- a/src/external/TFitPofB-lib/include/TBofZCalc.h +++ b/src/external/TFitPofB-lib/include/TBofZCalc.h @@ -5,7 +5,7 @@ Author: Bastian M. Wojek e-mail: bastian.wojek@psi.ch - 2008/06/03 + 2008/06/30 ***************************************************************************/ @@ -44,6 +44,18 @@ protected: double fDZ; }; +//-------------------- +// Class "for Meissner screening" in a superconducting half-space +//-------------------- + +class TLondon1D_HS : public TBofZCalc { + +public: + + TLondon1D_HS(unsigned int, const vector& ); + +}; + //-------------------- // Class "for Meissner screening" in a thin superconducting film //-------------------- diff --git a/src/external/TFitPofB-lib/include/TLondon1D.h b/src/external/TFitPofB-lib/include/TLondon1D.h index fe0505d9..0c9b337e 100644 --- a/src/external/TFitPofB-lib/include/TLondon1D.h +++ b/src/external/TFitPofB-lib/include/TLondon1D.h @@ -5,7 +5,7 @@ Author: Bastian M. Wojek e-mail: bastian.wojek@psi.ch - 2008/06/06 + 2008/06/30 ***************************************************************************/ @@ -15,6 +15,30 @@ #include "PUserFcnBase.h" #include "TPofTCalc.h" +class TLondon1DHS : public PUserFcnBase { + +public: + // default conctructor + TLondon1DHS(); + ~TLondon1DHS(); + + double operator()(double, const vector&) const; + +private: + mutable vector fPar; + TTrimSPData *fImpProfile; + TPofTCalc *fPofT; + mutable bool fCalcNeeded; + mutable bool fFirstCall; + mutable vector fParForPofT; + mutable vector fParForBofZ; + mutable vector fParForPofB; + string fWisdom; + unsigned int fNSteps; + + ClassDef(TLondon1DHS,1) +}; + class TLondon1D1L : public PUserFcnBase { public: diff --git a/src/external/TFitPofB-lib/include/TLondon1DLinkDef.h b/src/external/TFitPofB-lib/include/TLondon1DLinkDef.h index 57217f01..3af86b93 100644 --- a/src/external/TFitPofB-lib/include/TLondon1DLinkDef.h +++ b/src/external/TFitPofB-lib/include/TLondon1DLinkDef.h @@ -5,7 +5,7 @@ Author: Bastian M. Wojek e-mail: bastian.wojek@psi.ch - 2008/05/29 + 2008/06/30 ***************************************************************************/ @@ -16,6 +16,7 @@ #pragma link off all classes; #pragma link off all functions; +#pragma link C++ class TLondon1DHS+; #pragma link C++ class TLondon1D1L+; #pragma link C++ class TLondon1D2L+; #pragma link C++ class TLondon1D3L+;