modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted, the version is changed to 1.4.3
This commit is contained in:
52
src/external/BMWtools/BMWIntegrator.h
vendored
52
src/external/BMWtools/BMWIntegrator.h
vendored
@ -36,8 +36,6 @@
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* <p>Alternative base class for 1D integrations using the GNU Scientific Library integrator.
|
||||
* The difference to the other class is that here the integration parameters have to be supplied directly to the IntegrateFunc method.
|
||||
@ -67,7 +65,7 @@ class T2Integrator {
|
||||
*/
|
||||
inline double T2Integrator::FuncAtXgsl(double x, void *ptrPair)
|
||||
{
|
||||
pair<T2Integrator*, const vector<double>*> *pairOfPointers = static_cast<pair<T2Integrator*, const vector<double>*>*>(ptrPair);
|
||||
std::pair<T2Integrator*, const std::vector<double>*> *pairOfPointers = static_cast<std::pair<T2Integrator*, const std::vector<double>*>*>(ptrPair);
|
||||
return pairOfPointers->first->FuncAtX(x, *(pairOfPointers->second));
|
||||
}
|
||||
|
||||
@ -83,14 +81,14 @@ inline double T2Integrator::FuncAtXgsl(double x, void *ptrPair)
|
||||
*/
|
||||
inline double T2Integrator::IntegrateFunc(double x1, double x2, const std::vector<double> &par)
|
||||
{
|
||||
pair<T2Integrator*, const vector<double>*> ptrPair;
|
||||
std::pair<T2Integrator*, const std::vector<double>*> ptrPair;
|
||||
ptrPair.first = (this);
|
||||
ptrPair.second = ∥
|
||||
|
||||
ROOT::Math::GSLIntegrator *integrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
double value(integrator->Integral(&T2Integrator::FuncAtXgsl, static_cast<void*>(&ptrPair), x1, x2));
|
||||
delete integrator;
|
||||
integrator = 0;
|
||||
integrator = nullptr;
|
||||
|
||||
return value;
|
||||
}
|
||||
@ -123,7 +121,7 @@ class TIntegrator {
|
||||
double IntegrateFunc(double, double);
|
||||
|
||||
protected:
|
||||
mutable vector<double> fPar; ///< parameters of the integrand
|
||||
mutable std::vector<double> fPar; ///< parameters of the integrand
|
||||
|
||||
private:
|
||||
static double FuncAtXgsl(double, void *);
|
||||
@ -146,7 +144,7 @@ inline TIntegrator::TIntegrator() : fFunc(0) {
|
||||
inline TIntegrator::~TIntegrator(){
|
||||
fPar.clear();
|
||||
delete fIntegrator;
|
||||
fIntegrator=0;
|
||||
fIntegrator=nullptr;
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
@ -193,7 +191,7 @@ class TMCIntegrator {
|
||||
double IntegrateFunc(size_t, double *, double *);
|
||||
|
||||
protected:
|
||||
mutable vector<double> fPar; ///< parameters of the integrand
|
||||
mutable std::vector<double> fPar; ///< parameters of the integrand
|
||||
|
||||
private:
|
||||
static double FuncAtXgsl(double *, size_t, void *);
|
||||
@ -216,7 +214,7 @@ inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
||||
inline TMCIntegrator::~TMCIntegrator(){
|
||||
fPar.clear();
|
||||
delete fMCIntegrator;
|
||||
fMCIntegrator=0;
|
||||
fMCIntegrator=nullptr;
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
@ -265,7 +263,7 @@ class TDWaveGapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -284,7 +282,7 @@ class TCosSqDWaveGapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -303,7 +301,7 @@ class TSinSqDWaveGapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -321,7 +319,7 @@ class TAnSWaveGapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -339,7 +337,7 @@ class TAnSWaveGapIntegralDivonne {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -357,7 +355,7 @@ class TAnSWaveGapIntegralSuave {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -375,7 +373,7 @@ class TNonMonDWave1GapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -393,7 +391,7 @@ class TNonMonDWave2GapIntegralCuhre {
|
||||
double IntegrateFunc();
|
||||
|
||||
protected:
|
||||
static vector<double> fPar; ///< parameters of the integrand
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
@ -485,7 +483,7 @@ class TIntBesselJ0Exp : public T2Integrator {
|
||||
~TIntBesselJ0Exp() {}
|
||||
|
||||
private:
|
||||
double FuncAtX(double, const vector<double>&) const;
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -496,7 +494,7 @@ class TIntBesselJ0Exp : public T2Integrator {
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TIntBesselJ0Exp::FuncAtX(double x, const vector<double> &par) const
|
||||
inline double TIntBesselJ0Exp::FuncAtX(double x, const std::vector<double> &par) const
|
||||
{
|
||||
double w0t(TMath::TwoPi()*par[0]*x);
|
||||
double j0;
|
||||
@ -518,7 +516,7 @@ class TIntSinGss : public T2Integrator {
|
||||
~TIntSinGss() {}
|
||||
|
||||
private:
|
||||
double FuncAtX(double, const vector<double>&) const;
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -529,7 +527,7 @@ class TIntSinGss : public T2Integrator {
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TIntSinGss::FuncAtX(double x, const vector<double> &par) const
|
||||
inline double TIntSinGss::FuncAtX(double x, const std::vector<double> &par) const
|
||||
{
|
||||
return TMath::Sin(TMath::TwoPi()*par[0]*x) * TMath::Exp(-0.5*par[1]*par[1]*x*x);
|
||||
}
|
||||
@ -546,7 +544,7 @@ class TIntSGInterpolation : public T2Integrator {
|
||||
~TIntSGInterpolation() {}
|
||||
|
||||
private:
|
||||
double FuncAtX(double, const vector<double>&) const;
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -557,7 +555,7 @@ class TIntSGInterpolation : public T2Integrator {
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TIntSGInterpolation::FuncAtX(double x, const vector<double> &par) const
|
||||
inline double TIntSGInterpolation::FuncAtX(double x, const std::vector<double> &par) const
|
||||
{
|
||||
// Parameters: nu_L [MHz], a [1/us], lambda [1/us], beta [1], t [us]
|
||||
double wt(TMath::TwoPi()*par[0]*x);
|
||||
@ -600,7 +598,7 @@ class TFirstUniaxialGssKTIntegral : public T2Integrator {
|
||||
virtual ~TFirstUniaxialGssKTIntegral() {}
|
||||
|
||||
private:
|
||||
virtual double FuncAtX(double, const vector<double>&) const; // variable: x
|
||||
virtual double FuncAtX(double, const std::vector<double>&) const; // variable: x
|
||||
};
|
||||
|
||||
/**
|
||||
@ -611,7 +609,7 @@ class TFirstUniaxialGssKTIntegral : public T2Integrator {
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TFirstUniaxialGssKTIntegral::FuncAtX(double x, const vector<double> &par) const
|
||||
inline double TFirstUniaxialGssKTIntegral::FuncAtX(double x, const std::vector<double> &par) const
|
||||
{
|
||||
double eps(par[0]*par[0]/(par[1]*par[1]) - 1.0);
|
||||
double p(1.0 + eps*x*x);
|
||||
@ -630,7 +628,7 @@ class TSecondUniaxialGssKTIntegral : public T2Integrator {
|
||||
virtual ~TSecondUniaxialGssKTIntegral() {}
|
||||
|
||||
private:
|
||||
virtual double FuncAtX(double, const vector<double>&) const; // variable: x
|
||||
virtual double FuncAtX(double, const std::vector<double>&) const; // variable: x
|
||||
};
|
||||
|
||||
/**
|
||||
@ -641,7 +639,7 @@ class TSecondUniaxialGssKTIntegral : public T2Integrator {
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TSecondUniaxialGssKTIntegral::FuncAtX(double x, const vector<double> &par) const
|
||||
inline double TSecondUniaxialGssKTIntegral::FuncAtX(double x, const std::vector<double> &par) const
|
||||
{
|
||||
double eps(par[0]*par[0]/(par[1]*par[1]) - 1.0);
|
||||
double p(1.0 + eps*x*x);
|
||||
|
91
src/external/BMWtools/BMWStartupHandler.cpp
vendored
91
src/external/BMWtools/BMWStartupHandler.cpp
vendored
@ -32,7 +32,6 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@ -245,8 +244,8 @@ void BMWStartupHandler::OnComment(const char *str)
|
||||
*/
|
||||
void BMWStartupHandler::OnWarning(const char *str)
|
||||
{
|
||||
cerr << endl << "BMWStartupHandler::OnWarning: BMWStartupHandler **WARNING** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "BMWStartupHandler::OnWarning: BMWStartupHandler **WARNING** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -259,8 +258,8 @@ void BMWStartupHandler::OnWarning(const char *str)
|
||||
*/
|
||||
void BMWStartupHandler::OnError(const char *str)
|
||||
{
|
||||
cerr << endl << "BMWStartupHandler::OnError: BMWStartupHandler **ERROR** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "BMWStartupHandler::OnError: BMWStartupHandler **ERROR** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -273,8 +272,8 @@ void BMWStartupHandler::OnError(const char *str)
|
||||
*/
|
||||
void BMWStartupHandler::OnFatalError(const char *str)
|
||||
{
|
||||
cerr << endl << "BMWStartupHandler::OnFatalError: BMWStartupHandler **FATAL ERROR** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "BMWStartupHandler::OnFatalError: BMWStartupHandler **FATAL ERROR** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -305,107 +304,107 @@ void BMWStartupHandler::CheckLists()
|
||||
if(fLF) {
|
||||
// check if delta_t_LF is given, if not set default
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check specified LF time resolution for the Laplace transform ... " << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check specified LF time resolution for the Laplace transform ... " << std::endl;
|
||||
if(!fDeltatLF) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the LF time resolution. Setting the default (0.04 ns)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the LF time resolution. Setting the default (0.04 ns)." << std::endl;
|
||||
fDeltatLF = 0.00004;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fDeltatLF << " us" << endl;
|
||||
std::cout << fDeltatLF << " us" << std::endl;
|
||||
}
|
||||
|
||||
// check if N_LF is given, if not set default
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check length of the Laplace transform ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check length of the Laplace transform ..." << std::endl;
|
||||
if (!fNStepsLF) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the length of the Laplace transform. Setting the default (524288)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the length of the Laplace transform. Setting the default (524288)." << std::endl;
|
||||
fNStepsLF = 524288;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fNStepsLF << endl;
|
||||
std::cout << fNStepsLF << std::endl;
|
||||
}
|
||||
} else {
|
||||
// check if delta_t is given, if not set default
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check specified time resolution ... " << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check specified time resolution ... " << std::endl;
|
||||
if(!fDeltat) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the time resolution. Setting the default (10 ns)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the time resolution. Setting the default (10 ns)." << std::endl;
|
||||
fDeltat = 0.01;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fDeltat << " us" << endl;
|
||||
std::cout << fDeltat << " us" << std::endl;
|
||||
}
|
||||
|
||||
// check if delta_B is given, if not set default
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check specified field resolution ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check specified field resolution ..." << std::endl;
|
||||
if(!fDeltaB) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the field resolution. Setting the default (0.1 G)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the field resolution. Setting the default (0.1 G)." << std::endl;
|
||||
fDeltaB = 0.1;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fDeltaB << " G" << endl;
|
||||
std::cout << fDeltaB << " G" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// check if any wisdom-file is specified
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check wisdom file ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check wisdom file ..." << std::endl;
|
||||
if (!fWisdomFile.size()) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify a wisdom file. No FFTW plans will be loaded or saved." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify a wisdom file. No FFTW plans will be loaded or saved." << std::endl;
|
||||
fWisdomFile = "";
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fWisdomFile << endl;
|
||||
std::cout << fWisdomFile << std::endl;
|
||||
}
|
||||
|
||||
// check if any float-wisdom-file is specified
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check float-wisdom file ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check float-wisdom file ..." << std::endl;
|
||||
if (!fWisdomFile.size()) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify a float-wisdom file. No FFTW plans will be loaded or saved." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify a float-wisdom file. No FFTW plans will be loaded or saved." << std::endl;
|
||||
fWisdomFileFloat = "";
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fWisdomFileFloat << endl;
|
||||
std::cout << fWisdomFileFloat << std::endl;
|
||||
}
|
||||
|
||||
if (fLEM) {
|
||||
|
||||
// check if any data path is given
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check data path ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check data path ..." << std::endl;
|
||||
if (fDataPath.empty()) {
|
||||
cerr << "BMWStartupHandler::CheckLists: 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;
|
||||
std::cerr << "BMWStartupHandler::CheckLists: This is not going to work, you have to set a valid data path where to find the rge-files in the xml-file!" << std::endl;
|
||||
assert(!fDataPath.empty());
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fDataPath << endl;
|
||||
std::cout << fDataPath << std::endl;
|
||||
}
|
||||
|
||||
// check if any energies are given
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check energy list ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check energy list ..." << std::endl;
|
||||
if (fEnergyList.size() != fEnergyLabelList.size()) {
|
||||
cerr << "BMWStartupHandler::CheckLists: The number of energies and energy labels are different! Please fix it!" << endl \
|
||||
<< "BMWStartupHandler::CheckLists: The program will be terminated now!" << endl;
|
||||
std::cerr << "BMWStartupHandler::CheckLists: The number of energies and energy labels are different! Please fix it!" << std::endl \
|
||||
<< "BMWStartupHandler::CheckLists: The program will be terminated now!" << std::endl;
|
||||
assert(fEnergyList.size() == fEnergyLabelList.size());
|
||||
}
|
||||
if (fEnergyList.empty()) {
|
||||
cerr << "BMWStartupHandler::CheckLists: Energy list empty!" << endl \
|
||||
<< "BMWStartupHandler::CheckLists: Trying to use the standard energies: 0.0 to 35.0 keV in 0.1 keV steps" << endl;
|
||||
std::cerr << "BMWStartupHandler::CheckLists: Energy list empty!" << std::endl \
|
||||
<< "BMWStartupHandler::CheckLists: Trying to use the standard energies: 0.0 to 35.0 keV in 0.1 keV steps" << std::endl;
|
||||
for (double x(0.0); x<= 35.0; x+=0.1) {
|
||||
fEnergyList.push_back(x);
|
||||
}
|
||||
}
|
||||
if (fEnergyLabelList.empty()) {
|
||||
cerr << "BMWStartupHandler::CheckLists: Energy label list empty!" << endl \
|
||||
<< "BMWStartupHandler::CheckLists: Trying to use the specified energies as labels in the format %02.1f..." << endl \
|
||||
<< "BMWStartupHandler::CheckLists: Most probably this will go wrong and should therefore be fixed in the xml-file!" << endl;
|
||||
std::cerr << "BMWStartupHandler::CheckLists: Energy label list empty!" << std::endl \
|
||||
<< "BMWStartupHandler::CheckLists: Trying to use the specified energies as labels in the format %02.1f..." << std::endl \
|
||||
<< "BMWStartupHandler::CheckLists: Most probably this will go wrong and should therefore be fixed in the xml-file!" << std::endl;
|
||||
char eChar[5];
|
||||
for(unsigned int i(0); i<fEnergyList.size(); i++) {
|
||||
sprintf(eChar, "%02.1f", fEnergyList[i]);
|
||||
fEnergyLabelList.push_back(string(eChar));
|
||||
fEnergyLabelList.push_back(std::string(eChar));
|
||||
}
|
||||
}
|
||||
|
||||
@ -416,33 +415,33 @@ void BMWStartupHandler::CheckLists()
|
||||
}
|
||||
|
||||
if(fDebug) {
|
||||
cout << "Energies and Labels:" << endl;
|
||||
for ( map<double, string>::const_iterator iter(fEnergies.begin()); iter != fEnergies.end(); ++iter )
|
||||
cout << iter->first << " " << iter->second << endl;
|
||||
std::cout << "Energies and Labels:" << std::endl;
|
||||
for ( std::map<double, std::string>::const_iterator iter(fEnergies.begin()); iter != fEnergies.end(); ++iter )
|
||||
std::cout << iter->first << " " << iter->second << std::endl;
|
||||
}
|
||||
|
||||
// check if any number of steps for the theory function is specified
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check number of steps for theory ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check number of steps for theory ..." << std::endl;
|
||||
if (!fNSteps) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the number of steps for the theory. Setting the default (3000)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the number of steps for the theory. Setting the default (3000)." << std::endl;
|
||||
fNSteps = 3000;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fNSteps << endl;
|
||||
std::cout << fNSteps << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (fVortex) {
|
||||
// check if any number of steps for the theory function is specified
|
||||
if(fDebug)
|
||||
cout << endl << "BMWStartupHandler::CheckLists: check number of steps for Vortex grid ..." << endl;
|
||||
std::cout << std::endl << "BMWStartupHandler::CheckLists: check number of steps for Vortex grid ..." << std::endl;
|
||||
if (!fGridSteps) {
|
||||
cout << "BMWStartupHandler::CheckLists: You did not specify the number of steps for the grid. Setting the default (256)." << endl;
|
||||
std::cout << "BMWStartupHandler::CheckLists: You did not specify the number of steps for the grid. Setting the default (256)." << std::endl;
|
||||
fGridSteps = 256;
|
||||
} else {
|
||||
if(fDebug)
|
||||
cout << fGridSteps << endl;
|
||||
std::cout << fGridSteps << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
22
src/external/BMWtools/BMWStartupHandler.h
vendored
22
src/external/BMWtools/BMWStartupHandler.h
vendored
@ -11,7 +11,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter, Bastian M. Wojek *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -67,12 +67,12 @@ class BMWStartupHandler : public TQObject {
|
||||
|
||||
virtual void CheckLists();
|
||||
|
||||
virtual const string GetDataPath() const { return fDataPath; } ///< returns the path to TRIM.SP files
|
||||
virtual map<double, string> GetEnergies() const { return fEnergies; } ///< returns energies and file labels of available TRIM.SP files
|
||||
virtual const std::string GetDataPath() const { return fDataPath; } ///< returns the path to TRIM.SP files
|
||||
virtual std::map<double, std::string> GetEnergies() const { return fEnergies; } ///< returns energies and file labels of available TRIM.SP files
|
||||
virtual const double GetDeltat() const { return fDeltat; } ///< returns the time resolution of P(t) when using Fourier transforms
|
||||
virtual const double GetDeltaB() const { return fDeltaB; } ///< returns the field resolution of p(B) when using Fourier transforms
|
||||
virtual const string GetWisdomFile() const { return fWisdomFile; } ///< returns the path to the FFTW3 double-wisdom file
|
||||
virtual const string GetWisdomFileFloat() const { return fWisdomFileFloat; } ///< returns the path to the FFTW3 float-wisdom file
|
||||
virtual const std::string GetWisdomFile() const { return fWisdomFile; } ///< returns the path to the FFTW3 double-wisdom file
|
||||
virtual const std::string GetWisdomFileFloat() const { return fWisdomFileFloat; } ///< returns the path to the FFTW3 float-wisdom file
|
||||
virtual const unsigned int GetNSteps() const { return fNSteps; } ///< returns the number of steps in one-dimensional theory functions
|
||||
virtual const unsigned int GetGridSteps() const { return fGridSteps; } ///< returns the number of steps in each direction when calculating two-dimensional spatial field distributions
|
||||
virtual const double GetDeltatLF() const { return fDeltatLF; } ///< returns the time resolution of P(t) when using Laplace transforms for the calculation of LF-relaxation functions
|
||||
@ -90,14 +90,14 @@ class BMWStartupHandler : public TQObject {
|
||||
bool fLEM; ///< low-energy muSR flag
|
||||
bool fVortex; ///< vortex-lattice flag
|
||||
bool fLF; ///< longitudinal-field flag
|
||||
string fDataPath; ///< path to TRIM.SP files
|
||||
vector<string> fEnergyLabelList; ///< file labels of the TRIM.SP files
|
||||
vector<double> fEnergyList; ///< muon implantation energies of the TRIM.SP files
|
||||
map<double, string> fEnergies; ///< muon implantation energies and file labels of the TRIM.SP files
|
||||
std::string fDataPath; ///< path to TRIM.SP files
|
||||
std::vector<std::string> fEnergyLabelList; ///< file labels of the TRIM.SP files
|
||||
std::vector<double> fEnergyList; ///< muon implantation energies of the TRIM.SP files
|
||||
std::map<double, std::string> fEnergies; ///< muon implantation energies and file labels of the TRIM.SP files
|
||||
double fDeltat; ///< time resolution of P(t) when using Fourier transforms
|
||||
double fDeltaB; ///< field resolution of p(B) when using Fourier transforms
|
||||
string fWisdomFile; ///< FFTW3 double-wisdom file
|
||||
string fWisdomFileFloat; ///< FFTW3 float-wisdom file
|
||||
std::string fWisdomFile; ///< FFTW3 double-wisdom file
|
||||
std::string fWisdomFileFloat; ///< FFTW3 float-wisdom file
|
||||
unsigned int fNSteps; ///< number of steps in one-dimensional theory functions
|
||||
unsigned int fGridSteps; ///< number of steps in each direction when calculating two-dimensional spatial field distributions
|
||||
double fDeltatLF; ///< time resolution of P(t) when using Laplace transforms for the calculation of LF-relaxation functions
|
||||
|
15
src/external/MagProximity/PMPRgeHandler.cpp
vendored
15
src/external/MagProximity/PMPRgeHandler.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PMPRgeHandler.h"
|
||||
|
||||
@ -92,7 +91,7 @@ Double_t PMPRgeHandler::GetRgeValue(const Int_t index, const Double_t dist)
|
||||
{
|
||||
Double_t rgeVal = 0.0;
|
||||
|
||||
UInt_t distIdx = (UInt_t)(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0]));
|
||||
UInt_t distIdx = static_cast<UInt_t>(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0]));
|
||||
|
||||
if (distIdx >= fRgeDataList[index].stoppingDistance.size()) {
|
||||
rgeVal = 0.0;
|
||||
@ -140,7 +139,7 @@ Double_t PMPRgeHandler::GetRgeValue(const Double_t energy, const Double_t dist)
|
||||
*/
|
||||
Bool_t PMPRgeHandler::LoadRgeData(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList)
|
||||
{
|
||||
ifstream fin;
|
||||
std::ifstream fin;
|
||||
PMPRgeData data;
|
||||
Int_t idx=0;
|
||||
TString dataName, tstr;
|
||||
@ -150,11 +149,11 @@ Bool_t PMPRgeHandler::LoadRgeData(const PStringVector &rgeDataPathList, const PD
|
||||
|
||||
for (UInt_t i=0; i<rgeDataPathList.size(); i++) {
|
||||
// open rge-file for reading
|
||||
fin.open(rgeDataPathList[i].Data(), iostream::in);
|
||||
fin.open(rgeDataPathList[i].Data(), std::iostream::in);
|
||||
if (!fin.is_open()) {
|
||||
cout << endl << "PMPRgeHandler::LoadRgeData **ERROR**";
|
||||
cout << endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PMPRgeHandler::LoadRgeData **ERROR**";
|
||||
std::cout << std::endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
std::cout << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
2
src/external/MagProximity/PMPRgeHandler.h
vendored
2
src/external/MagProximity/PMPRgeHandler.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
25
src/external/MagProximity/PMPStartupHandler.cpp
vendored
25
src/external/MagProximity/PMPStartupHandler.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PMPStartupHandler.h"
|
||||
|
||||
@ -61,7 +60,7 @@ PMPStartupHandler::PMPStartupHandler()
|
||||
fStartupFileFound = true;
|
||||
fStartupFilePath = TString(startup_path_name);
|
||||
} else { // startup file is not found in the current directory
|
||||
cout << endl << "PMPStartupHandler(): **WARNING** Couldn't find mag_proximity_startup.xml in the current directory, will try default one." << endl;
|
||||
std::cout << std::endl << "PMPStartupHandler(): **WARNING** Couldn't find mag_proximity_startup.xml in the current directory, will try default one." << std::endl;
|
||||
strncpy(startup_path_name, "/home/nemu/analysis/musrfit/src/external/MagProximity/mag_proximity_startup.xml", sizeof(startup_path_name));
|
||||
if (StartupFileExists(startup_path_name)) {
|
||||
fStartupFileFound = true;
|
||||
@ -160,9 +159,9 @@ void PMPStartupHandler::OnCharacters(const char *str)
|
||||
tstr += ".rge";
|
||||
fTrimSpDataPathList.push_back(tstr);
|
||||
} else {
|
||||
cout << endl << "PMPStartupHandler::OnCharacters: **ERROR** when finding energy:";
|
||||
cout << endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PMPStartupHandler::OnCharacters: **ERROR** when finding energy:";
|
||||
std::cout << std::endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -193,8 +192,8 @@ void PMPStartupHandler::OnComment(const char *str)
|
||||
*/
|
||||
void PMPStartupHandler::OnWarning(const char *str)
|
||||
{
|
||||
cout << endl << "PMPStartupHandler **WARNING** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PMPStartupHandler **WARNING** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -207,8 +206,8 @@ void PMPStartupHandler::OnWarning(const char *str)
|
||||
*/
|
||||
void PMPStartupHandler::OnError(const char *str)
|
||||
{
|
||||
cout << endl << "PMPStartupHandler **ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PMPStartupHandler **ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -221,8 +220,8 @@ void PMPStartupHandler::OnError(const char *str)
|
||||
*/
|
||||
void PMPStartupHandler::OnFatalError(const char *str)
|
||||
{
|
||||
cout << endl << "PMPStartupHandler **FATAL ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PMPStartupHandler **FATAL ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -249,7 +248,7 @@ bool PMPStartupHandler::StartupFileExists(char *fln)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
ifstream ifile(fln);
|
||||
std::ifstream ifile(fln);
|
||||
|
||||
if (ifile.fail()) {
|
||||
result = false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
2
src/external/MagProximity/PMagProximity.h
vendored
2
src/external/MagProximity/PMagProximity.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -10,7 +10,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -33,7 +33,6 @@
|
||||
#include <cmath>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include <TMath.h>
|
||||
@ -70,8 +69,8 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
||||
Int_t status = parseXmlFile(saxParser, startup_path_name);
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cout << endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
@ -83,18 +82,18 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
||||
|
||||
// check if everything went fine with the startup handler
|
||||
if (!fStartupHandler->IsValid()) {
|
||||
cout << endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
cout << endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
// load all the TRIM.SP rge-files
|
||||
fRgeHandler = new PMPRgeHandler(fStartupHandler->GetTrimSpDataPathList(), fStartupHandler->GetTrimSpDataVectorList());
|
||||
if (!fRgeHandler->IsValid()) {
|
||||
cout << endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
cout << endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
}
|
||||
@ -113,11 +112,11 @@ PMagProximityFitterGlobal::~PMagProximityFitterGlobal()
|
||||
|
||||
if (fRgeHandler) {
|
||||
delete fRgeHandler;
|
||||
fRgeHandler = 0;
|
||||
fRgeHandler = nullptr;
|
||||
}
|
||||
if (fStartupHandler) {
|
||||
delete fStartupHandler;
|
||||
fStartupHandler = 0;
|
||||
fStartupHandler = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,19 +197,6 @@ Double_t PMagProximityFitterGlobal::GetMagneticField(const Double_t z) const
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
static UInt_t count=0;
|
||||
if (count < 10) {
|
||||
count++;
|
||||
if (idx == fField.size()-1)
|
||||
cout << endl << "debug> z=" << z << ", idx=" << idx << ", fDz=" << fDz << ", fField[idx]=" << fField[idx] << ", result=" << result;
|
||||
else
|
||||
cout << endl << "debug> z=" << z << ", idx=" << idx << ", fDz=" << fDz << ", fField[idx]=" << fField[idx] << ", fField[idx+1]=" << fField[idx+1] << ", result=" << result;
|
||||
cout << endl;
|
||||
}
|
||||
*/
|
||||
// cout << endl << z << ", " << result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -228,7 +214,7 @@ PMagProximityFitter::PMagProximityFitter()
|
||||
{
|
||||
fValid = false;
|
||||
fInvokedGlobal = false;
|
||||
fMagProximityFitterGlobal = 0;
|
||||
fMagProximityFitterGlobal = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -241,7 +227,7 @@ PMagProximityFitter::~PMagProximityFitter()
|
||||
{
|
||||
if ((fMagProximityFitterGlobal != 0) && fInvokedGlobal) {
|
||||
delete fMagProximityFitterGlobal;
|
||||
fMagProximityFitterGlobal = 0;
|
||||
fMagProximityFitterGlobal = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,7 +242,7 @@ PMagProximityFitter::~PMagProximityFitter()
|
||||
* \param globalPart
|
||||
* \param idx
|
||||
*/
|
||||
void PMagProximityFitter::SetGlobalPart(vector<void*> &globalPart, UInt_t idx)
|
||||
void PMagProximityFitter::SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx)
|
||||
{
|
||||
fIdxGlobal = static_cast<Int_t>(idx);
|
||||
|
||||
@ -264,10 +250,10 @@ void PMagProximityFitter::SetGlobalPart(vector<void*> &globalPart, UInt_t idx)
|
||||
fMagProximityFitterGlobal = new PMagProximityFitterGlobal();
|
||||
if (fMagProximityFitterGlobal == 0) {
|
||||
fValid = false;
|
||||
cerr << endl << ">> PMagProximityFitter::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> PMagProximityFitter::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||
} else if (!fMagProximityFitterGlobal->IsValid()) {
|
||||
fValid = false;
|
||||
cerr << endl << ">> PMagProximityFitter::SetGlobalPart(): **ERROR** initialization of global user function object failed, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> PMagProximityFitter::SetGlobalPart(): **ERROR** initialization of global user function object failed, sorry ..." << std::endl;
|
||||
} else {
|
||||
fValid = true;
|
||||
fInvokedGlobal = true;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -69,7 +69,7 @@ class PMagProximityFitter : public PUserFcnBase
|
||||
virtual ~PMagProximityFitter();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return true; }
|
||||
virtual void SetGlobalPart(vector<void*> &globalPart, UInt_t idx);
|
||||
virtual void SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx);
|
||||
virtual Bool_t GlobalPartIsValid() const;
|
||||
|
||||
virtual Double_t operator()(Double_t t, const std::vector<Double_t> ¶m) const;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Suter *
|
||||
* Copyright (C) 2011-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@
|
||||
|
||||
begin : Alex Amato, October 2005
|
||||
modified : Andrea Raselli, October 2009
|
||||
: Andreas Suter, April 2019
|
||||
copyright : (C) 2005 by
|
||||
email : alex.amato@psi.ch
|
||||
|
||||
@ -30,7 +31,6 @@
|
||||
#define MuSR_td_PSI_bin_H_
|
||||
|
||||
#include <iostream>
|
||||
using namespace std ;
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
#include <cmath>
|
||||
@ -58,10 +58,10 @@ class MuSR_td_PSI_bin {
|
||||
private:
|
||||
// ------------------------------------start of the variables
|
||||
|
||||
string filename;
|
||||
string readstatus;
|
||||
string writestatus;
|
||||
string consistencyStatus;
|
||||
std::string filename;
|
||||
std::string readstatus;
|
||||
std::string writestatus;
|
||||
std::string consistencyStatus;
|
||||
bool readingok;
|
||||
bool writingok;
|
||||
bool consistencyOk;
|
||||
@ -118,7 +118,7 @@ class MuSR_td_PSI_bin {
|
||||
NOTE: Histogram information returned by \<pointer_to_array\> = ..._array() methods
|
||||
should be freed by delete [] \<pointer_to_array\>;
|
||||
*/
|
||||
vector< vector<double> > histos_vector ;
|
||||
std::vector< std::vector<double> > histos_vector ;
|
||||
|
||||
// ------------------------------------end of the variables
|
||||
|
||||
@ -135,10 +135,10 @@ class MuSR_td_PSI_bin {
|
||||
bool readingOK() const;
|
||||
bool writingOK() const;
|
||||
bool CheckDataConsistency(int tag=0); // tag: 0=reasonable, 1=strict
|
||||
string ReadStatus() const;
|
||||
string WriteStatus() const;
|
||||
string ConsistencyStatus() const;
|
||||
string Filename() const;
|
||||
std::string ReadStatus() const;
|
||||
std::string WriteStatus() const;
|
||||
std::string ConsistencyStatus() const;
|
||||
std::string Filename() const;
|
||||
|
||||
int Show() const;
|
||||
int Clear();
|
||||
@ -148,17 +148,17 @@ class MuSR_td_PSI_bin {
|
||||
|
||||
int *get_histo_array_int(int histo_num);
|
||||
double *get_histo_array(int histo_num, int binning);
|
||||
int put_histo_array_int(vector< vector<int> > histo, int tag = 0);
|
||||
vector<double> get_histo_vector(int histo_num, int binning);
|
||||
vector<double> get_histo_vector_no0(int histo_num, int binning);
|
||||
int put_histo_array_int(std::vector< std::vector<int> > histo, int tag = 0);
|
||||
std::vector<double> get_histo_vector(int histo_num, int binning);
|
||||
std::vector<double> get_histo_vector_no0(int histo_num, int binning);
|
||||
|
||||
double *get_histo_fromt0_array(int histo_num, int binning, int offset = 0);
|
||||
|
||||
vector<double> get_histo_fromt0_vector(int histo_num, int binning, int offset = 0);
|
||||
std::vector<double> get_histo_fromt0_vector(int histo_num, int binning, int offset = 0);
|
||||
|
||||
double *get_histo_goodBins_array(int histo_num, int binning);
|
||||
|
||||
vector<double> get_histo_goodBins_vector(int histo_num, int binning);
|
||||
std::vector<double> get_histo_goodBins_vector(int histo_num, int binning);
|
||||
|
||||
double *get_histo_fromt0_minus_bckgrd_array(int histo_num,
|
||||
int lower_bckgdr,
|
||||
@ -166,23 +166,23 @@ class MuSR_td_PSI_bin {
|
||||
int binning,
|
||||
int offset = 0);
|
||||
|
||||
vector<double> get_histo_fromt0_minus_bckgrd_vector(int histo_num,
|
||||
std::vector<double> get_histo_fromt0_minus_bckgrd_vector(int histo_num,
|
||||
int lower_bckgdr,
|
||||
int higher_bckgdr,
|
||||
int binning,
|
||||
int offset = 0);
|
||||
|
||||
double *get_histo_goodBins_minus_bckgrd_array(int histo_num,
|
||||
double *get_histo_goodBins_minus_bckgrd_array(int histo_num,
|
||||
int lower_bckgrd,
|
||||
int higher_bckgrd,
|
||||
int binning);
|
||||
|
||||
vector<double> get_histo_goodBins_minus_bckgrd_vector(int histo_num,
|
||||
std::vector<double> get_histo_goodBins_minus_bckgrd_vector(int histo_num,
|
||||
int lower_bckgrd,
|
||||
int higher_bckgrd,
|
||||
int binning);
|
||||
|
||||
double *get_asymmetry_array(int histo_num_plus,
|
||||
double *get_asymmetry_array(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -193,7 +193,7 @@ class MuSR_td_PSI_bin {
|
||||
int offset = 0,
|
||||
double y_offset = 0.);
|
||||
|
||||
vector<double> get_asymmetry_vector(int histo_num_plus,
|
||||
std::vector<double> get_asymmetry_vector(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -204,7 +204,7 @@ class MuSR_td_PSI_bin {
|
||||
int offset = 0,
|
||||
double y_offset = 0.);
|
||||
|
||||
double *get_error_asymmetry_array(int histo_num_plus,
|
||||
double *get_error_asymmetry_array(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -214,7 +214,7 @@ class MuSR_td_PSI_bin {
|
||||
int higher_bckgrd_minus,
|
||||
int offset = 0);
|
||||
|
||||
vector<double> get_error_asymmetry_vector(int histo_num_plus,
|
||||
std::vector<double> get_error_asymmetry_vector(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -224,7 +224,7 @@ class MuSR_td_PSI_bin {
|
||||
int higher_bckgrd_minus,
|
||||
int offset = 0);
|
||||
|
||||
double *get_asymmetry_goodBins_array(int histo_num_plus,
|
||||
double *get_asymmetry_goodBins_array(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -233,7 +233,7 @@ class MuSR_td_PSI_bin {
|
||||
int lower_bckgrd_minus,
|
||||
int higher_bckgrd_minus);
|
||||
|
||||
vector<double> get_asymmetry_goodBins_vector(int histo_num_plus,
|
||||
std::vector<double> get_asymmetry_goodBins_vector(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -251,7 +251,7 @@ class MuSR_td_PSI_bin {
|
||||
int lower_bckgrd_minus,
|
||||
int higher_bckgrd_minus);
|
||||
|
||||
vector<double> get_error_asymmetry_goodBins_vector(int histo_num_plus,
|
||||
std::vector<double> get_error_asymmetry_goodBins_vector(int histo_num_plus,
|
||||
int histo_num_minus,
|
||||
double alpha_param,
|
||||
int binning,
|
||||
@ -274,28 +274,28 @@ class MuSR_td_PSI_bin {
|
||||
int get_numberHisto_int();
|
||||
void put_numberHisto_int(int val) { number_histo = val; }
|
||||
|
||||
string get_nameHisto(int i);
|
||||
int put_nameHisto(string histoName, int i);
|
||||
vector<string> get_histoNames_vector();
|
||||
int put_histoNames_vector(vector<string> &histoNames);
|
||||
std::string get_nameHisto(int i);
|
||||
int put_nameHisto(std::string histoName, int i);
|
||||
std::vector<std::string> get_histoNames_vector();
|
||||
int put_histoNames_vector(std::vector<std::string> &histoNames);
|
||||
|
||||
long get_eventsHisto_long(int i);
|
||||
vector<long> get_eventsHisto_vector();
|
||||
std::vector<long> get_eventsHisto_vector();
|
||||
|
||||
long get_totalEvents_long();
|
||||
|
||||
int get_numberScaler_int();
|
||||
int put_numberScaler_int(int val);
|
||||
vector<long> get_scalers_vector();
|
||||
int put_scalers_vector(vector<int> scalerData);
|
||||
vector<string> get_scalersNames_vector();
|
||||
int put_scalersNames_vector(vector<string> scalersName);
|
||||
std::vector<long> get_scalers_vector();
|
||||
int put_scalers_vector(std::vector<int> scalerData);
|
||||
std::vector<std::string> get_scalersNames_vector();
|
||||
int put_scalersNames_vector(std::vector<std::string> scalersName);
|
||||
|
||||
int get_default_binning();
|
||||
int get_t0_int(int i);
|
||||
int put_t0_int(int histoNo, int t0);
|
||||
vector<int> get_t0_vector();
|
||||
int put_t0_vector(vector<int> &t0Data);
|
||||
std::vector<int> get_t0_vector();
|
||||
int put_t0_vector(std::vector<int> &t0Data);
|
||||
double get_t0_double(int i);
|
||||
|
||||
int get_max_t0_int ();
|
||||
@ -304,11 +304,11 @@ class MuSR_td_PSI_bin {
|
||||
int get_min_2_t0_int (int k, int j);
|
||||
|
||||
int get_firstGood_int(int i);
|
||||
vector<int> get_firstGood_vector();
|
||||
std::vector<int> get_firstGood_vector();
|
||||
int put_firstGood_int(int i, int j);
|
||||
|
||||
int get_lastGood_int(int i);
|
||||
vector<int> get_lastGood_vector();
|
||||
std::vector<int> get_lastGood_vector();
|
||||
int put_lastGood_int(int i, int j);
|
||||
|
||||
int get_max_lastGood_int ();
|
||||
@ -319,30 +319,30 @@ class MuSR_td_PSI_bin {
|
||||
int get_runNumber_int();
|
||||
int put_runNumber_int(int i);
|
||||
|
||||
string get_sample();
|
||||
int put_sample(string sample);
|
||||
string get_field();
|
||||
int put_field(string field);
|
||||
string get_orient();
|
||||
int put_orient(string orientation);
|
||||
string get_temp();
|
||||
int put_temp(string temp);
|
||||
string get_setup();
|
||||
int put_setup(string setup);
|
||||
string get_comment();
|
||||
int put_comment(string comment);
|
||||
std::string get_sample();
|
||||
int put_sample(std::string sample);
|
||||
std::string get_field();
|
||||
int put_field(std::string field);
|
||||
std::string get_orient();
|
||||
int put_orient(std::string orientation);
|
||||
std::string get_temp();
|
||||
int put_temp(std::string temp);
|
||||
std::string get_setup();
|
||||
int put_setup(std::string setup);
|
||||
std::string get_comment();
|
||||
int put_comment(std::string comment);
|
||||
|
||||
vector<string> get_timeStart_vector();
|
||||
int put_timeStart_vector(vector<string> timeStart);
|
||||
vector<string> get_timeStop_vector();
|
||||
int put_timeStop_vector(vector<string> timeStop);
|
||||
std::vector<std::string> get_timeStart_vector();
|
||||
int put_timeStart_vector(std::vector<std::string> timeStart);
|
||||
std::vector<std::string> get_timeStop_vector();
|
||||
int put_timeStop_vector(std::vector<std::string> timeStop);
|
||||
|
||||
int get_numberTemperature_int();
|
||||
int put_numberTemperature_int(int noOfTemps);
|
||||
vector<double> get_temperatures_vector();
|
||||
int put_temperatures_vector(vector<double> &temps);
|
||||
vector<double> get_devTemperatures_vector();
|
||||
int put_devTemperatures_vector(vector<double> &devTemps);
|
||||
std::vector<double> get_temperatures_vector();
|
||||
int put_temperatures_vector(std::vector<double> &temps);
|
||||
std::vector<double> get_devTemperatures_vector();
|
||||
int put_devTemperatures_vector(std::vector<double> &devTemps);
|
||||
|
||||
private:
|
||||
|
||||
|
121
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
121
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
|
||||
#include "TMusrRunHeader.h"
|
||||
|
||||
@ -275,14 +274,14 @@ void TMusrRunHeader::Init(TString fileName)
|
||||
Set("RunInfo/No of Histos", 0);
|
||||
prop.Set("Time Resolution", 0.0, "ns");
|
||||
Set("RunInfo/Time Resolution", prop);
|
||||
vector<int> ivec;
|
||||
std::vector<int> ivec;
|
||||
ivec.push_back(0);
|
||||
Set("RunInfo/RedGreen Offsets", ivec);
|
||||
|
||||
Set("DetectorInfo/Detector001/Name", "n/a");
|
||||
Set("DetectorInfo/Detector001/Histo Number", 0);
|
||||
Set("DetectorInfo/Detector001/Histo Length", 0);
|
||||
Set("DetectorInfo/Detector001/Time Zero Bin", (Double_t)0.0);
|
||||
Set("DetectorInfo/Detector001/Time Zero Bin", static_cast<Double_t>(0.0));
|
||||
Set("DetectorInfo/Detector001/First Good Bin", 0);
|
||||
Set("DetectorInfo/Detector001/Last Good Bin", 0);
|
||||
|
||||
@ -341,8 +340,8 @@ Bool_t TMusrRunHeader::FillFolder(TFolder *folder)
|
||||
Ssiz_t pos=0;
|
||||
bool found=false;
|
||||
|
||||
if (folder == 0) {
|
||||
cerr << endl << ">> TMusrRunHeader::FillFolder(): **ERROR** folder == 0!!" << endl;
|
||||
if (folder == nullptr) {
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::FillFolder(): **ERROR** folder == 0!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -361,14 +360,14 @@ Bool_t TMusrRunHeader::FillFolder(TFolder *folder)
|
||||
path=fPathNameOrder[i];
|
||||
pos = path.Last('/');
|
||||
if (pos == -1) {
|
||||
cerr << endl << ">> TMusrRunHeader::FillFolder(): **ERROR** somethig is wrong with the path=" << path << " !!" << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::FillFolder(): **ERROR** somethig is wrong with the path=" << path << " !!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
path.Remove(pos); // remove the value from the path
|
||||
|
||||
oarray = (TObjArray*)FindObject(folder, path);
|
||||
oarray = dynamic_cast<TObjArray*>(FindObject(folder, path));
|
||||
if (!oarray) {
|
||||
cerr << endl << ">> TMusrRunHeader::FillFolder(): **ERROR** couldn't create header structure!!" << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::FillFolder(): **ERROR** couldn't create header structure!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -378,7 +377,7 @@ Bool_t TMusrRunHeader::FillFolder(TFolder *folder)
|
||||
str = GetFirst(name, ':'); // get the first part of the encoded string, i.e. <nnn> - <name>
|
||||
found = false;
|
||||
for (Int_t j=0; j<oarray->GetEntriesFast(); j++) {
|
||||
p_ostr = (TObjString*) oarray->At(j);
|
||||
p_ostr = dynamic_cast<TObjString*>(oarray->At(j));
|
||||
if (p_ostr->GetString().BeginsWith(str)) { // present hence replace
|
||||
oarray->AddAt(ostr.Clone(), j);
|
||||
found = true;
|
||||
@ -563,7 +562,7 @@ void TMusrRunHeader::Set(TString pathName, TString value)
|
||||
for (i=0; i<fStringObj.size(); i++) {
|
||||
if (!fStringObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fStringObj[i].SetType("TString");
|
||||
fStringObj[i].SetValue(value);
|
||||
break;
|
||||
@ -597,7 +596,7 @@ void TMusrRunHeader::Set(TString pathName, Int_t value)
|
||||
for (i=0; i<fIntObj.size(); i++) {
|
||||
if (!fIntObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fIntObj[i].SetType("Int_t");
|
||||
fIntObj[i].SetValue(value);
|
||||
break;
|
||||
@ -631,7 +630,7 @@ void TMusrRunHeader::Set(TString pathName, Double_t value)
|
||||
for (i=0; i<fDoubleObj.size(); i++) {
|
||||
if (!fDoubleObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fDoubleObj[i].SetType("Double_t");
|
||||
fDoubleObj[i].SetValue(value);
|
||||
break;
|
||||
@ -665,7 +664,7 @@ void TMusrRunHeader::Set(TString pathName, TMusrRunPhysicalQuantity value)
|
||||
for (i=0; i<fMusrRunPhysQuantityObj.size(); i++) {
|
||||
if (!fMusrRunPhysQuantityObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fMusrRunPhysQuantityObj[i].SetType("TMusrRunHeader");
|
||||
fMusrRunPhysQuantityObj[i].SetValue(value);
|
||||
break;
|
||||
@ -699,7 +698,7 @@ void TMusrRunHeader::Set(TString pathName, TStringVector value)
|
||||
for (i=0; i<fStringVectorObj.size(); i++) {
|
||||
if (!fStringVectorObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fStringVectorObj[i].SetType("TStringVector");
|
||||
fStringVectorObj[i].SetValue(value);
|
||||
break;
|
||||
@ -733,7 +732,7 @@ void TMusrRunHeader::Set(TString pathName, TIntVector value)
|
||||
for (i=0; i<fIntVectorObj.size(); i++) {
|
||||
if (!fIntVectorObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fIntVectorObj[i].SetType("TIntVector");
|
||||
fIntVectorObj[i].SetValue(value);
|
||||
break;
|
||||
@ -767,7 +766,7 @@ void TMusrRunHeader::Set(TString pathName, TDoubleVector value)
|
||||
for (i=0; i<fDoubleVectorObj.size(); i++) {
|
||||
if (!fDoubleVectorObj[i].GetPathName().CompareTo(pathName, TString::kIgnoreCase)) {
|
||||
if (!fQuiet)
|
||||
cerr << endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << endl;
|
||||
std::cerr << std::endl << ">> **WARNING** " << pathName.Data() << " already exists, will replace it." << std::endl;
|
||||
fDoubleVectorObj[i].SetType("TDoubleVector");
|
||||
fDoubleVectorObj[i].SetValue(value);
|
||||
break;
|
||||
@ -803,7 +802,7 @@ Bool_t TMusrRunHeader::ExtractAll(TFolder *folder)
|
||||
// clean up all internal structures - just in case this is called multiple times
|
||||
CleanUp();
|
||||
|
||||
while ((entry = (TObjArray*)next())) {
|
||||
while ((entry = dynamic_cast<TObjArray*>(next()))) {
|
||||
ExtractHeaderInformation(entry, entry->GetName());
|
||||
}
|
||||
return true;
|
||||
@ -821,8 +820,8 @@ Bool_t TMusrRunHeader::ExtractAll(TFolder *folder)
|
||||
Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)
|
||||
{
|
||||
TString label(""), path(""), pathName(""), str(""), strValue(""), type("");
|
||||
TObjString *ostr = 0;
|
||||
TObjArray *tokens = 0;
|
||||
TObjString *ostr = nullptr;
|
||||
TObjArray *tokens = nullptr;
|
||||
Ssiz_t idx1;
|
||||
Int_t intValue;
|
||||
Double_t dval;
|
||||
@ -833,7 +832,7 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
str = TString(headerInfo->At(i)->ClassName());
|
||||
if (str == "TObjArray") { // sub tree
|
||||
path = requestedPath + "/" + TString(headerInfo->At(i)->GetName());
|
||||
ExtractHeaderInformation((TObjArray*)headerInfo->At(i), path);
|
||||
ExtractHeaderInformation(dynamic_cast<TObjArray*>(headerInfo->At(i)), path);
|
||||
} else { // handle all the rest, i.e. already data
|
||||
|
||||
ostr = dynamic_cast<TObjString*>(headerInfo->At(i));
|
||||
@ -869,8 +868,8 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
|
||||
// 1st get the description if present
|
||||
tokens = strValue.Tokenize(";");
|
||||
if (tokens == 0) {
|
||||
cerr << endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << endl;
|
||||
if (tokens == nullptr) {
|
||||
std::cerr << std::endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -892,7 +891,7 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
tokens = 0;
|
||||
tokens = nullptr;
|
||||
}
|
||||
|
||||
// 2nd collect all the other properties, this is easier when first a potential description is removed
|
||||
@ -911,8 +910,8 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
}
|
||||
|
||||
tokens = strValue.Tokenize(" +;");
|
||||
if (tokens == 0) {
|
||||
cerr << endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << endl;
|
||||
if (tokens == nullptr) {
|
||||
std::cerr << std::endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -965,15 +964,15 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
tokens = 0;
|
||||
tokens = nullptr;
|
||||
}
|
||||
|
||||
Set(pathName, prop);
|
||||
} else if (type == "TStringVector") {
|
||||
TStringVector svec;
|
||||
tokens = strValue.Tokenize(";");
|
||||
if (tokens == 0) {
|
||||
cerr << endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << endl;
|
||||
if (tokens == nullptr) {
|
||||
std::cerr << std::endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << std::endl;
|
||||
return false;
|
||||
}
|
||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||
@ -984,14 +983,14 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
}
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
tokens = 0;
|
||||
tokens = nullptr;
|
||||
}
|
||||
Set(pathName, svec);
|
||||
} else if (type == "TIntVector") {
|
||||
TIntVector ivec;
|
||||
tokens = strValue.Tokenize(";");
|
||||
if (tokens == 0) {
|
||||
cerr << endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << endl;
|
||||
if (tokens == nullptr) {
|
||||
std::cerr << std::endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << std::endl;
|
||||
return false;
|
||||
}
|
||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||
@ -1000,14 +999,14 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
}
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
tokens = 0;
|
||||
tokens = nullptr;
|
||||
}
|
||||
Set(pathName, ivec);
|
||||
} else if (type == "TDoubleVector") {
|
||||
TDoubleVector dvec;
|
||||
tokens = strValue.Tokenize(";");
|
||||
if (tokens == 0) {
|
||||
cerr << endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << endl;
|
||||
if (tokens == nullptr) {
|
||||
std::cerr << std::endl << ">> **ERROR** Couldn't tokenize entry in Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString requestedPath)" << std::endl;
|
||||
return false;
|
||||
}
|
||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||
@ -1016,7 +1015,7 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
}
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
tokens = 0;
|
||||
tokens = nullptr;
|
||||
}
|
||||
Set(pathName, dvec);
|
||||
}
|
||||
@ -1034,9 +1033,9 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
*/
|
||||
void TMusrRunHeader::DumpHeader()
|
||||
{
|
||||
cout << endl << "***************************************";
|
||||
cout << endl << "header info of file : " << fFileName;
|
||||
cout << endl << "***************************************";
|
||||
std::cout << std::endl << "***************************************";
|
||||
std::cout << std::endl << "header info of file : " << fFileName;
|
||||
std::cout << std::endl << "***************************************";
|
||||
|
||||
TString str(""), tstr(""), fmt(""), path(""), name(""), currentPath("");
|
||||
TMusrRunPhysicalQuantity prop;
|
||||
@ -1046,7 +1045,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
SplitPathName(fPathNameOrder[i], path, name);
|
||||
if (path != currentPath) {
|
||||
currentPath = path;
|
||||
cout << endl << currentPath;
|
||||
std::cout << std::endl << currentPath;
|
||||
}
|
||||
|
||||
// go through all objects and try to find it
|
||||
@ -1055,7 +1054,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
if (fStringObj[j].GetPathName() == fPathNameOrder[i]) { // found correct object
|
||||
SplitPathName(fStringObj[j].GetPathName(), path, name);
|
||||
str.Form(" %03d - %s: %s -@%d", i, name.Data(), fStringObj[j].GetValue().Data(), MRH_TSTRING);
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 2nd check Int_t
|
||||
@ -1063,7 +1062,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
if (fIntObj[j].GetPathName() == fPathNameOrder[i]) { // found correct object
|
||||
SplitPathName(fIntObj[j].GetPathName(), path, name);
|
||||
str.Form(" %03d - %s: %d -@%d", i, name.Data(), fIntObj[j].GetValue(), MRH_INT);
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 3rd check Double_t
|
||||
@ -1072,7 +1071,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
SplitPathName(fDoubleObj[j].GetPathName(), path, name);
|
||||
fmt.Form(" %%03d - %%s: %%.%dlf -@%%d", MRH_DOUBLE_PREC);
|
||||
str.Form(fmt, i, name.Data(), fDoubleObj[j].GetValue(), MRH_DOUBLE);
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 4th check TMusrRunPhysicalQuantity
|
||||
@ -1125,7 +1124,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
}
|
||||
}
|
||||
str.Form(" %03d - %s -@%d", i, tstr.Data(), MRH_TMUSR_RUN_PHYSICAL_QUANTITY);
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 5th check TStringVector
|
||||
@ -1139,7 +1138,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
str += vstr[vstr.size()-1];
|
||||
str += " -@";
|
||||
str += MRH_TSTRING_VECTOR;
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 6th check TIntVector
|
||||
@ -1155,7 +1154,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
str += vint[vint.size()-1];
|
||||
str += " -@";
|
||||
str += MRH_INT_VECTOR;
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
// 7th check TDoubleVector
|
||||
@ -1175,12 +1174,12 @@ void TMusrRunHeader::DumpHeader()
|
||||
str += subStr;
|
||||
str += " -@";
|
||||
str += MRH_DOUBLE_VECTOR;
|
||||
cout << endl << str;
|
||||
std::cout << std::endl << str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -1303,8 +1302,8 @@ TString TMusrRunHeader::GetLabel(TString str)
|
||||
Ssiz_t idx2 = str.First(':');
|
||||
if ((idx1 == -1) || (idx2 == -1)) {
|
||||
if (!fQuiet) {
|
||||
cerr << endl << ">> TMusrRunHeader::GetLabel(): **WARNING** str='" << str << "', seems not correctly encoded.";
|
||||
cerr << endl << ">> Will omit it." << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::GetLabel(): **WARNING** str='" << str << "', seems not correctly encoded.";
|
||||
std::cerr << std::endl << ">> Will omit it." << std::endl;
|
||||
}
|
||||
return label;
|
||||
}
|
||||
@ -1335,8 +1334,8 @@ TString TMusrRunHeader::GetStrValue(TString str)
|
||||
Ssiz_t idx2 = str.Last('-');
|
||||
if ((idx1 == -1) || (idx2 == -1)) {
|
||||
if (!fQuiet) {
|
||||
cerr << endl << ">> TMusrRunHeader::GetStrValue(): **WARNING** str='" << str << "', seems not correctly encoded.";
|
||||
cerr << endl << ">> Will omit it." << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::GetStrValue(): **WARNING** str='" << str << "', seems not correctly encoded.";
|
||||
std::cerr << std::endl << ">> Will omit it." << std::endl;
|
||||
}
|
||||
return strValue;
|
||||
}
|
||||
@ -1366,8 +1365,8 @@ TString TMusrRunHeader::GetType(TString str)
|
||||
|
||||
if (pos == -1) { // i.e. NOT found
|
||||
if (!fQuiet) {
|
||||
cerr << endl << ">> TMusrRunHeader::GetType(): **WARNING** str=" << str << " seems to be an invalid MusrROOT run header string.";
|
||||
cerr << endl << ">> Will omit it." << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::GetType(): **WARNING** str=" << str << " seems to be an invalid MusrROOT run header string.";
|
||||
std::cerr << std::endl << ">> Will omit it." << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1377,7 +1376,7 @@ TString TMusrRunHeader::GetType(TString str)
|
||||
typeStr.Remove(0, pos+1);
|
||||
Int_t typeVal;
|
||||
if (!typeStr.IsDigit()) {
|
||||
cerr << endl << ">> TMusrRunHeader::GetType(): **ERROR** typeStr=" << typeStr << " is not supported." << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::GetType(): **ERROR** typeStr=" << typeStr << " is not supported." << std::endl;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1406,7 +1405,7 @@ TString TMusrRunHeader::GetType(TString str)
|
||||
result = "TDoubleVector";
|
||||
break;
|
||||
default:
|
||||
cerr << endl << ">> TMusrRunHeader::GetType(): **ERROR** found unsupport type encoded with: " << typeVal << "." << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::GetType(): **ERROR** found unsupport type encoded with: " << typeVal << "." << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1437,23 +1436,23 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path)
|
||||
|
||||
// remove the first path element
|
||||
if (!RemoveFirst(path, '/')) {
|
||||
cerr << endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't tokenize path!!" << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't tokenize path!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!obj) { // required object not present, create it
|
||||
TObjArray *oarray = new TObjArray();
|
||||
if (!oarray) {
|
||||
cerr << endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << endl;
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
// set the name of the new TObjArray
|
||||
oarray->SetName(str);
|
||||
|
||||
if (!strcmp(treeObj->ClassName(), "TFolder"))
|
||||
((TFolder*)treeObj)->Add(oarray);
|
||||
(dynamic_cast<TFolder*>(treeObj))->Add(oarray);
|
||||
else // it is a TObjArray
|
||||
((TObjArray*)treeObj)->AddLast(oarray);
|
||||
(dynamic_cast<TObjArray*>(treeObj))->AddLast(oarray);
|
||||
|
||||
return UpdateFolder(oarray, path);
|
||||
} else { // object present, hence check rest of the path
|
||||
@ -1477,7 +1476,7 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path)
|
||||
TObject* TMusrRunHeader::FindObject(TObject *treeObj, TString path)
|
||||
{
|
||||
Ssiz_t pos;
|
||||
TObject *obj=0;
|
||||
TObject *obj=nullptr;
|
||||
|
||||
// make sure that treeObj is either TFolder or TObjArray
|
||||
if (strcmp(treeObj->ClassName(), "TFolder") && strcmp(treeObj->ClassName(), "TObjArray"))
|
||||
|
25
src/external/MusrRoot/TMusrRunHeader.h
vendored
25
src/external/MusrRoot/TMusrRunHeader.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
#define TMUSRRUNHEADER_H
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include <TDatime.h>
|
||||
#include <TObject.h>
|
||||
@ -52,9 +51,9 @@ using namespace std;
|
||||
#define MRH_INT_VECTOR 5
|
||||
#define MRH_DOUBLE_VECTOR 6
|
||||
|
||||
typedef vector<Int_t> TIntVector;
|
||||
typedef vector<Double_t> TDoubleVector;
|
||||
typedef vector<TString> TStringVector;
|
||||
typedef std::vector<Int_t> TIntVector;
|
||||
typedef std::vector<Double_t> TDoubleVector;
|
||||
typedef std::vector<TString> TStringVector;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <class T> class TMusrRunObject : public TObject
|
||||
@ -160,15 +159,15 @@ private:
|
||||
TString fFileName;
|
||||
TString fVersion;
|
||||
|
||||
vector< TMusrRunObject<TString> > fStringObj;
|
||||
vector< TMusrRunObject<Int_t> > fIntObj;
|
||||
vector< TMusrRunObject<Double_t> > fDoubleObj;
|
||||
vector< TMusrRunObject<TMusrRunPhysicalQuantity> > fMusrRunPhysQuantityObj;
|
||||
vector< TMusrRunObject<TStringVector> > fStringVectorObj;
|
||||
vector< TMusrRunObject<TIntVector> > fIntVectorObj;
|
||||
vector< TMusrRunObject<TDoubleVector> > fDoubleVectorObj;
|
||||
std::vector< TMusrRunObject<TString> > fStringObj;
|
||||
std::vector< TMusrRunObject<Int_t> > fIntObj;
|
||||
std::vector< TMusrRunObject<Double_t> > fDoubleObj;
|
||||
std::vector< TMusrRunObject<TMusrRunPhysicalQuantity> > fMusrRunPhysQuantityObj;
|
||||
std::vector< TMusrRunObject<TStringVector> > fStringVectorObj;
|
||||
std::vector< TMusrRunObject<TIntVector> > fIntVectorObj;
|
||||
std::vector< TMusrRunObject<TDoubleVector> > fDoubleVectorObj;
|
||||
|
||||
vector< TString > fPathNameOrder; ///< keeps the path-name as they were created in ordered to keep ordering
|
||||
std::vector< TString > fPathNameOrder; ///< keeps the path-name as they were created in ordered to keep ordering
|
||||
|
||||
virtual void Init(TString str="n/a");
|
||||
virtual void CleanUp();
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
2
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
2
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
2
src/external/Nonlocal/PNL_PippardFitter.h
vendored
2
src/external/Nonlocal/PNL_PippardFitter.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
11
src/external/Nonlocal/PNL_RgeHandler.cpp
vendored
11
src/external/Nonlocal/PNL_RgeHandler.cpp
vendored
@ -33,7 +33,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PNL_RgeHandler.h"
|
||||
|
||||
@ -145,7 +144,7 @@ Double_t PNL_RgeHandler::GetRgeValue(const Double_t energy, const Double_t dist)
|
||||
*/
|
||||
Bool_t PNL_RgeHandler::LoadRgeData(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList)
|
||||
{
|
||||
ifstream fin;
|
||||
std::ifstream fin;
|
||||
PNL_RgeData data;
|
||||
TString tstr;
|
||||
char line[512];
|
||||
@ -154,11 +153,11 @@ Bool_t PNL_RgeHandler::LoadRgeData(const PStringVector &rgeDataPathList, const P
|
||||
|
||||
for (UInt_t i=0; i<rgeDataPathList.size(); i++) {
|
||||
// open rge-file for reading
|
||||
fin.open(rgeDataPathList[i].Data(), iostream::in);
|
||||
fin.open(rgeDataPathList[i].Data(), std::iostream::in);
|
||||
if (!fin.is_open()) {
|
||||
cout << endl << "PNL_RgeHandler::LoadRgeData **ERROR**";
|
||||
cout << endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_RgeHandler::LoadRgeData **ERROR**";
|
||||
std::cout << std::endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
std::cout << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
2
src/external/Nonlocal/PNL_RgeHandler.h
vendored
2
src/external/Nonlocal/PNL_RgeHandler.h
vendored
@ -10,7 +10,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
35
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
35
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PNL_StartupHandler.h"
|
||||
|
||||
@ -63,7 +62,7 @@ PNL_StartupHandler::PNL_StartupHandler()
|
||||
fStartupFileFound = true;
|
||||
fStartupFilePath = TString(startup_path_name);
|
||||
} else { // startup file is not found in the current directory
|
||||
cout << endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << std::endl;
|
||||
home_str = getenv("HOME");
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/nonlocal_startup.xml", home_str);
|
||||
if (StartupFileExists(startup_path_name)) {
|
||||
@ -107,8 +106,8 @@ void PNL_StartupHandler::OnEndDocument()
|
||||
// check if anything was set, and if not set some default stuff
|
||||
if (fFourierPoints == 0) {
|
||||
fFourierPoints = 262144;
|
||||
cout << endl << "PNL_StartupHandler::OnEndDocument: **WARNING** \"fourier_points\" not defined in nonlocal_startup.xml.";
|
||||
cout << endl << " will set it to " << fFourierPoints << "." << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler::OnEndDocument: **WARNING** \"fourier_points\" not defined in nonlocal_startup.xml.";
|
||||
std::cout << std::endl << " will set it to " << fFourierPoints << "." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,9 +162,9 @@ void PNL_StartupHandler::OnCharacters(const char *str)
|
||||
if (tstr.IsDigit()) {
|
||||
fFourierPoints = tstr.Atoi();
|
||||
} else {
|
||||
cout << endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding fourier_points:";
|
||||
cout << endl << "\"" << str << "\" is not a number, will ignore it and use the default value.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding fourier_points:";
|
||||
std::cout << std::endl << "\"" << str << "\" is not a number, will ignore it and use the default value.";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
break;
|
||||
case eDataPath:
|
||||
@ -180,9 +179,9 @@ void PNL_StartupHandler::OnCharacters(const char *str)
|
||||
tstr += ".rge";
|
||||
fTrimSpDataPathList.push_back(tstr);
|
||||
} else {
|
||||
cout << endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding energy:";
|
||||
cout << endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler::OnCharacters: **ERROR** when finding energy:";
|
||||
std::cout << std::endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -213,8 +212,8 @@ void PNL_StartupHandler::OnComment(const char *str)
|
||||
*/
|
||||
void PNL_StartupHandler::OnWarning(const char *str)
|
||||
{
|
||||
cout << endl << "PNL_StartupHandler **WARNING** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler **WARNING** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -227,8 +226,8 @@ void PNL_StartupHandler::OnWarning(const char *str)
|
||||
*/
|
||||
void PNL_StartupHandler::OnError(const char *str)
|
||||
{
|
||||
cout << endl << "PNL_StartupHandler **ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler **ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -241,8 +240,8 @@ void PNL_StartupHandler::OnError(const char *str)
|
||||
*/
|
||||
void PNL_StartupHandler::OnFatalError(const char *str)
|
||||
{
|
||||
cout << endl << "PNL_StartupHandler **FATAL ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PNL_StartupHandler **FATAL ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -269,7 +268,7 @@ bool PNL_StartupHandler::StartupFileExists(char *fln)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
ifstream ifile(fln);
|
||||
std::ifstream ifile(fln);
|
||||
|
||||
if (ifile.fail()) {
|
||||
result = false;
|
||||
|
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
@ -10,7 +10,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
2
src/external/Nonlocal/PNonlocal.h
vendored
2
src/external/Nonlocal/PNonlocal.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
3
src/external/TLemRunHeader/TLemRunHeader.cxx
vendored
3
src/external/TLemRunHeader/TLemRunHeader.cxx
vendored
@ -4,9 +4,6 @@
|
||||
// 18/06/2006
|
||||
//
|
||||
//
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "TLemRunHeader.h"
|
||||
|
||||
ClassImp(TLemRunHeader)
|
||||
|
4
src/external/libBNMR/TBNMR.cpp
vendored
4
src/external/libBNMR/TBNMR.cpp
vendored
@ -40,7 +40,7 @@ ClassImp(ExpRlx) // for the ROOT-dictionary
|
||||
ClassImp(SExpRlx)
|
||||
|
||||
|
||||
double ExpRlx::operator()(double x, const vector<double> &par) const {
|
||||
double ExpRlx::operator()(double x, const std::vector<double> &par) const {
|
||||
assert(par.size()==2); // make sure the number of parameters handed to the function is correct
|
||||
|
||||
// par[0] time of beam off
|
||||
@ -66,7 +66,7 @@ double ExpRlx::operator()(double x, const vector<double> &par) const {
|
||||
TF1 SExpRlx::sexp1=TF1("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 20000.0);
|
||||
TF1 SExpRlx::sexp2=TF1("sexp", "exp(-([3]-x)/[4])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 20000.0);
|
||||
|
||||
double SExpRlx::operator()(double x, const vector<double> &par) const {
|
||||
double SExpRlx::operator()(double x, const std::vector<double> &par) const {
|
||||
assert(par.size()==3); // make sure the number of parameters handed to the function is correct
|
||||
|
||||
// par[0] time of beam off
|
||||
|
8
src/external/libBNMR/TBNMR.h
vendored
8
src/external/libBNMR/TBNMR.h
vendored
@ -52,11 +52,11 @@ public:
|
||||
~ExpRlx(){}
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
// function operator
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
// definition of the class for the ROOT-dictionary
|
||||
ClassDef(ExpRlx,1)
|
||||
@ -70,11 +70,11 @@ public:
|
||||
~SExpRlx(){}
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
// function operator
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
private:
|
||||
static TF1 sexp1;
|
||||
static TF1 sexp2;
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include "BMWStartupHandler.h"
|
||||
@ -49,7 +48,7 @@ ClassImp(TMeanFieldsForScTrilayer)
|
||||
TMeanFieldsForScHalfSpace::TMeanFieldsForScHalfSpace() {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -63,8 +62,8 @@ TMeanFieldsForScHalfSpace::TMeanFieldsForScHalfSpace() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
@ -83,15 +82,15 @@ TMeanFieldsForScHalfSpace::TMeanFieldsForScHalfSpace() {
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
// Parameters: field, deadlayer, lambda
|
||||
|
||||
double TMeanFieldsForScHalfSpace::operator()(double E, const vector<double> &par_vec) const{
|
||||
double TMeanFieldsForScHalfSpace::operator()(double E, const std::vector<double> &par_vec) const{
|
||||
|
||||
// Calculate field profile
|
||||
vector<double> parForBofZ(par_vec);
|
||||
std::vector<double> parForBofZ(par_vec);
|
||||
|
||||
TLondon1D_HS BofZ(parForBofZ);
|
||||
|
||||
vector<double> energies(fImpProfile->Energy());
|
||||
vector<double>::const_iterator energyIter;
|
||||
std::vector<double> energies(fImpProfile->Energy());
|
||||
std::vector<double>::const_iterator energyIter;
|
||||
energyIter = find(energies.begin(), energies.end(), E);
|
||||
|
||||
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
|
||||
@ -121,8 +120,8 @@ double TMeanFieldsForScHalfSpace::CalcMeanB (double E, const TLondon1D_HS& BofZ)
|
||||
|
||||
fImpProfile->Normalize(E);
|
||||
|
||||
vector<double> z(fImpProfile->DataZ(E));
|
||||
vector<double> nz(fImpProfile->DataNZ(E));
|
||||
std::vector<double> z(fImpProfile->DataZ(E));
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
// calculate mean field
|
||||
@ -140,7 +139,7 @@ double TMeanFieldsForScHalfSpace::CalcMeanB (double E, const TLondon1D_HS& BofZ)
|
||||
TMeanFieldsForScSingleLayer::TMeanFieldsForScSingleLayer() {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -154,8 +153,8 @@ TMeanFieldsForScSingleLayer::TMeanFieldsForScSingleLayer() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
@ -174,24 +173,24 @@ TMeanFieldsForScSingleLayer::TMeanFieldsForScSingleLayer() {
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
// Parameters: field, deadlayer, thicknessSC, lambda, weight (deadlayer), weight (SC), weight (substrate)
|
||||
|
||||
double TMeanFieldsForScSingleLayer::operator()(double E, const vector<double> &par_vec) const{
|
||||
double TMeanFieldsForScSingleLayer::operator()(double E, const std::vector<double> &par_vec) const{
|
||||
|
||||
vector<double> interfaces;
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par_vec[1]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]);
|
||||
|
||||
vector<double> weights;
|
||||
std::vector<double> weights;
|
||||
weights.push_back(par_vec[4]);
|
||||
weights.push_back(par_vec[5]);
|
||||
weights.push_back(par_vec[6]);
|
||||
|
||||
// Calculate field profile
|
||||
vector<double> parForBofZ(par_vec);
|
||||
std::vector<double> parForBofZ(par_vec);
|
||||
|
||||
TLondon1D_1L BofZ(parForBofZ);
|
||||
|
||||
vector<double> energies(fImpProfile->Energy());
|
||||
vector<double>::const_iterator energyIter;
|
||||
std::vector<double> energies(fImpProfile->Energy());
|
||||
std::vector<double>::const_iterator energyIter;
|
||||
energyIter = find(energies.begin(), energies.end(), E);
|
||||
|
||||
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
|
||||
@ -215,13 +214,13 @@ double TMeanFieldsForScSingleLayer::operator()(double E, const vector<double> &p
|
||||
}
|
||||
}
|
||||
|
||||
double TMeanFieldsForScSingleLayer::CalcMeanB (double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_1L& BofZ) const {
|
||||
double TMeanFieldsForScSingleLayer::CalcMeanB (double E, const std::vector<double>& interfaces, const std::vector<double>& weights, const TLondon1D_1L& BofZ) const {
|
||||
//calcData->UseHighResolution(E);
|
||||
fImpProfile->WeightLayers(E, interfaces, weights);
|
||||
fImpProfile->Normalize(E);
|
||||
|
||||
vector<double> z(fImpProfile->DataZ(E));
|
||||
vector<double> nz(fImpProfile->DataNZ(E));
|
||||
std::vector<double> z(fImpProfile->DataZ(E));
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
// calculate mean field
|
||||
@ -239,7 +238,7 @@ double TMeanFieldsForScSingleLayer::CalcMeanB (double E, const vector<double>& i
|
||||
TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -253,8 +252,8 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug(), 1);
|
||||
|
||||
@ -274,33 +273,33 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
|
||||
// Parameters: field, deadlayer, layer1, layer2, lambda1, lambda2, weight1 (deadlayer), weight2, weight3, weight4 (substrate),
|
||||
// [Gss width for profile convolution]
|
||||
|
||||
double TMeanFieldsForScBilayer::operator()(double E, const vector<double> &par_vec) const{
|
||||
double TMeanFieldsForScBilayer::operator()(double E, const std::vector<double> &par_vec) const{
|
||||
|
||||
double width(0.0);
|
||||
if (par_vec.size() == 11) {
|
||||
width = par_vec[10];
|
||||
}
|
||||
|
||||
vector<double> interfaces;
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par_vec[1]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]+par_vec[3]);
|
||||
|
||||
vector<double> weights;
|
||||
std::vector<double> weights;
|
||||
weights.push_back(par_vec[6]);
|
||||
weights.push_back(par_vec[7]);
|
||||
weights.push_back(par_vec[8]);
|
||||
weights.push_back(par_vec[9]);
|
||||
|
||||
// Calculate field profile
|
||||
vector<double> parForBofZ;
|
||||
std::vector<double> parForBofZ;
|
||||
for (unsigned int i(0); i<6; i++)
|
||||
parForBofZ.push_back(par_vec[i]);
|
||||
|
||||
TLondon1D_2L BofZ(parForBofZ);
|
||||
|
||||
vector<double> energies(fImpProfile->Energy());
|
||||
vector<double>::const_iterator energyIter;
|
||||
std::vector<double> energies(fImpProfile->Energy());
|
||||
std::vector<double>::const_iterator energyIter;
|
||||
energyIter = find(energies.begin(), energies.end(), E);
|
||||
|
||||
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
|
||||
@ -324,7 +323,7 @@ double TMeanFieldsForScBilayer::operator()(double E, const vector<double> &par_v
|
||||
}
|
||||
}
|
||||
|
||||
double TMeanFieldsForScBilayer::CalcMeanB (double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_2L& BofZ, double width=0.0) const {
|
||||
double TMeanFieldsForScBilayer::CalcMeanB (double E, const std::vector<double>& interfaces, const std::vector<double>& weights, const TLondon1D_2L& BofZ, double width=0.0) const {
|
||||
//fImpProfile->UseHighResolution(E);
|
||||
//fImpProfile->ConvolveGss(width, E);
|
||||
//fImpProfile->SetOriginal();
|
||||
@ -332,8 +331,8 @@ double TMeanFieldsForScBilayer::CalcMeanB (double E, const vector<double>& inter
|
||||
fImpProfile->ConvolveGss(width, E);
|
||||
fImpProfile->Normalize(E);
|
||||
|
||||
vector<double> z(fImpProfile->DataZ(E));
|
||||
vector<double> nz(fImpProfile->DataNZ(E));
|
||||
std::vector<double> z(fImpProfile->DataZ(E));
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
if (E==20.0){
|
||||
@ -358,7 +357,7 @@ double TMeanFieldsForScBilayer::CalcMeanB (double E, const vector<double>& inter
|
||||
TMeanFieldsForScTrilayer::TMeanFieldsForScTrilayer() {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -372,8 +371,8 @@ TMeanFieldsForScTrilayer::TMeanFieldsForScTrilayer() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
@ -392,15 +391,15 @@ TMeanFieldsForScTrilayer::TMeanFieldsForScTrilayer() {
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
// Parameters: field, deadlayer, layer1, layer2, layer3, lambda1, lambda2, lambda3, weight1, weight2, weight3, weight4, weight5
|
||||
|
||||
double TMeanFieldsForScTrilayer::operator()(double E, const vector<double> &par_vec) const{
|
||||
double TMeanFieldsForScTrilayer::operator()(double E, const std::vector<double> &par_vec) const{
|
||||
|
||||
vector<double> interfaces;
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par_vec[1]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]+par_vec[3]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]+par_vec[3]+par_vec[4]);
|
||||
|
||||
vector<double> weights;
|
||||
std::vector<double> weights;
|
||||
weights.push_back(par_vec[8]);
|
||||
weights.push_back(par_vec[9]);
|
||||
weights.push_back(par_vec[10]);
|
||||
@ -408,14 +407,14 @@ double TMeanFieldsForScTrilayer::operator()(double E, const vector<double> &par_
|
||||
weights.push_back(par_vec[12]);
|
||||
|
||||
// Calculate field profile
|
||||
vector<double> parForBofZ;
|
||||
std::vector<double> parForBofZ;
|
||||
for (unsigned int i(0); i<8; i++)
|
||||
parForBofZ.push_back(par_vec[i]);
|
||||
|
||||
TLondon1D_3L BofZ(parForBofZ);
|
||||
|
||||
vector<double> energies(fImpProfile->Energy());
|
||||
vector<double>::const_iterator energyIter;
|
||||
std::vector<double> energies(fImpProfile->Energy());
|
||||
std::vector<double>::const_iterator energyIter;
|
||||
energyIter = find(energies.begin(), energies.end(), E);
|
||||
|
||||
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
|
||||
@ -439,13 +438,13 @@ double TMeanFieldsForScTrilayer::operator()(double E, const vector<double> &par_
|
||||
}
|
||||
}
|
||||
|
||||
double TMeanFieldsForScTrilayer::CalcMeanB (double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_3L& BofZ) const {
|
||||
double TMeanFieldsForScTrilayer::CalcMeanB (double E, const std::vector<double>& interfaces, const std::vector<double>& weights, const TLondon1D_3L& BofZ) const {
|
||||
//calcData->UseHighResolution(E);
|
||||
fImpProfile->WeightLayers(E, interfaces, weights);
|
||||
fImpProfile->Normalize(E);
|
||||
|
||||
vector<double> z(fImpProfile->DataZ(E));
|
||||
vector<double> nz(fImpProfile->DataNZ(E));
|
||||
std::vector<double> z(fImpProfile->DataZ(E));
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
// calculate mean field
|
||||
@ -463,7 +462,7 @@ double TMeanFieldsForScTrilayer::CalcMeanB (double E, const vector<double>& inte
|
||||
TMeanFieldsForScTrilayerWithInsulator::TMeanFieldsForScTrilayerWithInsulator() {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -477,8 +476,8 @@ TMeanFieldsForScTrilayerWithInsulator::TMeanFieldsForScTrilayerWithInsulator() {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
@ -497,15 +496,15 @@ TMeanFieldsForScTrilayerWithInsulator::TMeanFieldsForScTrilayerWithInsulator() {
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
// Parameters: field, deadlayer, layer1, layer2, layer3, lambda1, lambda2, weight1, weight2, weight3, weight4, weight5
|
||||
|
||||
double TMeanFieldsForScTrilayerWithInsulator::operator()(double E, const vector<double> &par_vec) const{
|
||||
double TMeanFieldsForScTrilayerWithInsulator::operator()(double E, const std::vector<double> &par_vec) const{
|
||||
|
||||
vector<double> interfaces;
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par_vec[1]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]+par_vec[3]);
|
||||
interfaces.push_back(par_vec[1]+par_vec[2]+par_vec[3]+par_vec[4]);
|
||||
|
||||
vector<double> weights;
|
||||
std::vector<double> weights;
|
||||
weights.push_back(par_vec[7]);
|
||||
weights.push_back(par_vec[8]);
|
||||
weights.push_back(par_vec[9]);
|
||||
@ -513,14 +512,14 @@ double TMeanFieldsForScTrilayerWithInsulator::operator()(double E, const vector<
|
||||
weights.push_back(par_vec[11]);
|
||||
|
||||
// Calculate field profile
|
||||
vector<double> parForBofZ;
|
||||
std::vector<double> parForBofZ;
|
||||
for (unsigned int i(0); i<7; i++)
|
||||
parForBofZ.push_back(par_vec[i]);
|
||||
|
||||
TLondon1D_3LwInsulator BofZ(parForBofZ);
|
||||
|
||||
vector<double> energies(fImpProfile->Energy());
|
||||
vector<double>::const_iterator energyIter;
|
||||
std::vector<double> energies(fImpProfile->Energy());
|
||||
std::vector<double>::const_iterator energyIter;
|
||||
energyIter = find(energies.begin(), energies.end(), E);
|
||||
|
||||
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
|
||||
@ -545,13 +544,13 @@ double TMeanFieldsForScTrilayerWithInsulator::operator()(double E, const vector<
|
||||
}
|
||||
|
||||
double TMeanFieldsForScTrilayerWithInsulator::CalcMeanB
|
||||
(double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_3LwInsulator& BofZ) const {
|
||||
(double E, const std::vector<double>& interfaces, const std::vector<double>& weights, const TLondon1D_3LwInsulator& BofZ) const {
|
||||
//calcData->UseHighResolution(E);
|
||||
fImpProfile->WeightLayers(E, interfaces, weights);
|
||||
fImpProfile->Normalize(E);
|
||||
|
||||
vector<double> z(fImpProfile->DataZ(E));
|
||||
vector<double> nz(fImpProfile->DataNZ(E));
|
||||
std::vector<double> z(fImpProfile->DataZ(E));
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
// calculate mean field
|
||||
|
@ -39,10 +39,10 @@ public:
|
||||
~TMeanFieldsForScHalfSpace() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const TLondon1D_HS&) const;
|
||||
|
||||
private:
|
||||
@ -59,11 +59,11 @@ public:
|
||||
~TMeanFieldsForScSingleLayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_1L&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_1L&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
@ -79,11 +79,11 @@ public:
|
||||
~TMeanFieldsForScBilayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_2L&, double) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_2L&, double) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
@ -99,11 +99,11 @@ public:
|
||||
~TMeanFieldsForScTrilayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_3L&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3L&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
@ -119,11 +119,11 @@ public:
|
||||
~TMeanFieldsForScTrilayerWithInsulator() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_3LwInsulator&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3LwInsulator&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
|
52
src/external/libFitPofB/classes/TBofZCalc.cpp
vendored
52
src/external/libFitPofB/classes/TBofZCalc.cpp
vendored
@ -37,8 +37,6 @@
|
||||
#endif
|
||||
|
||||
#include <cmath>
|
||||
//#include <iostream>
|
||||
//#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
//------------------
|
||||
@ -122,7 +120,7 @@ void TBofZCalc::Calculate()
|
||||
// Parameters: Bext[G], deadlayer[nm], lambda[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_HS::TLondon1D_HS(const vector<double> ¶m, unsigned int steps)
|
||||
TLondon1D_HS::TLondon1D_HS(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = 200.0/double(steps);
|
||||
@ -149,14 +147,14 @@ double TLondon1D_HS::GetBmin() const
|
||||
return fParam[0]*exp((fParam[1]-200.0)/fParam[2]);
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TLondon1D_HS::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TLondon1D_HS::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= 0.0 || BB > fParam[0])
|
||||
return inv;
|
||||
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
invAndDerivative.first = fParam[1] - fParam[2]*log(BB/fParam[0]);
|
||||
invAndDerivative.second = -fParam[2]/BB;
|
||||
@ -173,7 +171,7 @@ vector< pair<double, double> > TLondon1D_HS::GetInverseAndDerivative(double BB)
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness[nm], lambda[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_1L::TLondon1D_1L(const vector<double> ¶m, unsigned int steps)
|
||||
TLondon1D_1L::TLondon1D_1L(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = param[2]/double(steps);
|
||||
@ -254,15 +252,15 @@ void TLondon1D_1L::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TLondon1D_1L::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TLondon1D_1L::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= fMinB || BB > fParam[0])
|
||||
return inv;
|
||||
|
||||
double inverse[2];
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
inverse[0]=fParam[3]*log((BB-sqrt(BB*BB-4.0*fCoeff[0]*fCoeff[1]))/(2.0*fCoeff[1]));
|
||||
inverse[1]=fParam[3]*log((BB+sqrt(BB*BB-4.0*fCoeff[0]*fCoeff[1]))/(2.0*fCoeff[1]));
|
||||
@ -288,7 +286,7 @@ vector< pair<double, double> > TLondon1D_1L::GetInverseAndDerivative(double BB)
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], lambda1[nm], lambda2[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_2L::TLondon1D_2L(const vector<double> ¶m, unsigned int steps)
|
||||
TLondon1D_2L::TLondon1D_2L(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = (param[2]+param[3])/double(steps);
|
||||
@ -389,15 +387,15 @@ void TLondon1D_2L::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TLondon1D_2L::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TLondon1D_2L::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= fMinB || BB >= fParam[0])
|
||||
return inv;
|
||||
|
||||
double inverse[3];
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
switch(fMinTag)
|
||||
{
|
||||
@ -457,7 +455,7 @@ vector< pair<double, double> > TLondon1D_2L::GetInverseAndDerivative(double BB)
|
||||
// Parameters: Bext[G], B1[G], deadlayer[nm], thickness1[nm], lambda[nm]
|
||||
//------------------
|
||||
|
||||
TProximity1D_1LHS::TProximity1D_1LHS(const vector<double> ¶m, unsigned int steps)
|
||||
TProximity1D_1LHS::TProximity1D_1LHS(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = 200./double(steps);
|
||||
@ -512,15 +510,15 @@ void TProximity1D_1LHS::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TProximity1D_1LHS::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TProximity1D_1LHS::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= fMinB || BB > fParam[0])
|
||||
return inv;
|
||||
|
||||
double inverse[2];
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
inverse[0]=(fParam[0]*(fParam[2]+fParam[3])-fParam[1]*fParam[2]-BB*fParam[3])/(fParam[0]-fParam[1]);
|
||||
inverse[1]=fParam[2]+fParam[3]-fParam[4]*log(BB/fParam[1]);
|
||||
@ -545,7 +543,7 @@ vector< pair<double, double> > TProximity1D_1LHS::GetInverseAndDerivative(double
|
||||
// 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 steps)
|
||||
TLondon1D_3L::TLondon1D_3L(const std::vector<double> ¶m, unsigned int steps)
|
||||
// : fSteps(steps), fDZ((param[2]+param[3]+param[4])/double(steps)), fParam(param), fMinTag(-1), fMinZ(-1.0), fMinB(-1.0)
|
||||
{
|
||||
// no members of TLondon1D_3L, therefore the initialization list cannot be used!!
|
||||
@ -681,15 +679,15 @@ void TLondon1D_3L::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TLondon1D_3L::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TLondon1D_3L::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= fMinB || BB > fParam[0])
|
||||
return inv;
|
||||
|
||||
double inverse[4];
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
switch(fMinTag)
|
||||
{
|
||||
@ -791,7 +789,7 @@ vector< pair<double, double> > TLondon1D_3L::GetInverseAndDerivative(double BB)
|
||||
// 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 steps)
|
||||
TLondon1D_3LS::TLondon1D_3LS(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = (param[2]+param[3]+param[4])/double(steps);
|
||||
@ -915,15 +913,15 @@ void TLondon1D_3LS::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
vector< pair<double, double> > TLondon1D_3LS::GetInverseAndDerivative(double BB) const
|
||||
std::vector< std::pair<double, double> > TLondon1D_3LS::GetInverseAndDerivative(double BB) const
|
||||
{
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
|
||||
if(BB <= fMinB || BB > fParam[0])
|
||||
return inv;
|
||||
|
||||
double inverse[4];
|
||||
pair<double, double> invAndDerivative;
|
||||
std::pair<double, double> invAndDerivative;
|
||||
|
||||
switch(fMinTag)
|
||||
{
|
||||
@ -1025,7 +1023,7 @@ vector< pair<double, double> > TLondon1D_3LS::GetInverseAndDerivative(double BB)
|
||||
// Parameters: Bext[G], deadlayer[nm], thickness1[nm], thickness2[nm], thickness3[nm], lambda1[nm], lambda2[nm]
|
||||
//------------------
|
||||
|
||||
TLondon1D_3LwInsulator::TLondon1D_3LwInsulator(const vector<double> ¶m, unsigned int steps)
|
||||
TLondon1D_3LwInsulator::TLondon1D_3LwInsulator(const std::vector<double> ¶m, unsigned int steps)
|
||||
{
|
||||
fSteps = steps;
|
||||
fDZ = (param[2]+param[3]+param[4])/static_cast<double>(steps);
|
||||
|
@ -40,7 +40,6 @@
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "TMath.h"
|
||||
|
||||
@ -73,7 +72,7 @@ TBulkVortexFieldCalc::~TBulkVortexFieldCalc() {
|
||||
FILE *wordsOfWisdomW;
|
||||
wordsOfWisdomW = fopen(fWisdom.c_str(), "w");
|
||||
if (wordsOfWisdomW == NULL) {
|
||||
cout << "TBulkVortexFieldCalc::~TBulkVortexFieldCalc(): Could not open file ... No wisdom is exported..." << endl;
|
||||
std::cout << "TBulkVortexFieldCalc::~TBulkVortexFieldCalc(): Could not open file ... No wisdom is exported..." << std::endl;
|
||||
} else {
|
||||
fftw_export_wisdom_to_file(wordsOfWisdomW);
|
||||
fclose(wordsOfWisdomW);
|
||||
@ -123,7 +122,7 @@ double TBulkVortexFieldCalc::GetBmax() const {
|
||||
}
|
||||
}
|
||||
|
||||
TBulkTriVortexLondonFieldCalc::TBulkTriVortexLondonFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkTriVortexLondonFieldCalc::TBulkTriVortexLondonFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -143,7 +142,7 @@ TBulkTriVortexLondonFieldCalc::TBulkTriVortexLondonFieldCalc(const string& wisdo
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -174,11 +173,11 @@ TBulkTriVortexLondonFieldCalc::TBulkTriVortexLondonFieldCalc(const string& wisdo
|
||||
void TBulkTriVortexLondonFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -302,7 +301,7 @@ void TBulkTriVortexLondonFieldCalc::CalculateGrid() const {
|
||||
|
||||
}
|
||||
|
||||
TBulkSqVortexLondonFieldCalc::TBulkSqVortexLondonFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkSqVortexLondonFieldCalc::TBulkSqVortexLondonFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -322,7 +321,7 @@ TBulkSqVortexLondonFieldCalc::TBulkSqVortexLondonFieldCalc(const string& wisdom,
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -353,11 +352,11 @@ TBulkSqVortexLondonFieldCalc::TBulkSqVortexLondonFieldCalc(const string& wisdom,
|
||||
void TBulkSqVortexLondonFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -449,7 +448,7 @@ void TBulkSqVortexLondonFieldCalc::CalculateGrid() const {
|
||||
|
||||
|
||||
|
||||
TBulkTriVortexMLFieldCalc::TBulkTriVortexMLFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkTriVortexMLFieldCalc::TBulkTriVortexMLFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -469,7 +468,7 @@ TBulkTriVortexMLFieldCalc::TBulkTriVortexMLFieldCalc(const string& wisdom, const
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -500,11 +499,11 @@ TBulkTriVortexMLFieldCalc::TBulkTriVortexMLFieldCalc(const string& wisdom, const
|
||||
void TBulkTriVortexMLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -645,7 +644,7 @@ void TBulkTriVortexMLFieldCalc::CalculateGrid() const {
|
||||
}
|
||||
|
||||
|
||||
TBulkTriVortexAGLFieldCalc::TBulkTriVortexAGLFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkTriVortexAGLFieldCalc::TBulkTriVortexAGLFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -665,7 +664,7 @@ TBulkTriVortexAGLFieldCalc::TBulkTriVortexAGLFieldCalc(const string& wisdom, con
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -696,11 +695,11 @@ TBulkTriVortexAGLFieldCalc::TBulkTriVortexAGLFieldCalc(const string& wisdom, con
|
||||
void TBulkTriVortexAGLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -850,7 +849,7 @@ void TBulkTriVortexAGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
|
||||
|
||||
TBulkTriVortexAGLIIFieldCalc::TBulkTriVortexAGLIIFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkTriVortexAGLIIFieldCalc::TBulkTriVortexAGLIIFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -870,7 +869,7 @@ TBulkTriVortexAGLIIFieldCalc::TBulkTriVortexAGLIIFieldCalc(const string& wisdom,
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -901,11 +900,11 @@ TBulkTriVortexAGLIIFieldCalc::TBulkTriVortexAGLIIFieldCalc(const string& wisdom,
|
||||
void TBulkTriVortexAGLIIFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and vortex-core radius have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and vortex-core radius have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1054,7 +1053,7 @@ void TBulkTriVortexAGLIIFieldCalc::CalculateGrid() const {
|
||||
}
|
||||
|
||||
|
||||
TBulkTriVortexNGLFieldCalc::TBulkTriVortexNGLFieldCalc(const string& wisdom, const unsigned int steps)
|
||||
TBulkTriVortexNGLFieldCalc::TBulkTriVortexNGLFieldCalc(const std::string& wisdom, const unsigned int steps)
|
||||
: fLatticeConstant(0.0), fKappa(0.0), fSumAk(0.0), fSumOmegaSq(0.0), fSumSum(0.0)
|
||||
{
|
||||
fWisdom = wisdom;
|
||||
@ -1332,7 +1331,7 @@ void TBulkTriVortexNGLFieldCalc::CalculateGradient() const {
|
||||
// // #pragma omp parallel for default(shared) private(i) schedule(dynamic)
|
||||
// for (i = 0; i < NFFTsq; i += 1) {
|
||||
// if (fOmegaMatrix[i] < 0.0) {
|
||||
// cout << "Omega negative for index " << i << ", value: " << fOmegaMatrix[i] << endl;
|
||||
// std::cout << "Omega negative for index " << i << ", value: " << fOmegaMatrix[i] << std::endl;
|
||||
// fOmegaMatrix[i] = 0.0;
|
||||
// }
|
||||
// }
|
||||
@ -1909,11 +1908,11 @@ void TBulkTriVortexNGLFieldCalc::CalculateSumAk() const {
|
||||
void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 3) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2]) {
|
||||
cout << endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth and coherence length have to have finite values in order to calculate B(x,y)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1967,7 +1966,7 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
CalculateSumAk();
|
||||
|
||||
// cout << "fSumAk = " << fSumAk << endl;
|
||||
// std::cout << "fSumAk = " << fSumAk << std::endl;
|
||||
|
||||
// Do the Fourier transform to get omega(x,y) - Abrikosov
|
||||
|
||||
@ -2060,7 +2059,7 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
CalculateSumAk();
|
||||
|
||||
// cout << "fSumAk = " << fSumAk << endl;
|
||||
// std::cout << "fSumAk = " << fSumAk << std::endl;
|
||||
|
||||
// Need a copy of the aK-matrix since FFTW is manipulating the input in c2r and r2c transforms
|
||||
// Store it in the first half of the bK-matrix
|
||||
@ -2133,9 +2132,9 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
if (fFFTin[l][0]){
|
||||
if (((fabs(fFFTin[l][0]) > 1.0E-6) && (fabs(fCheckAkConvergence[l] - fFFTin[l][0])/fFFTin[l][0] > 1.0E-3)) || \
|
||||
(fCheckAkConvergence[l]/fFFTin[l][0] < 0.0)) {
|
||||
//cout << "old: " << fCheckAkConvergence[l] << ", new: " << fFFTin[l][0] << endl;
|
||||
//std::cout << "old: " << fCheckAkConvergence[l] << ", new: " << fFFTin[l][0] << std::endl;
|
||||
akConverged = false;
|
||||
//cout << "index = " << l << endl;
|
||||
//std::cout << "index = " << l << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2156,13 +2155,13 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
//break;
|
||||
}
|
||||
|
||||
// cout << "Ak Convergence: " << akConverged << endl;
|
||||
// std::cout << "Ak Convergence: " << akConverged << std::endl;
|
||||
|
||||
// Calculate omega again either for the bK-iteration step or again the aK-iteration
|
||||
|
||||
CalculateSumAk();
|
||||
|
||||
// cout << "fSumAk = " << fSumAk << " count = " << count << endl;
|
||||
// std::cout << "fSumAk = " << fSumAk << " count = " << count << std::endl;
|
||||
|
||||
// Do the Fourier transform to get omega(x,y)
|
||||
|
||||
@ -2222,14 +2221,14 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
if (fBkMatrix[l][0]) {
|
||||
if (((fabs(fBkMatrix[l][0]) > 1.0E-6) && (fabs(fCheckBkConvergence[l] - fBkMatrix[l][0])/fabs(fBkMatrix[l][0]) > 1.0E-3)) || \
|
||||
(fCheckBkConvergence[l]/fBkMatrix[l][0] < 0.0)) {
|
||||
// cout << "old: " << fCheckBkConvergence[l] << ", new: " << fBkMatrix[l][0] << endl;
|
||||
// std::cout << "old: " << fCheckBkConvergence[l] << ", new: " << fBkMatrix[l][0] << std::endl;
|
||||
bkConverged = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cout << "Bk Convergence: " << bkConverged << endl;
|
||||
// std::cout << "Bk Convergence: " << bkConverged << std::endl;
|
||||
|
||||
if (!bkConverged) {
|
||||
#ifdef HAVE_GOMP
|
||||
@ -2338,7 +2337,7 @@ void TBulkTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
}
|
||||
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc::TBulkAnisotropicTriVortexLondonFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc::TBulkAnisotropicTriVortexLondonFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -2358,7 +2357,7 @@ TBulkAnisotropicTriVortexLondonFieldCalc::TBulkAnisotropicTriVortexLondonFieldCa
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -2389,12 +2388,12 @@ TBulkAnisotropicTriVortexLondonFieldCalc::TBulkAnisotropicTriVortexLondonFieldCa
|
||||
void TBulkAnisotropicTriVortexLondonFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 5) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2] || !fParam[3] || !fParam[4]) {
|
||||
cout << endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< endl;
|
||||
std::cout << std::endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2555,7 +2554,7 @@ void TBulkAnisotropicTriVortexLondonFieldCalc::CalculateGrid() const {
|
||||
|
||||
}
|
||||
|
||||
TBulkAnisotropicTriVortexMLFieldCalc::TBulkAnisotropicTriVortexMLFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkAnisotropicTriVortexMLFieldCalc::TBulkAnisotropicTriVortexMLFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -2575,7 +2574,7 @@ TBulkAnisotropicTriVortexMLFieldCalc::TBulkAnisotropicTriVortexMLFieldCalc(const
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -2606,12 +2605,12 @@ TBulkAnisotropicTriVortexMLFieldCalc::TBulkAnisotropicTriVortexMLFieldCalc(const
|
||||
void TBulkAnisotropicTriVortexMLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 5) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2] || !fParam[3] || !fParam[4]) {
|
||||
cout << endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< endl;
|
||||
std::cout << std::endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2754,7 +2753,7 @@ void TBulkAnisotropicTriVortexMLFieldCalc::CalculateGrid() const {
|
||||
|
||||
}
|
||||
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc::TBulkAnisotropicTriVortexAGLFieldCalc(const string& wisdom, const unsigned int steps) {
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc::TBulkAnisotropicTriVortexAGLFieldCalc(const std::string& wisdom, const unsigned int steps) {
|
||||
fWisdom = wisdom;
|
||||
if (steps % 2) {
|
||||
fSteps = steps + 1;
|
||||
@ -2774,7 +2773,7 @@ TBulkAnisotropicTriVortexAGLFieldCalc::TBulkAnisotropicTriVortexAGLFieldCalc(con
|
||||
fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps];
|
||||
fFFTout = new double[fSteps*fSteps];
|
||||
|
||||
// cout << "Check for the FFT plan..." << endl;
|
||||
// std::cout << "Check for the FFT plan..." << std::endl;
|
||||
|
||||
// Load wisdom from file if it exists and should be used
|
||||
|
||||
@ -2805,12 +2804,12 @@ TBulkAnisotropicTriVortexAGLFieldCalc::TBulkAnisotropicTriVortexAGLFieldCalc(con
|
||||
void TBulkAnisotropicTriVortexAGLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 5) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2] || !fParam[3] || !fParam[4]) {
|
||||
cout << endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< endl;
|
||||
std::cout << std::endl << "The field, penetration depths and coherence lengths have to have finite values in order to calculate B(x,y)!" \
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "TMath.h"
|
||||
|
||||
@ -60,7 +59,7 @@ TFilmVortexFieldCalc::~TFilmVortexFieldCalc() {
|
||||
FILE *wordsOfWisdomW;
|
||||
wordsOfWisdomW = fopen(fWisdom.c_str(), "w");
|
||||
if (wordsOfWisdomW == NULL) {
|
||||
cout << "TFilmVortexFieldCalc::~TFilmVortexFieldCalc(): Could not open file ... No wisdom is exported..." << endl;
|
||||
std::cout << "TFilmVortexFieldCalc::~TFilmVortexFieldCalc(): Could not open file ... No wisdom is exported..." << std::endl;
|
||||
} else {
|
||||
fftwf_export_wisdom_to_file(wordsOfWisdomW);
|
||||
fclose(wordsOfWisdomW);
|
||||
@ -71,7 +70,7 @@ TFilmVortexFieldCalc::~TFilmVortexFieldCalc() {
|
||||
|
||||
fftwf_destroy_plan(fFFTplan);
|
||||
|
||||
delete[] fFFTin; fFFTin = 0;
|
||||
delete[] fFFTin; fFFTin = nullptr;
|
||||
|
||||
for(unsigned int i(0); i<3; ++i){
|
||||
delete[] fBout[i]; fBout[i] = 0;
|
||||
@ -117,10 +116,10 @@ float TFilmVortexFieldCalc::GetBmax() const {
|
||||
}
|
||||
|
||||
|
||||
TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, const unsigned int steps, const unsigned int stepsZ)
|
||||
TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const std::string& wisdom, const unsigned int steps, const unsigned int stepsZ)
|
||||
: fLatticeConstant(0.0), fKappa(0.0), fSumOmegaSq(0.0), fSumSum(0.0), fFind3dSolution(false)
|
||||
{
|
||||
// cout << "TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc... ";
|
||||
// std::cout << "TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc... ";
|
||||
|
||||
fWisdom = wisdom;
|
||||
switch (stepsZ % 2) {
|
||||
@ -171,7 +170,7 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con
|
||||
temp = new float[stepsSqStZ]; // (grad omega)_(x,y,z)
|
||||
fOmegaDiffMatrix.push_back(temp);
|
||||
}
|
||||
temp = 0;
|
||||
temp = nullptr;
|
||||
|
||||
fOmegaMatrix = new float[stepsSqStZ]; // |psi|^2
|
||||
|
||||
@ -201,7 +200,7 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con
|
||||
|
||||
FILE *wordsOfWisdomR;
|
||||
wordsOfWisdomR = fopen(fWisdom.c_str(), "r");
|
||||
if (wordsOfWisdomR == NULL) {
|
||||
if (wordsOfWisdomR == nullptr) {
|
||||
fUseWisdom = false;
|
||||
} else {
|
||||
wisdomLoaded = fftwf_import_wisdom_from_file(wordsOfWisdomR);
|
||||
@ -215,7 +214,7 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con
|
||||
// create the FFT plans
|
||||
|
||||
if (fUseWisdom) {
|
||||
// cout << "use wisdom ... ";
|
||||
// std::cout << "use wisdom ... ";
|
||||
// use the first plan from the base class here - it will be destroyed by the base class destructor
|
||||
fFFTplan = fftwf_plan_dft_3d(fSteps, fSteps, fStepsZ, fFFTin, fRealSpaceMatrix, FFTW_BACKWARD, FFTW_EXHAUSTIVE);
|
||||
fFFTplanBkToBandQ = fftwf_plan_dft_3d(fSteps, fSteps, fStepsZ, fBkMatrix, fBkMatrix, FFTW_BACKWARD, FFTW_EXHAUSTIVE);
|
||||
@ -226,7 +225,7 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con
|
||||
fFFTplanForBatSurf = fftwf_plan_dft_2d(fSteps, fSteps, fBkS, fBkS, FFTW_FORWARD, FFTW_EXHAUSTIVE);
|
||||
}
|
||||
else {
|
||||
// cout << "do not use wisdom ... ";
|
||||
// std::cout << "do not use wisdom ... ";
|
||||
// use the first plan from the base class here - it will be destroyed by the base class destructor
|
||||
fFFTplan = fftwf_plan_dft_3d(fSteps, fSteps, fStepsZ, fFFTin, fRealSpaceMatrix, FFTW_BACKWARD, FFTW_ESTIMATE);
|
||||
fFFTplanBkToBandQ = fftwf_plan_dft_3d(fSteps, fSteps, fStepsZ, fBkMatrix, fBkMatrix, FFTW_BACKWARD, FFTW_ESTIMATE);
|
||||
@ -236,7 +235,7 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con
|
||||
fFFTplanForPk2 = fftwf_plan_dft_3d(fSteps, fSteps, fStepsZ, fQMatrix, fQMatrix, FFTW_BACKWARD, FFTW_ESTIMATE);
|
||||
fFFTplanForBatSurf = fftwf_plan_dft_2d(fSteps, fSteps, fBkS, fBkS, FFTW_FORWARD, FFTW_ESTIMATE);
|
||||
}
|
||||
// cout << "done" << endl;
|
||||
// std::cout << "done" << endl;
|
||||
}
|
||||
|
||||
TFilmTriVortexNGLFieldCalc::~TFilmTriVortexNGLFieldCalc() {
|
||||
@ -254,19 +253,19 @@ TFilmTriVortexNGLFieldCalc::~TFilmTriVortexNGLFieldCalc() {
|
||||
}
|
||||
fOmegaDiffMatrix.clear();
|
||||
|
||||
delete[] fOmegaMatrix; fOmegaMatrix = 0;
|
||||
delete[] fBkMatrix; fBkMatrix = 0;
|
||||
delete[] fRealSpaceMatrix; fRealSpaceMatrix = 0;
|
||||
delete[] fPkMatrix; fPkMatrix = 0;
|
||||
delete[] fQMatrix; fQMatrix = 0;
|
||||
delete[] fQMatrixA; fQMatrixA = 0;
|
||||
delete[] fSumAkFFTin; fSumAkFFTin = 0;
|
||||
delete[] fSumAk; fSumAk = 0;
|
||||
delete[] fBkS; fBkS = 0;
|
||||
delete[] fGstorage; fGstorage = 0;
|
||||
delete[] fOmegaMatrix; fOmegaMatrix = nullptr;
|
||||
delete[] fBkMatrix; fBkMatrix = nullptr;
|
||||
delete[] fRealSpaceMatrix; fRealSpaceMatrix = nullptr;
|
||||
delete[] fPkMatrix; fPkMatrix = nullptr;
|
||||
delete[] fQMatrix; fQMatrix = nullptr;
|
||||
delete[] fQMatrixA; fQMatrixA = nullptr;
|
||||
delete[] fSumAkFFTin; fSumAkFFTin = nullptr;
|
||||
delete[] fSumAk; fSumAk = nullptr;
|
||||
delete[] fBkS; fBkS = nullptr;
|
||||
delete[] fGstorage; fGstorage = nullptr;
|
||||
|
||||
delete[] fCheckAkConvergence; fCheckAkConvergence = 0;
|
||||
delete[] fCheckBkConvergence; fCheckBkConvergence = 0;
|
||||
delete[] fCheckAkConvergence; fCheckAkConvergence = nullptr;
|
||||
delete[] fCheckBkConvergence; fCheckBkConvergence = nullptr;
|
||||
}
|
||||
|
||||
void TFilmTriVortexNGLFieldCalc::CalculateGatVortexCore() const {
|
||||
@ -2612,11 +2611,11 @@ void TFilmTriVortexNGLFieldCalc::CalculateSumAk() const {
|
||||
void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
// SetParameters - method has to be called from the user before the calculation!!
|
||||
if (fParam.size() < 4) {
|
||||
cout << endl << "The SetParameters-method has to be called before B(x,y,z) can be calculated!" << endl;
|
||||
std::cout << std::endl << "The SetParameters-method has to be called before B(x,y,z) can be calculated!" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (!fParam[0] || !fParam[1] || !fParam[2] || !fParam[3]) {
|
||||
cout << endl << "The field, penetration depth, coherence length and layer thickness have to have finite values in order to calculate B(x,y,z)!" << endl;
|
||||
std::cout << std::endl << "The field, penetration depth, coherence length and layer thickness have to have finite values in order to calculate B(x,y,z)!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2785,7 +2784,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
// CalculateGatVortexCore();
|
||||
// for (k = 0; k < NFFTz; ++k) {
|
||||
// cout << "g[" << k << "] = " << fGstorage[k] << endl;
|
||||
// std::cout << "g[" << k << "] = " << fGstorage[k] << std::endl;
|
||||
// }
|
||||
|
||||
#ifdef HAVE_GOMP
|
||||
@ -2800,7 +2799,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
(fOmegaDiffMatrix[0][l]*fOmegaDiffMatrix[0][l] + fOmegaDiffMatrix[1][l]*fOmegaDiffMatrix[1][l] + \
|
||||
fOmegaDiffMatrix[2][l]*fOmegaDiffMatrix[2][l])/(fourKappaSq*fOmegaMatrix[l]);
|
||||
} else {
|
||||
// cout << "index where omega is zero: " << l << endl;
|
||||
// std::cout << "index where omega is zero: " << l << std::endl;
|
||||
fRealSpaceMatrix[l][0] = 0.0;
|
||||
}
|
||||
fRealSpaceMatrix[l][1] = 0.0;
|
||||
@ -2862,7 +2861,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
(fOmegaDiffMatrix[0][index]*fOmegaDiffMatrix[0][index] + fOmegaDiffMatrix[1][index]*fOmegaDiffMatrix[1][index] + \
|
||||
fOmegaDiffMatrix[2][index]*fOmegaDiffMatrix[2][index])/(fourKappaSq*fOmegaMatrix[index]);
|
||||
} else {
|
||||
// cout << "! fOmegaMatrix at index " << index << endl;
|
||||
// std::cout << "! fOmegaMatrix at index " << index << std::endl;
|
||||
// fSumSum -= fGstorage[k];
|
||||
index = k + fStepsZ*(j + fSteps*(i + 1));
|
||||
if (i < NFFT - 1 && fOmegaMatrix[index]) {
|
||||
@ -2898,9 +2897,9 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
if (fFFTin[index][0]) {
|
||||
if (((fabs(fFFTin[index][0]) > 1.0E-5f) && (fabs(fCheckAkConvergence[index] - fFFTin[index][0])/fFFTin[index][0] > 5.0E-3f)) \
|
||||
|| ((fabs(fFFTin[index][0]) > 1.0E-10f) && (fCheckAkConvergence[index]/fFFTin[index][0] < 0.0))) {
|
||||
//cout << "old: " << fCheckAkConvergence[index] << ", new: " << fFFTin[index][0] << endl;
|
||||
//std::cout << "old: " << fCheckAkConvergence[index] << ", new: " << fFFTin[index][0] << std::endl;
|
||||
akConverged = false;
|
||||
//cout << "count = " << count << ", Ak index = " << index << endl;
|
||||
//std::cout << "count = " << count << ", Ak index = " << index << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2926,17 +2925,17 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
}
|
||||
}
|
||||
|
||||
// cout << "Ak Convergence: " << akConverged << endl;
|
||||
// std::cout << "Ak Convergence: " << akConverged << std::endl;
|
||||
|
||||
// Calculate omega again either for the bK-iteration step or again the aK-iteration
|
||||
|
||||
CalculateSumAk();
|
||||
|
||||
// cout << "fSumAk = ";
|
||||
// std::cout << "fSumAk = ";
|
||||
// for (k = 0; k < NFFTz; ++k){
|
||||
// cout << fSumAk[k][0] << ", ";
|
||||
// std::cout << fSumAk[k][0] << ", ";
|
||||
// }
|
||||
// cout << endl;
|
||||
// std::cout << endl;
|
||||
|
||||
meanAk = 0.0f;
|
||||
for (k = 0; k < NFFTz; ++k) {
|
||||
@ -2995,7 +2994,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
fBkS[index][1] = 0.f;
|
||||
}
|
||||
|
||||
// cout << "fC = " << fC << ", meanAk = " << meanAk << endl;
|
||||
// std::cout << "fC = " << fC << ", meanAk = " << meanAk << endl;
|
||||
|
||||
fSumSum = fC*meanAk;
|
||||
|
||||
@ -3027,9 +3026,9 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
if (((fabs(fBkMatrix[index][0]) > 1.0E-5f) && \
|
||||
(fabs(fCheckBkConvergence[index] - fBkMatrix[index][0])/fBkMatrix[index][0] > 5.0E-3f)) \
|
||||
|| ((fabs(fBkMatrix[index][0]) > 1.0E-10f) && (fCheckBkConvergence[index]/fBkMatrix[index][0] < 0.0))) {
|
||||
//cout << "old: " << fCheckBkConvergence[index] << ", new: " << fBkMatrix[index][0] << endl;
|
||||
//std::cout << "old: " << fCheckBkConvergence[index] << ", new: " << fBkMatrix[index][0] << std::endl;
|
||||
bkConverged = false;
|
||||
//cout << "count = " << count << ", Bk index = " << index << endl;
|
||||
//std::cout << "count = " << count << ", Bk index = " << index << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3038,7 +3037,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
break;
|
||||
}
|
||||
|
||||
// cout << "Bk Convergence: " << bkConverged << endl;
|
||||
// std::cout << "Bk Convergence: " << bkConverged << std::endl;
|
||||
|
||||
if (!bkConverged) {
|
||||
#ifdef HAVE_GOMP
|
||||
@ -3069,7 +3068,7 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
}
|
||||
|
||||
if (count == 50) {
|
||||
cout << "3D iterations aborted after " << count << " steps" << endl;
|
||||
std::cout << "3D iterations aborted after " << count << " steps" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3080,14 +3079,14 @@ void TFilmTriVortexNGLFieldCalc::CalculateGrid() const {
|
||||
|
||||
if (bkConverged && akConverged) {
|
||||
if (!fFind3dSolution) {
|
||||
//cout << "count = " << count << " 2D converged" << endl;
|
||||
//cout << "2D iterations converged after " << count << " steps" << endl;
|
||||
//std::cout << "count = " << count << " 2D converged" << std::endl;
|
||||
//std::cout << "2D iterations converged after " << count << " steps" << std::endl;
|
||||
//break;
|
||||
akConverged = false;
|
||||
bkConverged = false;
|
||||
fFind3dSolution = true;
|
||||
} else {
|
||||
cout << "3D iterations converged after " << count << " steps" << endl;
|
||||
std::cout << "3D iterations converged after " << count << " steps" << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
57
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
57
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
@ -32,7 +32,6 @@
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include "BMWStartupHandler.h"
|
||||
@ -256,7 +255,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -278,7 +277,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -416,7 +415,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -433,7 +432,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
for(unsigned int i(6); i<8; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
|
||||
interfaces.clear();
|
||||
@ -456,7 +455,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -466,11 +465,11 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// // Debugging start
|
||||
// if (!(fCallCounter%10000)){
|
||||
// cout << fCallCounter-1 << "\t";
|
||||
// std::cout << fCallCounter-1 << "\t";
|
||||
// for (unsigned int i(0); i<fPar.size(); i++){
|
||||
// cout << fPar[i] << "\t";
|
||||
// std::cout << fPar[i] << "\t";
|
||||
// }
|
||||
// cout << endl;
|
||||
// std::cout << std::endl;
|
||||
// }
|
||||
// // Debugging end
|
||||
|
||||
@ -597,7 +596,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<par.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -615,7 +614,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
for(unsigned int i(8); i<11; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
|
||||
interfaces.clear();
|
||||
@ -638,7 +637,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -766,7 +765,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -789,7 +788,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -920,7 +919,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<par.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -939,7 +938,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
for(unsigned int i(10); i<14; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
|
||||
interfaces.clear();
|
||||
@ -961,7 +960,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -1092,7 +1091,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(2); i<par.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
@ -1111,7 +1110,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
for(unsigned int i(9); i<13; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
|
||||
interfaces.clear();
|
||||
@ -1133,7 +1132,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@ -1163,7 +1162,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
// int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// // check for parse errors
|
||||
// if (status) { // error
|
||||
// cout << endl << "**WARNING** Reading/parsing " << startup_path_name << " failed." << endl;
|
||||
// std::cout << endl << "**WARNING** Reading/parsing " << startup_path_name << " failed." << std::endl;
|
||||
// }
|
||||
//
|
||||
// fNSteps = startupHandler->GetNSteps();
|
||||
@ -1213,12 +1212,12 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
// fPar = par;
|
||||
//
|
||||
// /* for (unsigned int i(0); i<fPar.size(); i++){
|
||||
// cout << "fPar[" << i << "] = " << fPar[i] << endl;
|
||||
// std::cout << "fPar[" << i << "] = " << fPar[i] << std::endl;
|
||||
// }
|
||||
// */
|
||||
// for (unsigned int i(2); i<fPar.size(); i++){
|
||||
// fParForBofZ.push_back(fPar[i]);
|
||||
// // cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||
// // std::cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << std::endl;
|
||||
// }
|
||||
// fFirstCall=false;
|
||||
// }
|
||||
@ -1253,7 +1252,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
//
|
||||
// if(!only_phase_changed) {
|
||||
//
|
||||
// // cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// // std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
//
|
||||
// for (unsigned int i(2); i<par.size(); i++)
|
||||
// fParForBofZ[i-2] = par[i];
|
||||
@ -1262,15 +1261,15 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
//
|
||||
// /* DEBUG ---------------------------
|
||||
// for(unsigned int i(0); i<fParForBofZ.size(); i++) {
|
||||
// cout << "ParForBofZ[" << i << "] = " << fParForBofZ[i] << endl;
|
||||
// std::cout << "ParForBofZ[" << i << "] = " << fParForBofZ[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// for(unsigned int i(0); i<fParForPofB.size(); i++) {
|
||||
// cout << "ParForPofB[" << i << "] = " << fParForPofB[i] << endl;
|
||||
// std::cout << "ParForPofB[" << i << "] = " << fParForPofB[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// for(unsigned int i(0); i<fParForPofT.size(); i++) {
|
||||
// cout << "ParForPofT[" << i << "] = " << fParForPofT[i] << endl;
|
||||
// std::cout << "ParForPofT[" << i << "] = " << fParForPofT[i] << std::endl;
|
||||
// }
|
||||
// ------------------------------------*/
|
||||
//
|
||||
@ -1284,7 +1283,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
// for(unsigned int i(par.size()-4); i<par.size(); i++)
|
||||
// weights.push_back(par[i]);
|
||||
//
|
||||
// // cout << "Weighting has changed, re-calculating n(z) now..." << endl;
|
||||
// // std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
// fImpProfile->WeightLayers(par[1], interfaces, weights);
|
||||
// }
|
||||
//
|
||||
@ -1293,7 +1292,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
// fPofT->DoFFT(PofB4);
|
||||
//
|
||||
// }/* else {
|
||||
// cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
// std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
// }*/
|
||||
//
|
||||
// fPofT->CalcPol(fParForPofT);
|
||||
|
24
src/external/libFitPofB/classes/TPofBCalc.cpp
vendored
24
src/external/libFitPofB/classes/TPofBCalc.cpp
vendored
@ -46,7 +46,7 @@
|
||||
#include <ctime>
|
||||
/-------------------------------------------------------*/
|
||||
|
||||
TPofBCalc::TPofBCalc(const vector<double> ¶) : fBmin(0.0), fBmax(0.0), fDT(para[0]), fDB(para[1]), fPBExists(false) {
|
||||
TPofBCalc::TPofBCalc(const std::vector<double> ¶) : fBmin(0.0), fBmax(0.0), fDT(para[0]), fDB(para[1]), fPBExists(false) {
|
||||
fPBSize = static_cast<int>(1.0/(gBar*fDT*fDB));
|
||||
if (fPBSize % 2) {
|
||||
fPBSize += 1;
|
||||
@ -74,7 +74,7 @@ TPofBCalc::TPofBCalc(const vector<double> ¶) : fBmin(0.0), fBmax(0.0), fDT(p
|
||||
|
||||
// Do not actually calculate P(B) but take it from a B and a P(B) vector of the same size
|
||||
|
||||
TPofBCalc::TPofBCalc(const vector<double>& b, const vector<double>& pb, double dt) {
|
||||
TPofBCalc::TPofBCalc(const std::vector<double>& b, const std::vector<double>& pb, double dt) {
|
||||
assert(b.size() == pb.size() && b.size() >= 2);
|
||||
fPBSize = pb.size();
|
||||
|
||||
@ -94,7 +94,7 @@ TPofBCalc::TPofBCalc(const vector<double>& b, const vector<double>& pb, double d
|
||||
fPB[i] = pb[i];
|
||||
}
|
||||
|
||||
vector<double>::const_iterator iter, iterB;
|
||||
std::vector<double>::const_iterator iter, iterB;
|
||||
iterB = b.begin();
|
||||
|
||||
for(iter = pb.begin(); iter != pb.end(); ++iter){
|
||||
@ -165,7 +165,7 @@ void TPofBCalc::Normalize(unsigned int minFilledIndex = 0, unsigned int maxFille
|
||||
|
||||
// Do not actually calculate P(B) but take it from a B and a P(B) vector of the same size
|
||||
|
||||
void TPofBCalc::SetPB(const vector<double> &pb) const {
|
||||
void TPofBCalc::SetPB(const std::vector<double> &pb) const {
|
||||
assert(fPBSize == pb.size());
|
||||
|
||||
int i;
|
||||
@ -183,7 +183,7 @@ void TPofBCalc::SetPB(const vector<double> &pb) const {
|
||||
return;
|
||||
}
|
||||
|
||||
void TPofBCalc::Calculate(const string &type, const vector<double> ¶) {
|
||||
void TPofBCalc::Calculate(const std::string &type, const std::vector<double> ¶) {
|
||||
|
||||
if (type == "skg"){ // skewed Gaussian
|
||||
|
||||
@ -235,7 +235,7 @@ void TPofBCalc::Calculate(const string &type, const vector<double> ¶) {
|
||||
// Parameters: dt[us], dB[G], Energy[keV], Bbg[G], width[us^{-1}], weight[1]
|
||||
//-----------
|
||||
|
||||
void TPofBCalc::Calculate(const TBofZCalcInverse *BofZ, const TTrimSPData *dataTrimSP, const vector<double> ¶) {
|
||||
void TPofBCalc::Calculate(const TBofZCalcInverse *BofZ, const TTrimSPData *dataTrimSP, const std::vector<double> ¶) {
|
||||
|
||||
if(fPBExists)
|
||||
return;
|
||||
@ -261,7 +261,7 @@ void TPofBCalc::Calculate(const TBofZCalcInverse *BofZ, const TTrimSPData *dataT
|
||||
|
||||
for (i = firstZerosEnd; i <= lastZerosStart; ++i) {
|
||||
|
||||
vector< pair<double, double> > inv;
|
||||
std::vector< std::pair<double, double> > inv;
|
||||
inv = BofZ->GetInverseAndDerivative(fB[i]);
|
||||
|
||||
for (unsigned int j(0); j < inv.size(); ++j) {
|
||||
@ -285,7 +285,7 @@ void TPofBCalc::Calculate(const TBofZCalcInverse *BofZ, const TTrimSPData *dataT
|
||||
// Parameters: dt[us], dB[G], Energy[keV]
|
||||
//-----------
|
||||
|
||||
void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP, const vector<double> ¶, unsigned int zonk) {
|
||||
void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP, const std::vector<double> ¶, unsigned int zonk) {
|
||||
|
||||
if(fPBExists)
|
||||
return;
|
||||
@ -306,8 +306,8 @@ void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP,
|
||||
|
||||
// calculate p(B) from B(z)
|
||||
|
||||
vector<double> *bofzZ = BofZ->DataZ();
|
||||
vector<double> *bofzBZ = BofZ->DataBZ();
|
||||
std::vector<double> *bofzZ = BofZ->DataZ();
|
||||
std::vector<double> *bofzBZ = BofZ->DataBZ();
|
||||
double ddZ(BofZ->GetDZ());
|
||||
|
||||
/* USED FOR DEBUGGING-----------------------------------
|
||||
@ -439,7 +439,7 @@ void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP,
|
||||
// Parameters: dt[us], dB[G] [, Bbg[G], width[us^{-1}], weight[1] ]
|
||||
//-----------
|
||||
|
||||
void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const vector<double> ¶) {
|
||||
void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const std::vector<double> ¶) {
|
||||
|
||||
if(fPBExists)
|
||||
return;
|
||||
@ -569,7 +569,7 @@ void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const vecto
|
||||
if (chunk < 10)
|
||||
chunk = 10;
|
||||
|
||||
vector< vector<unsigned int> > pBvec(n, vector<unsigned int>(fPBSize, 0));
|
||||
std::vector< std::vector<unsigned int> > pBvec(n, std::vector<unsigned int>(fPBSize, 0));
|
||||
|
||||
int indexStep(static_cast<int>(floor(static_cast<float>(numberOfSteps_2)/static_cast<float>(n))));
|
||||
|
||||
|
50
src/external/libFitPofB/classes/TPofTCalc.cpp
vendored
50
src/external/libFitPofB/classes/TPofTCalc.cpp
vendored
@ -66,12 +66,12 @@
|
||||
// Parameters: phase, dt, dB
|
||||
//------------------
|
||||
|
||||
TPofTCalc::TPofTCalc (const TPofBCalc *PofB, const string &wisdom, const vector<double> &par) : fWisdom(wisdom) {
|
||||
TPofTCalc::TPofTCalc (const TPofBCalc *PofB, const std::string &wisdom, const std::vector<double> &par) : fWisdom(wisdom) {
|
||||
|
||||
#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP)
|
||||
int init_threads(fftw_init_threads());
|
||||
if (!init_threads)
|
||||
cout << "TPofTCalc::TPofTCalc: Couldn't initialize multiple FFTW-threads ..." << endl;
|
||||
std::cout << "TPofTCalc::TPofTCalc: Couldn't initialize multiple FFTW-threads ..." << std::endl;
|
||||
else
|
||||
fftw_plan_with_nthreads(omp_get_num_procs());
|
||||
#endif
|
||||
@ -144,7 +144,7 @@ TPofTCalc::~TPofTCalc() {
|
||||
FILE *wordsOfWisdomW;
|
||||
wordsOfWisdomW = fopen(fWisdom.c_str(), "w");
|
||||
if (wordsOfWisdomW == NULL) {
|
||||
cout << "TPofTCalc::~TPofTCalc(): Could not open file ... No wisdom is exported..." << endl;
|
||||
std::cout << "TPofTCalc::~TPofTCalc(): Could not open file ... No wisdom is exported..." << std::endl;
|
||||
} else {
|
||||
fftw_export_wisdom_to_file(wordsOfWisdomW);
|
||||
fclose(wordsOfWisdomW);
|
||||
@ -180,7 +180,7 @@ void TPofTCalc::DoFFT() {
|
||||
// Parameters: phase, dt, dB
|
||||
//---------------------
|
||||
|
||||
void TPofTCalc::CalcPol(const vector<double> &par) {
|
||||
void TPofTCalc::CalcPol(const std::vector<double> &par) {
|
||||
|
||||
double sinph(sin(par[0]*PI/180.0)), cosph(cos(par[0]*PI/180.0));
|
||||
int i;
|
||||
@ -206,7 +206,7 @@ double TPofTCalc::Eval(double t) const {
|
||||
if (i < fNFFT/2){
|
||||
return fPT[i]+(fPT[i+1]-fPT[i])/(fT[i+1]-fT[i])*(t-fT[i]);
|
||||
}
|
||||
cout << "TPofTCalc::Eval: No data for the time " << t << " us available! Returning -999.0 ..." << endl;
|
||||
std::cout << "TPofTCalc::Eval: No data for the time " << t << " us available! Returning -999.0 ..." << std::endl;
|
||||
return -999.0;
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ double TPofTCalc::Eval(double t) const {
|
||||
// Parameters: output filename, par(dt, dB, timeres, channels, asyms, phases, t0s, N0s, bgs) optPar(field, energy)
|
||||
//---------------------
|
||||
|
||||
void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double> &par, const vector<double> *optPar = 0) {
|
||||
void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<double> &par, const std::vector<double> *optPar = 0) {
|
||||
|
||||
//determine the number of histograms to be built
|
||||
unsigned int numHist(0);
|
||||
@ -225,18 +225,18 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
numHist=(par.size()-4)/5;
|
||||
|
||||
if(!numHist){
|
||||
cout << "TPofTCalc::FakeData: The number of parameters for the histogram creation is not correct. Do nothing." << endl;
|
||||
std::cout << "TPofTCalc::FakeData: The number of parameters for the histogram creation is not correct. Do nothing." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
cout << "TPofTCalc::FakeData: " << numHist << " histograms to be built" << endl;
|
||||
std::cout << "TPofTCalc::FakeData: " << numHist << " histograms to be built" << std::endl;
|
||||
|
||||
int nChannels = int(par[3]);
|
||||
vector<int> t0;
|
||||
vector<double> asy0;
|
||||
vector<double> phase0;
|
||||
vector<double> N0;
|
||||
vector<double> bg;
|
||||
std::vector<int> t0;
|
||||
std::vector<double> asy0;
|
||||
std::vector<double> phase0;
|
||||
std::vector<double> N0;
|
||||
std::vector<double> bg;
|
||||
|
||||
for(unsigned int i(0); i<numHist; ++i) {
|
||||
t0.push_back(int(par[i+4+numHist*2]));
|
||||
@ -246,13 +246,13 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
bg.push_back(par[i+4+numHist*4]);
|
||||
}
|
||||
|
||||
vector<double> param; // Parameters for TPofTCalc::CalcPol
|
||||
std::vector<double> param; // Parameters for TPofTCalc::CalcPol
|
||||
param.push_back(0.0); // phase
|
||||
param.push_back(par[0]); // dt
|
||||
param.push_back(par[1]); // dB
|
||||
|
||||
vector< vector<double> > asy;
|
||||
vector<double> asydata(nChannels);
|
||||
std::vector< std::vector<double> > asy;
|
||||
std::vector<double> asydata(nChannels);
|
||||
double ttime;
|
||||
int j,k;
|
||||
|
||||
@ -286,12 +286,12 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
// }
|
||||
asy.push_back(asydata);
|
||||
// asydata.clear();
|
||||
cout << "TPofTCalc::FakeData: " << i+1 << "/" << numHist << " calculated!" << endl;
|
||||
std::cout << "TPofTCalc::FakeData: " << i+1 << "/" << numHist << " calculated!" << std::endl;
|
||||
}
|
||||
|
||||
// calculate the histograms
|
||||
vector< vector<double> > histo;
|
||||
vector<double> data(nChannels);
|
||||
std::vector< std::vector<double> > histo;
|
||||
std::vector<double> data(nChannels);
|
||||
|
||||
for (unsigned int i(0); i<numHist; ++i) { // loop over all histos
|
||||
|
||||
@ -307,16 +307,16 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
// end omp
|
||||
|
||||
histo.push_back(data);
|
||||
cout << "TPofTCalc::FakeData: " << i+1 << "/" << numHist << " done ..." << endl;
|
||||
std::cout << "TPofTCalc::FakeData: " << i+1 << "/" << numHist << " done ..." << std::endl;
|
||||
}
|
||||
|
||||
// add Poisson noise to the histograms
|
||||
|
||||
cout << "TPofTCalc::FakeData: Adding Poisson noise ..." << endl;
|
||||
std::cout << "TPofTCalc::FakeData: Adding Poisson noise ..." << std::endl;
|
||||
|
||||
TH1F* theoHisto;
|
||||
TH1F* fakeHisto;
|
||||
vector<TH1F*> histoData;
|
||||
std::vector<TH1F*> histoData;
|
||||
|
||||
TString name;
|
||||
for (unsigned int i(0); i<numHist; ++i) { // loop over all histos
|
||||
@ -351,7 +351,7 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
}
|
||||
}
|
||||
|
||||
cout << "TPofTCalc::FakeData: Write histograms and header information to the file ..." << endl;
|
||||
std::cout << "TPofTCalc::FakeData: Write histograms and header information to the file ..." << std::endl;
|
||||
|
||||
// save the histograms as root files
|
||||
// create run info folder and content
|
||||
@ -385,7 +385,7 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
for (unsigned int i(0); i<histoData.size(); i++)
|
||||
decayAnaModule->Add(histoData[i]);
|
||||
// post pileup corrected (PPC)
|
||||
vector<TH1F*> histoDataPPC;
|
||||
std::vector<TH1F*> histoDataPPC;
|
||||
for (unsigned int i(0); i<histoData.size(); i++) {
|
||||
histoDataPPC.push_back(dynamic_cast<TH1F*>(histoData[i]->Clone()));
|
||||
if (i < 10)
|
||||
@ -434,7 +434,7 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const vector<double>
|
||||
N0.clear();
|
||||
bg.clear();
|
||||
|
||||
cout << "TPofTCalc::FakeData: DONE." << endl << endl;
|
||||
std::cout << "TPofTCalc::FakeData: DONE." << std::endl << std::endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "TSkewedGss.h"
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include "BMWStartupHandler.h"
|
||||
@ -57,7 +56,7 @@ TSkewedGss::~TSkewedGss() {
|
||||
TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -104,7 +103,7 @@ TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TSkewedGss (phase,freq0,sigma-,sigma+)
|
||||
//------------------
|
||||
|
||||
double TSkewedGss::operator()(double t, const vector<double> &par) const {
|
||||
double TSkewedGss::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4);
|
||||
|
||||
@ -146,7 +145,7 @@ double TSkewedGss::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
if(!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
fParForPofB[2] = par[1]; // nu0
|
||||
fParForPofB[3] = par[2]; // sigma-
|
||||
@ -156,7 +155,7 @@ double TSkewedGss::operator()(double t, const vector<double> &par) const {
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
std::cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
|
43
src/external/libFitPofB/classes/TVortex.cpp
vendored
43
src/external/libFitPofB/classes/TVortex.cpp
vendored
@ -30,7 +30,6 @@
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include "BMWStartupHandler.h"
|
||||
@ -158,7 +157,7 @@ TBulkTriVortexNGL::~TBulkTriVortexNGL() {
|
||||
TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -218,7 +217,7 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
||||
TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -274,7 +273,7 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkTriVortexLondon (phase, av.field, lambda, xi, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkTriVortexLondon::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8); // normal, +BkgWeight, +VortexWeighting, +AFfield
|
||||
|
||||
@ -365,7 +364,7 @@ double TBulkTriVortexLondon::operator()(double t, const vector<double> &par) con
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkSqVortexLondon (phase, av.field, lambda, xi, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkSqVortexLondon::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkSqVortexLondon::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
@ -448,7 +447,7 @@ double TBulkSqVortexLondon::operator()(double t, const vector<double> &par) cons
|
||||
TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -504,7 +503,7 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkTriVortexML (phase, av.field, lambda, xi, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkTriVortexML::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
@ -587,7 +586,7 @@ double TBulkTriVortexML::operator()(double t, const vector<double> &par) const {
|
||||
TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -643,7 +642,7 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkTriVortexAGL (phase, av.field, lambda, xi, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkTriVortexAGL::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
@ -725,7 +724,7 @@ double TBulkTriVortexAGL::operator()(double t, const vector<double> &par) const
|
||||
TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -783,7 +782,7 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkTriVortexAGLII (phase, av.field, lambda, core-radius, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkTriVortexAGLII::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8);
|
||||
|
||||
@ -876,7 +875,7 @@ double TBulkTriVortexAGLII::operator()(double t, const vector<double> &par) cons
|
||||
TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -932,7 +931,7 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TBulkTriVortexNGL (phase, appl.field, lambda, xi, [not implemented: bkg weight])
|
||||
//------------------
|
||||
|
||||
double TBulkTriVortexNGL::operator()(double t, const vector<double> &par) const {
|
||||
double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
@ -1031,7 +1030,7 @@ TBulkAnisotropicTriVortexLondonGlobal::~TBulkAnisotropicTriVortexLondonGlobal()
|
||||
TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -1081,7 +1080,7 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
||||
}
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const vector<double> &par) const {
|
||||
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 6);
|
||||
/*
|
||||
@ -1191,7 +1190,7 @@ TBulkAnisotropicTriVortexLondon::~TBulkAnisotropicTriVortexLondon()
|
||||
* \param globalPart reference to the global user function object vector
|
||||
* \param idx global user function index within the theory tree
|
||||
*/
|
||||
void TBulkAnisotropicTriVortexLondon::SetGlobalPart(vector<void *> &globalPart, UInt_t idx)
|
||||
void TBulkAnisotropicTriVortexLondon::SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx)
|
||||
{
|
||||
fIdxGlobal = static_cast<Int_t>(idx);
|
||||
|
||||
@ -1273,7 +1272,7 @@ TBulkAnisotropicTriVortexMLGlobal::~TBulkAnisotropicTriVortexMLGlobal() {
|
||||
TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -1323,7 +1322,7 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
||||
}
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexMLGlobal::Calc(const vector<double> &par) const {
|
||||
void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 6);
|
||||
/*
|
||||
@ -1433,7 +1432,7 @@ TBulkAnisotropicTriVortexML::~TBulkAnisotropicTriVortexML()
|
||||
* \param globalPart reference to the global user function object vector
|
||||
* \param idx global user function index within the theory tree
|
||||
*/
|
||||
void TBulkAnisotropicTriVortexML::SetGlobalPart(vector<void *> &globalPart, UInt_t idx)
|
||||
void TBulkAnisotropicTriVortexML::SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx)
|
||||
{
|
||||
fIdxGlobal = static_cast<Int_t>(idx);
|
||||
|
||||
@ -1515,7 +1514,7 @@ TBulkAnisotropicTriVortexAGLGlobal::~TBulkAnisotropicTriVortexAGLGlobal() {
|
||||
TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -1565,7 +1564,7 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
||||
}
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const vector<double> &par) const {
|
||||
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 6);
|
||||
/*
|
||||
@ -1676,7 +1675,7 @@ TBulkAnisotropicTriVortexAGL::~TBulkAnisotropicTriVortexAGL()
|
||||
* \param globalPart reference to the global user function object vector
|
||||
* \param idx global user function index within the theory tree
|
||||
*/
|
||||
void TBulkAnisotropicTriVortexAGL::SetGlobalPart(vector<void *> &globalPart, UInt_t idx)
|
||||
void TBulkAnisotropicTriVortexAGL::SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx)
|
||||
{
|
||||
fIdxGlobal = static_cast<Int_t>(idx);
|
||||
|
||||
|
39
src/external/libFitPofB/include/TBofZCalc.h
vendored
39
src/external/libFitPofB/include/TBofZCalc.h
vendored
@ -30,7 +30,6 @@
|
||||
#define _TBofZCalc_H_
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* <p>Base class for any kind of theory function B(z)
|
||||
@ -47,8 +46,8 @@ public:
|
||||
fParam.clear();
|
||||
}
|
||||
|
||||
virtual vector<double>* DataZ() const {return &fZ;}
|
||||
virtual vector<double>* DataBZ() const {return &fBZ;}
|
||||
virtual std::vector<double>* DataZ() const {return &fZ;}
|
||||
virtual std::vector<double>* DataBZ() const {return &fBZ;}
|
||||
virtual void Calculate();
|
||||
virtual double GetBofZ(double) const = 0;
|
||||
virtual double GetBmin() const = 0;
|
||||
@ -58,9 +57,9 @@ public:
|
||||
protected:
|
||||
int fSteps; ///< number of discrete points where B(z) is calculated
|
||||
double fDZ; ///< resolution in z (spacing between two neighboring discrete B(z) points)
|
||||
vector<double> fParam; ///< parameters of the B(z) function
|
||||
mutable vector<double> fZ; ///< vector holding all z-values
|
||||
mutable vector<double> fBZ; ///< vector holding all B(z)-values
|
||||
std::vector<double> fParam; ///< parameters of the B(z) function
|
||||
mutable std::vector<double> fZ; ///< vector holding all z-values
|
||||
mutable std::vector<double> fBZ; ///< vector holding all B(z)-values
|
||||
};
|
||||
|
||||
/**
|
||||
@ -73,7 +72,7 @@ public:
|
||||
TBofZCalcInverse() {}
|
||||
virtual ~TBofZCalcInverse() {}
|
||||
|
||||
virtual vector< pair<double, double> > GetInverseAndDerivative(double) const = 0;
|
||||
virtual std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -83,11 +82,11 @@ class TLondon1D_HS : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_HS(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_HS(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
};
|
||||
|
||||
@ -98,11 +97,11 @@ class TLondon1D_1L : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_1L(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_1L(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
private:
|
||||
void SetBmin();
|
||||
@ -121,11 +120,11 @@ class TLondon1D_2L : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_2L(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_2L(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
private:
|
||||
void SetBmin();
|
||||
@ -145,11 +144,11 @@ class TProximity1D_1LHS : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TProximity1D_1LHS(const vector<double>&, unsigned int steps = 3000);
|
||||
TProximity1D_1LHS(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
private:
|
||||
void SetBmin();
|
||||
@ -168,11 +167,11 @@ class TLondon1D_3L : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3L(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_3L(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
private:
|
||||
void SetBmin();
|
||||
@ -192,11 +191,11 @@ class TLondon1D_3LS : public TBofZCalcInverse {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3LS(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_3LS(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
vector< pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
std::vector< std::pair<double, double> > GetInverseAndDerivative(double) const;
|
||||
|
||||
private:
|
||||
void SetBmin();
|
||||
@ -216,7 +215,7 @@ class TLondon1D_3LwInsulator : public TBofZCalc {
|
||||
|
||||
public:
|
||||
|
||||
TLondon1D_3LwInsulator(const vector<double>&, unsigned int steps = 3000);
|
||||
TLondon1D_3LwInsulator(const std::vector<double>&, unsigned int steps = 3000);
|
||||
double GetBofZ(double) const;
|
||||
double GetBmin() const;
|
||||
double GetBmax() const;
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
// the following ifdef is needed for GCC 4.6 or higher, fftw 3.3 or higher and root 5.30.03 or lower
|
||||
//#ifdef __CINT__
|
||||
@ -51,7 +50,7 @@ public:
|
||||
virtual ~TBulkVortexFieldCalc();
|
||||
|
||||
virtual double* DataB() const {return fFFTout;}
|
||||
virtual void SetParameters(const vector<double>& par) {fParam = par; fGridExists = false;}
|
||||
virtual void SetParameters(const std::vector<double>& par) {fParam = par; fGridExists = false;}
|
||||
virtual void CalculateGrid() const = 0;
|
||||
virtual double GetBmin() const;
|
||||
virtual double GetBmax() const;
|
||||
@ -61,13 +60,13 @@ public:
|
||||
virtual bool IsTriangular() const = 0;
|
||||
|
||||
protected:
|
||||
vector<double> fParam; ///< parameters used to calculate B(x,y)
|
||||
std::vector<double> fParam; ///< parameters used to calculate B(x,y)
|
||||
unsigned int fSteps; ///< number of steps in which the "unit cell" of the vortex lattice is devided in (in each direction)
|
||||
mutable fftw_complex *fFFTin; ///< Fourier components of the field
|
||||
mutable double *fFFTout; ///< spatial field distribution B(x,y) in a "unit cell" of the vortex lattice
|
||||
fftw_plan fFFTplan; ///< FFTW plan for the 2D-Fourier transform from Fourier space to real space
|
||||
bool fUseWisdom; ///< tag determining if FFTW wisdom is used
|
||||
string fWisdom; ///< file name of the FFTW wisdom-file
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom-file
|
||||
mutable bool fGridExists; ///< tag determining if B(x,y) has been calculated for the given set of parameters
|
||||
};
|
||||
|
||||
@ -79,7 +78,7 @@ class TBulkTriVortexLondonFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkTriVortexLondonFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkTriVortexLondonFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkTriVortexLondonFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -95,7 +94,7 @@ class TBulkAnisotropicTriVortexLondonFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkAnisotropicTriVortexLondonFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -111,7 +110,7 @@ class TBulkSqVortexLondonFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkSqVortexLondonFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkSqVortexLondonFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkSqVortexLondonFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -127,7 +126,7 @@ class TBulkTriVortexMLFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkTriVortexMLFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkTriVortexMLFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkTriVortexMLFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -144,7 +143,7 @@ class TBulkAnisotropicTriVortexMLFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkAnisotropicTriVortexMLFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkAnisotropicTriVortexMLFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkAnisotropicTriVortexMLFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -160,7 +159,7 @@ class TBulkTriVortexAGLFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkTriVortexAGLFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkTriVortexAGLFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkTriVortexAGLFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -176,7 +175,7 @@ class TBulkTriVortexAGLIIFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkTriVortexAGLIIFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkTriVortexAGLIIFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkTriVortexAGLIIFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -193,7 +192,7 @@ class TBulkAnisotropicTriVortexAGLFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkAnisotropicTriVortexAGLFieldCalc() {}
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -210,7 +209,7 @@ class TBulkTriVortexNGLFieldCalc : public TBulkVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TBulkTriVortexNGLFieldCalc(const string&, const unsigned int steps = 256);
|
||||
TBulkTriVortexNGLFieldCalc(const std::string&, const unsigned int steps = 256);
|
||||
~TBulkTriVortexNGLFieldCalc();
|
||||
|
||||
void CalculateGrid() const;
|
||||
|
@ -32,7 +32,6 @@
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
// the following ifdef is needed for GCC 4.6 or higher, fftw 3.3 or higher and root 5.30.03 or lower
|
||||
//#ifdef __CINT__
|
||||
@ -52,8 +51,8 @@ public:
|
||||
|
||||
virtual ~TFilmVortexFieldCalc();
|
||||
|
||||
virtual vector<float*> DataB() const {return fBout;}
|
||||
virtual void SetParameters(const vector<float>& par) {fParam = par; fGridExists = false;}
|
||||
virtual std::vector<float*> DataB() const {return fBout;}
|
||||
virtual void SetParameters(const std::vector<float>& par) {fParam = par; fGridExists = false;}
|
||||
virtual void CalculateGrid() const = 0;
|
||||
virtual float GetBmin() const;
|
||||
virtual float GetBmax() const;
|
||||
@ -62,14 +61,14 @@ public:
|
||||
virtual unsigned int GetNumberOfSteps() const {return fSteps;}
|
||||
|
||||
protected:
|
||||
vector<float> fParam;
|
||||
std::vector<float> fParam;
|
||||
unsigned int fSteps; // number of steps, the "unit cell" of the vortex lattice is devided in (in x- and y- direction)
|
||||
unsigned int fStepsZ; // number of layers that should be calculated in z-direction (film slices)
|
||||
mutable fftwf_complex *fFFTin; // Fourier components of omega
|
||||
mutable vector<float*> fBout; // three pointers to Bx, By, Bz; each of these arrays is in row-major order
|
||||
mutable std::vector<float*> fBout; // three pointers to Bx, By, Bz; each of these arrays is in row-major order
|
||||
fftwf_plan fFFTplan;
|
||||
bool fUseWisdom;
|
||||
string fWisdom;
|
||||
std::string fWisdom;
|
||||
mutable bool fGridExists;
|
||||
};
|
||||
|
||||
@ -81,7 +80,7 @@ class TFilmTriVortexNGLFieldCalc : public TFilmVortexFieldCalc {
|
||||
|
||||
public:
|
||||
|
||||
TFilmTriVortexNGLFieldCalc(const string&, const unsigned int steps = 256, const unsigned int stepsZ = 32);
|
||||
TFilmTriVortexNGLFieldCalc(const std::string&, const unsigned int steps = 256, const unsigned int stepsZ = 32);
|
||||
~TFilmTriVortexNGLFieldCalc();
|
||||
|
||||
void CalculateGrid() const;
|
||||
@ -91,7 +90,7 @@ public:
|
||||
fftwf_complex* GetRealSpaceMatrix() const {return fRealSpaceMatrix;}
|
||||
float* GetOmegaMatrix() const {return fOmegaMatrix;}
|
||||
fftwf_complex* GetBkSMatrix() const {return fBkS;}
|
||||
vector<float*> GetOmegaDiffMatrix() const {return fOmegaDiffMatrix;}
|
||||
std::vector<float*> GetOmegaDiffMatrix() const {return fOmegaDiffMatrix;}
|
||||
fftwf_complex* GetQMatrix() const {return fQMatrix;}
|
||||
fftwf_complex* GetPMatrix() const {return fPkMatrix;}
|
||||
|
||||
@ -113,7 +112,7 @@ private:
|
||||
void CalculateGatVortexCore() const;
|
||||
|
||||
mutable float *fOmegaMatrix;
|
||||
mutable vector<float*> fOmegaDiffMatrix;
|
||||
mutable std::vector<float*> fOmegaDiffMatrix;
|
||||
mutable fftwf_complex *fRealSpaceMatrix;
|
||||
mutable fftwf_complex *fBkMatrix;
|
||||
mutable fftwf_complex *fPkMatrix;
|
||||
|
76
src/external/libFitPofB/include/TLondon1D.h
vendored
76
src/external/libFitPofB/include/TLondon1D.h
vendored
@ -44,13 +44,13 @@ public:
|
||||
~TLondon1DHS();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
@ -77,22 +77,22 @@ public:
|
||||
~TLondon1D1L();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
//mutable unsigned int fCallCounter;
|
||||
|
||||
@ -112,22 +112,22 @@ public:
|
||||
~TLondon1D2L();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(TLondon1D2L,1)
|
||||
@ -146,22 +146,22 @@ public:
|
||||
~TProximity1D1LHS();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(TProximity1D1LHS,1)
|
||||
@ -180,22 +180,22 @@ public:
|
||||
~TLondon1D3L();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(TLondon1D3L,1)
|
||||
@ -214,22 +214,22 @@ public:
|
||||
~TLondon1D3LS();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(TLondon1D3LS,1)
|
||||
|
18
src/external/libFitPofB/include/TPofBCalc.h
vendored
18
src/external/libFitPofB/include/TPofBCalc.h
vendored
@ -46,25 +46,25 @@ class TPofBCalc {
|
||||
public:
|
||||
|
||||
// standard constructor: allocates memory for B and PB, the arrays are filled later by one of the Calculate-methods
|
||||
TPofBCalc(const vector<double>&);
|
||||
TPofBCalc(const std::vector<double>&);
|
||||
// alternative constructor: PB is not actually calculated but copied from a vector
|
||||
TPofBCalc(const vector<double>&, const vector<double>& , double dt = 0.01);
|
||||
TPofBCalc(const std::vector<double>&, const std::vector<double>& , double dt = 0.01);
|
||||
~TPofBCalc() {
|
||||
delete[] fB; fB = 0;
|
||||
delete[] fPB; fPB = 0;
|
||||
delete[] fB; fB = nullptr;
|
||||
delete[] fPB; fPB = nullptr;
|
||||
}
|
||||
|
||||
void Calculate(const string&, const vector<double>&);
|
||||
void Calculate(const TBofZCalc*, const TTrimSPData*, const vector<double>&, unsigned int);
|
||||
void Calculate(const TBofZCalcInverse*, const TTrimSPData*, const vector<double>&);
|
||||
void Calculate(const TBulkVortexFieldCalc*, const vector<double>&);
|
||||
void Calculate(const std::string&, const std::vector<double>&);
|
||||
void Calculate(const TBofZCalc*, const TTrimSPData*, const std::vector<double>&, unsigned int);
|
||||
void Calculate(const TBofZCalcInverse*, const TTrimSPData*, const std::vector<double>&);
|
||||
void Calculate(const TBulkVortexFieldCalc*, const std::vector<double>&);
|
||||
|
||||
const double* DataB() const {return fB;}
|
||||
double* DataPB() const {return fPB;}
|
||||
double GetBmin() const {return fBmin;}
|
||||
double GetBmax() const {return fBmax;}
|
||||
unsigned int GetPBSize() const {return fPBSize;}
|
||||
void SetPB(const vector<double>&) const;
|
||||
void SetPB(const std::vector<double>&) const;
|
||||
void ConvolveGss(double);
|
||||
void AddBackground(double, double, double);
|
||||
double GetFirstMoment() const;
|
||||
|
6
src/external/libFitPofB/include/TPofTCalc.h
vendored
6
src/external/libFitPofB/include/TPofTCalc.h
vendored
@ -48,14 +48,14 @@ class TPofTCalc {
|
||||
|
||||
public:
|
||||
|
||||
TPofTCalc(const TPofBCalc*, const string&, const vector<double>&);
|
||||
TPofTCalc(const TPofBCalc*, const std::string&, const std::vector<double>&);
|
||||
~TPofTCalc();
|
||||
|
||||
const double* DataT() const {return fT;}
|
||||
const double* DataPT() const {return fPT;}
|
||||
void DoFFT();
|
||||
void CalcPol(const vector<double>&);
|
||||
void FakeData(const string&, const vector<double>&, const vector<double>*);
|
||||
void CalcPol(const std::vector<double>&);
|
||||
void FakeData(const std::string&, const std::vector<double>&, const std::vector<double>*);
|
||||
double Eval(double) const;
|
||||
|
||||
private:
|
||||
|
12
src/external/libFitPofB/include/TSkewedGss.h
vendored
12
src/external/libFitPofB/include/TSkewedGss.h
vendored
@ -44,20 +44,20 @@ public:
|
||||
~TSkewedGss();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
|
||||
ClassDef(TSkewedGss,1)
|
||||
};
|
||||
|
132
src/external/libFitPofB/include/TVortex.h
vendored
132
src/external/libFitPofB/include/TVortex.h
vendored
@ -44,22 +44,22 @@ public:
|
||||
~TBulkTriVortexLondon();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkTriVortexLondon,1)
|
||||
@ -77,22 +77,22 @@ public:
|
||||
~TBulkSqVortexLondon();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkSqVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkSqVortexLondon,1)
|
||||
@ -110,22 +110,22 @@ public:
|
||||
~TBulkTriVortexML();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkTriVortexML,1)
|
||||
@ -143,22 +143,22 @@ public:
|
||||
~TBulkTriVortexAGL();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkTriVortexAGL,1)
|
||||
@ -176,22 +176,22 @@ public:
|
||||
~TBulkTriVortexAGLII();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLIIFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkTriVortexAGLII,1)
|
||||
@ -209,22 +209,22 @@ public:
|
||||
~TBulkTriVortexNGL();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the model
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexNGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
ClassDef(TBulkTriVortexNGL,1)
|
||||
@ -245,22 +245,22 @@ public:
|
||||
|
||||
bool IsValid() { return fValid; }
|
||||
|
||||
void Calc(const vector<double>&) const;
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable vector<double> fPar; ///< parameter vector
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
// definition of the class for the ROOT-dictionary
|
||||
@ -280,10 +280,10 @@ public:
|
||||
~TBulkAnisotropicTriVortexLondon();
|
||||
|
||||
virtual bool NeedGlobalPart() const { return true; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, unsigned int idx);
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, unsigned int idx);
|
||||
virtual bool GlobalPartIsValid() const;
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
bool fValid;
|
||||
@ -309,22 +309,22 @@ public:
|
||||
|
||||
bool IsValid() { return fValid; }
|
||||
|
||||
void Calc(const vector<double>&) const;
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable vector<double> fPar; ///< parameter vector
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
// definition of the class for the ROOT-dictionary
|
||||
@ -344,10 +344,10 @@ public:
|
||||
~TBulkAnisotropicTriVortexML();
|
||||
|
||||
virtual bool NeedGlobalPart() const { return true; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, unsigned int idx);
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, unsigned int idx);
|
||||
virtual bool GlobalPartIsValid() const;
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
bool fValid;
|
||||
@ -373,22 +373,22 @@ public:
|
||||
|
||||
bool IsValid() { return fValid; }
|
||||
|
||||
void Calc(const vector<double>&) const;
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable vector<double> fPar; ///< parameter vector
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fGridSteps; ///< number of points in x- and y-direction for which B(x,y) is calculated
|
||||
|
||||
// definition of the class for the ROOT-dictionary
|
||||
@ -408,10 +408,10 @@ public:
|
||||
~TBulkAnisotropicTriVortexAGL();
|
||||
|
||||
virtual bool NeedGlobalPart() const { return true; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, unsigned int idx);
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, unsigned int idx);
|
||||
virtual bool GlobalPartIsValid() const;
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
bool fValid;
|
||||
|
113
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
113
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
@ -29,15 +29,12 @@
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "BMWIntegrator.h"
|
||||
#include "TGapIntegrals.h"
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
#define TWOPI 6.28318530717958647692
|
||||
|
||||
|
||||
ClassImp(TGapSWave)
|
||||
ClassImp(TGapDWave)
|
||||
ClassImp(TGapCosSqDWave)
|
||||
@ -71,7 +68,7 @@ ClassImp(TFilmMagnetizationDWave)
|
||||
TGapSWave::TGapSWave() {
|
||||
TGapIntegral *gapint = new TGapIntegral();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -87,7 +84,7 @@ TGapSWave::TGapSWave() {
|
||||
TGapDWave::TGapDWave() {
|
||||
TDWaveGapIntegralCuhre *gapint = new TDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -103,7 +100,7 @@ TGapDWave::TGapDWave() {
|
||||
TGapCosSqDWave::TGapCosSqDWave() {
|
||||
TCosSqDWaveGapIntegralCuhre *gapint = new TCosSqDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -119,7 +116,7 @@ TGapCosSqDWave::TGapCosSqDWave() {
|
||||
TGapSinSqDWave::TGapSinSqDWave() {
|
||||
TSinSqDWaveGapIntegralCuhre *gapint = new TSinSqDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -135,7 +132,7 @@ TGapSinSqDWave::TGapSinSqDWave() {
|
||||
TGapAnSWave::TGapAnSWave() {
|
||||
TAnSWaveGapIntegralCuhre *gapint = new TAnSWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -151,7 +148,7 @@ TGapAnSWave::TGapAnSWave() {
|
||||
TGapNonMonDWave1::TGapNonMonDWave1() {
|
||||
TNonMonDWave1GapIntegralCuhre *gapint = new TNonMonDWave1GapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -167,7 +164,7 @@ TGapNonMonDWave1::TGapNonMonDWave1() {
|
||||
TGapNonMonDWave2::TGapNonMonDWave2() {
|
||||
TNonMonDWave2GapIntegralCuhre *gapint = new TNonMonDWave2GapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = 0;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -262,7 +259,7 @@ TLambdaInvNonMonDWave2::TLambdaInvNonMonDWave2() {
|
||||
*/
|
||||
TGapSWave::~TGapSWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -277,7 +274,7 @@ TGapSWave::~TGapSWave() {
|
||||
*/
|
||||
TGapDWave::~TGapDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -292,7 +289,7 @@ TGapDWave::~TGapDWave() {
|
||||
*/
|
||||
TGapCosSqDWave::~TGapCosSqDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -307,7 +304,7 @@ TGapCosSqDWave::~TGapCosSqDWave() {
|
||||
*/
|
||||
TGapSinSqDWave::~TGapSinSqDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -322,7 +319,7 @@ TGapSinSqDWave::~TGapSinSqDWave() {
|
||||
*/
|
||||
TGapAnSWave::~TGapAnSWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -337,7 +334,7 @@ TGapAnSWave::~TGapAnSWave() {
|
||||
*/
|
||||
TGapNonMonDWave1::~TGapNonMonDWave1() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -352,7 +349,7 @@ TGapNonMonDWave1::~TGapNonMonDWave1() {
|
||||
*/
|
||||
TGapNonMonDWave2::~TGapNonMonDWave2() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = 0;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@ -367,7 +364,7 @@ TGapNonMonDWave2::~TGapNonMonDWave2() {
|
||||
*/
|
||||
TLambdaSWave::~TLambdaSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -376,7 +373,7 @@ TLambdaSWave::~TLambdaSWave() {
|
||||
*/
|
||||
TLambdaDWave::~TLambdaDWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -385,7 +382,7 @@ TLambdaDWave::~TLambdaDWave() {
|
||||
*/
|
||||
TLambdaAnSWave::~TLambdaAnSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -394,7 +391,7 @@ TLambdaAnSWave::~TLambdaAnSWave() {
|
||||
*/
|
||||
TLambdaNonMonDWave1::~TLambdaNonMonDWave1() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -403,7 +400,7 @@ TLambdaNonMonDWave1::~TLambdaNonMonDWave1() {
|
||||
*/
|
||||
TLambdaNonMonDWave2::~TLambdaNonMonDWave2() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -412,7 +409,7 @@ TLambdaNonMonDWave2::~TLambdaNonMonDWave2() {
|
||||
*/
|
||||
TLambdaInvSWave::~TLambdaInvSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -421,7 +418,7 @@ TLambdaInvSWave::~TLambdaInvSWave() {
|
||||
*/
|
||||
TLambdaInvDWave::~TLambdaInvDWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -430,7 +427,7 @@ TLambdaInvDWave::~TLambdaInvDWave() {
|
||||
*/
|
||||
TLambdaInvAnSWave::~TLambdaInvAnSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -439,7 +436,7 @@ TLambdaInvAnSWave::~TLambdaInvAnSWave() {
|
||||
*/
|
||||
TLambdaInvNonMonDWave1::~TLambdaInvNonMonDWave1() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -448,7 +445,7 @@ TLambdaInvNonMonDWave1::~TLambdaInvNonMonDWave1() {
|
||||
*/
|
||||
TLambdaInvNonMonDWave2::~TLambdaInvNonMonDWave2() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -457,7 +454,7 @@ TLambdaInvNonMonDWave2::~TLambdaInvNonMonDWave2() {
|
||||
* <p>prepare the needed parameters for the integration carried out in TGapIntegral.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (9).
|
||||
*/
|
||||
double TGapSWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapSWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)]
|
||||
|
||||
@ -506,7 +503,7 @@ double TGapSWave::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
double ds;
|
||||
|
||||
vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
std::vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 2) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -536,7 +533,7 @@ double TGapSWave::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TDWaveGapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (10).
|
||||
*/
|
||||
double TGapDWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapDWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)]
|
||||
|
||||
@ -584,7 +581,7 @@ double TGapDWave::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
std::vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 2) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -620,7 +617,7 @@ double TGapDWave::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TCosSqDWaveGapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (??).
|
||||
*/
|
||||
double TGapCosSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapCosSqDWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0_D (meV), [2] Delta0_S (meV) [[3] c0_D (1), [4] aG_D (1), [5] c0_S (1), [6] aG_S (1)]
|
||||
|
||||
@ -667,7 +664,7 @@ double TGapCosSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
std::vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 3) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -708,7 +705,7 @@ double TGapCosSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TSinSqDWaveGapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (??).
|
||||
*/
|
||||
double TGapSinSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapSinSqDWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0_D (meV), [2] Delta0_S (meV) [[3] c0_D (1), [4] aG_D (1), [5] c0_S (1), [6] aG_S (1)]
|
||||
|
||||
@ -756,7 +753,7 @@ double TGapSinSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
std::vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 3) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -797,7 +794,7 @@ double TGapSinSqDWave::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TAnSWaveGapIntegralCuhre (anisotropic s-wave).
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (13).
|
||||
*/
|
||||
double TGapAnSWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapAnSWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)]
|
||||
|
||||
@ -846,7 +843,7 @@ double TGapAnSWave::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
std::vector<double> intPar; // parameters for the integral, T & Delta(T)
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 3) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -883,7 +880,7 @@ double TGapAnSWave::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TNonMonDWave1GapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (11).
|
||||
*/
|
||||
double TGapNonMonDWave1::operator()(double t, const vector<double> &par) const {
|
||||
double TGapNonMonDWave1::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)]
|
||||
|
||||
@ -931,7 +928,7 @@ double TGapNonMonDWave1::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral: 2 k_B T, Delta(T), a, E_c, phi_c
|
||||
std::vector<double> intPar; // parameters for the integral: 2 k_B T, Delta(T), a, E_c, phi_c
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 3) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -965,7 +962,7 @@ double TGapNonMonDWave1::operator()(double t, const vector<double> &par) const {
|
||||
* <p>prepare the needed parameters for the integration carried out in TNonMonDWave2GapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (11).
|
||||
*/
|
||||
double TGapNonMonDWave2::operator()(double t, const vector<double> &par) const {
|
||||
double TGapNonMonDWave2::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)]
|
||||
|
||||
@ -1013,7 +1010,7 @@ double TGapNonMonDWave2::operator()(double t, const vector<double> &par) const {
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
|
||||
double ds;
|
||||
vector<double> intPar; // parameters for the integral: 2 k_B T, Delta(T), a, E_c, phi_c
|
||||
std::vector<double> intPar; // parameters for the integral: 2 k_B T, Delta(T), a, E_c, phi_c
|
||||
intPar.push_back(0.172346648*t); // 2 kB T, kB in meV/K = 0.086173324 meV/K
|
||||
if (par.size() == 3) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
@ -1047,7 +1044,7 @@ double TGapNonMonDWave2::operator()(double t, const vector<double> &par) const {
|
||||
* <p>Superfluid density in the ``two-fluid'' approximation.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(7) and (14).
|
||||
*/
|
||||
double TGapPowerLaw::operator()(double t, const vector<double> &par) const {
|
||||
double TGapPowerLaw::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 2); // two parameters: Tc, n
|
||||
|
||||
@ -1068,7 +1065,7 @@ double TGapPowerLaw::operator()(double t, const vector<double> &par) const {
|
||||
* Here we use INTENTIONALLY the temperature dependence of the gap according
|
||||
* to A. Carrington and F. Manzano, Physica C 385 (2003) 205
|
||||
*/
|
||||
double TGapDirtySWave::operator()(double t, const vector<double> &par) const {
|
||||
double TGapDirtySWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)]
|
||||
|
||||
@ -1095,7 +1092,7 @@ double TGapDirtySWave::operator()(double t, const vector<double> &par) const {
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaSWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaSWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
@ -1113,7 +1110,7 @@ double TLambdaSWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaDWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaDWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
@ -1131,7 +1128,7 @@ double TLambdaDWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaAnSWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaAnSWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1149,7 +1146,7 @@ double TLambdaAnSWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaNonMonDWave1::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaNonMonDWave1::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1167,7 +1164,7 @@ double TLambdaNonMonDWave1::operator()(double t, const vector<double> &par) cons
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaNonMonDWave2::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaNonMonDWave2::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1185,7 +1182,7 @@ double TLambdaNonMonDWave2::operator()(double t, const vector<double> &par) cons
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaPowerLaw::operator()(double t, const vector<double> &par) const {
|
||||
double TLambdaPowerLaw::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 2); // two parameters: Tc, N
|
||||
|
||||
@ -1203,7 +1200,7 @@ double TLambdaPowerLaw::operator()(double t, const vector<double> &par) const {
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvSWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaInvSWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
@ -1221,7 +1218,7 @@ double TLambdaInvSWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvDWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaInvDWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
@ -1239,7 +1236,7 @@ double TLambdaInvDWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvAnSWave::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaInvAnSWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1257,7 +1254,7 @@ double TLambdaInvAnSWave::operator()(double t, const vector<double> &par) const
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvNonMonDWave1::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaInvNonMonDWave1::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1275,7 +1272,7 @@ double TLambdaInvNonMonDWave1::operator()(double t, const vector<double> &par) c
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvNonMonDWave2::operator()(double t, const vector<double> &par) const
|
||||
double TLambdaInvNonMonDWave2::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 3); // three parameters: Tc, Delta0, a
|
||||
|
||||
@ -1293,7 +1290,7 @@ double TLambdaInvNonMonDWave2::operator()(double t, const vector<double> &par) c
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvPowerLaw::operator()(double t, const vector<double> &par) const {
|
||||
double TLambdaInvPowerLaw::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 2); // two parameters: Tc, N
|
||||
|
||||
@ -1323,7 +1320,7 @@ TFilmMagnetizationDWave::TFilmMagnetizationDWave()
|
||||
TFilmMagnetizationDWave::~TFilmMagnetizationDWave()
|
||||
{
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = 0;
|
||||
fLambdaInvSq = nullptr;
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
@ -1331,7 +1328,7 @@ TFilmMagnetizationDWave::~TFilmMagnetizationDWave()
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TFilmMagnetizationDWave::operator()(double t, const vector<double> &par) const
|
||||
double TFilmMagnetizationDWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 4); // four parameters: Tc, Delta0, lambda0, film-thickness
|
||||
|
||||
@ -1340,7 +1337,7 @@ double TFilmMagnetizationDWave::operator()(double t, const vector<double> &par)
|
||||
if (t >= fPar[0])
|
||||
return 0.0;
|
||||
|
||||
vector<double> parForGapIntegral;
|
||||
std::vector<double> parForGapIntegral;
|
||||
parForGapIntegral.push_back(fPar[0]);
|
||||
parForGapIntegral.push_back(fPar[1]);
|
||||
|
||||
|
162
src/external/libGapIntegrals/TGapIntegrals.h
vendored
162
src/external/libGapIntegrals/TGapIntegrals.h
vendored
@ -32,8 +32,6 @@
|
||||
#include<vector>
|
||||
#include<cmath>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "BMWIntegrator.h"
|
||||
|
||||
@ -48,19 +46,19 @@ public:
|
||||
virtual ~TGapSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapIntegral *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapSWave,1)
|
||||
};
|
||||
@ -76,19 +74,19 @@ public:
|
||||
virtual ~TGapDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TDWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapDWave,1)
|
||||
};
|
||||
@ -104,19 +102,19 @@ public:
|
||||
virtual ~TGapCosSqDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TCosSqDWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapCosSqDWave,1)
|
||||
};
|
||||
@ -132,19 +130,19 @@ public:
|
||||
virtual ~TGapSinSqDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TSinSqDWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapSinSqDWave,1)
|
||||
};
|
||||
@ -160,19 +158,19 @@ public:
|
||||
virtual ~TGapAnSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TAnSWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapAnSWave,1)
|
||||
};
|
||||
@ -188,19 +186,19 @@ public:
|
||||
virtual ~TGapNonMonDWave1();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TNonMonDWave1GapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapNonMonDWave1,1)
|
||||
};
|
||||
@ -216,19 +214,19 @@ public:
|
||||
virtual ~TGapNonMonDWave2();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TNonMonDWave2GapIntegralCuhre *fGapIntegral;
|
||||
mutable vector<double> fTemp;
|
||||
mutable vector<double>::const_iterator fTempIter;
|
||||
mutable vector<double> fIntegralValues;
|
||||
mutable vector<bool> fCalcNeeded;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapNonMonDWave2,1)
|
||||
};
|
||||
@ -245,10 +243,10 @@ public:
|
||||
virtual ~TGapPowerLaw() {}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -266,10 +264,10 @@ public:
|
||||
virtual ~TGapDirtySWave() {}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -288,10 +286,10 @@ public:
|
||||
virtual ~TLambdaSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapSWave *fLambdaInvSq;
|
||||
@ -310,10 +308,10 @@ public:
|
||||
virtual ~TLambdaDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
@ -332,10 +330,10 @@ public:
|
||||
virtual ~TLambdaAnSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapAnSWave *fLambdaInvSq;
|
||||
@ -354,10 +352,10 @@ public:
|
||||
virtual ~TLambdaNonMonDWave1();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave1 *fLambdaInvSq;
|
||||
@ -376,10 +374,10 @@ public:
|
||||
virtual ~TLambdaNonMonDWave2();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave2 *fLambdaInvSq;
|
||||
@ -398,10 +396,10 @@ public:
|
||||
virtual ~TLambdaPowerLaw() {}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -419,10 +417,10 @@ public:
|
||||
virtual ~TLambdaInvSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapSWave *fLambdaInvSq;
|
||||
@ -441,10 +439,10 @@ public:
|
||||
virtual ~TLambdaInvDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
@ -463,10 +461,10 @@ public:
|
||||
virtual ~TLambdaInvAnSWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapAnSWave *fLambdaInvSq;
|
||||
@ -485,10 +483,10 @@ public:
|
||||
virtual ~TLambdaInvNonMonDWave1();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave1 *fLambdaInvSq;
|
||||
@ -507,10 +505,10 @@ public:
|
||||
virtual ~TLambdaInvNonMonDWave2();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave2 *fLambdaInvSq;
|
||||
@ -529,10 +527,10 @@ public:
|
||||
virtual ~TLambdaInvPowerLaw() {}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -550,15 +548,15 @@ public:
|
||||
virtual ~TFilmMagnetizationDWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
|
||||
mutable vector<double> fPar;
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TFilmMagnetizationDWave,1)
|
||||
};
|
||||
|
5
src/external/libGbGLF/PGbGLF.cpp
vendored
5
src/external/libGbGLF/PGbGLF.cpp
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2016 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -34,7 +34,6 @@
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
#include "PMusr.h"
|
||||
#include "PGbGLF.h"
|
||||
@ -87,7 +86,7 @@ Double_t PGbGLF::operator()(Double_t t, const std::vector<Double_t> &par) const
|
||||
do {
|
||||
sumM = 0.0;
|
||||
for (Int_t i=0; i<n-1; i++) {
|
||||
tt = ((Double_t)i + 0.5) * dt;
|
||||
tt = (static_cast<Double_t>(i) + 0.5) * dt;
|
||||
sumM += pz_GbG_2(tt, par);
|
||||
}
|
||||
sumM *= dt;
|
||||
|
5
src/external/libGbGLF/PGbGLF.h
vendored
5
src/external/libGbGLF/PGbGLF.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2016 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
#define _PGBGLF_H_
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
|
||||
@ -46,7 +45,7 @@ class PGbGLF : public PUserFcnBase
|
||||
virtual ~PGbGLF() {}
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) {}
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) {}
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
virtual Double_t operator()(Double_t t, const std::vector<Double_t> ¶m) const;
|
||||
|
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
@ -7,7 +7,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016 by Andreas Suter *
|
||||
* Copyright (C) 2016-2019 by Andreas Suter *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
48
src/external/libLFRelaxation/TLFRelaxation.cpp
vendored
48
src/external/libLFRelaxation/TLFRelaxation.cpp
vendored
@ -44,8 +44,6 @@
|
||||
#include "BMWStartupHandler.h"
|
||||
#include "TLFRelaxation.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
#define TWOPI 6.28318530717958647692
|
||||
#define Nsteps 100
|
||||
@ -76,7 +74,7 @@ TLFStatGssKT::TLFStatGssKT() {
|
||||
*/
|
||||
TLFStatGssKT::~TLFStatGssKT() {
|
||||
delete fIntSinGss;
|
||||
fIntSinGss = 0;
|
||||
fIntSinGss = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -88,7 +86,7 @@ TLFStatGssKT::~TLFStatGssKT() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$ \endlatexonly]
|
||||
*/
|
||||
double TLFStatGssKT::operator()(double t, const vector<double> &par) const {
|
||||
double TLFStatGssKT::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 2); // two parameters nu=gbar*B,sigma
|
||||
|
||||
@ -129,7 +127,7 @@ TLFStatExpKT::TLFStatExpKT() {
|
||||
*/
|
||||
TLFStatExpKT::~TLFStatExpKT() {
|
||||
delete fIntBesselJ0Exp;
|
||||
fIntBesselJ0Exp = 0;
|
||||
fIntBesselJ0Exp = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -141,7 +139,7 @@ TLFStatExpKT::~TLFStatExpKT() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$ \endlatexonly]
|
||||
*/
|
||||
double TLFStatExpKT::operator()(double t, const vector<double> &par) const {
|
||||
double TLFStatExpKT::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 2); // two parameters nu=gbar*B,rate
|
||||
|
||||
@ -188,13 +186,13 @@ TLFDynGssKT::TLFDynGssKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0) {
|
||||
#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3F_THREADS) && defined(HAVE_GOMP)
|
||||
int init_threads(fftwf_init_threads());
|
||||
if (!init_threads)
|
||||
cout << "TLFDynGssKT::TLFDynGssKT: Couldn't initialize multiple FFTW-threads ..." << endl;
|
||||
std::cout << "TLFDynGssKT::TLFDynGssKT: Couldn't initialize multiple FFTW-threads ..." << std::endl;
|
||||
else
|
||||
fftwf_plan_with_nthreads(omp_get_num_procs());
|
||||
#endif
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -205,9 +203,9 @@ TLFDynGssKT::TLFDynGssKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -263,7 +261,7 @@ TLFDynGssKT::~TLFDynGssKT() {
|
||||
FILE *wordsOfWisdomW;
|
||||
wordsOfWisdomW = fopen(fWisdom.c_str(), "w");
|
||||
if (wordsOfWisdomW == NULL) {
|
||||
cout << "TLFDynGssKT::~TLFDynGssKT(): Could not open file ... No wisdom is exported..." << endl;
|
||||
std::cout << "TLFDynGssKT::~TLFDynGssKT(): Could not open file ... No wisdom is exported..." << std::endl;
|
||||
} else {
|
||||
fftwf_export_wisdom_to_file(wordsOfWisdomW);
|
||||
fclose(wordsOfWisdomW);
|
||||
@ -276,7 +274,7 @@ TLFDynGssKT::~TLFDynGssKT() {
|
||||
fftwf_destroy_plan(fFFTplanBACK);
|
||||
free(fFFTtime);
|
||||
fftwf_free(fFFTfreq);
|
||||
cout << "TLFDynGssKT::~TLFDynGssKT(): " << fCounter << " full FFT cycles needed..." << endl;
|
||||
std::cout << "TLFDynGssKT::~TLFDynGssKT(): " << fCounter << " full FFT cycles needed..." << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -288,7 +286,7 @@ TLFDynGssKT::~TLFDynGssKT() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
*/
|
||||
double TLFDynGssKT::operator()(double t, const vector<double> &par) const {
|
||||
double TLFDynGssKT::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 3); // three parameters nuL=gbar*B,sigma,fluct.rate nu (fourth parameter: t[us] for SG-function)
|
||||
|
||||
@ -459,7 +457,7 @@ TLFDynSG::~TLFDynSG() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
*/
|
||||
double TLFDynSG::operator()(double t, const vector<double> &par) const {
|
||||
double TLFDynSG::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 3); // three parameters nuL=gbar*B, a ,fluct.rate nu
|
||||
|
||||
@ -513,13 +511,13 @@ TLFDynExpKT::TLFDynExpKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0), f
|
||||
#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3F_THREADS) && defined(HAVE_GOMP)
|
||||
int init_threads(fftwf_init_threads());
|
||||
if (!init_threads)
|
||||
cout << "TLFDynExpKT::TLFDynExpKT: Couldn't initialize multiple FFTW-threads ..." << endl;
|
||||
std::cout << "TLFDynExpKT::TLFDynExpKT: Couldn't initialize multiple FFTW-threads ..." << std::endl;
|
||||
else
|
||||
fftwf_plan_with_nthreads(omp_get_num_procs());
|
||||
#endif
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -530,9 +528,9 @@ TLFDynExpKT::TLFDynExpKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0), f
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -588,7 +586,7 @@ TLFDynExpKT::~TLFDynExpKT() {
|
||||
FILE *wordsOfWisdomW;
|
||||
wordsOfWisdomW = fopen(fWisdom.c_str(), "w");
|
||||
if (wordsOfWisdomW == NULL) {
|
||||
cout << "TLFDynExpKT::~TLFDynExpKT(): Could not open file ... No wisdom is exported..." << endl;
|
||||
std::cout << "TLFDynExpKT::~TLFDynExpKT(): Could not open file ... No wisdom is exported..." << std::endl;
|
||||
} else {
|
||||
fftwf_export_wisdom_to_file(wordsOfWisdomW);
|
||||
fclose(wordsOfWisdomW);
|
||||
@ -601,7 +599,7 @@ TLFDynExpKT::~TLFDynExpKT() {
|
||||
fftwf_destroy_plan(fFFTplanBACK);
|
||||
free(fFFTtime);
|
||||
fftwf_free(fFFTfreq);
|
||||
cout << "TLFDynExpKT::~TLFDynExpKT(): " << fCounter << " full FFT cyles needed..." << endl;
|
||||
std::cout << "TLFDynExpKT::~TLFDynExpKT(): " << fCounter << " full FFT cyles needed..." << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -613,7 +611,7 @@ TLFDynExpKT::~TLFDynExpKT() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
*/
|
||||
double TLFDynExpKT::operator()(double t, const vector<double> &par) const {
|
||||
double TLFDynExpKT::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 3); // three parameters nuL=gbar*B,sigma,fluct.rate nu
|
||||
|
||||
@ -799,7 +797,7 @@ TLFSGInterpolation::~TLFSGInterpolation() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>), λ (μs<sup>-1</sup>), β (1) \endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$, $\lambda~(\mu\mathrm{s}^{-1})$, $\beta~(1)$ \endlatexonly]
|
||||
*/
|
||||
double TLFSGInterpolation::operator()(double t, const vector<double> &par) const {
|
||||
double TLFSGInterpolation::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 4); // four parameters nu=gbar*B [MHz], a [1/us], lambda [1/us], beta [1]
|
||||
|
||||
@ -815,7 +813,7 @@ double TLFSGInterpolation::operator()(double t, const vector<double> &par) const
|
||||
|
||||
double omegaL(TMath::TwoPi()*par[0]);
|
||||
|
||||
vector<double> intpar(par);
|
||||
std::vector<double> intpar(par);
|
||||
intpar.push_back(t);
|
||||
double intValue = fIntegral->IntegrateFunc(0.0, t, intpar);
|
||||
intpar.clear();
|
||||
|
38
src/external/libLFRelaxation/TLFRelaxation.h
vendored
38
src/external/libLFRelaxation/TLFRelaxation.h
vendored
@ -34,8 +34,6 @@
|
||||
#include<cmath>
|
||||
#include<map>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
|
||||
// the following ifdef is needed for GCC 4.6 or higher, fftw 3.3 or higher and root 5.30.03 or lower
|
||||
@ -61,10 +59,10 @@ public:
|
||||
~TLFStatGssKT();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TIntSinGss *fIntSinGss; ///< integrator
|
||||
@ -88,10 +86,10 @@ public:
|
||||
~TLFStatExpKT();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TIntBesselJ0Exp *fIntBesselJ0Exp; ///< integrator
|
||||
@ -122,17 +120,17 @@ public:
|
||||
~TLFDynGssKT();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
mutable std::vector<double> fPar; ///< parameters of the function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
mutable bool fCalcNeeded; ///< flag indicating if the expensive Laplace transform has to be done (e.g. after parameters have changed)
|
||||
mutable bool fFirstCall; ///< flag indicating if the function is evaluated for the first time
|
||||
bool fUseWisdom; ///< flag showing if a FFTW3-wisdom file is used
|
||||
string fWisdom; ///< path to the wisdom file
|
||||
std::string fWisdom; ///< path to the wisdom file
|
||||
unsigned int fNSteps; ///< length of the Laplace transform
|
||||
double fDt; ///< time resolution
|
||||
double fDw; ///< frequency resolution
|
||||
@ -175,17 +173,17 @@ public:
|
||||
~TLFDynExpKT();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
mutable std::vector<double> fPar; ///< parameters of the function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), <i>a</i> (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $a~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
mutable bool fCalcNeeded; ///< flag indicating if the expensive Laplace transform has to be done (e.g. after parameters have changed)
|
||||
mutable bool fFirstCall; ///< flag indicating if the function is evaluated for the first time
|
||||
bool fUseWisdom; ///< flag showing if a FFTW3-wisdom file is used
|
||||
string fWisdom; ///< path to the wisdom file
|
||||
std::string fWisdom; ///< path to the wisdom file
|
||||
unsigned int fNSteps; ///< length of the Laplace transform
|
||||
double fDt; ///< time resolution
|
||||
double fDw; ///< frequency resolution
|
||||
@ -230,14 +228,14 @@ public:
|
||||
~TLFDynSG();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
mutable vector<double> fPar; ///< parameters of the dynamic Gaussian depolarization function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
vector<TLFDynGssKT*> fLFDynGssIntegral; ///< vector of dynamic Gaussian depolarization functions for a subset of static widths
|
||||
mutable std::vector<double> fPar; ///< parameters of the dynamic Gaussian depolarization function [\htmlonly ν<sub>L</sub>=<i>B</i>γ<sub>μ</sub>/2π (MHz), σ (μs<sup>-1</sup>), ν (MHz)\endhtmlonly \latexonly $\nu_{\mathrm{L}}=B\gamma_{\mu}/2\pi~(\mathrm{MHz})$, $\sigma~(\mu\mathrm{s}^{-1})$, $\nu~(\mathrm{MHz})$ \endlatexonly]
|
||||
std::vector<TLFDynGssKT*> fLFDynGssIntegral; ///< vector of dynamic Gaussian depolarization functions for a subset of static widths
|
||||
|
||||
ClassDef(TLFDynSG,1)
|
||||
};
|
||||
@ -258,10 +256,10 @@ public:
|
||||
~TLFSGInterpolation();
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TIntSGInterpolation *fIntegral; ///< integrator
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,11 +31,9 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PStartupHandler_PM.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
@ -93,7 +91,7 @@ Double_t PRgeHandler_PM::GetRgeValue(const Int_t index, const Double_t dist)
|
||||
{
|
||||
Double_t rgeVal = 0.0;
|
||||
|
||||
UInt_t distIdx = (UInt_t)(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0]));
|
||||
UInt_t distIdx = static_cast<UInt_t>(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0]));
|
||||
|
||||
if (distIdx >= fRgeDataList[index].stoppingDistance.size()) {
|
||||
rgeVal = 0.0;
|
||||
@ -141,7 +139,7 @@ Double_t PRgeHandler_PM::GetRgeValue(const Double_t energy, const Double_t dist)
|
||||
*/
|
||||
Bool_t PRgeHandler_PM::LoadRgeData(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList)
|
||||
{
|
||||
ifstream fin;
|
||||
std::ifstream fin;
|
||||
PRgeData_PM data;
|
||||
Int_t idx=0;
|
||||
TString dataName, tstr;
|
||||
@ -151,11 +149,11 @@ Bool_t PRgeHandler_PM::LoadRgeData(const PStringVector &rgeDataPathList, const P
|
||||
|
||||
for (UInt_t i=0; i<rgeDataPathList.size(); i++) {
|
||||
// open rge-file for reading
|
||||
fin.open(rgeDataPathList[i].Data(), iostream::in);
|
||||
fin.open(rgeDataPathList[i].Data(), std::iostream::in);
|
||||
if (!fin.is_open()) {
|
||||
cerr << endl << "PRgeHandler_PM::LoadRgeData **ERROR**";
|
||||
cerr << endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "PRgeHandler_PM::LoadRgeData **ERROR**";
|
||||
std::cerr << std::endl << " Could not open file " << rgeDataPathList[i].Data();
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -240,7 +238,7 @@ PStartupHandler_PM::PStartupHandler_PM()
|
||||
fStartupFileFound = true;
|
||||
fStartupFilePath = TString(startup_path_name);
|
||||
} else { // startup file is not found in the current directory
|
||||
cout << endl << ">> PStartupHandler_PM(): **WARNING** Couldn't find photoMeissner_startup.xml in the current directory, will try default one." << endl;
|
||||
std::cout << std::endl << ">> PStartupHandler_PM(): **WARNING** Couldn't find photoMeissner_startup.xml in the current directory, will try default one." << std::endl;
|
||||
home_path = getenv("HOME");
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/external/photoMeissner_startup.xml", home_path);
|
||||
if (StartupFileExists(startup_path_name)) {
|
||||
@ -250,7 +248,7 @@ PStartupHandler_PM::PStartupHandler_PM()
|
||||
}
|
||||
|
||||
// init RGE handler
|
||||
fRgeHandler = 0;
|
||||
fRgeHandler = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -286,15 +284,15 @@ void PStartupHandler_PM::OnEndDocument()
|
||||
|
||||
|
||||
fRgeHandler = new PRgeHandler_PM(fRgeFilePathList, fRgeDataEnergyList);
|
||||
if (fRgeHandler == 0) { // severe problem
|
||||
if (fRgeHandler == nullptr) { // severe problem
|
||||
fIsValid = false;
|
||||
cerr << endl << ">> PStartupHandler_PM::OnEndDocument(): **ERROR** couldn't invoke RGE handler." << endl << endl;
|
||||
std::cerr << std::endl << ">> PStartupHandler_PM::OnEndDocument(): **ERROR** couldn't invoke RGE handler." << std::endl << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fRgeHandler->IsValid()) { // severe problem
|
||||
fIsValid = false;
|
||||
cerr << endl << ">> PStartupHandler_PM::OnEndDocument(): **ERROR** RGE handler not valid." << endl << endl;
|
||||
std::cerr << std::endl << ">> PStartupHandler_PM::OnEndDocument(): **ERROR** RGE handler not valid." << std::endl << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -353,9 +351,9 @@ void PStartupHandler_PM::OnCharacters(const char *str)
|
||||
dval = tstr.Atof();
|
||||
fRgeDataEnergyList.push_back(dval);
|
||||
} else {
|
||||
cerr << endl << "PStartupHandler_PM::OnCharacters: **ERROR** when finding energy:";
|
||||
cerr << endl << "\"" << str << "\" is not a floating point number, will ignore it.";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "PStartupHandler_PM::OnCharacters: **ERROR** when finding energy:";
|
||||
std::cerr << std::endl << "\"" << str << "\" is not a floating point number, will ignore it.";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -386,8 +384,8 @@ void PStartupHandler_PM::OnComment(const char *str)
|
||||
*/
|
||||
void PStartupHandler_PM::OnWarning(const char *str)
|
||||
{
|
||||
cerr << endl << "PStartupHandler_PM **WARNING** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "PStartupHandler_PM **WARNING** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -400,8 +398,8 @@ void PStartupHandler_PM::OnWarning(const char *str)
|
||||
*/
|
||||
void PStartupHandler_PM::OnError(const char *str)
|
||||
{
|
||||
cerr << endl << "PStartupHandler_PM **ERROR** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "PStartupHandler_PM **ERROR** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -414,8 +412,8 @@ void PStartupHandler_PM::OnError(const char *str)
|
||||
*/
|
||||
void PStartupHandler_PM::OnFatalError(const char *str)
|
||||
{
|
||||
cerr << endl << "PStartupHandler_PM **FATAL ERROR** " << str;
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << "PStartupHandler_PM **FATAL ERROR** " << str;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -492,7 +490,7 @@ bool PStartupHandler_PM::StartupFileExists(char *fln)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
ifstream ifile(fln);
|
||||
std::ifstream ifile(fln);
|
||||
|
||||
if (ifile.fail()) {
|
||||
result = false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
#define _PPHOTOMEISSNER_H_
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "PStartupHandler_PM.h"
|
||||
@ -46,11 +45,11 @@ class PPhotoMeissner : public PUserFcnBase
|
||||
|
||||
// global user-function-access functions, here without any functionality
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void*> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
// function operator
|
||||
Double_t operator()(Double_t, const vector<Double_t>&) const;
|
||||
Double_t operator()(Double_t, const std::vector<Double_t>&) const;
|
||||
|
||||
private:
|
||||
PStartupHandler_PM *fStartupHandler;
|
||||
@ -61,8 +60,8 @@ class PPhotoMeissner : public PUserFcnBase
|
||||
constexpr static const Double_t fTwoPi = 6.28318530717958623;
|
||||
|
||||
Double_t InuMinus(const Double_t nu, const Double_t x) const;
|
||||
Double_t FieldFilm(const Double_t z, const vector<Double_t> &par) const;
|
||||
Double_t FieldHalfSpace(const Double_t z, const vector<Double_t> &par) const;
|
||||
Double_t FieldFilm(const Double_t z, const std::vector<Double_t> &par) const;
|
||||
Double_t FieldHalfSpace(const Double_t z, const std::vector<Double_t> &par) const;
|
||||
|
||||
// definition of the class for the ROOT dictionary
|
||||
ClassDef(PPhotoMeissner, 1)
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -30,7 +30,6 @@
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <TSAXParser.h>
|
||||
|
||||
@ -50,7 +49,7 @@ ClassImp(PSkewedLorentzian) // for ROOT dictionary
|
||||
PSkewedLorentzian::PSkewedLorentzian()
|
||||
{
|
||||
// init
|
||||
fStartupHandler = 0;
|
||||
fStartupHandler = nullptr;
|
||||
fNoOfFields = 0;
|
||||
fRange = 0;
|
||||
fValid = true;
|
||||
@ -67,22 +66,22 @@ PSkewedLorentzian::PSkewedLorentzian()
|
||||
Int_t status = parseXmlFile(saxParser, startup_path_name);
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cout << endl << ">> PSkewedLorentzian::PSkewedLorentzian: **WARNING** Reading/parsing skewedLorentzian_startup.xml failed.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << ">> PSkewedLorentzian::PSkewedLorentzian: **WARNING** Reading/parsing skewedLorentzian_startup.xml failed.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
saxParser = nullptr;
|
||||
}
|
||||
|
||||
// check if everything went fine with the startup handler
|
||||
if (!fStartupHandler->IsValid()) {
|
||||
cout << endl << ">> PSkewedLorentzian::PSkewedLorentzian **PANIC ERROR**";
|
||||
cout << endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << ">> PSkewedLorentzian::PSkewedLorentzian **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
@ -92,18 +91,18 @@ PSkewedLorentzian::PSkewedLorentzian()
|
||||
|
||||
// check if the parameters potentially make sense
|
||||
if (fNoOfFields == 0) {
|
||||
cout << endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
cout << endl << ">> Found number of field value == 0. Doesn't make sense, will set it to 101." << endl;
|
||||
std::cout << std::endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
std::cout << std::endl << ">> Found number of field value == 0. Doesn't make sense, will set it to 101." << std::endl;
|
||||
fNoOfFields = 101;
|
||||
} else if (fNoOfFields > 1000) {
|
||||
cout << endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
cout << endl << ">> Found number of field value == " << fNoOfFields << ".";
|
||||
cout << endl << ">> This is a very large number! Are you sure?" << endl;
|
||||
std::cout << std::endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
std::cout << std::endl << ">> Found number of field value == " << fNoOfFields << ".";
|
||||
std::cout << std::endl << ">> This is a very large number! Are you sure?" << std::endl;
|
||||
}
|
||||
|
||||
if (fRange < 1.0) {
|
||||
cout << endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
cout << endl << ">> Found range value < 1.0 (" << fRange << "). Doesn't make sense, will set it to 10.0." << endl;
|
||||
std::cout << std::endl << ">> PSkewedLorentzian::PSkewedLorentzian **WARNING**";
|
||||
std::cout << std::endl << ">> Found range value < 1.0 (" << fRange << "). Doesn't make sense, will set it to 10.0." << std::endl;
|
||||
fRange = 10.0;
|
||||
}
|
||||
}
|
||||
@ -129,7 +128,7 @@ PSkewedLorentzian::~PSkewedLorentzian()
|
||||
* \param t
|
||||
* \param par
|
||||
*/
|
||||
Double_t PSkewedLorentzian::operator()(Double_t t, const vector<Double_t> &par) const
|
||||
Double_t PSkewedLorentzian::operator()(Double_t t, const std::vector<Double_t> &par) const
|
||||
{
|
||||
// expected parameters: (0) B0: Peak Field, (1) beta: field width, (2) Delta: skewness width, (3) phi: detector phase
|
||||
assert(par.size() == 4);
|
||||
@ -151,25 +150,25 @@ Double_t PSkewedLorentzian::operator()(Double_t t, const vector<Double_t> &par)
|
||||
if (fNoOfFields % 2 == 0) { // even number of sampling points
|
||||
dB = fieldRangeMinus / (fNoOfFields/2 + 0.5);
|
||||
for (Int_t j=fNoOfFields/2-1; j>=0; j--) {
|
||||
dval = par[0] - dB*((Double_t)j+0.5);
|
||||
dval = par[0] - dB*(static_cast<Double_t>(j)+0.5);
|
||||
if (dval > 0.0)
|
||||
BB.push_back(dval); // Bj = B0 - dB*(j+1/2) for Bj < B0
|
||||
}
|
||||
dB = fieldRangePlus / (fNoOfFields/2 + 0.5);
|
||||
for (Int_t j=0; j<(Int_t)(fNoOfFields/2); j++)
|
||||
BB.push_back(par[0] + dB*((Double_t)j+0.5)); // Bj = B0 + dB*(j+1/2) for Bj > B0
|
||||
for (Int_t j=0; j<static_cast<Int_t>(fNoOfFields/2); j++)
|
||||
BB.push_back(par[0] + dB*(static_cast<Double_t>(j)+0.5)); // Bj = B0 + dB*(j+1/2) for Bj > B0
|
||||
} else { // odd number of sampling points
|
||||
Int_t halfNoOfPoints = (fNoOfFields-1)/2;
|
||||
dB = fieldRangeMinus / halfNoOfPoints;
|
||||
for (Int_t j=halfNoOfPoints; j>0; j--) {
|
||||
dval = par[0] - dB*(Double_t)j;
|
||||
dval = par[0] - dB*static_cast<Double_t>(j);
|
||||
if (dval > 0.0)
|
||||
BB.push_back(dval); // Bj = B0 - dB*j for Bj < B0
|
||||
}
|
||||
BB.push_back(par[0]); // Bj = B0
|
||||
dB = fieldRangePlus / halfNoOfPoints;
|
||||
for (Int_t j=1; j<=halfNoOfPoints; j++)
|
||||
BB.push_back(par[0] + dB*(Double_t)j); // Bj = B0 + dB*j for Bj > B0
|
||||
BB.push_back(par[0] + dB*static_cast<Double_t>(j)); // Bj = B0 + dB*j for Bj > B0
|
||||
}
|
||||
|
||||
// calculate the asymmetry
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
#include "PStartupHandler_SV.h"
|
||||
|
||||
@ -60,7 +59,7 @@ PStartupHandler_SV::PStartupHandler_SV()
|
||||
fStartupFileFound = true;
|
||||
fStartupFilePath = TString(startup_path_name);
|
||||
} else { // startup file is not found in the current directory
|
||||
cout << endl << ">> PStartupHandler_SV(): **WARNING** Couldn't find spinValve_startup.xml in the current directory, will try default one." << endl;
|
||||
std::cout << std::endl << ">> PStartupHandler_SV(): **WARNING** Couldn't find spinValve_startup.xml in the current directory, will try default one." << std::endl;
|
||||
home_path = getenv("HOME");
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/external/spinValve_startup.xml", home_path);
|
||||
if (StartupFileExists(startup_path_name)) {
|
||||
@ -145,9 +144,9 @@ void PStartupHandler_SV::OnCharacters(const char *str)
|
||||
if (tstr.IsDigit()) {
|
||||
fNoOfFields = tstr.Atoi();
|
||||
} else {
|
||||
cout << endl << "PStartupHandler_SV::OnCharacters: **ERROR** when finding number_of_fields:";
|
||||
cout << endl << "\"" << str << "\" is not a number, will ignore it and use the default value.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PStartupHandler_SV::OnCharacters: **ERROR** when finding number_of_fields:";
|
||||
std::cout << std::endl << "\"" << str << "\" is not a number, will ignore it and use the default value.";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
break;
|
||||
case eRange:
|
||||
@ -155,9 +154,9 @@ void PStartupHandler_SV::OnCharacters(const char *str)
|
||||
if (tstr.IsFloat()) {
|
||||
fRange = tstr.Atof();
|
||||
} else {
|
||||
cout << endl << "PStartupHandler_SV::OnCharacters: **ERROR** when finding range:";
|
||||
cout << endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PStartupHandler_SV::OnCharacters: **ERROR** when finding range:";
|
||||
std::cout << std::endl << "\"" << str << "\" is not a floating point number, will ignore it and use the default value.";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -188,8 +187,8 @@ void PStartupHandler_SV::OnComment(const char *str)
|
||||
*/
|
||||
void PStartupHandler_SV::OnWarning(const char *str)
|
||||
{
|
||||
cout << endl << "PStartupHandler_SV **WARNING** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PStartupHandler_SV **WARNING** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -202,8 +201,8 @@ void PStartupHandler_SV::OnWarning(const char *str)
|
||||
*/
|
||||
void PStartupHandler_SV::OnError(const char *str)
|
||||
{
|
||||
cout << endl << "PStartupHandler_SV **ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PStartupHandler_SV **ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -216,8 +215,8 @@ void PStartupHandler_SV::OnError(const char *str)
|
||||
*/
|
||||
void PStartupHandler_SV::OnFatalError(const char *str)
|
||||
{
|
||||
cout << endl << "PStartupHandler_SV **FATAL ERROR** " << str;
|
||||
cout << endl;
|
||||
std::cout << std::endl << "PStartupHandler_SV **FATAL ERROR** " << str;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -244,7 +243,7 @@ bool PStartupHandler_SV::StartupFileExists(char *fln)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
ifstream ifile(fln);
|
||||
std::ifstream ifile(fln);
|
||||
|
||||
if (ifile.fail()) {
|
||||
result = false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -31,7 +31,6 @@
|
||||
#define _PSKEWEDLORENTZIAN_H_
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "PStartupHandler_SV.h"
|
||||
@ -46,11 +45,11 @@ class PSkewedLorentzian : public PUserFcnBase
|
||||
|
||||
// global user-function-access functions, here without any functionality
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void*> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
// function operator
|
||||
Double_t operator()(Double_t, const vector<Double_t>&) const;
|
||||
Double_t operator()(Double_t, const std::vector<Double_t>&) const;
|
||||
|
||||
private:
|
||||
PStartupHandler_SV *fStartupHandler;
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013 by Andreas Suter *
|
||||
* Copyright (C) 2013-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
26
src/external/libZFRelaxation/ZFRelaxation.cpp
vendored
26
src/external/libZFRelaxation/ZFRelaxation.cpp
vendored
@ -35,8 +35,6 @@
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
ClassImp(ZFMagGss)
|
||||
ClassImp(ZFMagExp)
|
||||
|
||||
@ -49,7 +47,7 @@ ClassImp(ZFMagExp)
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly α (1), ν (MHz), σ<sub>T</sub>; (μs<sup>-1</sup>), σ<sub>L</sub>; (μs<sup>-1</sup>)\endhtmlonly \latexonly $\alpha~(1)$, $\nu~(\mathrm{MHz})$, $\sigma_{\mathrm{T}}~(\mu\mathrm{s}^{-1})$, $\sigma_{\mathrm{L}}~(\mu\mathrm{s}^{-1})$ \endlatexonly]
|
||||
*/
|
||||
double ZFMagGss::operator()(double t, const vector<double> &par) const {
|
||||
double ZFMagGss::operator()(double t, const std::vector<double> &par) const {
|
||||
assert(par.size()==4);
|
||||
double w(TWO_PI * par[1]), sst(par[2]*par[2]*t);
|
||||
return par[0] * (cos(w*t) - sst/w*sin(w*t)) * exp(-0.5*sst*t) + (1.0-par[0]) * exp(-0.5*par[3]*par[3]*t*t);
|
||||
@ -64,7 +62,7 @@ double ZFMagGss::operator()(double t, const vector<double> &par) const {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly α (1), ν (MHz), <i>a</i><sub>T</sub>; (μs<sup>-1</sup>), <i>a</i><sub>L</sub>; (μs<sup>-1</sup>)\endhtmlonly \latexonly $\alpha~(1)$, $\nu~(\mathrm{MHz})$, $a_{\mathrm{T}}~(\mu\mathrm{s}^{-1})$, $a_{\mathrm{L}}~(\mu\mathrm{s}^{-1})$ \endlatexonly]
|
||||
*/
|
||||
double ZFMagExp::operator()(double t, const vector<double> &par) const {
|
||||
double ZFMagExp::operator()(double t, const std::vector<double> &par) const {
|
||||
assert(par.size()==4);
|
||||
double w(TWO_PI * par[1]);
|
||||
return par[0] * (cos(w*t) - par[2]/w*sin(w*t)) * exp(-par[2]*t) + (1.0-par[0]) * exp(-par[3]*t);
|
||||
@ -88,8 +86,8 @@ UniaxialStatGssKT::UniaxialStatGssKT() {
|
||||
* <p>Destructor
|
||||
*/
|
||||
UniaxialStatGssKT::~UniaxialStatGssKT() {
|
||||
delete fIntFirst; fIntFirst = 0;
|
||||
delete fIntSecond; fIntSecond = 0;
|
||||
delete fIntFirst; fIntFirst = nullptr;
|
||||
delete fIntSecond; fIntSecond = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -101,27 +99,27 @@ UniaxialStatGssKT::~UniaxialStatGssKT() {
|
||||
* \param t time \htmlonly (μs) \endhtmlonly \latexonly ($\mu\mathrm{s}$) \endlatexonly
|
||||
* \param par parameters [\htmlonly σ<sub>1</sub> (μs<sup>-1</sup>), σ<sub>2</sub> (μs<sup>-1</sup>), Θ (°)\endhtmlonly \latexonly $\sigma_{1}~(\mu\mathrm{s}^{-1})$, $\sigma_{2}~(\mu\mathrm{s}^{-1})$, $\Theta~(^{\circ})$ \endlatexonly]
|
||||
*/
|
||||
double UniaxialStatGssKT::operator()(double t, const vector<double> &par) const {
|
||||
double UniaxialStatGssKT::operator()(double t, const std::vector<double> &par) const {
|
||||
assert(par.size() == 3);
|
||||
|
||||
if (t < 0.0)
|
||||
return 1.0;
|
||||
|
||||
// set the parameters for the integrations
|
||||
vector<double> intParam(3);
|
||||
std::vector<double> intParam(3);
|
||||
intParam[0] = par[0];
|
||||
intParam[1] = par[1];
|
||||
intParam[2] = t;
|
||||
|
||||
if (((fabs(par[1]) < 1.0e-5) && (fabs(par[0]) > 1.0e-2)) || (fabs(par[0]/par[1]) > 1000.0)) {
|
||||
cerr << endl;
|
||||
cerr << ">> UniaxialStatGssKT: WARNING Ratio sigma1/sigma2 unreasonably large! Set it internally to 1000. Please check your parameters!";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << ">> UniaxialStatGssKT: WARNING Ratio sigma1/sigma2 unreasonably large! Set it internally to 1000. Please check your parameters!";
|
||||
std::cerr << std::endl;
|
||||
intParam[1] = 1.0e-3*intParam[0];
|
||||
} else if (fabs(par[1]) < 1.0e-10) {
|
||||
cerr << endl;
|
||||
cerr << ">> UniaxialStatGssKT: WARNING sigma2 too small! Set it internally to 1.0E-10. Please check your parameters!";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << ">> UniaxialStatGssKT: WARNING sigma2 too small! Set it internally to 1.0E-10. Please check your parameters!";
|
||||
std::cerr << std::endl;
|
||||
intParam[1] = 1.0e-10;
|
||||
}
|
||||
|
||||
|
13
src/external/libZFRelaxation/ZFRelaxation.h
vendored
13
src/external/libZFRelaxation/ZFRelaxation.h
vendored
@ -33,7 +33,6 @@
|
||||
#include "BMWIntegrator.h"
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
@ -52,10 +51,10 @@ public:
|
||||
~ZFMagGss(){} ///< default destructor
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
ClassDef(ZFMagGss,1)
|
||||
};
|
||||
@ -77,10 +76,10 @@ public:
|
||||
~ZFMagExp(){} ///< default destructor
|
||||
|
||||
Bool_t NeedGlobalPart() const { return false; }
|
||||
void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
ClassDef(ZFMagExp,1)
|
||||
};
|
||||
@ -101,10 +100,10 @@ public:
|
||||
virtual ~UniaxialStatGssKT();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const vector<double>&) const;
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TFirstUniaxialGssKTIntegral *fIntFirst;
|
||||
|
729
src/external/nexus/PNeXus.cpp
vendored
729
src/external/nexus/PNeXus.cpp
vendored
File diff suppressed because it is too large
Load Diff
395
src/external/nexus/PNeXus.h
vendored
395
src/external/nexus/PNeXus.h
vendored
@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2014 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -32,7 +32,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "napi.h"
|
||||
|
||||
@ -75,18 +74,18 @@ class PNeXusProp {
|
||||
PNeXusProp();
|
||||
virtual ~PNeXusProp() {}
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual double GetValue() { return fValue; }
|
||||
virtual string GetUnit() { return fUnit; }
|
||||
virtual std::string GetUnit() { return fUnit; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetValue(double val) { fValue = val; }
|
||||
virtual void SetUnit(string unit) { fUnit = unit; }
|
||||
virtual void SetUnit(std::string unit) { fUnit = unit; }
|
||||
|
||||
private:
|
||||
string fName;
|
||||
std::string fName;
|
||||
double fValue;
|
||||
string fUnit;
|
||||
std::string fUnit;
|
||||
};
|
||||
|
||||
class PNeXusBeam1 {
|
||||
@ -97,14 +96,14 @@ class PNeXusBeam1 {
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual double GetTotalCounts() { return fTotalCounts; }
|
||||
virtual string GetUnits() { return fUnits; }
|
||||
virtual std::string GetUnits() { return fUnits; }
|
||||
|
||||
virtual void SetTotalCounts(double counts) { fTotalCounts = counts; }
|
||||
virtual void SetUnits(string units) { fUnits = units; }
|
||||
virtual void SetUnits(std::string units) { fUnits = units; }
|
||||
|
||||
private:
|
||||
double fTotalCounts; ///< total number of counts
|
||||
string fUnits; ///< 'units' in which total counts is given, e.g. 'Mev'
|
||||
std::string fUnits; ///< 'units' in which total counts is given, e.g. 'Mev'
|
||||
};
|
||||
|
||||
class PNeXusCollimator1 {
|
||||
@ -114,11 +113,11 @@ class PNeXusCollimator1 {
|
||||
|
||||
virtual bool IsValid(bool strict) { return true; } // currently only a dummy
|
||||
|
||||
virtual string GetType() { return fType; }
|
||||
virtual void SetType(string type) { fType = type; }
|
||||
virtual std::string GetType() { return fType; }
|
||||
virtual void SetType(std::string type) { fType = type; }
|
||||
|
||||
private:
|
||||
string fType;
|
||||
std::string fType;
|
||||
};
|
||||
|
||||
class PNeXusDetector1 {
|
||||
@ -142,18 +141,18 @@ class PNeXusInstrument1 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual PNeXusDetector1* GetDetector() { return &fDetector; }
|
||||
virtual PNeXusCollimator1* GetCollimator() { return &fCollimator; }
|
||||
virtual PNeXusBeam1* GetBeam() { return &fBeam; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetDetector(PNeXusDetector1 &detector) { fDetector = detector; }
|
||||
virtual void SetCollimator(PNeXusCollimator1 &collimator) { fCollimator = collimator; }
|
||||
virtual void SetBeam(PNeXusBeam1 &beam) { fBeam = beam; }
|
||||
|
||||
private:
|
||||
string fName; ///< instrument name
|
||||
std::string fName; ///< instrument name
|
||||
PNeXusDetector1 fDetector;
|
||||
PNeXusCollimator1 fCollimator;
|
||||
PNeXusBeam1 fBeam;
|
||||
@ -166,38 +165,38 @@ class PNeXusSample1 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual string GetShape() { return fShape; }
|
||||
virtual string GetMagneticFieldState() { return fMagneticFieldState; }
|
||||
virtual string GetEnvironment() { return fEnvironment; }
|
||||
virtual double GetPhysPropValue(string name, bool &ok);
|
||||
virtual void GetPhysPropUnit(string name, string &unit, bool &ok);
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual std::string GetShape() { return fShape; }
|
||||
virtual std::string GetMagneticFieldState() { return fMagneticFieldState; }
|
||||
virtual std::string GetEnvironment() { return fEnvironment; }
|
||||
virtual double GetPhysPropValue(std::string name, bool &ok);
|
||||
virtual void GetPhysPropUnit(std::string name, std::string &unit, bool &ok);
|
||||
virtual int IsMagneticFieldVectorAvailable() { return fMagneticFieldVectorAvailable; }
|
||||
virtual vector<double> GetMagneticFieldVector() { return fMagneticFieldVector; }
|
||||
virtual string GetMagneticFieldVectorUnits() { return fMagneticFieldVectorUnits; }
|
||||
virtual string GetMagneticFieldVectorCoordinateSystem() { return fMagneticFieldVectorCoordinateSystem; }
|
||||
virtual std::vector<double> GetMagneticFieldVector() { return fMagneticFieldVector; }
|
||||
virtual std::string GetMagneticFieldVectorUnits() { return fMagneticFieldVectorUnits; }
|
||||
virtual std::string GetMagneticFieldVectorCoordinateSystem() { return fMagneticFieldVectorCoordinateSystem; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetShape(string shape) { fShape = shape; }
|
||||
virtual void SetMagneticFieldState(string magFieldState) { fMagneticFieldState = magFieldState; }
|
||||
virtual void SetEnvironment(string env) { fEnvironment = env; }
|
||||
virtual void SetPhysProp(string name, double value, string unit, int idx=-1);
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetShape(std::string shape) { fShape = shape; }
|
||||
virtual void SetMagneticFieldState(std::string magFieldState) { fMagneticFieldState = magFieldState; }
|
||||
virtual void SetEnvironment(std::string env) { fEnvironment = env; }
|
||||
virtual void SetPhysProp(std::string name, double value, std::string unit, int idx=-1);
|
||||
virtual void SetMagneticFieldVectorAvailable(int avail) { fMagneticFieldVectorAvailable = avail; }
|
||||
virtual void SetMagneticFieldVector(vector<double> &magVec) { fMagneticFieldVector = magVec; }
|
||||
virtual void SetMagneticFieldVectorCoordinateSystem(string coord) { fMagneticFieldVectorCoordinateSystem = coord; }
|
||||
virtual void SetMagneticFieldUnits(string units) { fMagneticFieldVectorUnits = units; }
|
||||
virtual void SetMagneticFieldVector(std::vector<double> &magVec) { fMagneticFieldVector = magVec; }
|
||||
virtual void SetMagneticFieldVectorCoordinateSystem(std::string coord) { fMagneticFieldVectorCoordinateSystem = coord; }
|
||||
virtual void SetMagneticFieldUnits(std::string units) { fMagneticFieldVectorUnits = units; }
|
||||
|
||||
private:
|
||||
string fName; ///< sample name
|
||||
string fShape; ///< sample orientation
|
||||
string fMagneticFieldState; ///< magnetic field state, e.g. TF, ZF, ...
|
||||
string fEnvironment; ///< sample environment, e.g. CCR, Konti-1, ...
|
||||
vector<PNeXusProp> fPhysProp; ///< collects the temperature, magnetic field
|
||||
std::string fName; ///< sample name
|
||||
std::string fShape; ///< sample orientation
|
||||
std::string fMagneticFieldState; ///< magnetic field state, e.g. TF, ZF, ...
|
||||
std::string fEnvironment; ///< sample environment, e.g. CCR, Konti-1, ...
|
||||
std::vector<PNeXusProp> fPhysProp; ///< collects the temperature, magnetic field
|
||||
|
||||
int fMagneticFieldVectorAvailable; ///< flag '0' magnetic field vector not available, '1' magnetic field vector available
|
||||
vector<double> fMagneticFieldVector; ///< magnetic field vector
|
||||
string fMagneticFieldVectorUnits; ///< units in which the magnetic field vector is given
|
||||
string fMagneticFieldVectorCoordinateSystem; ///< coordinate system, e.g. 'cartesian'
|
||||
std::vector<double> fMagneticFieldVector; ///< magnetic field vector
|
||||
std::string fMagneticFieldVectorUnits; ///< units in which the magnetic field vector is given
|
||||
std::string fMagneticFieldVectorCoordinateSystem; ///< coordinate system, e.g. 'cartesian'
|
||||
};
|
||||
|
||||
class PNeXusUser1 {
|
||||
@ -207,15 +206,15 @@ class PNeXusUser1 {
|
||||
|
||||
virtual bool IsValid(bool strict) { return true; } // currently only a dummy
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual string GetExperimentNumber() { return fExperimentNumber; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual std::string GetExperimentNumber() { return fExperimentNumber; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetExperimentNumber(string expNum) { fExperimentNumber = expNum; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetExperimentNumber(std::string expNum) { fExperimentNumber = expNum; }
|
||||
|
||||
private:
|
||||
string fName; ///< user name
|
||||
string fExperimentNumber; ///< experiment number, RB number at ISIS
|
||||
std::string fName; ///< user name
|
||||
std::string fExperimentNumber; ///< experiment number, RB number at ISIS
|
||||
};
|
||||
|
||||
class PNeXusAlpha1 {
|
||||
@ -244,41 +243,41 @@ class PNeXusData1 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual double GetTimeResolution(string units);
|
||||
virtual vector<unsigned int> *GetT0s() { return &fT0; }
|
||||
virtual double GetTimeResolution(std::string units);
|
||||
virtual std::vector<unsigned int> *GetT0s() { return &fT0; }
|
||||
virtual int GetT0(unsigned int idx);
|
||||
virtual vector<unsigned int> *GetFirstGoodBins() { return &fFirstGoodBin; }
|
||||
virtual std::vector<unsigned int> *GetFirstGoodBins() { return &fFirstGoodBin; }
|
||||
virtual int GetFirstGoodBin(unsigned int idx);
|
||||
virtual vector<unsigned int> *GetLastGoodBins() { return &fLastGoodBin; }
|
||||
virtual std::vector<unsigned int> *GetLastGoodBins() { return &fLastGoodBin; }
|
||||
virtual int GetLastGoodBin(unsigned int idx);
|
||||
virtual vector<string> *GetHistoNames() { return &fHistoName; }
|
||||
virtual void GetHistoName(unsigned int idx, string &name, bool &ok);
|
||||
virtual std::vector<std::string> *GetHistoNames() { return &fHistoName; }
|
||||
virtual void GetHistoName(unsigned int idx, std::string &name, bool &ok);
|
||||
virtual unsigned int GetNoOfHistos() { return fHisto.size(); }
|
||||
virtual unsigned int GetHistoLength(unsigned int histoNo=0);
|
||||
virtual vector<unsigned int> *GetHisto(unsigned int histoNo);
|
||||
virtual vector<int> *GetGrouping() { return &fGrouping; }
|
||||
virtual vector<PNeXusAlpha1> *GetAlpha() { return &fAlpha; }
|
||||
virtual std::vector<unsigned int> *GetHisto(unsigned int histoNo);
|
||||
virtual std::vector<int> *GetGrouping() { return &fGrouping; }
|
||||
virtual std::vector<PNeXusAlpha1> *GetAlpha() { return &fAlpha; }
|
||||
|
||||
virtual void SetTimeResolution(double val, string units);
|
||||
virtual void SetTimeResolution(double val, std::string units);
|
||||
virtual void SetT0(unsigned int t0, int idx=-1);
|
||||
virtual void SetFirstGoodBin(unsigned int fgb, int idx=-1);
|
||||
virtual void SetLastGoodBin(unsigned int lgb, int idx=-1);
|
||||
virtual void FlushHistos();
|
||||
virtual void SetHisto(vector<unsigned int> &data, int histoNo=-1);
|
||||
virtual void SetHisto(std::vector<unsigned int> &data, int histoNo=-1);
|
||||
virtual void FlushGrouping() { fGrouping.clear(); }
|
||||
virtual void SetGrouping(vector<int> &grouping) { fGrouping = grouping; }
|
||||
virtual void SetGrouping(std::vector<int> &grouping) { fGrouping = grouping; }
|
||||
virtual void FlushAlpha() { fAlpha.clear(); }
|
||||
virtual void SetAlpha(vector<PNeXusAlpha1> &alpha) { fAlpha = alpha; }
|
||||
virtual void SetAlpha(std::vector<PNeXusAlpha1> &alpha) { fAlpha = alpha; }
|
||||
|
||||
private:
|
||||
double fTimeResolution; ///< time resolution in (ps)
|
||||
vector<unsigned int> fT0;
|
||||
vector<unsigned int> fFirstGoodBin;
|
||||
vector<unsigned int> fLastGoodBin;
|
||||
vector<string> fHistoName;
|
||||
vector< vector<unsigned int> > fHisto;
|
||||
vector<int> fGrouping;
|
||||
vector<PNeXusAlpha1> fAlpha;
|
||||
std::vector<unsigned int> fT0;
|
||||
std::vector<unsigned int> fFirstGoodBin;
|
||||
std::vector<unsigned int> fLastGoodBin;
|
||||
std::vector<std::string> fHistoName;
|
||||
std::vector< std::vector<unsigned int> > fHisto;
|
||||
std::vector<int> fGrouping;
|
||||
std::vector<PNeXusAlpha1> fAlpha;
|
||||
};
|
||||
|
||||
class PNeXusEntry1 {
|
||||
@ -288,32 +287,32 @@ class PNeXusEntry1 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetProgramName() { return fProgramName; }
|
||||
virtual string GetProgramVersion() { return fProgramVersion; }
|
||||
virtual std::string GetProgramName() { return fProgramName; }
|
||||
virtual std::string GetProgramVersion() { return fProgramVersion; }
|
||||
virtual int GetRunNumber() { return fRunNumber; }
|
||||
virtual string GetTitle() { return fTitle; }
|
||||
virtual string GetNotes() { return fNotes; }
|
||||
virtual string GetAnalysis() { return fAnalysis; }
|
||||
virtual string GetLaboratory() { return fLaboratory; }
|
||||
virtual string GetBeamline() { return fBeamline; }
|
||||
virtual string GetStartTime() { return fStartTime; }
|
||||
virtual string GetStopTime() { return fStopTime; }
|
||||
virtual std::string GetTitle() { return fTitle; }
|
||||
virtual std::string GetNotes() { return fNotes; }
|
||||
virtual std::string GetAnalysis() { return fAnalysis; }
|
||||
virtual std::string GetLaboratory() { return fLaboratory; }
|
||||
virtual std::string GetBeamline() { return fBeamline; }
|
||||
virtual std::string GetStartTime() { return fStartTime; }
|
||||
virtual std::string GetStopTime() { return fStopTime; }
|
||||
virtual int GetSwitchingState() { return fSwitchingState; }
|
||||
virtual PNeXusUser1* GetUser() { return &fUser; }
|
||||
virtual PNeXusSample1* GetSample() { return &fSample; }
|
||||
virtual PNeXusInstrument1* GetInstrument() { return &fInstrument; }
|
||||
virtual PNeXusData1* GetData() { return &fData; }
|
||||
|
||||
virtual void SetProgramName(string name) { fProgramName = name; }
|
||||
virtual void SetProgramVersion(string version) { fProgramVersion = version; }
|
||||
virtual void SetProgramName(std::string name) { fProgramName = name; }
|
||||
virtual void SetProgramVersion(std::string version) { fProgramVersion = version; }
|
||||
virtual void SetRunNumber(int number) { fRunNumber = number; }
|
||||
virtual void SetTitle(string title) { fTitle = title; }
|
||||
virtual void SetNotes(string notes) { fNotes = notes; }
|
||||
virtual void SetAnalysis(string analysis) { fAnalysis = analysis; }
|
||||
virtual void SetLaboratory(string lab) { fLaboratory = lab; }
|
||||
virtual void SetBeamline(string beamline) { fBeamline = beamline; }
|
||||
virtual int SetStartTime(string time);
|
||||
virtual int SetStopTime(string time);
|
||||
virtual void SetTitle(std::string title) { fTitle = title; }
|
||||
virtual void SetNotes(std::string notes) { fNotes = notes; }
|
||||
virtual void SetAnalysis(std::string analysis) { fAnalysis = analysis; }
|
||||
virtual void SetLaboratory(std::string lab) { fLaboratory = lab; }
|
||||
virtual void SetBeamline(std::string beamline) { fBeamline = beamline; }
|
||||
virtual int SetStartTime(std::string time);
|
||||
virtual int SetStopTime(std::string time);
|
||||
virtual int SetSwitchingState(int state);
|
||||
virtual void SetUser(PNeXusUser1 &user) { fUser = user; }
|
||||
virtual void SetSample(PNeXusSample1 &sample) { fSample = sample; }
|
||||
@ -321,16 +320,16 @@ class PNeXusEntry1 {
|
||||
virtual void SetData(PNeXusData1 &data) { fData = data; }
|
||||
|
||||
private:
|
||||
string fProgramName; ///< name of the creating program
|
||||
string fProgramVersion; ///< version of the creating program
|
||||
std::string fProgramName; ///< name of the creating program
|
||||
std::string fProgramVersion; ///< version of the creating program
|
||||
int fRunNumber; ///< run number
|
||||
string fTitle; ///< string containing the run title
|
||||
string fNotes; ///< comments
|
||||
string fAnalysis; ///< type of muon experiment "muonTD", "ALC", ...
|
||||
string fLaboratory; ///< name of the laboratory where the data are taken, e.g. PSI, triumf, ISIS, J-Parc
|
||||
string fBeamline; ///< name of the beamline used for the experiment, e.g. muE4
|
||||
string fStartTime; ///< start date/time of the run
|
||||
string fStopTime; ///< stop date/time of the run
|
||||
std::string fTitle; ///< string containing the run title
|
||||
std::string fNotes; ///< comments
|
||||
std::string fAnalysis; ///< type of muon experiment "muonTD", "ALC", ...
|
||||
std::string fLaboratory; ///< name of the laboratory where the data are taken, e.g. PSI, triumf, ISIS, J-Parc
|
||||
std::string fBeamline; ///< name of the beamline used for the experiment, e.g. muE4
|
||||
std::string fStartTime; ///< start date/time of the run
|
||||
std::string fStopTime; ///< stop date/time of the run
|
||||
int fSwitchingState; ///< '1' normal data collection, '2' Red/Green mode
|
||||
PNeXusUser1 fUser; ///< NXuser info IDF Version 1
|
||||
PNeXusSample1 fSample; ///< NXsample info IDF Version 1
|
||||
@ -345,18 +344,18 @@ class PNeXusSource2 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual string GetType() { return fType; }
|
||||
virtual string GetProbe() { return fProbe; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual std::string GetType() { return fType; }
|
||||
virtual std::string GetProbe() { return fProbe; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetType(string type) { fType = type; }
|
||||
virtual void SetProbe(string probe) { fProbe = probe; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetType(std::string type) { fType = type; }
|
||||
virtual void SetProbe(std::string probe) { fProbe = probe; }
|
||||
|
||||
private:
|
||||
string fName; ///< facility name
|
||||
string fType; ///< continous muon source, pulsed muon source, low energy muon source, ...
|
||||
string fProbe; ///< positive muon, negative muon
|
||||
std::string fName; ///< facility name
|
||||
std::string fType; ///< continous muon source, pulsed muon source, low energy muon source, ...
|
||||
std::string fProbe; ///< positive muon, negative muon
|
||||
};
|
||||
|
||||
class PNeXusBeamline2 {
|
||||
@ -366,12 +365,12 @@ class PNeXusBeamline2 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
|
||||
private:
|
||||
string fName;
|
||||
std::string fName;
|
||||
};
|
||||
|
||||
class PNeXusDetector2 {
|
||||
@ -380,21 +379,21 @@ class PNeXusDetector2 {
|
||||
virtual ~PNeXusDetector2();
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
virtual string GetErrorMsg() { return fErrorMsg; }
|
||||
virtual std::string GetErrorMsg() { return fErrorMsg; }
|
||||
|
||||
virtual string GetDescription() { return fDescription; }
|
||||
virtual double GetTimeResolution(string units);
|
||||
virtual vector<double> *GetRawTime() { return &fRawTime; }
|
||||
virtual string GetRawTimeName() { return fRawTimeName; }
|
||||
virtual string GetRawTimeUnit() { return fRawTimeUnit; }
|
||||
virtual bool IsT0Present() { return (fT0 == 0) ? false : true; }
|
||||
virtual std::string GetDescription() { return fDescription; }
|
||||
virtual double GetTimeResolution(std::string units);
|
||||
virtual std::vector<double> *GetRawTime() { return &fRawTime; }
|
||||
virtual std::string GetRawTimeName() { return fRawTimeName; }
|
||||
virtual std::string GetRawTimeUnit() { return fRawTimeUnit; }
|
||||
virtual bool IsT0Present() { return (fT0 == nullptr) ? false : true; }
|
||||
virtual int GetT0Tag() { return fT0Tag; }
|
||||
virtual int GetT0(int idxp=-1, int idxs=-1);
|
||||
virtual int* GetT0s() { return fT0; }
|
||||
virtual bool IsFirstGoodBinPresent() { return (fFirstGoodBin == 0) ? false : true; }
|
||||
virtual bool IsFirstGoodBinPresent() { return (fFirstGoodBin == nullptr) ? false : true; }
|
||||
virtual int GetFirstGoodBin(int idxp=-1, int idxs=-1);
|
||||
virtual int* GetFirstGoodBins() { return fFirstGoodBin; }
|
||||
virtual bool IsLastGoodBinPresent() { return (fLastGoodBin == 0) ? false : true; }
|
||||
virtual bool IsLastGoodBinPresent() { return (fLastGoodBin == nullptr) ? false : true; }
|
||||
virtual int GetLastGoodBin(int idxp=-1, int idxs=-1);
|
||||
virtual int* GetLastGoodBins() { return fLastGoodBin; }
|
||||
virtual int GetNoOfPeriods() { return fNoOfPeriods; }
|
||||
@ -403,14 +402,14 @@ class PNeXusDetector2 {
|
||||
virtual int GetHistoValue(int idx_p, int idx_s, int idx_b);
|
||||
virtual int* GetHistos() { return fHisto; }
|
||||
virtual unsigned int GetSpectrumIndexSize() { return fSpectrumIndex.size(); }
|
||||
virtual vector<int> *GetSpectrumIndex() { return &fSpectrumIndex; }
|
||||
virtual std::vector<int> *GetSpectrumIndex() { return &fSpectrumIndex; }
|
||||
virtual int GetSpectrumIndex(unsigned int idx);
|
||||
|
||||
virtual void SetDescription(string description) { fDescription = description; }
|
||||
virtual void SetTimeResolution(double val, string units);
|
||||
virtual void SetRawTime(vector<double> &rawTime);
|
||||
virtual void SetRawTimeName(string rawTimeName) { fRawTimeName = rawTimeName; }
|
||||
virtual void SetRawTimeUnit(string rawTimeUnit) { fRawTimeUnit = rawTimeUnit; }
|
||||
virtual void SetDescription(std::string description) { fDescription = description; }
|
||||
virtual void SetTimeResolution(double val, std::string units);
|
||||
virtual void SetRawTime(std::vector<double> &rawTime);
|
||||
virtual void SetRawTimeName(std::string rawTimeName) { fRawTimeName = rawTimeName; }
|
||||
virtual void SetRawTimeUnit(std::string rawTimeUnit) { fRawTimeUnit = rawTimeUnit; }
|
||||
virtual void SetT0Tag(int tag) { fT0Tag = tag; }
|
||||
virtual int SetT0(int *t0);
|
||||
virtual int SetFirstGoodBin(int *fgb);
|
||||
@ -419,17 +418,17 @@ class PNeXusDetector2 {
|
||||
virtual void SetNoOfSpectra(int val) { fNoOfSpectra = val; }
|
||||
virtual void SetNoOfBins(int val) { fNoOfBins = val; }
|
||||
virtual int SetHistos(int *histo);
|
||||
virtual void SetSpectrumIndex(vector<int> spectIdx) { fSpectrumIndex = spectIdx; }
|
||||
virtual void SetSpectrumIndex(std::vector<int> spectIdx) { fSpectrumIndex = spectIdx; }
|
||||
virtual void SetSpectrumIndex(int spectIdx, int idx=-1);
|
||||
|
||||
private:
|
||||
string fErrorMsg; ///< internal error message
|
||||
string fDescription; ///< description of the detector
|
||||
std::string fErrorMsg; ///< internal error message
|
||||
std::string fDescription; ///< description of the detector
|
||||
double fTimeResolution; ///< keeps the time resolution in (ps)
|
||||
vector<int> fSpectrumIndex; ///< list of global spectra
|
||||
vector<double> fRawTime; ///< keeps a raw time vector
|
||||
string fRawTimeName; ///< name of the raw time vector
|
||||
string fRawTimeUnit; ///< unit of the raw time vector
|
||||
std::vector<int> fSpectrumIndex; ///< list of global spectra
|
||||
std::vector<double> fRawTime; ///< keeps a raw time vector
|
||||
std::string fRawTimeName; ///< name of the raw time vector
|
||||
std::string fRawTimeUnit; ///< unit of the raw time vector
|
||||
|
||||
int fNoOfPeriods; ///< number of periods or -1 if not defined
|
||||
int fNoOfSpectra; ///< number of spectra or -1 if not defined
|
||||
@ -449,18 +448,18 @@ class PNeXusInstrument2 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual PNeXusSource2* GetSource() { return &fSource; }
|
||||
virtual PNeXusBeamline2* GetBeamline() { return &fBeamline; }
|
||||
virtual PNeXusDetector2* GetDetector() { return &fDetector; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetSource(PNeXusSource2 &source) { fSource = source; }
|
||||
virtual void SetBeamline(PNeXusBeamline2 &beamline) { fBeamline = beamline; }
|
||||
virtual void SetDetector(PNeXusDetector2 &detector) { fDetector = detector; }
|
||||
|
||||
private:
|
||||
string fName; ///< name of the instrument
|
||||
std::string fName; ///< name of the instrument
|
||||
PNeXusSource2 fSource; ///< details of the muon source used
|
||||
PNeXusBeamline2 fBeamline; ///< beamline description
|
||||
PNeXusDetector2 fDetector; ///< details of the detectors which also includes the data!!
|
||||
@ -473,28 +472,28 @@ class PNeXusSample2 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual string GetDescription() { return fDescription; }
|
||||
virtual string GetMagneticFieldState() { return fMagneticFieldState; }
|
||||
virtual string GetEnvironmentTemp() { return fEnvironmentTemp; }
|
||||
virtual string GetEnvironmentField() { return fEnvironmentField; }
|
||||
virtual double GetPhysPropValue(string name, bool &ok);
|
||||
virtual void GetPhysPropUnit(string name, string &unit, bool &ok);
|
||||
virtual std::string GetName() { return fName; }
|
||||
virtual std::string GetDescription() { return fDescription; }
|
||||
virtual std::string GetMagneticFieldState() { return fMagneticFieldState; }
|
||||
virtual std::string GetEnvironmentTemp() { return fEnvironmentTemp; }
|
||||
virtual std::string GetEnvironmentField() { return fEnvironmentField; }
|
||||
virtual double GetPhysPropValue(std::string name, bool &ok);
|
||||
virtual void GetPhysPropUnit(std::string name, std::string &unit, bool &ok);
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetDescription(string description) { fDescription = description; }
|
||||
virtual void SetMagneticFieldState(string magFieldState) { fMagneticFieldState = magFieldState; }
|
||||
virtual void SetEnvironmentTemp(string env) { fEnvironmentTemp = env; }
|
||||
virtual void SetEnvironmentField(string env) { fEnvironmentField = env; }
|
||||
virtual void SetPhysProp(string name, double value, string unit, int idx=-1);
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
virtual void SetDescription(std::string description) { fDescription = description; }
|
||||
virtual void SetMagneticFieldState(std::string magFieldState) { fMagneticFieldState = magFieldState; }
|
||||
virtual void SetEnvironmentTemp(std::string env) { fEnvironmentTemp = env; }
|
||||
virtual void SetEnvironmentField(std::string env) { fEnvironmentField = env; }
|
||||
virtual void SetPhysProp(std::string name, double value, std::string unit, int idx=-1);
|
||||
|
||||
private:
|
||||
string fName; ///< sample name
|
||||
string fDescription; ///< sample description
|
||||
string fMagneticFieldState; ///< magnetic field state, e.g. TF, ZF, ...
|
||||
string fEnvironmentTemp; ///< sample environment related to temperature, e.g. CCR, Konti-1, ...
|
||||
string fEnvironmentField; ///< sample environment related to field, e.g. WEW-Bruker
|
||||
vector<PNeXusProp> fPhysProp; ///< collects the temperature, magnetic field
|
||||
std::string fName; ///< sample name
|
||||
std::string fDescription; ///< sample description
|
||||
std::string fMagneticFieldState; ///< magnetic field state, e.g. TF, ZF, ...
|
||||
std::string fEnvironmentTemp; ///< sample environment related to temperature, e.g. CCR, Konti-1, ...
|
||||
std::string fEnvironmentField; ///< sample environment related to field, e.g. WEW-Bruker
|
||||
std::vector<PNeXusProp> fPhysProp; ///< collects the temperature, magnetic field
|
||||
};
|
||||
|
||||
class PNeXusUser2 {
|
||||
@ -504,12 +503,12 @@ class PNeXusUser2 {
|
||||
|
||||
virtual bool IsValid(bool strict) { return true; } // currently only a dummy
|
||||
|
||||
virtual string GetName() { return fName; }
|
||||
virtual std::string GetName() { return fName; }
|
||||
|
||||
virtual void SetName(string name) { fName = name; }
|
||||
virtual void SetName(std::string name) { fName = name; }
|
||||
|
||||
private:
|
||||
string fName; ///< user name
|
||||
std::string fName; ///< user name
|
||||
};
|
||||
|
||||
class PNeXusEntry2 {
|
||||
@ -519,41 +518,41 @@ class PNeXusEntry2 {
|
||||
|
||||
virtual bool IsValid(bool strict);
|
||||
|
||||
virtual string GetErrorMsg() { return fErrorMsg; }
|
||||
virtual string GetDefinition() { return fDefinition; }
|
||||
virtual string GetProgramName() { return fProgramName; }
|
||||
virtual string GetProgramVersion() { return fProgramVersion; }
|
||||
virtual std::string GetErrorMsg() { return fErrorMsg; }
|
||||
virtual std::string GetDefinition() { return fDefinition; }
|
||||
virtual std::string GetProgramName() { return fProgramName; }
|
||||
virtual std::string GetProgramVersion() { return fProgramVersion; }
|
||||
virtual int GetRunNumber() { return fRunNumber; }
|
||||
virtual string GetTitle() { return fTitle; }
|
||||
virtual string GetStartTime() { return fStartTime; }
|
||||
virtual string GetStopTime() { return fStopTime; }
|
||||
virtual string GetExperimentIdentifier() { return fExperimentIdentifier; }
|
||||
virtual std::string GetTitle() { return fTitle; }
|
||||
virtual std::string GetStartTime() { return fStartTime; }
|
||||
virtual std::string GetStopTime() { return fStopTime; }
|
||||
virtual std::string GetExperimentIdentifier() { return fExperimentIdentifier; }
|
||||
virtual PNeXusUser2* GetUser() { return &fUser; }
|
||||
virtual PNeXusSample2* GetSample() { return &fSample; }
|
||||
virtual PNeXusInstrument2* GetInstrument() { return &fInstrument; }
|
||||
|
||||
virtual void SetDefinition(string def) { fDefinition = def; }
|
||||
virtual void SetProgramName(string name) { fProgramName = name; }
|
||||
virtual void SetProgramVersion(string version) { fProgramVersion = version; }
|
||||
virtual void SetDefinition(std::string def) { fDefinition = def; }
|
||||
virtual void SetProgramName(std::string name) { fProgramName = name; }
|
||||
virtual void SetProgramVersion(std::string version) { fProgramVersion = version; }
|
||||
virtual void SetRunNumber(int number) { fRunNumber = number; }
|
||||
virtual void SetTitle(string title) { fTitle = title; }
|
||||
virtual int SetStartTime(string time);
|
||||
virtual int SetStopTime(string time);
|
||||
virtual void SetExperimentIdentifier(string expId) { fExperimentIdentifier = expId; }
|
||||
virtual void SetTitle(std::string title) { fTitle = title; }
|
||||
virtual int SetStartTime(std::string time);
|
||||
virtual int SetStopTime(std::string time);
|
||||
virtual void SetExperimentIdentifier(std::string expId) { fExperimentIdentifier = expId; }
|
||||
virtual void SetUser(PNeXusUser2 &user) { fUser = user; }
|
||||
virtual void SetSample(PNeXusSample2 &sample) { fSample = sample; }
|
||||
virtual void SetInstrument(PNeXusInstrument2 &instrument) { fInstrument = instrument; }
|
||||
|
||||
private:
|
||||
string fErrorMsg; ///< internal error message
|
||||
string fDefinition; ///< the template (DTD name) on which the entry was based, e.g. 'pulsedTD'
|
||||
string fProgramName; ///< name of the creating program
|
||||
string fProgramVersion; ///< version of the creating program
|
||||
std::string fErrorMsg; ///< internal error message
|
||||
std::string fDefinition; ///< the template (DTD name) on which the entry was based, e.g. 'pulsedTD'
|
||||
std::string fProgramName; ///< name of the creating program
|
||||
std::string fProgramVersion; ///< version of the creating program
|
||||
int fRunNumber; ///< run number
|
||||
string fTitle; ///< string containing the run title
|
||||
string fStartTime; ///< start date/time of the run
|
||||
string fStopTime; ///< stop date/time of the run
|
||||
string fExperimentIdentifier; ///< experiment number, (for ISIS, the RB number)
|
||||
std::string fTitle; ///< string containing the run title
|
||||
std::string fStartTime; ///< start date/time of the run
|
||||
std::string fStopTime; ///< stop date/time of the run
|
||||
std::string fExperimentIdentifier; ///< experiment number, (for ISIS, the RB number)
|
||||
PNeXusUser2 fUser; ///< NXuser info IDF Version 2
|
||||
PNeXusSample2 fSample; ///< NXsample info IDF Version 2
|
||||
PNeXusInstrument2 fInstrument; ///< NXinstrument inf IDF Version 2
|
||||
@ -566,56 +565,56 @@ class PNeXus {
|
||||
virtual ~PNeXus();
|
||||
|
||||
virtual int GetIdfVersion() { return fIdfVersion; }
|
||||
virtual string GetFileName() { return fFileName; }
|
||||
virtual string GetFileTime() { return fFileTime; }
|
||||
virtual std::string GetFileName() { return fFileName; }
|
||||
virtual std::string GetFileTime() { return fFileTime; }
|
||||
|
||||
virtual void SetIdfVersion(unsigned int idf);
|
||||
virtual void SetFileName(string name) { fFileName = name; }
|
||||
virtual void SetFileTime(string time) { fFileTime = time; }
|
||||
virtual void SetFileName(std::string name) { fFileName = name; }
|
||||
virtual void SetFileTime(std::string time) { fFileTime = time; }
|
||||
|
||||
virtual PNeXusEntry1* GetEntryIdf1() { return fNxEntry1; }
|
||||
virtual PNeXusEntry2* GetEntryIdf2() { return fNxEntry2; }
|
||||
|
||||
virtual bool IsValid(bool strict=false);
|
||||
virtual int GetErrorCode() { return fErrorCode; }
|
||||
virtual string GetErrorMsg() { return fErrorMsg; }
|
||||
virtual std::string GetErrorMsg() { return fErrorMsg; }
|
||||
|
||||
virtual vector<unsigned int>* GetGroupedHisto(unsigned int idx);
|
||||
virtual std::vector<unsigned int>* GetGroupedHisto(unsigned int idx);
|
||||
|
||||
virtual int ReadFile(const char *fileName);
|
||||
virtual int WriteFile(const char *fileName, const char *fileType="hdf4", const unsigned int idf=2);
|
||||
|
||||
virtual void SetCreator(string str) { fCreator = str; }
|
||||
virtual void SetCreator(std::string str) { fCreator = str; }
|
||||
|
||||
virtual void Dump();
|
||||
|
||||
private:
|
||||
bool fValid;
|
||||
int fErrorCode;
|
||||
string fErrorMsg;
|
||||
std::string fErrorMsg;
|
||||
|
||||
string fNeXusVersion; ///< version of the NeXus API used in writing the file
|
||||
string fFileFormatVersion; ///< version of the HDF, HDF5, or XML library used to create the file (IDF 2 only)
|
||||
std::string fNeXusVersion; ///< version of the NeXus API used in writing the file
|
||||
std::string fFileFormatVersion; ///< version of the HDF, HDF5, or XML library used to create the file (IDF 2 only)
|
||||
|
||||
unsigned int fIdfVersion; ///< version of the instrument definition
|
||||
string fFileName; ///< file name of the original NeXus file to assist identification if the external name has been changed
|
||||
string fFileTime; ///< date and time of file creating (IDF 2 only)
|
||||
std::string fFileName; ///< file name of the original NeXus file to assist identification if the external name has been changed
|
||||
std::string fFileTime; ///< date and time of file creating (IDF 2 only)
|
||||
NXhandle fFileHandle;
|
||||
|
||||
string fCreator; ///< facility of program where the file originated
|
||||
std::string fCreator; ///< facility of program where the file originated
|
||||
|
||||
PNeXusEntry1 *fNxEntry1; ///< NXentry for IDF 1
|
||||
PNeXusEntry2 *fNxEntry2; ///< NXentry for IDF 2
|
||||
|
||||
vector< vector<unsigned int> > fGroupedHisto;
|
||||
std::vector< std::vector<unsigned int> > fGroupedHisto;
|
||||
|
||||
virtual void Init();
|
||||
virtual bool ErrorHandler(NXstatus status, int errCode, const string &errMsg);
|
||||
virtual NXstatus GetStringData(string &str);
|
||||
virtual NXstatus GetStringAttr(string attr, string &str);
|
||||
virtual bool ErrorHandler(NXstatus status, int errCode, const std::string &errMsg);
|
||||
virtual NXstatus GetStringData(std::string &str);
|
||||
virtual NXstatus GetStringAttr(std::string attr, std::string &str);
|
||||
virtual int GetDataSize(int type);
|
||||
virtual NXstatus GetDoubleVectorData(vector<double> &data);
|
||||
virtual NXstatus GetIntVectorData(vector<int> &data);
|
||||
virtual NXstatus GetDoubleVectorData(std::vector<double> &data);
|
||||
virtual NXstatus GetIntVectorData(std::vector<int> &data);
|
||||
|
||||
virtual int ReadFileIdf1();
|
||||
virtual int ReadFileIdf2();
|
||||
@ -628,8 +627,8 @@ class PNeXus {
|
||||
virtual bool IsValidIdf1(bool strict);
|
||||
virtual bool IsValidIdf2(bool strict);
|
||||
|
||||
virtual bool SearchInGroup(string str, string tag, NXname &nxname, NXname &nxclass, int &dataType);
|
||||
virtual bool SearchAttrInData(string str, int &length, int &dataType);
|
||||
virtual bool SearchInGroup(std::string str, std::string tag, NXname &nxname, NXname &nxclass, int &dataType);
|
||||
virtual bool SearchAttrInData(std::string str, int &length, int &dataType);
|
||||
};
|
||||
|
||||
#endif // _PNEXUS_H_
|
||||
|
Reference in New Issue
Block a user