Adjusted a few things to get the thing working with musrfit
This commit is contained in:
parent
120574c5a2
commit
ce3078db6d
@ -5,7 +5,7 @@ ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
|
|||||||
|
|
||||||
#---------------------------------------------------
|
#---------------------------------------------------
|
||||||
|
|
||||||
|
OS = LINUX
|
||||||
CXX = g++
|
CXX = g++
|
||||||
CXXFLAGS = -g -Wall -Wno-trigraphs -fPIC
|
CXXFLAGS = -g -Wall -Wno-trigraphs -fPIC
|
||||||
MUSRFITINCLUDE = ../../../include
|
MUSRFITINCLUDE = ../../../include
|
||||||
@ -63,3 +63,9 @@ TFitPofBStartupHandlerDict.cpp: ../include/TFitPofBStartupHandler.h ../include/T
|
|||||||
@echo "Generating dictionary $@..."
|
@echo "Generating dictionary $@..."
|
||||||
rootcint -f $@ -c -p $^
|
rootcint -f $@ -c -p $^
|
||||||
|
|
||||||
|
install: all
|
||||||
|
@echo "Installing shared lib: libTFitPofB.so"
|
||||||
|
ifeq ($(OS),LINUX)
|
||||||
|
cp -pv $(SHLIB) $(ROOTSYS)/lib
|
||||||
|
cp -pv $(LOCALINCLUDE)/*.h $(ROOTSYS)/include
|
||||||
|
endif
|
||||||
|
214
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
214
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
@ -16,16 +16,54 @@ using namespace std;
|
|||||||
#include <TSAXParser.h>
|
#include <TSAXParser.h>
|
||||||
#include "TFitPofBStartupHandler.h"
|
#include "TFitPofBStartupHandler.h"
|
||||||
|
|
||||||
ClassImp(TLondon1D)
|
|
||||||
ClassImp(TLondon1D1L)
|
ClassImp(TLondon1D1L)
|
||||||
ClassImp(TLondon1D2L)
|
ClassImp(TLondon1D2L)
|
||||||
|
ClassImp(TLondon1D3L)
|
||||||
ClassImp(TLondon1D3LS)
|
ClassImp(TLondon1D3LS)
|
||||||
|
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
// Destructor of the TLondon1D class -- cleaning up
|
// Destructor of the TLondon1D1L/2L/3L/3LS classes -- cleaning up
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TLondon1D::~TLondon1D() {
|
TLondon1D1L::~TLondon1D1L() {
|
||||||
|
cout << "This is the TLondon1D1L-destructor. Jippieh!" << endl;
|
||||||
|
fPar.clear();
|
||||||
|
fParForBofZ.clear();
|
||||||
|
fParForPofB.clear();
|
||||||
|
fParForPofT.clear();
|
||||||
|
delete fImpProfile;
|
||||||
|
fImpProfile = 0;
|
||||||
|
delete fPofT;
|
||||||
|
fPofT = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TLondon1D2L::~TLondon1D2L() {
|
||||||
|
cout << "This is the TLondon1D2L-destructor. Jippieh!" << endl;
|
||||||
|
fPar.clear();
|
||||||
|
fParForBofZ.clear();
|
||||||
|
fParForPofB.clear();
|
||||||
|
fParForPofT.clear();
|
||||||
|
delete fImpProfile;
|
||||||
|
fImpProfile = 0;
|
||||||
|
delete fPofT;
|
||||||
|
fPofT = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TLondon1D3L::~TLondon1D3L() {
|
||||||
|
cout << "This is the TLondon1D3L-destructor. Jippieh!" << endl;
|
||||||
|
fPar.clear();
|
||||||
|
fParForBofZ.clear();
|
||||||
|
fParForPofB.clear();
|
||||||
|
fParForPofT.clear();
|
||||||
|
delete fImpProfile;
|
||||||
|
fImpProfile = 0;
|
||||||
|
delete fPofT;
|
||||||
|
fPofT = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TLondon1D3LS::~TLondon1D3LS() {
|
||||||
|
cout << "This is the TLondon1D3LS-destructor. Jippieh!" << endl;
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForBofZ.clear();
|
fParForBofZ.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -41,14 +79,8 @@ TLondon1D::~TLondon1D() {
|
|||||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TLondon1D1L::TLondon1D1L(const vector<double> &par) {
|
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
|
cout << "This is the TLondon1D1L-constructor. Juhu!" << endl;
|
||||||
// extract function parameters
|
|
||||||
// for(unsigned int i(0); i<parNo.size(); i++) {
|
|
||||||
// fPar.push_back(par[parNo[i]-1]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
fPar = par;
|
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("TFitPofB_startup.xml");
|
string startup_path_name("TFitPofB_startup.xml");
|
||||||
@ -67,16 +99,13 @@ TLondon1D1L::TLondon1D1L(const vector<double> &par) {
|
|||||||
string rge_path(startupHandler->GetDataPath());
|
string rge_path(startupHandler->GetDataPath());
|
||||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||||
|
|
||||||
fParForPofT.push_back(fPar[0]);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofT.push_back(startupHandler->GetDeltaB());
|
fParForPofT.push_back(startupHandler->GetDeltaB());
|
||||||
|
|
||||||
for (unsigned int i(2); i<fPar.size(); i++)
|
|
||||||
fParForBofZ.push_back(fPar[i]);
|
|
||||||
|
|
||||||
fParForPofB.push_back(startupHandler->GetDeltat());
|
fParForPofB.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofB.push_back(startupHandler->GetDeltaB());
|
fParForPofB.push_back(startupHandler->GetDeltaB());
|
||||||
fParForPofB.push_back(fPar[1]);
|
fParForPofB.push_back(0.0);
|
||||||
|
|
||||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||||
fImpProfile = x;
|
fImpProfile = x;
|
||||||
@ -88,7 +117,6 @@ TLondon1D1L::TLondon1D1L(const vector<double> &par) {
|
|||||||
y = 0;
|
y = 0;
|
||||||
delete y;
|
delete y;
|
||||||
|
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (saxParser) {
|
if (saxParser) {
|
||||||
delete saxParser;
|
delete saxParser;
|
||||||
@ -107,6 +135,25 @@ TLondon1D1L::TLondon1D1L(const vector<double> &par) {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D1L::operator()(double t, const vector<double> &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); i<fPar.size(); i++){
|
||||||
|
cout << "fPar[" << i << "] = " << fPar[i] << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i(2); i<fPar.size(); i++){
|
||||||
|
fParForBofZ.push_back(fPar[i]);
|
||||||
|
cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||||
|
}
|
||||||
|
fFirstCall=false;
|
||||||
|
cout << this << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// check if any parameter has changed
|
// check if any parameter has changed
|
||||||
|
|
||||||
@ -136,9 +183,9 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
if(!only_phase_changed) {
|
if(!only_phase_changed) {
|
||||||
|
|
||||||
cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||||
|
|
||||||
for (unsigned int i(2); i<par.size(); i++)
|
for (unsigned int i(2); i<fPar.size(); i++)
|
||||||
fParForBofZ[i-2] = par[i];
|
fParForBofZ[i-2] = par[i];
|
||||||
|
|
||||||
fParForPofB[2] = par[1]; // energy
|
fParForPofB[2] = par[1]; // energy
|
||||||
@ -147,9 +194,9 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
TPofBCalc PofB1(BofZ1, *fImpProfile, fParForPofB);
|
TPofBCalc PofB1(BofZ1, *fImpProfile, fParForPofB);
|
||||||
fPofT->DoFFT(PofB1);
|
fPofT->DoFFT(PofB1);
|
||||||
|
|
||||||
} else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
|
|
||||||
@ -165,15 +212,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TLondon1D2L::TLondon1D2L(const vector<double> &par) : fLastTwoChanged(true) {
|
TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true), fLastTwoChanged(true) {
|
||||||
|
|
||||||
// extract function parameters
|
|
||||||
// for(unsigned int i(0); i<parNo.size(); i++) {
|
|
||||||
// fPar.push_back(par[parNo[i]-1]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
fPar = par;
|
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("TFitPofB_startup.xml");
|
string startup_path_name("TFitPofB_startup.xml");
|
||||||
|
|
||||||
@ -191,16 +230,13 @@ TLondon1D2L::TLondon1D2L(const vector<double> &par) : fLastTwoChanged(true) {
|
|||||||
string rge_path(startupHandler->GetDataPath());
|
string rge_path(startupHandler->GetDataPath());
|
||||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||||
|
|
||||||
fParForPofT.push_back(fPar[0]);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofT.push_back(startupHandler->GetDeltaB());
|
fParForPofT.push_back(startupHandler->GetDeltaB());
|
||||||
|
|
||||||
for (unsigned int i(2); i<fPar.size(); i++)
|
|
||||||
fParForBofZ.push_back(fPar[i]);
|
|
||||||
|
|
||||||
fParForPofB.push_back(startupHandler->GetDeltat());
|
fParForPofB.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofB.push_back(startupHandler->GetDeltaB());
|
fParForPofB.push_back(startupHandler->GetDeltaB());
|
||||||
fParForPofB.push_back(fPar[1]);
|
fParForPofB.push_back(0.0);
|
||||||
|
|
||||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||||
fImpProfile = x;
|
fImpProfile = x;
|
||||||
@ -230,6 +266,24 @@ TLondon1D2L::TLondon1D2L(const vector<double> &par) : fLastTwoChanged(true) {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D2L::operator()(double t, const vector<double> &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); i<fPar.size(); i++){
|
||||||
|
cout << "fPar[" << i << "] = " << fPar[i] << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i(2); i<fPar.size(); i++){
|
||||||
|
fParForBofZ.push_back(fPar[i]);
|
||||||
|
cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||||
|
}
|
||||||
|
fFirstCall=false;
|
||||||
|
}
|
||||||
|
|
||||||
// check if any parameter has changed
|
// check if any parameter has changed
|
||||||
|
|
||||||
@ -261,7 +315,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
if(!only_phase_changed) {
|
if(!only_phase_changed) {
|
||||||
|
|
||||||
cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||||
|
|
||||||
for (unsigned int i(2); i<par.size(); i++)
|
for (unsigned int i(2); i<par.size(); i++)
|
||||||
fParForBofZ[i-2] = par[i];
|
fParForBofZ[i-2] = par[i];
|
||||||
@ -284,9 +338,9 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
TPofBCalc PofB2(BofZ2, *fImpProfile, fParForPofB);
|
TPofBCalc PofB2(BofZ2, *fImpProfile, fParForPofB);
|
||||||
fPofT->DoFFT(PofB2);
|
fPofT->DoFFT(PofB2);
|
||||||
|
|
||||||
} else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
|
|
||||||
@ -303,15 +357,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TLondon1D3L::TLondon1D3L(const vector<double> &par) : fLastThreeChanged(true) {
|
TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true), fLastThreeChanged(true) {
|
||||||
|
|
||||||
// extract function parameters
|
|
||||||
// for(unsigned int i(0); i<parNo.size(); i++) {
|
|
||||||
// fPar.push_back(par[parNo[i]-1]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
fPar = par;
|
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("TFitPofB_startup.xml");
|
string startup_path_name("TFitPofB_startup.xml");
|
||||||
|
|
||||||
@ -329,16 +375,13 @@ TLondon1D3L::TLondon1D3L(const vector<double> &par) : fLastThreeChanged(true) {
|
|||||||
string rge_path(startupHandler->GetDataPath());
|
string rge_path(startupHandler->GetDataPath());
|
||||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||||
|
|
||||||
fParForPofT.push_back(fPar[0]);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofT.push_back(startupHandler->GetDeltaB());
|
fParForPofT.push_back(startupHandler->GetDeltaB());
|
||||||
|
|
||||||
for (unsigned int i(2); i<fPar.size(); i++)
|
|
||||||
fParForBofZ.push_back(fPar[i]);
|
|
||||||
|
|
||||||
fParForPofB.push_back(startupHandler->GetDeltat());
|
fParForPofB.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofB.push_back(startupHandler->GetDeltaB());
|
fParForPofB.push_back(startupHandler->GetDeltaB());
|
||||||
fParForPofB.push_back(fPar[1]);
|
fParForPofB.push_back(0.0);
|
||||||
|
|
||||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||||
fImpProfile = x;
|
fImpProfile = x;
|
||||||
@ -359,7 +402,6 @@ TLondon1D3L::TLondon1D3L(const vector<double> &par) : fLastThreeChanged(true) {
|
|||||||
delete startupHandler;
|
delete startupHandler;
|
||||||
startupHandler = 0;
|
startupHandler = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -369,6 +411,24 @@ TLondon1D3L::TLondon1D3L(const vector<double> &par) : fLastThreeChanged(true) {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D3L::operator()(double t, const vector<double> &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); i<fPar.size(); i++){
|
||||||
|
cout << "fPar[" << i << "] = " << fPar[i] << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i(2); i<fPar.size(); i++){
|
||||||
|
fParForBofZ.push_back(fPar[i]);
|
||||||
|
cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||||
|
}
|
||||||
|
fFirstCall=false;
|
||||||
|
}
|
||||||
|
|
||||||
// check if any parameter has changed
|
// check if any parameter has changed
|
||||||
|
|
||||||
@ -400,7 +460,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
if(!only_phase_changed) {
|
if(!only_phase_changed) {
|
||||||
|
|
||||||
cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||||
|
|
||||||
for (unsigned int i(2); i<par.size(); i++)
|
for (unsigned int i(2); i<par.size(); i++)
|
||||||
fParForBofZ[i-2] = par[i];
|
fParForBofZ[i-2] = par[i];
|
||||||
@ -438,9 +498,9 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
TPofBCalc PofB3(BofZ3, *fImpProfile, fParForPofB);
|
TPofBCalc PofB3(BofZ3, *fImpProfile, fParForPofB);
|
||||||
fPofT->DoFFT(PofB3);
|
fPofT->DoFFT(PofB3);
|
||||||
|
|
||||||
} else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
|
|
||||||
@ -457,15 +517,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TLondon1D3LS::TLondon1D3LS(const vector<double> &par) : fLastThreeChanged(true) {
|
TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true), fLastThreeChanged(true) {
|
||||||
|
|
||||||
// extract function parameters
|
|
||||||
// for(unsigned int i(0); i<parNo.size(); i++) {
|
|
||||||
// fPar.push_back(par[parNo[i]-1]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
fPar = par;
|
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("TFitPofB_startup.xml");
|
string startup_path_name("TFitPofB_startup.xml");
|
||||||
|
|
||||||
@ -483,16 +535,13 @@ TLondon1D3LS::TLondon1D3LS(const vector<double> &par) : fLastThreeChanged(true)
|
|||||||
string rge_path(startupHandler->GetDataPath());
|
string rge_path(startupHandler->GetDataPath());
|
||||||
vector<string> energy_vec(startupHandler->GetEnergyList());
|
vector<string> energy_vec(startupHandler->GetEnergyList());
|
||||||
|
|
||||||
fParForPofT.push_back(fPar[0]);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofT.push_back(startupHandler->GetDeltaB());
|
fParForPofT.push_back(startupHandler->GetDeltaB());
|
||||||
|
|
||||||
for (unsigned int i(2); i<fPar.size(); i++)
|
|
||||||
fParForBofZ.push_back(fPar[i]);
|
|
||||||
|
|
||||||
fParForPofB.push_back(startupHandler->GetDeltat());
|
fParForPofB.push_back(startupHandler->GetDeltat());
|
||||||
fParForPofB.push_back(startupHandler->GetDeltaB());
|
fParForPofB.push_back(startupHandler->GetDeltaB());
|
||||||
fParForPofB.push_back(fPar[1]);
|
fParForPofB.push_back(0.0);
|
||||||
|
|
||||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||||
fImpProfile = x;
|
fImpProfile = x;
|
||||||
@ -513,7 +562,6 @@ TLondon1D3LS::TLondon1D3LS(const vector<double> &par) : fLastThreeChanged(true)
|
|||||||
delete startupHandler;
|
delete startupHandler;
|
||||||
startupHandler = 0;
|
startupHandler = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -523,6 +571,24 @@ TLondon1D3LS::TLondon1D3LS(const vector<double> &par) : fLastThreeChanged(true)
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
double TLondon1D3LS::operator()(double t, const vector<double> &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); i<fPar.size(); i++){
|
||||||
|
cout << "fPar[" << i << "] = " << fPar[i] << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i(2); i<fPar.size(); i++){
|
||||||
|
fParForBofZ.push_back(fPar[i]);
|
||||||
|
cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||||
|
}
|
||||||
|
fFirstCall=false;
|
||||||
|
}
|
||||||
|
|
||||||
// check if any parameter has changed
|
// check if any parameter has changed
|
||||||
|
|
||||||
@ -554,7 +620,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
if(!only_phase_changed) {
|
if(!only_phase_changed) {
|
||||||
|
|
||||||
cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||||
|
|
||||||
for (unsigned int i(2); i<par.size(); i++)
|
for (unsigned int i(2); i<par.size(); i++)
|
||||||
fParForBofZ[i-2] = par[i];
|
fParForBofZ[i-2] = par[i];
|
||||||
@ -578,9 +644,9 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
|||||||
TPofBCalc PofB3S(BofZ3S, *fImpProfile, fParForPofB);
|
TPofBCalc PofB3S(BofZ3S, *fImpProfile, fParForPofB);
|
||||||
fPofT->DoFFT(PofB3S);
|
fPofT->DoFFT(PofB3S);
|
||||||
|
|
||||||
} else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
@ -93,7 +93,7 @@ void TPofTCalc::DoFFT(const TPofBCalc &PofB) {
|
|||||||
fFFTout[i][1] = 0.0;
|
fFFTout[i][1] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "perform the Fourier transform..." << endl;
|
// cout << "perform the Fourier transform..." << endl;
|
||||||
|
|
||||||
fftw_execute(fFFTplan);
|
fftw_execute(fFFTplan);
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ TPofTCalc::~TPofTCalc() {
|
|||||||
fftw_destroy_plan(fFFTplan);
|
fftw_destroy_plan(fFFTplan);
|
||||||
free(fFFTin);
|
free(fFFTin);
|
||||||
fftw_free(fFFTout);
|
fftw_free(fFFTout);
|
||||||
fftw_cleanup();
|
// fftw_cleanup();
|
||||||
fT.clear();
|
fT.clear();
|
||||||
fPT.clear();
|
fPT.clear();
|
||||||
|
|
||||||
|
83
src/external/TFitPofB-lib/include/TLondon1D.h
vendored
83
src/external/TFitPofB-lib/include/TLondon1D.h
vendored
@ -15,86 +15,101 @@
|
|||||||
#include "PUserFcnBase.h"
|
#include "PUserFcnBase.h"
|
||||||
#include "TPofTCalc.h"
|
#include "TPofTCalc.h"
|
||||||
|
|
||||||
class TLondon1D : public PUserFcnBase {
|
class TLondon1D1L : public PUserFcnBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
// default conctructor
|
||||||
TLondon1D() : fCalcNeeded(true) {}
|
TLondon1D1L();
|
||||||
virtual ~TLondon1D();
|
~TLondon1D1L();
|
||||||
|
|
||||||
virtual double operator()(double, const vector<double>&) const = 0;
|
double operator()(double, const vector<double>&) const;
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
mutable vector<double> fPar;
|
mutable vector<double> fPar;
|
||||||
TTrimSPData *fImpProfile;
|
TTrimSPData *fImpProfile;
|
||||||
TPofTCalc *fPofT;
|
TPofTCalc *fPofT;
|
||||||
mutable bool fCalcNeeded;
|
mutable bool fCalcNeeded;
|
||||||
|
mutable bool fFirstCall;
|
||||||
mutable vector<double> fParForPofT;
|
mutable vector<double> fParForPofT;
|
||||||
mutable vector<double> fParForBofZ;
|
mutable vector<double> fParForBofZ;
|
||||||
mutable vector<double> fParForPofB;
|
mutable vector<double> fParForPofB;
|
||||||
string fWisdom;
|
string fWisdom;
|
||||||
unsigned int fNSteps;
|
unsigned int fNSteps;
|
||||||
|
|
||||||
ClassDef(TLondon1D,1)
|
|
||||||
};
|
|
||||||
|
|
||||||
class TLondon1D1L : public TLondon1D {
|
|
||||||
|
|
||||||
public:
|
|
||||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
|
||||||
TLondon1D1L() {}
|
|
||||||
TLondon1D1L(const vector<double>&);
|
|
||||||
~TLondon1D1L() {}
|
|
||||||
|
|
||||||
double operator()(double, const vector<double>&) const;
|
|
||||||
|
|
||||||
ClassDef(TLondon1D1L,1)
|
ClassDef(TLondon1D1L,1)
|
||||||
};
|
};
|
||||||
|
|
||||||
class TLondon1D2L : public TLondon1D {
|
class TLondon1D2L : public PUserFcnBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
// default conctructor
|
||||||
TLondon1D2L() : fLastTwoChanged(true) {}
|
TLondon1D2L();
|
||||||
TLondon1D2L(const vector<double>&);
|
~TLondon1D2L();
|
||||||
~TLondon1D2L() {}
|
|
||||||
|
|
||||||
double operator()(double, const vector<double>&) const;
|
double operator()(double, const vector<double>&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable vector<double> fPar;
|
||||||
|
TTrimSPData *fImpProfile;
|
||||||
|
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 bool fLastTwoChanged;
|
mutable bool fLastTwoChanged;
|
||||||
|
|
||||||
ClassDef(TLondon1D2L,1)
|
ClassDef(TLondon1D2L,1)
|
||||||
};
|
};
|
||||||
|
|
||||||
class TLondon1D3L : public TLondon1D {
|
class TLondon1D3L : public PUserFcnBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
// default conctructor
|
||||||
TLondon1D3L() : fLastThreeChanged(true) {}
|
TLondon1D3L();
|
||||||
TLondon1D3L(const vector<double>&);
|
~TLondon1D3L();
|
||||||
~TLondon1D3L() {}
|
|
||||||
|
|
||||||
double operator()(double, const vector<double>&) const;
|
double operator()(double, const vector<double>&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable vector<double> fPar;
|
||||||
|
TTrimSPData *fImpProfile;
|
||||||
|
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 bool fLastThreeChanged;
|
mutable bool fLastThreeChanged;
|
||||||
|
|
||||||
ClassDef(TLondon1D3L,1)
|
ClassDef(TLondon1D3L,1)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TLondon1D3LS : public TLondon1D {
|
class TLondon1D3LS : public PUserFcnBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// default conctructor only for the ROOT dictionary - DO NOT USE IT OTHERWISE!
|
// default conctructor
|
||||||
TLondon1D3LS() : fLastThreeChanged(true) {}
|
TLondon1D3LS();
|
||||||
TLondon1D3LS(const vector<double>&);
|
~TLondon1D3LS();
|
||||||
~TLondon1D3LS() {}
|
|
||||||
|
|
||||||
double operator()(double, const vector<double>&) const;
|
double operator()(double, const vector<double>&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable vector<double> fPar;
|
||||||
|
TTrimSPData *fImpProfile;
|
||||||
|
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 bool fLastThreeChanged;
|
mutable bool fLastThreeChanged;
|
||||||
|
|
||||||
ClassDef(TLondon1D3LS,1)
|
ClassDef(TLondon1D3LS,1)
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#pragma link off all classes;
|
#pragma link off all classes;
|
||||||
#pragma link off all functions;
|
#pragma link off all functions;
|
||||||
|
|
||||||
#pragma link C++ class TLondon1D+;
|
|
||||||
#pragma link C++ class TLondon1D1L+;
|
#pragma link C++ class TLondon1D1L+;
|
||||||
#pragma link C++ class TLondon1D2L+;
|
#pragma link C++ class TLondon1D2L+;
|
||||||
#pragma link C++ class TLondon1D3L+;
|
#pragma link C++ class TLondon1D3L+;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user