Parameters to be specified by the user (e.g. path to imp. profiles) are now loaded from a xml-file.
This commit is contained in:
parent
e889421a30
commit
e4e561d9b6
@ -25,6 +25,7 @@ OBJS += TTrimSPDataHandler.o
|
||||
OBJS += TBofZCalc.o
|
||||
OBJS += TPofBCalc.o
|
||||
OBJS += TPofTCalc.o
|
||||
OBJS += TFitPofBStartupHandler.o TFitPofBStartupHandlerDict.o
|
||||
OBJS += TLondon1D.o TLondon1DDict.o
|
||||
|
||||
SHLIB = libTFitPofB.so
|
||||
@ -56,3 +57,7 @@ TLondon1DDict.cpp: ../include/TLondon1D.h ../include/TLondon1DLinkDef.h
|
||||
@echo "Generating dictionary $@..."
|
||||
rootcint -f $@ -c -p $^
|
||||
|
||||
TFitPofBStartupHandlerDict.cpp: ../include/TFitPofBStartupHandler.h ../include/TFitPofBStartupHandlerLinkDef.h
|
||||
@echo "Generating dictionary $@..."
|
||||
rootcint -f $@ -c -p $^
|
||||
|
||||
|
40
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
40
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/24
|
||||
2008/05/30
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -116,11 +116,47 @@ TLondon1D_2L::TLondon1D_2L(const vector<double> ¶m) {
|
||||
|
||||
//------------------
|
||||
// Constructor of the TLondon1D_3L class
|
||||
// 1D-London screening in a thin superconducting film, three layers, three lambdas
|
||||
// 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
|
||||
|
||||
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]));
|
||||
|
||||
double N21(2.0*(param[7]*cosh(param[4]/param[7])*((-1.0+exp(2.0*param[2]/param[5]))*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])));
|
||||
|
||||
double N22(((param[5]+exp(2.0*param[2]/param[5])*(param[5]-param[6])+param[6])*(-param[7]*cosh(param[4]/param[7]) + param[6]*sinh(param[4]/param[7]))+exp(2.0*param[3]/param[6])*(param[5]-param[6] + exp(2.0*param[2]/param[5])*(param[5]+param[6]))*(param[7]*cosh(param[4]/param[7])+param[6]*sinh(param[4]/param[7]))));
|
||||
|
||||
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);
|
||||
double ZZ, BBz;
|
||||
|
||||
for (unsigned int j(0); j<n; j++) {
|
||||
ZZ = param[1] + (double)j*fDZ;
|
||||
fZ.push_back(ZZ);
|
||||
if (ZZ < param[1]+param[2]) {
|
||||
BBz = (2.0*param[0]*exp(param[2]/param[5])*(-param[6]*param[7]*sinh((param[1]-ZZ)/param[5]) + param[7]*cosh(param[4]/param[7])*(param[6]*cosh(param[3]/param[6])*sinh((param[2]+param[1]-ZZ)/param[5]) + param[5]*cosh((param[2]+param[1]-ZZ)/param[5])*sinh(param[3]/param[6])) + param[6]*(param[5]*cosh((param[2]+param[1]-ZZ)/param[5])*cosh(param[3]/param[6]) + param[6]*sinh((param[2]+param[1]-ZZ)/param[5])*sinh(param[3]/param[6]))*sinh(param[4]/param[7])))/N1;
|
||||
} else if (ZZ < param[1]+param[2]+param[3]) {
|
||||
BBz = (param[0]*exp((param[2]+param[1]-ZZ)/param[6])*(-param[5]-param[6]+exp(2.0*param[2]/param[5])*(param[6]-param[5]))*param[7])/N21 + (param[0]*exp(-(param[2]+param[1]+ZZ)/param[6])*(exp((param[3]+2.0*ZZ)/param[6])*(param[5]-param[6] + exp(2.0*param[2]/param[5])*(param[5]+param[6]))*param[7] + 2.0*exp(param[2]/param[5])*param[5]*(exp(2.0*ZZ/param[6])*(-param[7]*cosh(param[4]/param[7]) + param[6]*sinh(param[4]/param[7]))+(cosh(2.0*(param[2]+param[3]+param[1])/param[6]) + sinh(2.0*(param[2]+param[3]+param[1])/param[6]))*(param[7]*cosh(param[4]/param[7])+param[6]*sinh(param[4]/param[7])))))/N22;
|
||||
} else {
|
||||
BBz = (param[0]*exp(-(param[2]+param[3]+param[1]+ZZ)/param[7])*(-exp(-param[3]/param[6] + 2.0*(param[2]+param[3]+param[1])/param[7])*(-4.0*exp(param[2]/param[5]+param[3]/param[6]+param[4]/param[7])*param[5]*param[6] + (-1.0+exp(2.0*param[2]/param[5]))*param[6]*(-param[6]+exp(2.0*param[3]/param[6])*(param[6]-param[7])-param[7]) + (1.0+exp(2.0*param[2]/param[5]))*param[5]*(param[6]+exp(2.0*param[3]/param[6])*(param[6]-param[7])+param[7])) + 4.0*exp(param[2]/param[5]-(param[4]-2.0*ZZ)/param[7])*(-param[5]*param[6]+exp(param[4]/param[7]) * (param[6]*sinh(param[2]/param[5])*(param[7]*cosh(param[3]/param[6])+param[6]*sinh(param[3]/param[6])) + param[5]*cosh(param[2]/param[5])*(param[6]*cosh(param[3]/param[6])+param[7]*sinh(param[3]/param[6]))))))/N3;
|
||||
}
|
||||
fBZ.push_back(BBz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------
|
||||
// Constructor of the TLondon1D_3LS class
|
||||
// 1D-London screening in a thin superconducting film, three layers, two lambdas (top and bottom layer: lambda1)
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], thickness3[nm], lambda1[nm], lambda2[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_3L::TLondon1D_3L(const vector<double> ¶m) {
|
||||
TLondon1D_3LS::TLondon1D_3LS(const vector<double> ¶m) {
|
||||
|
||||
unsigned int n(5000); // number of steps for the calculation
|
||||
|
||||
|
244
src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp
vendored
Normal file
244
src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
/***************************************************************************
|
||||
|
||||
TFitPofBStartupHandler.h
|
||||
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/30
|
||||
|
||||
based upon:
|
||||
$Id: PStartupHandler.cpp 3340 2008-04-30 12:27:01Z nemu $
|
||||
by Andreas Suter
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "TFitPofBStartupHandler.h"
|
||||
|
||||
ClassImpQ(TFitPofBStartupHandler)
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TFitPofBStartupHandler::TFitPofBStartupHandler()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TFitPofBStartupHandler::~TFitPofBStartupHandler()
|
||||
{
|
||||
// clean up
|
||||
fEnergyList.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnStartDocument
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnStartDocument()
|
||||
{
|
||||
fKey = eEmpty;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnEndDocument
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnEndDocument()
|
||||
{
|
||||
// check if anything was set, and if not set some default stuff
|
||||
CheckLists();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnStartElement
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
* \param attributes
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnStartElement(const char *str, const TList *attributes)
|
||||
{
|
||||
if (!strcmp(str, "data_path")) {
|
||||
fKey = eDataPath;
|
||||
} else if (!strcmp(str, "energy")) {
|
||||
fKey = eEnergy;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnEndElement
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnEndElement(const char *str)
|
||||
{
|
||||
fKey = eEmpty;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnCharacters
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnCharacters(const char *str)
|
||||
{
|
||||
switch (fKey) {
|
||||
case eDataPath:
|
||||
// set the data path to the given path
|
||||
fDataPath = str;
|
||||
break;
|
||||
case eEnergy:
|
||||
// add str to the energy list
|
||||
fEnergyList.push_back(str);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnComment
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnComment(const char *str)
|
||||
{
|
||||
// nothing to be done for now
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnWarning
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnWarning(const char *str)
|
||||
{
|
||||
cout << endl << "TFitPofBStartupHandler **WARNING** " << str;
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnError
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnError(const char *str)
|
||||
{
|
||||
cout << endl << "TFitPofBStartupHandler **ERROR** " << str;
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnFatalError
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnFatalError(const char *str)
|
||||
{
|
||||
cout << endl << "TFitPofBStartupHandler **FATAL ERROR** " << str;
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// OnCdataBlock
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* \param str
|
||||
*/
|
||||
void TFitPofBStartupHandler::OnCdataBlock(const char *str, int len)
|
||||
{
|
||||
// nothing to be done for now
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CheckList
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*/
|
||||
void TFitPofBStartupHandler::CheckLists()
|
||||
{
|
||||
// check if anything was set, and if not set some default stuff
|
||||
|
||||
// check if any data path is given
|
||||
cout << endl << ">> check data path ...";
|
||||
if (!fDataPath.size()) {
|
||||
cout << endl << ">> This is not going to work, you have to set a valid data path where to find the rge-files in the xml-file!" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// check if any energies are given
|
||||
cout << endl << ">> check energy list ..." << endl;
|
||||
if (!fEnergyList.size()) {
|
||||
cout << endl << ">> Energy list empty! Setting the default list.";
|
||||
char eChar[5];
|
||||
for(unsigned int i(0); i<33; i++) {
|
||||
for(unsigned int j(0); j<10; j++) {
|
||||
sprintf(eChar, "%02u_%u", i, j);
|
||||
fEnergyList.push_back(string(eChar));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// end ---------------------------------------------------------------------
|
||||
|
292
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
292
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/29
|
||||
2008/05/30
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -13,6 +13,9 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include "TFitPofBStartupHandler.h"
|
||||
|
||||
ClassImp(TLondon1D)
|
||||
ClassImp(TLondon1D1L)
|
||||
ClassImp(TLondon1D2L)
|
||||
@ -37,33 +40,52 @@ TLondon1D::~TLondon1D() {
|
||||
|
||||
TLondon1D1L::TLondon1D1L(const vector<unsigned int> &parNo, const vector<double> &par) {
|
||||
|
||||
// extract function parameters
|
||||
for(unsigned int i(0); i<parNo.size(); i++) {
|
||||
fPar.push_back(par[parNo[i]-1]);
|
||||
}
|
||||
|
||||
// string rge_path("/home/l_wojek/nt/wojek/g/Bastian/ImplantationDepth/YBCO_PBCO-");
|
||||
// string energy_arr[] = {"02_1", "02_5", "03_5", "05_0", "07_5", "10_0", "12_5", "15_0", "17_5", "19_0", "20_0", "22_5", "25_0"};
|
||||
// read startup file
|
||||
string startup_path_name("TFitPofB_startup.xml");
|
||||
|
||||
string rge_path("/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-");
|
||||
string energy_arr[] = {"04_6", "09_6", "14_6", "18_6", "21_6", "24_6", "28_7"};
|
||||
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;
|
||||
}
|
||||
startupHandler->CheckLists();
|
||||
|
||||
vector<string> energy_vec(energy_arr, energy_arr+(sizeof(energy_arr)/sizeof(energy_arr[0])));
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
|
||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||
fImpProfile = x;
|
||||
x = 0;
|
||||
delete x;
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
|
||||
TPofTCalc *y = new TPofTCalc(par_for_PofT);
|
||||
fPofT = y;
|
||||
y = 0;
|
||||
delete y;
|
||||
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -160,39 +182,58 @@ double TLondon1D1L::Eval(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D2L::TLondon1D2L(const vector<unsigned int> &parNo, const vector<double> &par) : fLastTwoChanged(true) {
|
||||
|
||||
// extract function parameters
|
||||
for(unsigned int i(0); i<parNo.size(); i++) {
|
||||
fPar.push_back(par[parNo[i]-1]);
|
||||
}
|
||||
|
||||
// string rge_path("/home/l_wojek/nt/wojek/g/Bastian/ImplantationDepth/YBCO_PBCO-");
|
||||
// string energy_arr[] = {"02_1", "02_5", "03_5", "05_0", "07_5", "10_0", "12_5", "15_0", "17_5", "19_0", "20_0", "22_5", "25_0"};
|
||||
// read startup file
|
||||
string startup_path_name("TFitPofB_startup.xml");
|
||||
|
||||
string rge_path("/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-");
|
||||
string energy_arr[] = {"04_6", "09_6", "14_6", "18_6", "21_6", "24_6", "28_7"};
|
||||
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;
|
||||
}
|
||||
startupHandler->CheckLists();
|
||||
|
||||
vector<string> energy_vec(energy_arr, energy_arr+(sizeof(energy_arr)/sizeof(energy_arr[0])));
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
|
||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||
fImpProfile = x;
|
||||
x = 0;
|
||||
delete x;
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
|
||||
TPofTCalc *y = new TPofTCalc(par_for_PofT);
|
||||
fPofT = y;
|
||||
y = 0;
|
||||
delete y;
|
||||
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------
|
||||
// TLondon1D2L-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 TLondon1D1L
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D2L
|
||||
//------------------
|
||||
|
||||
double TLondon1D2L::Eval(double t, const vector<double> &par) const {
|
||||
@ -292,48 +333,67 @@ double TLondon1D2L::Eval(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
//------------------
|
||||
// Constructor of the TLondon1D3LS class -- reading available implantation profiles and
|
||||
// Constructor of the TLondon1D3L class -- reading available implantation profiles and
|
||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||
//------------------
|
||||
|
||||
TLondon1D3LS::TLondon1D3LS(const vector<unsigned int> &parNo, const vector<double> &par) : fLastThreeChanged(true) {
|
||||
TLondon1D3L::TLondon1D3L(const vector<unsigned int> &parNo, const vector<double> &par) : fLastThreeChanged(true) {
|
||||
|
||||
// extract function parameters
|
||||
for(unsigned int i(0); i<parNo.size(); i++) {
|
||||
fPar.push_back(par[parNo[i]-1]);
|
||||
}
|
||||
|
||||
// string rge_path("/home/l_wojek/nt/wojek/g/Bastian/ImplantationDepth/YBCO_PBCO-");
|
||||
// string energy_arr[] = {"02_1", "02_5", "03_5", "05_0", "07_5", "10_0", "12_5", "15_0", "17_5", "19_0", "20_0", "22_5", "25_0"};
|
||||
// read startup file
|
||||
string startup_path_name("TFitPofB_startup.xml");
|
||||
|
||||
string rge_path("/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-");
|
||||
string energy_arr[] = {"04_6", "09_6", "14_6", "18_6", "21_6", "24_6", "28_7"};
|
||||
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;
|
||||
}
|
||||
startupHandler->CheckLists();
|
||||
|
||||
vector<string> energy_vec(energy_arr, energy_arr+(sizeof(energy_arr)/sizeof(energy_arr[0])));
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
|
||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||
fImpProfile = x;
|
||||
x = 0;
|
||||
delete x;
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
|
||||
TPofTCalc *y = new TPofTCalc(par_for_PofT);
|
||||
fPofT = y;
|
||||
y = 0;
|
||||
delete y;
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
// TLondon1D3LS-Method that calls the procedures to create B(z), p(B) and P(t)
|
||||
// TLondon1D3L-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 TLondon1D1L
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D3L
|
||||
//------------------
|
||||
|
||||
double TLondon1D3LS::Eval(double t, const vector<double> &par) const {
|
||||
double TLondon1D3L::Eval(double t, const vector<double> &par) const {
|
||||
|
||||
// check if any parameter has changed
|
||||
|
||||
@ -429,3 +489,161 @@ double TLondon1D3LS::Eval(double t, const vector<double> &par) const {
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
// Constructor of the TLondon1D3LS class -- reading available implantation profiles and
|
||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||
//------------------
|
||||
|
||||
TLondon1D3LS::TLondon1D3LS(const vector<unsigned int> &parNo, const vector<double> &par) {
|
||||
|
||||
// extract function parameters
|
||||
for(unsigned int i(0); i<parNo.size(); i++) {
|
||||
fPar.push_back(par[parNo[i]-1]);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
startupHandler->CheckLists();
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||
|
||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||
fImpProfile = x;
|
||||
x = 0;
|
||||
delete x;
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
for (unsigned int i(0); i<3; i++)
|
||||
par_for_PofT.push_back(fPar[i]);
|
||||
|
||||
TPofTCalc *y = new TPofTCalc(par_for_PofT);
|
||||
fPofT = y;
|
||||
y = 0;
|
||||
delete y;
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
// TLondon1D3LS-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 TLondon1D3LS
|
||||
//------------------
|
||||
|
||||
double TLondon1D3LS::Eval(double t, const vector<double> &par) const {
|
||||
|
||||
// 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 == 1 || i == 2) {
|
||||
cout << "You are varying dt or dB! These parameters have to be fixed! Quitting..." << endl;
|
||||
exit(-1);
|
||||
} else if (i == 0) {
|
||||
only_phase_changed = true;
|
||||
} else {
|
||||
only_phase_changed = false;
|
||||
}
|
||||
if (i == fPar.size()-3 || i == fPar.size()-2 || i == fPar.size()-1)
|
||||
fLastThreeChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (par_changed)
|
||||
fCalcNeeded = true;
|
||||
|
||||
/* DEBUGGING CODE COMMENTED -- quite a mess... sorry*/
|
||||
|
||||
// if model parameters have changed, recalculate B(z), P(B) and P(t)
|
||||
|
||||
if (fCalcNeeded) {
|
||||
|
||||
vector<double> par_for_PofT;
|
||||
|
||||
// cout << "par_for_PofT: ";
|
||||
|
||||
for (unsigned int i(0); i<3; i++) {
|
||||
par_for_PofT.push_back(par[i]);
|
||||
// cout << par[i] << " ";
|
||||
}
|
||||
// cout << endl;
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
vector<double> par_for_BofZ;
|
||||
vector<double> par_for_PofB;
|
||||
|
||||
// cout << "par_for_BofZ: ";
|
||||
|
||||
for (unsigned int i(4); i<par.size()-2; i++) {
|
||||
par_for_BofZ.push_back(par[i]);
|
||||
// cout << par[i] << " ";
|
||||
}
|
||||
// cout << endl;
|
||||
|
||||
// cout << "par_for_PofB: ";
|
||||
|
||||
for (unsigned int i(1); i<4; i++) {
|
||||
par_for_PofB.push_back(par[i]);
|
||||
// cout << par[i] << " ";
|
||||
}
|
||||
// cout << endl;
|
||||
|
||||
if(fLastThreeChanged) {
|
||||
vector<double> interfaces;
|
||||
interfaces.push_back(par[5]+par[6]);
|
||||
interfaces.push_back(par[5]+par[6]+par[7]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(par.size()-3); i<par.size(); i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
fImpProfile->WeightLayers(par[3], interfaces, weights);
|
||||
}
|
||||
|
||||
TLondon1D_3LS BofZ3S(par_for_BofZ);
|
||||
TPofBCalc PofB3S(BofZ3S, *fImpProfile, par_for_PofB);
|
||||
fPofT->DoFFT(PofB3S);
|
||||
|
||||
} else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
}
|
||||
|
||||
fPofT->CalcPol(par_for_PofT);
|
||||
|
||||
fCalcNeeded = false;
|
||||
fLastThreeChanged = false;
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/26
|
||||
2008/05/30
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -37,13 +37,12 @@ TTrimSPData::TTrimSPData(const string &path, vector<string> &energyVec) {
|
||||
|
||||
energyStr = path + energyVec[i] + ".rge";
|
||||
|
||||
fEnergy.push_back(atof(energyVec[i].replace(2,1,".").c_str()));
|
||||
|
||||
ifstream *rgeFile = new ifstream(energyStr.c_str());
|
||||
if(! *rgeFile) {
|
||||
cout << "rge-file not found! Exit now." << endl;
|
||||
exit(-1);
|
||||
cout << "rge-file not found! Try next energy..." << endl;
|
||||
delete rgeFile;
|
||||
} else {
|
||||
fEnergy.push_back(atof(energyVec[i].replace(2,1,".").c_str()));
|
||||
|
||||
while(*rgeFile >> word)
|
||||
if(word == "PARTICLES") break;
|
||||
@ -66,6 +65,8 @@ TTrimSPData::TTrimSPData(const string &path, vector<string> &energyVec) {
|
||||
}
|
||||
}
|
||||
|
||||
cout << "Read in " << fDataNZ.size() << " implantation profiles in total." << endl;
|
||||
|
||||
fOrigDataNZ = fDataNZ;
|
||||
|
||||
for(unsigned int i(0); i<fEnergy.size();i++)
|
||||
|
16
src/external/TFitPofB-lib/include/TBofZCalc.h
vendored
16
src/external/TFitPofB-lib/include/TBofZCalc.h
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/24
|
||||
2008/05/30
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -69,7 +69,7 @@ public:
|
||||
};
|
||||
|
||||
//--------------------
|
||||
// Class "for Meissner screening" in a thin superconducting film - tri-layer with two different lambdas
|
||||
// Class "for Meissner screening" in a thin superconducting film - tri-layer with three different lambdas
|
||||
//--------------------
|
||||
|
||||
class TLondon1D_3L : public TBofZCalc {
|
||||
@ -80,4 +80,16 @@ public:
|
||||
|
||||
};
|
||||
|
||||
//--------------------
|
||||
// Class "for Meissner screening" in a thin superconducting film - tri-layer with two different lambdas
|
||||
//--------------------
|
||||
|
||||
class TLondon1D_3LS : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3LS( const vector<double>& );
|
||||
|
||||
};
|
||||
|
||||
#endif // _BofZCalc_H_
|
||||
|
77
src/external/TFitPofB-lib/include/TFitPofBStartupHandler.h
vendored
Normal file
77
src/external/TFitPofB-lib/include/TFitPofBStartupHandler.h
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
/***************************************************************************
|
||||
|
||||
TFitPofBStartupHandler.h
|
||||
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/30
|
||||
|
||||
based upon:
|
||||
$Id: PStartupHandler.h 3396 2008-05-29 14:41:33Z nemu $
|
||||
by Andreas Suter
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _TFITPOFBSTARTUPHANDLER_H_
|
||||
#define _TFITPOFBSTARTUPHANDLER_H_
|
||||
|
||||
#include <TList.h>
|
||||
#include <TQObject.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class TFitPofBStartupHandler : public TQObject {
|
||||
public:
|
||||
TFitPofBStartupHandler();
|
||||
virtual ~TFitPofBStartupHandler();
|
||||
|
||||
virtual void OnStartDocument(); // SLOT
|
||||
virtual void OnEndDocument(); // SLOT
|
||||
virtual void OnStartElement(const char*, const TList*); // SLOT
|
||||
virtual void OnEndElement(const char*); // SLOT
|
||||
virtual void OnCharacters(const char*); // SLOT
|
||||
virtual void OnComment(const char*); // SLOT
|
||||
virtual void OnWarning(const char*); // SLOT
|
||||
virtual void OnError(const char*); // SLOT
|
||||
virtual void OnFatalError(const char*); // SLOT
|
||||
virtual void OnCdataBlock(const char*, int); // SLOT
|
||||
|
||||
virtual void CheckLists();
|
||||
|
||||
virtual const string GetDataPath() const { return fDataPath; }
|
||||
virtual vector<string> GetEnergyList() const { return fEnergyList; }
|
||||
|
||||
private:
|
||||
enum EKeyWords {eEmpty, eComment, eDataPath, eEnergy, eEnergyList};
|
||||
|
||||
EKeyWords fKey;
|
||||
|
||||
string fDataPath;
|
||||
vector<string> fEnergyList;
|
||||
|
||||
ClassDef(TFitPofBStartupHandler, 1)
|
||||
};
|
||||
|
||||
#endif // _TFITPOFBSTARTUPHANDLER_H_
|
||||
|
23
src/external/TFitPofB-lib/include/TFitPofBStartupHandlerLinkDef.h
vendored
Normal file
23
src/external/TFitPofB-lib/include/TFitPofBStartupHandlerLinkDef.h
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/***************************************************************************
|
||||
|
||||
TLondon1DLinkDef.h
|
||||
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/29
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
// root dictionary stuff --------------------------------------------------
|
||||
#ifdef __CINT__
|
||||
|
||||
#pragma link off all globals;
|
||||
#pragma link off all classes;
|
||||
#pragma link off all functions;
|
||||
|
||||
#pragma link C++ class TFitPofBStartupHandler+;
|
||||
|
||||
#endif //__CINT__
|
||||
// root dictionary stuff --------------------------------------------------
|
||||
|
23
src/external/TFitPofB-lib/include/TLondon1D.h
vendored
23
src/external/TFitPofB-lib/include/TLondon1D.h
vendored
@ -5,7 +5,7 @@
|
||||
Author: Bastian M. Wojek
|
||||
e-mail: bastian.wojek@psi.ch
|
||||
|
||||
2008/05/29
|
||||
2008/05/30
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
class TLondon1D : public TObject {
|
||||
|
||||
public:
|
||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
||||
TLondon1D() : fCalcNeeded(true) {}
|
||||
virtual ~TLondon1D();
|
||||
|
||||
@ -35,6 +36,7 @@ protected:
|
||||
class TLondon1D1L : public TLondon1D {
|
||||
|
||||
public:
|
||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
||||
TLondon1D1L() {}
|
||||
TLondon1D1L(const vector<unsigned int>& , const vector<double>&);
|
||||
~TLondon1D1L() {}
|
||||
@ -47,6 +49,7 @@ public:
|
||||
class TLondon1D2L : public TLondon1D {
|
||||
|
||||
public:
|
||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
||||
TLondon1D2L() : fLastTwoChanged(true) {}
|
||||
TLondon1D2L(const vector<unsigned int>& , const vector<double>&);
|
||||
~TLondon1D2L() {}
|
||||
@ -59,9 +62,27 @@ private:
|
||||
ClassDef(TLondon1D2L,1)
|
||||
};
|
||||
|
||||
class TLondon1D3L : public TLondon1D {
|
||||
|
||||
public:
|
||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
||||
TLondon1D3L() : fLastThreeChanged(true) {}
|
||||
TLondon1D3L(const vector<unsigned int>& , const vector<double>&);
|
||||
~TLondon1D3L() {}
|
||||
|
||||
double Eval(double, const vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable bool fLastThreeChanged;
|
||||
|
||||
ClassDef(TLondon1D3L,1)
|
||||
};
|
||||
|
||||
|
||||
class TLondon1D3LS : public TLondon1D {
|
||||
|
||||
public:
|
||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
||||
TLondon1D3LS() : fLastThreeChanged(true) {}
|
||||
TLondon1D3LS(const vector<unsigned int>& , const vector<double>&);
|
||||
~TLondon1D3LS() {}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma link C++ class TLondon1D+;
|
||||
#pragma link C++ class TLondon1D1L+;
|
||||
#pragma link C++ class TLondon1D2L+;
|
||||
#pragma link C++ class TLondon1D3L+;
|
||||
#pragma link C++ class TLondon1D3LS+;
|
||||
|
||||
#endif //__CINT__
|
||||
|
@ -20,6 +20,7 @@
|
||||
class TPofTCalc {
|
||||
|
||||
public:
|
||||
|
||||
TPofTCalc(const vector<double>&);
|
||||
~TPofTCalc();
|
||||
|
||||
|
2
src/external/TFitPofB-lib/test/Makefile.test
vendored
2
src/external/TFitPofB-lib/test/Makefile.test
vendored
@ -19,7 +19,7 @@ CXXFLAGS += $(ROOTCFLAGS)
|
||||
LDFLAGS +=
|
||||
|
||||
# the ROOT libraries
|
||||
LIBS = $(ROOTLIBS)
|
||||
LIBS = $(ROOTLIBS) -lXMLParser
|
||||
|
||||
EXEC = test
|
||||
|
||||
|
17
src/external/TFitPofB-lib/test/TFitPofB_startup.xml
vendored
Normal file
17
src/external/TFitPofB-lib/test/TFitPofB_startup.xml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TFitPofB>
|
||||
<comment>
|
||||
TFitPofB_startup.xml
|
||||
Defines path and energies of TrimSP-rge-files to be read in
|
||||
</comment>
|
||||
<data_path>/home/l_wojek/TrimSP/AuYBCO_2005/AuYBCO-500000-</data_path>
|
||||
<energy_list>
|
||||
<energy>04_6</energy>
|
||||
<energy>09_6</energy>
|
||||
<energy>14_6</energy>
|
||||
<energy>18_6</energy>
|
||||
<energy>21_6</energy>
|
||||
<energy>24_6</energy>
|
||||
<energy>28_7</energy>
|
||||
</energy_list>
|
||||
</TFitPofB>
|
49
src/external/TFitPofB-lib/test/test.cpp
vendored
49
src/external/TFitPofB-lib/test/test.cpp
vendored
@ -101,7 +101,7 @@ int main(){
|
||||
/**************** Test TLondon1D1L *********************************
|
||||
|
||||
unsigned int parNo_arr[] = {1, 3, 5, 7, 9, 10, 11, 12};
|
||||
double par_arr[] = {0.0, 999.0, 0.01, 999.0, 0.01, 999.0, 21.6, 999.0, 100.0, 5.0, 190.0, 180.0};
|
||||
double par_arr[] = {0.0, 999.0, 0.01, 999.0, 0.01, 999.0, 4.6, 999.0, 100.0, 5.0, 190.0, 180.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])));
|
||||
@ -136,6 +136,25 @@ int main(){
|
||||
|
||||
/**************** Test TLondon1D3LS *********************************/
|
||||
|
||||
unsigned int parNo_arr[] = {1, 3, 5, 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};
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
TLondon1D3L fitter(parNo_vec, par_vec);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/**************** Test TLondon1D3LS *********************************
|
||||
|
||||
unsigned int parNo_arr[] = {1, 3, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
|
||||
double par_arr[] = {0.0, 999.0, 0.01, 999.0, 0.01, 999.0, 21.6, 999.0, 100.0, 5.0, 70.0, 50.0, 70.0, 180.0, 500.0, 1.0, 0.3, 1.0};
|
||||
|
||||
@ -150,7 +169,7 @@ int main(){
|
||||
|
||||
TLondon1D3LS fitter(parNo_vec, par_vec);
|
||||
|
||||
/************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
ofstream of01("test_fitter01.dat");
|
||||
ofstream of02("test_fitter02.dat");
|
||||
@ -169,46 +188,44 @@ int main(){
|
||||
}
|
||||
of01.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[10] -= 10.0;
|
||||
par_vec_sub[3] = 9.6;
|
||||
par_vec_sub[10] = 300.0;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of02 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of02.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[10] -= 10.0;
|
||||
par_vec_sub[0] = 40.6;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of03 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of03.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[13] = 0.3;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of04 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of04.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[10] -= 10.0;
|
||||
par_vec_sub[11] = 500.0;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of05 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of05.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[10] -= 10.0;
|
||||
/*
|
||||
par_vec_sub[3] = 24.6;
|
||||
par_vec_sub[7] -= 10.0;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of06 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of06.close();
|
||||
|
||||
par_vec_sub[0] += 10.0;
|
||||
par_vec_sub[3] = 28.7;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of07 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
@ -223,7 +240,7 @@ int main(){
|
||||
of08.close();
|
||||
|
||||
par_vec_sub[0] = 0.0;
|
||||
par_vec_sub[10] = 1000.0;
|
||||
par_vec_sub[7] = 1000.0;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of09 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
@ -231,13 +248,13 @@ int main(){
|
||||
of09.close();
|
||||
|
||||
par_vec_sub[0] = 0.0;
|
||||
par_vec_sub[12] = 1.0;
|
||||
par_vec_sub[7] = 10.0;
|
||||
|
||||
for (double i(0.); i<12.0; i+=0.003) {
|
||||
of10 << i << " " << fitter.Eval(i, par_vec_sub) << endl;
|
||||
}
|
||||
of10.close();
|
||||
|
||||
*/
|
||||
/*
|
||||
vector<double> data01, data02, data03, data04, data05, data06, data07, data08, data09, data10;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user