Merged muonspin/musrfit:root6 into master
This commit is contained in:
commit
7279de07ff
207
src/external/BMWtools/BMWIntegrator.cpp
vendored
207
src/external/BMWtools/BMWIntegrator.cpp
vendored
@ -35,8 +35,186 @@
|
||||
#define SEED 0
|
||||
#define STATEFILE NULL
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TPointPWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - value of the integral
|
||||
*/
|
||||
double TPointPWaveGapIntegralCuhre::IntegrateFunc(int tag)
|
||||
{
|
||||
const unsigned int NCOMP(1);
|
||||
const unsigned int NVEC(1);
|
||||
const double EPSREL (1e-4);
|
||||
const double EPSABS (1e-6);
|
||||
const unsigned int VERBOSE (0);
|
||||
const unsigned int LAST (4);
|
||||
const unsigned int MINEVAL (0);
|
||||
const unsigned int MAXEVAL (50000);
|
||||
|
||||
const unsigned int KEY (13);
|
||||
|
||||
int nregions, neval, fail;
|
||||
double integral[NCOMP], error[NCOMP], prob[NCOMP];
|
||||
|
||||
if (tag == 0)
|
||||
Cuhre(fNDim, NCOMP, Integrand_aa, USERDATA, NVEC,
|
||||
EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL,
|
||||
KEY, STATEFILE, SPIN,
|
||||
&nregions, &neval, &fail, integral, error, prob);
|
||||
else
|
||||
Cuhre(fNDim, NCOMP, Integrand_cc, USERDATA, NVEC,
|
||||
EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL,
|
||||
KEY, STATEFILE, SPIN,
|
||||
&nregions, &neval, &fail, integral, error, prob);
|
||||
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
* for p-wave point, aa==bb component
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - 0
|
||||
*
|
||||
* \param ndim number of dimensions of the integral (2 here)
|
||||
* \param x point where the function should be evaluated
|
||||
* \param ncomp number of components of the integrand (1 here)
|
||||
* \param f function value
|
||||
* \param userdata additional user parameters (required by the interface, NULL here)
|
||||
*/
|
||||
int TPointPWaveGapIntegralCuhre::Integrand_aa(const int *ndim, const double x[],
|
||||
const int *ncomp, double f[], void *userdata) // x = {E, z}, fPar = {twokBT, Delta(T), Ec, zc}
|
||||
{
|
||||
double z = x[1]*fPar[3];
|
||||
double deltasq(pow(sqrt(1.0-z*z)*fPar[1],2.0));
|
||||
f[0] = (1.0-z*z)/TMath::Power(TMath::CosH(TMath::Sqrt(x[0]*x[0]*fPar[2]*fPar[2]+deltasq)/fPar[0]),2.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
* for p-wave point, cc component
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - 0
|
||||
*
|
||||
* \param ndim number of dimensions of the integral (2 here)
|
||||
* \param x point where the function should be evaluated
|
||||
* \param ncomp number of components of the integrand (1 here)
|
||||
* \param f function value
|
||||
* \param userdata additional user parameters (required by the interface, NULL here)
|
||||
*/
|
||||
int TPointPWaveGapIntegralCuhre::Integrand_cc(const int *ndim, const double x[],
|
||||
const int *ncomp, double f[], void *userdata) // x = {E, z}, fPar = {twokBT, Delta(T), Ec, zc}
|
||||
{
|
||||
double z = x[1]*fPar[3];
|
||||
double deltasq(pow(sqrt(1.0-z*z)*fPar[1],2.0));
|
||||
f[0] = (z*z)/TMath::Power(TMath::CosH(TMath::Sqrt(x[0]*x[0]*fPar[2]*fPar[2]+deltasq)/fPar[0]),2.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TLinePWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - value of the integral
|
||||
*/
|
||||
double TLinePWaveGapIntegralCuhre::IntegrateFunc(int tag)
|
||||
{
|
||||
const unsigned int NCOMP(1);
|
||||
const unsigned int NVEC(1);
|
||||
const double EPSREL (1e-4);
|
||||
const double EPSABS (1e-6);
|
||||
const unsigned int VERBOSE (0);
|
||||
const unsigned int LAST (4);
|
||||
const unsigned int MINEVAL (0);
|
||||
const unsigned int MAXEVAL (50000);
|
||||
|
||||
const unsigned int KEY (13);
|
||||
|
||||
int nregions, neval, fail;
|
||||
double integral[NCOMP], error[NCOMP], prob[NCOMP];
|
||||
|
||||
if (tag == 0)
|
||||
Cuhre(fNDim, NCOMP, Integrand_aa, USERDATA, NVEC,
|
||||
EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL,
|
||||
KEY, STATEFILE, SPIN,
|
||||
&nregions, &neval, &fail, integral, error, prob);
|
||||
else
|
||||
Cuhre(fNDim, NCOMP, Integrand_cc, USERDATA, NVEC,
|
||||
EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL,
|
||||
KEY, STATEFILE, SPIN,
|
||||
&nregions, &neval, &fail, integral, error, prob);
|
||||
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
* for p-wave line, aa==bb component
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - 0
|
||||
*
|
||||
* \param ndim number of dimensions of the integral (2 here)
|
||||
* \param x point where the function should be evaluated
|
||||
* \param ncomp number of components of the integrand (1 here)
|
||||
* \param f function value
|
||||
* \param userdata additional user parameters (required by the interface, NULL here)
|
||||
*/
|
||||
int TLinePWaveGapIntegralCuhre::Integrand_aa(const int *ndim, const double x[],
|
||||
const int *ncomp, double f[], void *userdata) // x = {E, z}, fPar = {twokBT, Delta(T), Ec, zc}
|
||||
{
|
||||
double z = x[1]*fPar[3];
|
||||
double deltasq(pow(z*fPar[1],2.0));
|
||||
f[0] = (1.0-z*z)/TMath::Power(TMath::CosH(TMath::Sqrt(x[0]*x[0]*fPar[2]*fPar[2]+deltasq)/fPar[0]),2.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
* for p-wave line, cc component
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - 0
|
||||
*
|
||||
* \param ndim number of dimensions of the integral (2 here)
|
||||
* \param x point where the function should be evaluated
|
||||
* \param ncomp number of components of the integrand (1 here)
|
||||
* \param f function value
|
||||
* \param userdata additional user parameters (required by the interface, NULL here)
|
||||
*/
|
||||
int TLinePWaveGapIntegralCuhre::Integrand_cc(const int *ndim, const double x[],
|
||||
const int *ncomp, double f[], void *userdata) // x = {E, z}, fPar = {twokBT, Delta(T), Ec, zc}
|
||||
{
|
||||
double z = x[1]*fPar[3];
|
||||
double deltasq(pow(z*fPar[1],2.0));
|
||||
f[0] = (z*z)/TMath::Power(TMath::CosH(TMath::Sqrt(x[0]*x[0]*fPar[2]*fPar[2]+deltasq)/fPar[0]),2.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TDWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -67,6 +245,7 @@ double TDWaveGapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
@ -87,8 +266,11 @@ int TDWaveGapIntegralCuhre::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TCosSqDWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -119,6 +301,7 @@ double TCosSqDWaveGapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
@ -139,8 +322,11 @@ int TCosSqDWaveGapIntegralCuhre::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TSinSqDWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -171,6 +357,7 @@ double TSinSqDWaveGapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
@ -191,8 +378,11 @@ int TSinSqDWaveGapIntegralCuhre::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TAnSWaveGapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -223,6 +413,7 @@ double TAnSWaveGapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
@ -243,8 +434,11 @@ int TAnSWaveGapIntegralCuhre::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TAnSWaveGapIntegralDivonne::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Divonne interface
|
||||
*
|
||||
@ -283,6 +477,7 @@ double TAnSWaveGapIntegralDivonne::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Divonne---actual implementation of the function
|
||||
*
|
||||
@ -303,8 +498,11 @@ int TAnSWaveGapIntegralDivonne::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TAnSWaveGapIntegralSuave::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Suave interface
|
||||
*
|
||||
@ -337,6 +535,7 @@ double TAnSWaveGapIntegralSuave::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Suave---actual implementation of the function
|
||||
*
|
||||
@ -357,8 +556,11 @@ int TAnSWaveGapIntegralSuave::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TNonMonDWave1GapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -389,6 +591,7 @@ double TNonMonDWave1GapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
@ -409,8 +612,11 @@ int TNonMonDWave1GapIntegralCuhre::Integrand(const int *ndim, const double x[],
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> TNonMonDWave2GapIntegralCuhre::fPar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Integrate the function using the Cuhre interface
|
||||
*
|
||||
@ -441,6 +647,7 @@ double TNonMonDWave2GapIntegralCuhre::IntegrateFunc()
|
||||
return integral[0];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value for the use with Cuhre---actual implementation of the function
|
||||
*
|
||||
|
151
src/external/BMWtools/BMWIntegrator.h
vendored
151
src/external/BMWtools/BMWIntegrator.h
vendored
@ -36,6 +36,7 @@
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <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.
|
||||
@ -54,6 +55,7 @@ class T2Integrator {
|
||||
static double FuncAtXgsl(double, void *);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Method for passing the integrand function value to the integrator.
|
||||
*
|
||||
@ -69,6 +71,7 @@ inline double T2Integrator::FuncAtXgsl(double x, void *ptrPair)
|
||||
return pairOfPointers->first->FuncAtX(x, *(pairOfPointers->second));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the integral of the function between the given boundaries
|
||||
*
|
||||
@ -93,20 +96,7 @@ inline double T2Integrator::IntegrateFunc(double x1, double x2, const std::vecto
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Base class for 1D integrations using the GNU Scientific Library integrator.
|
||||
* The function which should be integrated has to be implemented in a derived class.
|
||||
@ -129,6 +119,7 @@ class TIntegrator {
|
||||
mutable double (*fFunc)(double, void *); ///< pointer to the integrand function
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Constructor of the base class for 1D integrations
|
||||
* Allocation of memory for an integration using the adaptive 31 point Gauss-Kronrod rule
|
||||
@ -137,6 +128,7 @@ inline TIntegrator::TIntegrator() : fFunc(0) {
|
||||
fIntegrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Destructor of the base class for 1D integrations
|
||||
* Clean up.
|
||||
@ -148,6 +140,7 @@ inline TIntegrator::~TIntegrator(){
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Method for passing the integrand function value to the integrator.
|
||||
*
|
||||
@ -162,6 +155,7 @@ inline double TIntegrator::FuncAtXgsl(double x, void *obj)
|
||||
return ((TIntegrator*)obj)->FuncAtX(x);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the integral of the function between the given boundaries
|
||||
*
|
||||
@ -177,6 +171,7 @@ inline double TIntegrator::IntegrateFunc(double x1, double x2)
|
||||
return fIntegrator->Integral(fFunc, (this), x1, x2);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Base class for multidimensional Monte-Carlo integrations using the GNU Scientific Library integrator.
|
||||
* The function which should be integrated has to be implemented in a derived class.
|
||||
@ -199,6 +194,7 @@ class TMCIntegrator {
|
||||
mutable double (*fFunc)(double *, size_t, void *); ///< pointer to the integrand function
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Constructor of the base class for multidimensional Monte-Carlo integrations
|
||||
* Allocation of memory for an integration using the MISER algorithm of Press and Farrar
|
||||
@ -207,6 +203,7 @@ inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
||||
fMCIntegrator = new ROOT::Math::GSLMCIntegrator(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Destructor of the base class for 1D integrations
|
||||
* Clean up.
|
||||
@ -218,6 +215,7 @@ inline TMCIntegrator::~TMCIntegrator(){
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Method for passing the integrand function value to the integrator.
|
||||
*
|
||||
@ -233,6 +231,7 @@ inline double TMCIntegrator::FuncAtXgsl(double *x, size_t dim, void *obj)
|
||||
return ((TMCIntegrator*)obj)->FuncAtX(x);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the integral of the function between the given boundaries
|
||||
*
|
||||
@ -249,6 +248,47 @@ inline double TMCIntegrator::IntegrateFunc(size_t dim, double *x1, double *x2)
|
||||
return fMCIntegrator->Integral(fFunc, dim, x1, x2, (this));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a point p symmetry of the superconducting order parameter.
|
||||
* The integration uses the Cuhre algorithm of the Cuba library.
|
||||
*/
|
||||
class TPointPWaveGapIntegralCuhre {
|
||||
public:
|
||||
TPointPWaveGapIntegralCuhre() : fNDim(2) {}
|
||||
~TPointPWaveGapIntegralCuhre() { fPar.clear(); }
|
||||
void SetParameters(const std::vector<double> &par) { fPar=par; }
|
||||
static int Integrand_aa(const int*, const double[], const int*, double[], void*);
|
||||
static int Integrand_cc(const int*, const double[], const int*, double[], void*);
|
||||
double IntegrateFunc(int tag);
|
||||
|
||||
protected:
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a line p symmetry of the superconducting order parameter.
|
||||
* The integration uses the Cuhre algorithm of the Cuba library.
|
||||
*/
|
||||
class TLinePWaveGapIntegralCuhre {
|
||||
public:
|
||||
TLinePWaveGapIntegralCuhre() : fNDim(2) {}
|
||||
~TLinePWaveGapIntegralCuhre() { fPar.clear(); }
|
||||
void SetParameters(const std::vector<double> &par) { fPar=par; }
|
||||
static int Integrand_aa(const int*, const double[], const int*, double[], void*);
|
||||
static int Integrand_cc(const int*, const double[], const int*, double[], void*);
|
||||
double IntegrateFunc(int tag);
|
||||
|
||||
protected:
|
||||
static std::vector<double> fPar; ///< parameters of the integrand
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a d_{x^2-y^2} symmetry of the superconducting order parameter.
|
||||
@ -267,6 +307,7 @@ class TDWaveGapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density along the a-axis
|
||||
* within the semi-classical model assuming a cylindrical Fermi surface and a mixed d_{x^2-y^2} + s symmetry of the
|
||||
@ -286,6 +327,7 @@ class TCosSqDWaveGapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density along the b-axis
|
||||
* within the semi-classical model assuming a cylindrical Fermi surface and a mixed d_{x^2-y^2} + s symmetry of the
|
||||
@ -305,6 +347,7 @@ class TSinSqDWaveGapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "anisotropic s-wave" symmetry of the superconducting order parameter.
|
||||
@ -323,6 +366,7 @@ class TAnSWaveGapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "anisotropic s-wave" symmetry of the superconducting order parameter.
|
||||
@ -341,6 +385,7 @@ class TAnSWaveGapIntegralDivonne {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "anisotropic s-wave" symmetry of the superconducting order parameter.
|
||||
@ -359,6 +404,7 @@ class TAnSWaveGapIntegralSuave {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "non-monotonic d-wave" symmetry of the superconducting order parameter.
|
||||
@ -377,6 +423,7 @@ class TNonMonDWave1GapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Two-dimensional integrator class for the efficient calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "non-monotonic d-wave" symmetry of the superconducting order parameter.
|
||||
@ -395,6 +442,7 @@ class TNonMonDWave2GapIntegralCuhre {
|
||||
unsigned int fNDim; ///< dimension of the integral
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Test class for the 2D MC integration
|
||||
* Integral: x*y dx dy
|
||||
@ -406,6 +454,7 @@ class T2DTest : public TMCIntegrator {
|
||||
double FuncAtX(double *) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function x*y
|
||||
*
|
||||
@ -419,6 +468,65 @@ inline double T2DTest::FuncAtX(double *x) const
|
||||
return x[0]*x[1];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 2D Monte-Carlo integration for the calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a point p symmetry of the superconducting order parameter.
|
||||
* The integration uses the GSL integration routines.
|
||||
*/
|
||||
class TPointPWaveGapIntegral : public TMCIntegrator {
|
||||
public:
|
||||
TPointPWaveGapIntegral() {}
|
||||
~TPointPWaveGapIntegral() {}
|
||||
double FuncAtX(double *) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 2D Monte-Carlo integration for the calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a line p symmetry of the superconducting order parameter.
|
||||
* The integration uses the GSL integration routines.
|
||||
*/
|
||||
class TLinePWaveGapIntegral : public TMCIntegrator {
|
||||
public:
|
||||
TLinePWaveGapIntegral() {}
|
||||
~TLinePWaveGapIntegral() {}
|
||||
double FuncAtX(double *) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - function value
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TPointPWaveGapIntegral::FuncAtX(double *x) const // x = {E, theta}, fPar = {T, Delta(T)}
|
||||
{
|
||||
double twokt(2.0*0.08617384436*fPar[0]); // kB in meV/K
|
||||
double deltasq(TMath::Power(fPar[1]*TMath::Sin(x[1]),2.0));
|
||||
return -TMath::Sin(x[1])/(4.0*twokt*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt)*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function
|
||||
*
|
||||
* <p><b>return:</b>
|
||||
* - function value
|
||||
*
|
||||
* \param x point where the function should be evaluated
|
||||
*/
|
||||
inline double TLinePWaveGapIntegral::FuncAtX(double *x) const // x = {E, theta}, fPar = {T, Delta(T)}
|
||||
{
|
||||
double twokt(2.0*0.08617384436*fPar[0]); // kB in meV/K
|
||||
double deltasq(TMath::Power(fPar[1]*TMath::Cos(x[1]),2.0));
|
||||
return -TMath::Sin(x[1])/(4.0*twokt*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt)*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 2D Monte-Carlo integration for the calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and a d_{x^2-y^2} symmetry of the superconducting order parameter.
|
||||
@ -431,6 +539,7 @@ class TDWaveGapIntegral : public TMCIntegrator {
|
||||
double FuncAtX(double *) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function
|
||||
*
|
||||
@ -446,6 +555,7 @@ inline double TDWaveGapIntegral::FuncAtX(double *x) const // x = {E, phi}, fPar
|
||||
return -1.0/(2.0*twokt*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt)*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 2D Monte-Carlo integration for the calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an "anisotropic s-wave" symmetry of the superconducting order parameter.
|
||||
@ -458,6 +568,7 @@ class TAnSWaveGapIntegral : public TMCIntegrator {
|
||||
double FuncAtX(double *) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function
|
||||
*
|
||||
@ -473,6 +584,7 @@ inline double TAnSWaveGapIntegral::FuncAtX(double *x) const // x = {E, phi}, fPa
|
||||
return -1.0/(2.0*twokt*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt)*TMath::CosH(TMath::Sqrt(x[0]*x[0]+deltasq)/twokt));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration of j0(a*x)*exp(-b*x)
|
||||
* The integration uses the GSL integration routines.
|
||||
@ -486,6 +598,7 @@ class TIntBesselJ0Exp : public T2Integrator {
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function j0(a*x)*exp(-b*x)
|
||||
*
|
||||
@ -506,6 +619,7 @@ inline double TIntBesselJ0Exp::FuncAtX(double x, const std::vector<double> &par)
|
||||
return j0 * TMath::Exp(-par[1]*x);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration of sin(a*x)*exp(-b*x*x)
|
||||
* The integration uses the GSL integration routines.
|
||||
@ -519,6 +633,7 @@ class TIntSinGss : public T2Integrator {
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function sin(a*x)*exp(-b*x*x)
|
||||
*
|
||||
@ -532,6 +647,7 @@ inline double TIntSinGss::FuncAtX(double x, const std::vector<double> &par) cons
|
||||
return TMath::Sin(TMath::TwoPi()*par[0]*x) * TMath::Exp(-0.5*par[1]*par[1]*x*x);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration of the "DeRenzi Spin Glass Interpolation Integrand"
|
||||
* See Eq. (5) of R. De Renzi and S. Fanesi, Physica B 289-290, 209-212 (2000).
|
||||
@ -547,6 +663,7 @@ class TIntSGInterpolation : public T2Integrator {
|
||||
double FuncAtX(double, const std::vector<double>&) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function
|
||||
*
|
||||
@ -563,6 +680,7 @@ inline double TIntSGInterpolation::FuncAtX(double x, const std::vector<double> &
|
||||
return (wt*TMath::Cos(wt)-TMath::Sin(wt))/(wt*wt)*TMath::Exp(-TMath::Power(expo,par[3]))/TMath::Power(expo,(1.0-par[3]));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration for the calculation of the superfluid density within the semi-classical model
|
||||
* assuming a cylindrical Fermi surface and an isotropic s-wave symmetry of the superconducting order parameter.
|
||||
@ -575,6 +693,7 @@ class TGapIntegral : public TIntegrator {
|
||||
double FuncAtX(double) const; // variable: E
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the function df/dE * E / sqrt(E^2 - Delta^2)
|
||||
*
|
||||
@ -588,6 +707,7 @@ inline double TGapIntegral::FuncAtX(double e) const
|
||||
return 1.0/(TMath::Power(TMath::CosH(TMath::Sqrt(e*e+fPar[1]*fPar[1])/fPar[0]),2.0));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration for the calculation of the uniaxial static Gauss-Kubo-Toyabe function
|
||||
* The integration uses the GSL integration routines.
|
||||
@ -601,6 +721,7 @@ class TFirstUniaxialGssKTIntegral : public T2Integrator {
|
||||
virtual double FuncAtX(double, const std::vector<double>&) const; // variable: x
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the integrand in Eq. (7) of Solt's article
|
||||
*
|
||||
@ -618,6 +739,7 @@ inline double TFirstUniaxialGssKTIntegral::FuncAtX(double x, const std::vector<d
|
||||
return (1.0 - x*x)*(p - SsqTsq)/TMath::Power(p, 2.5)*TMath::Exp(-0.5*SsqTsq/p);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class for the 1D integration for the calculation of the uniaxial static Gauss-Kubo-Toyabe function
|
||||
* The integration uses the GSL integration routines.
|
||||
@ -631,6 +753,7 @@ class TSecondUniaxialGssKTIntegral : public T2Integrator {
|
||||
virtual double FuncAtX(double, const std::vector<double>&) const; // variable: x
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the function value---actual implementation of the integrand in Eq. (7) of Solt's article
|
||||
*
|
||||
|
2
src/external/libGapIntegrals/CMakeLists.txt
vendored
2
src/external/libGapIntegrals/CMakeLists.txt
vendored
@ -41,7 +41,7 @@ add_library(GapIntegrals SHARED
|
||||
#--- set target properties, e.g. version --------------------------------------
|
||||
set_target_properties(GapIntegrals
|
||||
PROPERTIES
|
||||
VERSION "1.0.0"
|
||||
VERSION "1.1.0"
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
|
BIN
src/external/libGapIntegrals/GapIntegrals.pdf
vendored
BIN
src/external/libGapIntegrals/GapIntegrals.pdf
vendored
Binary file not shown.
90
src/external/libGapIntegrals/GapIntegrals.tex
vendored
90
src/external/libGapIntegrals/GapIntegrals.tex
vendored
@ -74,16 +74,17 @@ E-Mail: & \verb?andreas.suter@psi.ch? &&
|
||||
\section*{\musrfithead plug-in for the calculation of the temperature dependence of $\bm{1/\lambda^2}$ for various gap symmetries}%
|
||||
|
||||
This memo is intended to give a short summary of the background on which the \gapint plug-in for \musrfit \cite{musrfit} has been developed. The aim of this implementation is the efficient calculation of integrals of the form
|
||||
\begin{equation}\label{int}
|
||||
\begin{equation}\label{eq:int_phi}
|
||||
I(T) = 1 + \frac{1}{\pi}\int_0^{2\pi}\int_{\Delta(\varphi,T)}^{\infty}\left(\frac{\partial f}{\partial E}\right) \frac{E}{\sqrt{E^2-\Delta^2(\varphi,T)}}\mathrm{d}E\mathrm{d}\varphi\,,
|
||||
\end{equation}
|
||||
where $f = (1+\exp(E/k_{\mathrm B}T))^{-1}$, like they appear e.g. in the theoretical temperature dependence of $1/\lambda^2$~\cite{Manzano}.
|
||||
In order not to do too many unnecessary function calls during the final numerical evaluation we simplify the integral (\ref{int}) as far as possible analytically. The derivative of $f$ is given by
|
||||
For gap symmetries which involve not only a $E$- and $\varphi$-dependence but also a $\theta$-dependence, see the special section towards the end of the memo.
|
||||
In order not to do too many unnecessary function calls during the final numerical evaluation we simplify the integral (\ref{eq:int_phi}) as far as possible analytically. The derivative of $f$ is given by
|
||||
\begin{equation}\label{derivative}
|
||||
\frac{\partial f}{\partial E} = -\frac{1}{k_{\mathrm B}T}\frac{\exp(E/k_{\mathrm B}T)}{\left(1+\exp(E/k_{\mathrm B}T)\right)^2} = -\frac{1}{4k_{\mathrm B}T} \frac{1}{\cosh^2\left(E/2k_{\mathrm B}T\right)}.
|
||||
\end{equation}
|
||||
Using (\ref{derivative}) and doing the substitution $E'^2 = E^2-\Delta^2(\varphi,T)$, equation (\ref{int}) can be written as
|
||||
\begin{equation}
|
||||
Using (\ref{derivative}) and doing the substitution $E'^2 = E^2-\Delta^2(\varphi,T)$, equation (\ref{eq:int_phi}) can be written as
|
||||
\begin{equation}\label{eq:bmw_2d}
|
||||
\begin{split}
|
||||
I(T) & = 1 - \frac{1}{4\pi k_{\mathrm B}T}\int_0^{2\pi}\int_{\Delta(\varphi,T)}^{\infty}\frac{1}{\cosh^2\left(E/2k_{\mathrm B}T\right)}\frac{E}{\sqrt{E^2-\Delta^2(\varphi,T)}}\mathrm{d}E\mathrm{d}\varphi \\
|
||||
& = 1 - \frac{1}{4\pi k_{\mathrm B}T}\int_0^{2\pi}\int_{0}^{\infty}\frac{1}{\cosh^2\left(\sqrt{E'^2+\Delta^2(\varphi,T)}/2k_{\mathrm B}T\right)}\mathrm{d}E'\mathrm{d}\varphi\,.
|
||||
@ -167,6 +168,22 @@ The \gapint plug-in calculates $\tilde{I}(T)$ for the following $\Delta(\varphi)
|
||||
Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $[c_0~(1),~a_{\rm G}~(1)]$.
|
||||
If $c_0$ and $a_{\rm G}$ are provided, the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used,
|
||||
otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.
|
||||
\item[\textit{p}-wave (point) \cite{Pang2015}:]
|
||||
\begin{equation}
|
||||
\Delta(\theta, T) = \Delta(T) \sin(\theta) = \Delta(T) \cdot \sqrt{1-z^2}
|
||||
\end{equation}
|
||||
\musrfit theory line: \verb?userFcn libGapIntegrals TGapPointPWave 1 2 [3 [4 5]]?\\[1.5ex]
|
||||
Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, [ \verb?orientation_tag?, $[c_0~(1),~a_{\rm G}~(1)]$]. If $c_0$ and $a_{\rm G}$ are provided,
|
||||
the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \\
|
||||
\verb?orientation_tag?: $0=\{aa,bb\}$, $1=cc$, and the default $2=$ average (see Eq.\ (\ref{eq:n_avg}))
|
||||
\item[\textit{p}-wave (line) \cite{Ozaki1986}:]
|
||||
\begin{equation}
|
||||
\Delta(\theta, T) = \Delta(T) \cos(\theta) = \Delta(T) \cdot z
|
||||
\end{equation}
|
||||
\musrfit theory line: \verb?userFcn libGapIntegrals TGapLinePWave 1 2 [3 [4 5]]?\\[1.5ex]
|
||||
Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, [ \verb?orientation_tag?, $[c_0~(1),~a_{\rm G}~(1)]$]. If $c_0$ and $a_{\rm G}$ are provided,
|
||||
the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \\
|
||||
\verb?orientation_tag?: $0=\{aa,bb\}$, $1=cc$, and the default $2=$ average (see Eq.\ (\ref{eq:n_avg}))
|
||||
\end{description}
|
||||
|
||||
\noindent It is also possible to calculate a power law temperature dependence (in the two fluid approximation $n=4$) and the dirty \textit{s}-wave expression.
|
||||
@ -193,6 +210,69 @@ Obviously for this no integration is needed.
|
||||
within the semi-classical model assuming a cylindrical Fermi surface and a mixed $d_{x^2-y^2} + s$ symmetry of the superconducting order parameter
|
||||
(effectively: $d_{x^2-y^2}$ with shifted nodes and \textit{a}-\textit{b}-anisotropy)) see the source code.
|
||||
|
||||
\subsection*{Gap Integrals for $\bm{\theta}$-, and $\bm{(\theta, \varphi)}$-dependent Gaps}%
|
||||
|
||||
First some general formulae as found in Ref.\,\cite{Prozorov}. It assumes an anisotropic response which can be classified in 3 directions ($a$, $b$, and $c$).
|
||||
|
||||
\noindent For the case of a 2D Fermi surface (cylindrical symmetry):
|
||||
|
||||
\begin{equation}\label{eq:n_anisotrope_2D}
|
||||
n_{aa \atop bb}(T) = 1 - \frac{1}{2\pi k_{\rm B} T} \int_0^{2\pi} \mathrm{d}\varphi\, {\cos^2(\varphi) \atop \sin^2(\varphi)} \underbrace{\int_0^\infty \mathrm{d}\varepsilon\, \left\{ \cosh\left[\frac{\sqrt{\varepsilon^2 + \Delta^2}}{2 k_{\rm B}T}\right]\right\}^{-2}}_{= G(\Delta(\varphi), T)}
|
||||
\end{equation}
|
||||
|
||||
\noindent For the case of a 3D Fermi surface:
|
||||
|
||||
\begin{eqnarray}
|
||||
n_{aa \atop bb}(T) &=& 1 - \frac{3}{4\pi k_{\rm B} T} \int_0^1 \mathrm{d}z\, (1-z^2) \int_0^{2\pi} \mathrm{d}\varphi\, {\cos^2(\varphi) \atop \sin^2(\varphi)} \cdot G(\Delta(z,\varphi), T) \label{eq:n_anisotrope_3D_aabb} \\
|
||||
n_{cc}(T) &=& 1 - \frac{3}{2\pi k_{\rm B} T} \int_0^1 \mathrm{d}z\, z^2 \int_0^{2\pi} \mathrm{d}\varphi\, \cos^2(\varphi) \cdot G(\Delta(z,\varphi), T) \label{eq:n_anisotrope_3D_cc}
|
||||
\end{eqnarray}
|
||||
|
||||
\noindent The ``powder averaged'' superfluid density is then defined as
|
||||
|
||||
\begin{equation}\label{eq:n_avg}
|
||||
n_{\rm S} = \frac{1}{3}\cdot \left[ \sqrt{n_{aa} n_{bb}} + \sqrt{n_{aa} n_{cc}} + \sqrt{n_{bb} n_{cc}} \right]
|
||||
\end{equation}
|
||||
|
||||
\subsubsection*{Isotropic s-Wave Gap}
|
||||
|
||||
\noindent For the 2D/3D case this means that $\Delta$ is just a constant.
|
||||
|
||||
\noindent For the 2D case it follows
|
||||
|
||||
\begin{equation}
|
||||
n_{aa \atop bb}(T) = 1 - \frac{1}{2 k_{\rm B} T} \cdot G(\Delta, T) = n_{\rm S}(T).
|
||||
\end{equation}
|
||||
|
||||
\noindent This is the same as Eq.(\ref{eq:bmw_2d}), assuming a $\Delta \neq f(\varphi)$.
|
||||
|
||||
\vspace{5mm}
|
||||
|
||||
\noindent The 3D case for $\Delta \neq f(\theta, \varphi)$:
|
||||
|
||||
\noindent The variable transformation $z = \cos(\theta)$ leads to $\mathrm{d}z = -\sin(\theta)\,\mathrm{d}\theta$, $z=0 \to \theta=\pi/2$, $z=1 \to \theta=0$, and hence to
|
||||
|
||||
\begin{eqnarray*}
|
||||
n_{aa \atop bb}(T) &=& 1 - \frac{3}{4\pi k_{\rm B} T} \underbrace{\int_0^{\pi/2} \mathrm{d}\theta \, \sin^3(\theta)}_{= 2/3} \, \underbrace{\int_0^{2\pi} \mathrm{d}\varphi {\cos^2(\varphi) \atop \sin^2(\varphi)}}_{=\pi} \cdot G(\Delta, T) \\
|
||||
&=& 1 - \frac{1}{2 k_{\rm B} T} \cdot G(\Delta, T). \\
|
||||
n_{cc}(T) &=& 1 - \frac{3}{2\pi k_{\rm B} T} \underbrace{\int_0^{\pi/2} \mathrm{d}\theta \, \cos^2(\theta)\sin(\theta)}_{=1/3} \, \underbrace{\int_0^{2\pi} \mathrm{d}\varphi \cos^2(\varphi)}_{=\pi} \cdot G(\Delta, T) \\
|
||||
&=& 1 - \frac{1}{2 k_{\rm B} T} \cdot G(\Delta, T).
|
||||
\end{eqnarray*}
|
||||
|
||||
\noindent And hence
|
||||
|
||||
$$ n_{\rm S}(T) = 1- \frac{1}{2 k_{\rm B} T} \cdot G(\Delta, T). $$
|
||||
|
||||
\subsubsection*{3D Fermi Surface Gap $\mathbf{\Delta \neq f(\bm\varphi)}$}
|
||||
|
||||
For this case the superfluid density integrals reduce to ($z=\cos(\theta)$)
|
||||
|
||||
\begin{eqnarray}
|
||||
n_{aa \atop bb}(T) &=& 1 - \frac{3}{4 k_{\rm B} T} \int_0^1 \mathrm{d}z\, (1-z^2) \cdot G(\Delta(z, T),T) \\
|
||||
n_{cc}(T) &=& 1 - \frac{3}{2 k_{\rm B} T} \int_0^1 \mathrm{d}z\, z^2 \cdot G(\Delta(z, T),T)
|
||||
\end{eqnarray}
|
||||
|
||||
|
||||
|
||||
\subsection*{License}
|
||||
The \gapint library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation \cite{GPL}; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
@ -208,6 +288,8 @@ The \gapint library is free software; you can redistribute it and/or modify it u
|
||||
\bibitem{Matsui} H.~Matsui~\textit{et al.}, \textit{Direct Observation of a Nonmonotonic $d_{x^2-y^2}$-Wave Superconducting Gap in the Electron-Doped High-T$_{\mathrm c}$ Superconductor Pr$_{0.89}$LaCe$_{0.11}$CuO$_4$}, Phys.~Rev.~Lett.~\textbf{95}~(2005)~017003
|
||||
\bibitem{Eremin} I.~Eremin, E.~Tsoncheva, and A.V.~Chubukov, \textit{Signature of the nonmonotonic $d$-wave gap in electron-doped cuprates}, Phys.~Rev.~B~\textbf{77}~(2008)~024508
|
||||
\bibitem{AnisotropicSWave} ??
|
||||
\bibitem{Pang2015} G.M.~Pang, \emph{et al.}, Phys.~Rev.~B~\textbf{91}~(2015)~220502(R), and references in there.
|
||||
\bibitem{Ozaki1986} M.~Ozaki, \emph{et al.}, Prog.~Theor.~Phys.~\textbf{75}~(1986)~442.
|
||||
\bibitem{Tinkham} M.~Tinkham, \textit{Introduction to Superconductivity} $2^{\rm nd}$ ed. (Dover Publications, New York, 2004).
|
||||
\bibitem{GPL} http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
|
||||
|
398
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
398
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
@ -36,6 +36,8 @@
|
||||
#define TWOPI 6.28318530717958647692
|
||||
|
||||
ClassImp(TGapSWave)
|
||||
ClassImp(TGapPointPWave)
|
||||
ClassImp(TGapLinePWave)
|
||||
ClassImp(TGapDWave)
|
||||
ClassImp(TGapCosSqDWave)
|
||||
ClassImp(TGapSinSqDWave)
|
||||
@ -46,6 +48,8 @@ ClassImp(TGapPowerLaw)
|
||||
ClassImp(TGapDirtySWave)
|
||||
|
||||
ClassImp(TLambdaSWave)
|
||||
ClassImp(TLambdaPointPWave)
|
||||
ClassImp(TLambdaLinePWave)
|
||||
ClassImp(TLambdaDWave)
|
||||
ClassImp(TLambdaAnSWave)
|
||||
ClassImp(TLambdaNonMonDWave1)
|
||||
@ -53,6 +57,8 @@ ClassImp(TLambdaNonMonDWave2)
|
||||
ClassImp(TLambdaPowerLaw)
|
||||
|
||||
ClassImp(TLambdaInvSWave)
|
||||
ClassImp(TLambdaInvPointPWave)
|
||||
ClassImp(TLambdaInvLinePWave)
|
||||
ClassImp(TLambdaInvDWave)
|
||||
ClassImp(TLambdaInvAnSWave)
|
||||
ClassImp(TLambdaInvNonMonDWave1)
|
||||
@ -77,6 +83,38 @@ TGapSWave::TGapSWave() {
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p> point p wave gap integral
|
||||
*/
|
||||
TGapPointPWave::TGapPointPWave() {
|
||||
TPointPWaveGapIntegralCuhre *gapint = new TPointPWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
fCalcNeeded.clear();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p> line p wave gap integral
|
||||
*/
|
||||
TGapLinePWave::TGapLinePWave() {
|
||||
TLinePWaveGapIntegralCuhre *gapint = new TLinePWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
fCalcNeeded.clear();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -181,6 +219,22 @@ TLambdaSWave::TLambdaSWave() {
|
||||
fLambdaInvSq = new TGapSWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaPointPWave::TLambdaPointPWave() {
|
||||
fLambdaInvSq = new TGapPointPWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaLinePWave::TLambdaLinePWave() {
|
||||
fLambdaInvSq = new TGapLinePWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -221,6 +275,22 @@ TLambdaInvSWave::TLambdaInvSWave() {
|
||||
fLambdaInvSq = new TGapSWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvPointPWave::TLambdaInvPointPWave() {
|
||||
fLambdaInvSq = new TGapPointPWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvLinePWave::TLambdaInvLinePWave() {
|
||||
fLambdaInvSq = new TGapLinePWave();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -268,6 +338,36 @@ TGapSWave::~TGapSWave() {
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TGapPointPWave::~TGapPointPWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
fCalcNeeded.clear();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TGapLinePWave::~TGapLinePWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
fCalcNeeded.clear();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -367,6 +467,24 @@ TLambdaSWave::~TLambdaSWave() {
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaPointPWave::~TLambdaPointPWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaLinePWave::~TLambdaLinePWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -412,6 +530,24 @@ TLambdaInvSWave::~TLambdaInvSWave() {
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvPointPWave::~TLambdaInvPointPWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvLinePWave::~TLambdaInvLinePWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -528,6 +664,191 @@ double TGapSWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>prepare the needed parameters for the integration carried out in TPointPWaveGapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, , especially Eq.(19) and (20).
|
||||
*/
|
||||
double TGapPointPWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [[2] orientation tag, [[3] c0 (1), [4] aG (1)]]
|
||||
|
||||
assert((par.size() >= 2) && (par.size() <= 5)); // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205
|
||||
// 4 or 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67
|
||||
// and Erratum Supercond. Sci. Technol. 21 (2008) 082003
|
||||
// c0 in the original context is c0 = (pi kB Tc) / Delta0
|
||||
// orientation tag: 0=aa,bb; 1=cc; 2=(sqrt[aa bb] + sqrt[aa cc] + sqrt[bb cc])/3 (default)
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
else if (t >= par[0])
|
||||
return 0.0;
|
||||
|
||||
// check if orientation tag is given
|
||||
int orientation_tag(2);
|
||||
if ((par.size()==3) || (par.size()==5))
|
||||
orientation_tag = static_cast<int>(par[2]);
|
||||
|
||||
bool integralParChanged(false);
|
||||
|
||||
if (fPar.empty()) { // first time calling this routine
|
||||
fPar = par;
|
||||
integralParChanged = true;
|
||||
} else { // check if Tc or Delta0 have changed
|
||||
for (unsigned int i(0); i<par.size(); i++) {
|
||||
if (par[i] != fPar[i]) {
|
||||
fPar[i] = par[i];
|
||||
integralParChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool newTemp(false);
|
||||
unsigned int vectorIndex;
|
||||
|
||||
if (integralParChanged) {
|
||||
fCalcNeeded.clear();
|
||||
fCalcNeeded.resize(fTemp.size(), true);
|
||||
}
|
||||
|
||||
fTempIter = find(fTemp.begin(), fTemp.end(), t);
|
||||
if(fTempIter == fTemp.end()) {
|
||||
fTemp.push_back(t);
|
||||
vectorIndex = fTemp.size() - 1;
|
||||
fCalcNeeded.push_back(true);
|
||||
newTemp = true;
|
||||
} else {
|
||||
vectorIndex = fTempIter - fTemp.begin();
|
||||
}
|
||||
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
double ds, ds1;
|
||||
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) || (par.size() == 3)) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
} else { // Prozorov/Giannetta
|
||||
intPar.push_back(par[1]*tanh(par[2]*sqrt(par[3]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1)))
|
||||
}
|
||||
intPar.push_back(4.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy
|
||||
intPar.push_back(1.0); // upper limit of theta-integration
|
||||
|
||||
fGapIntegral->SetParameters(intPar);
|
||||
if (orientation_tag == 0) // aa,bb
|
||||
ds = 1.0-(intPar[2]*3.0)/(2.0*intPar[0])*fGapIntegral->IntegrateFunc(0); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
else if (orientation_tag == 1) // cc
|
||||
ds = 1.0-(intPar[2]*3.0)/(intPar[0])*fGapIntegral->IntegrateFunc(1); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
else { // average
|
||||
ds = 1.0-(intPar[2]*3.0)/(2.0*intPar[0])*fGapIntegral->IntegrateFunc(0); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
ds1 = 1.0-(intPar[2]*3.0)/(intPar[0])*fGapIntegral->IntegrateFunc(1); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
ds = (ds + 2.0 * sqrt(ds*ds1))/3.0; // since aa==bb the avg looks like this
|
||||
}
|
||||
|
||||
intPar.clear();
|
||||
|
||||
if (newTemp)
|
||||
fIntegralValues.push_back(ds);
|
||||
else
|
||||
fIntegralValues[vectorIndex] = ds;
|
||||
|
||||
fCalcNeeded[vectorIndex] = false;
|
||||
}
|
||||
|
||||
return fIntegralValues[vectorIndex];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>prepare the needed parameters for the integration carried out in TLinePWaveGapIntegralCuhre.
|
||||
* For details see also the Memo GapIntegrals.pdf, especially Eq.(19) and (20).
|
||||
*/
|
||||
double TGapLinePWave::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
// parameters: [0] Tc (K), [1] Delta0 (meV), [[2] orientation tag, [[3] c0 (1), [4] aG (1)]]
|
||||
|
||||
assert((par.size() >= 2) && (par.size() <= 5)); // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205
|
||||
// 4 or 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67
|
||||
// and Erratum Supercond. Sci. Technol. 21 (2008) 082003
|
||||
// c0 in the original context is c0 = (pi kB Tc) / Delta0
|
||||
// orientation tag: 0=aa,bb; 1=cc; 2=(sqrt[aa bb] + sqrt[aa cc] + sqrt[bb cc])/3 (default)
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
else if (t >= par[0])
|
||||
return 0.0;
|
||||
|
||||
|
||||
// check if orientation tag is given
|
||||
int orientation_tag(2);
|
||||
if ((par.size()==3) || (par.size()==5))
|
||||
orientation_tag = static_cast<int>(par[2]);
|
||||
|
||||
bool integralParChanged(false);
|
||||
|
||||
if (fPar.empty()) { // first time calling this routine
|
||||
fPar = par;
|
||||
integralParChanged = true;
|
||||
} else { // check if parameter have changed
|
||||
for (unsigned int i(0); i<par.size(); i++) {
|
||||
if (par[i] != fPar[i]) {
|
||||
fPar[i] = par[i];
|
||||
integralParChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool newTemp(false);
|
||||
unsigned int vectorIndex;
|
||||
|
||||
if (integralParChanged) {
|
||||
fCalcNeeded.clear();
|
||||
fCalcNeeded.resize(fTemp.size(), true);
|
||||
}
|
||||
|
||||
fTempIter = find(fTemp.begin(), fTemp.end(), t);
|
||||
if(fTempIter == fTemp.end()) {
|
||||
fTemp.push_back(t);
|
||||
vectorIndex = fTemp.size() - 1;
|
||||
fCalcNeeded.push_back(true);
|
||||
newTemp = true;
|
||||
} else {
|
||||
vectorIndex = fTempIter - fTemp.begin();
|
||||
}
|
||||
|
||||
if (fCalcNeeded[vectorIndex]) {
|
||||
double ds, ds1;
|
||||
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) || (par.size() == 3)) { // Carrington/Manzano
|
||||
intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)));
|
||||
} else { // Prozorov/Giannetta
|
||||
intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1)))
|
||||
}
|
||||
intPar.push_back(4.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy
|
||||
intPar.push_back(1.0); // upper limit of z-integration
|
||||
|
||||
fGapIntegral->SetParameters(intPar);
|
||||
if (orientation_tag == 0) // aa,bb
|
||||
ds = 1.0-(intPar[2]*3.0)/(2.0*intPar[0])*fGapIntegral->IntegrateFunc(0); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
else if (orientation_tag == 1) // cc
|
||||
ds = 1.0-(intPar[2]*3.0)/(intPar[0])*fGapIntegral->IntegrateFunc(1); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
else { // average
|
||||
ds = 1.0-(intPar[2]*3.0)/(2.0*intPar[0])*fGapIntegral->IntegrateFunc(0); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
ds1 = 1.0-(intPar[2]*3.0)/(intPar[0])*fGapIntegral->IntegrateFunc(1); // integral prefactor is by 2 lower [Eqs.(19,20)] since intPar[0]==2kB T!
|
||||
ds = (ds + 2.0 * sqrt(ds*ds1))/3.0; // since aa==bb the avg looks like this
|
||||
}
|
||||
|
||||
intPar.clear();
|
||||
|
||||
if (newTemp)
|
||||
fIntegralValues.push_back(ds);
|
||||
else
|
||||
fIntegralValues[vectorIndex] = ds;
|
||||
|
||||
fCalcNeeded[vectorIndex] = false;
|
||||
}
|
||||
|
||||
return fIntegralValues[vectorIndex];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>prepare the needed parameters for the integration carried out in TDWaveGapIntegralCuhre.
|
||||
@ -609,7 +930,6 @@ double TGapDWave::operator()(double t, const std::vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fIntegralValues[vectorIndex];
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1103,7 +1423,40 @@ double TLambdaSWave::operator()(double t, const std::vector<double> &par) const
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaPointPWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
if (t >= par[0])
|
||||
return -1.0;
|
||||
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaLinePWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
if (t >= par[0])
|
||||
return -1.0;
|
||||
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1121,7 +1474,6 @@ double TLambdaDWave::operator()(double t, const std::vector<double> &par) const
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1139,7 +1491,6 @@ double TLambdaAnSWave::operator()(double t, const std::vector<double> &par) cons
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1157,7 +1508,6 @@ double TLambdaNonMonDWave1::operator()(double t, const std::vector<double> &par)
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1175,7 +1525,6 @@ double TLambdaNonMonDWave2::operator()(double t, const std::vector<double> &par)
|
||||
return 1.0;
|
||||
|
||||
return 1.0/sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1192,7 +1541,6 @@ double TLambdaPowerLaw::operator()(double t, const std::vector<double> &par) con
|
||||
return -1.0;
|
||||
|
||||
return 1.0/sqrt(1.0 - pow(t/par[0], par[1]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1211,7 +1559,40 @@ double TLambdaInvSWave::operator()(double t, const std::vector<double> &par) con
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvPointPWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
if (t >= par[0])
|
||||
return 0.0;
|
||||
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double TLambdaInvLinePWave::operator()(double t, const std::vector<double> &par) const
|
||||
{
|
||||
assert(par.size() == 2); // two parameters: Tc, Delta0
|
||||
|
||||
if (t >= par[0])
|
||||
return 0.0;
|
||||
|
||||
if (t <= 0.0)
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1229,7 +1610,6 @@ double TLambdaInvDWave::operator()(double t, const std::vector<double> &par) con
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1247,7 +1627,6 @@ double TLambdaInvAnSWave::operator()(double t, const std::vector<double> &par) c
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1265,7 +1644,6 @@ double TLambdaInvNonMonDWave1::operator()(double t, const std::vector<double> &p
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1283,7 +1661,6 @@ double TLambdaInvNonMonDWave2::operator()(double t, const std::vector<double> &p
|
||||
return 1.0;
|
||||
|
||||
return sqrt((*fLambdaInvSq)(t, par));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -1300,7 +1677,6 @@ double TLambdaInvPowerLaw::operator()(double t, const std::vector<double> &par)
|
||||
return 0.0;
|
||||
|
||||
return sqrt(1.0 - pow(t/par[0], par[1]));
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
144
src/external/libGapIntegrals/TGapIntegrals.h
vendored
144
src/external/libGapIntegrals/TGapIntegrals.h
vendored
@ -63,6 +63,62 @@ private:
|
||||
ClassDef(TGapSWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TGapPointPWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TGapPointPWave();
|
||||
virtual ~TGapPointPWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TPointPWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapPointPWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TGapLinePWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TGapLinePWave();
|
||||
virtual ~TGapLinePWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TLinePWaveGapIntegralCuhre *fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
mutable std::vector<bool> fCalcNeeded;
|
||||
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
ClassDef(TGapLinePWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -297,6 +353,50 @@ private:
|
||||
ClassDef(TLambdaSWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TLambdaPointPWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaPointPWave();
|
||||
virtual ~TLambdaPointPWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapPointPWave *fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaPointPWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TLambdaLinePWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaLinePWave();
|
||||
virtual ~TLambdaLinePWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapLinePWave *fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaLinePWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@ -428,6 +528,50 @@ private:
|
||||
ClassDef(TLambdaInvSWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TLambdaInvPointPWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvPointPWave();
|
||||
virtual ~TLambdaInvPointPWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapPointPWave *fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvPointPWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
class TLambdaInvLinePWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvLinePWave();
|
||||
virtual ~TLambdaInvLinePWave();
|
||||
|
||||
virtual Bool_t NeedGlobalPart() const { return false; }
|
||||
virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) { }
|
||||
virtual Bool_t GlobalPartIsValid() const { return true; }
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapLinePWave *fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvLinePWave,1)
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
|
@ -35,6 +35,8 @@
|
||||
#pragma link off all functions;
|
||||
|
||||
#pragma link C++ class TGapSWave+;
|
||||
#pragma link C++ class TGapPointPWave+;
|
||||
#pragma link C++ class TGapLinePWave+;
|
||||
#pragma link C++ class TGapDWave+;
|
||||
#pragma link C++ class TGapCosSqDWave+;
|
||||
#pragma link C++ class TGapSinSqDWave+;
|
||||
@ -44,12 +46,16 @@
|
||||
#pragma link C++ class TGapPowerLaw+;
|
||||
#pragma link C++ class TGapDirtySWave+;
|
||||
#pragma link C++ class TLambdaSWave+;
|
||||
#pragma link C++ class TLambdaPointPWave+;
|
||||
#pragma link C++ class TLambdaLinePWave+;
|
||||
#pragma link C++ class TLambdaDWave+;
|
||||
#pragma link C++ class TLambdaAnSWave+;
|
||||
#pragma link C++ class TLambdaNonMonDWave1+;
|
||||
#pragma link C++ class TLambdaNonMonDWave2+;
|
||||
#pragma link C++ class TLambdaPowerLaw+;
|
||||
#pragma link C++ class TLambdaInvSWave+;
|
||||
#pragma link C++ class TLambdaInvPointPWave+;
|
||||
#pragma link C++ class TLambdaInvLinePWave+;
|
||||
#pragma link C++ class TLambdaInvDWave+;
|
||||
#pragma link C++ class TLambdaInvAnSWave+;
|
||||
#pragma link C++ class TLambdaInvNonMonDWave1+;
|
||||
|
@ -49,7 +49,11 @@ PShowVarNameDialog::PShowVarNameDialog(PCollInfo &info)
|
||||
// if fCollName is a path name, extract the fln
|
||||
QString collNameStr(info.fCollName);
|
||||
if (collNameStr.contains("/")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = collNameStr.split('/', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = collNameStr.split('/', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
collNameStr = tok[tok.count()-1];
|
||||
}
|
||||
QLabel *collName = new QLabel(collNameStr);
|
||||
@ -281,7 +285,11 @@ bool PVarDialog::basic_check()
|
||||
}
|
||||
|
||||
// tokenize variable input
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList strList = varStr.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList strList = varStr.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
// check if there are ANY var definitions
|
||||
ok = false;
|
||||
|
@ -432,7 +432,11 @@ PmuppCollection PParamDataHandler::ReadDbFile(const QString fln, bool &valid, QS
|
||||
if (param_found && !line.isEmpty()) {
|
||||
// check if parameter or run number and title
|
||||
token.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
token = line.split(",", QString::SkipEmptyParts);
|
||||
#else
|
||||
token = line.split(",", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (token.size()==0) {
|
||||
errorMsg = fln + QString(". No parameter tokens.");
|
||||
std::cerr << std::endl;
|
||||
@ -584,7 +588,11 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &
|
||||
|
||||
// read header information
|
||||
line = in.readLine();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
token = line.split(QRegExp("\\s+"), QString::SkipEmptyParts);
|
||||
#else
|
||||
token = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
QVector<QString> headerInfo;
|
||||
QVector<int> headerCode; // 0=value, 1=pos/neg err, 2=pos err, 3=neg err, 4=run number
|
||||
@ -612,7 +620,11 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &
|
||||
continue;
|
||||
lineNo++;
|
||||
token.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
token = line.split(QRegExp("\\s+"), QString::SkipEmptyParts);
|
||||
#else
|
||||
token = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
// paranoia check
|
||||
if (token.size() != headerInfo.size()) {
|
||||
errorMsg = QString("size mismatch between header and parameter int line: %1 (header=%2 / param=%3)").arg(lineNo).arg(headerInfo.size()).arg(token.size());
|
||||
@ -1037,6 +1049,11 @@ void PParamDataHandler::readFromStdErr()
|
||||
void PParamDataHandler::processDone(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
{
|
||||
qInfo() << "in processDone()";
|
||||
if ((exitStatus == QProcess::CrashExit) && (exitCode != 0))
|
||||
if ((exitStatus == QProcess::CrashExit) && (exitCode != 0)) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qInfo() << "**ERROR** processDone: exitCode = " << exitCode << endl;
|
||||
#else
|
||||
qInfo() << "**ERROR** processDone: exitCode = " << exitCode << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,11 @@ bool PmuppAdminXMLParser::characters()
|
||||
fAdmin->setTheme(false);
|
||||
break;
|
||||
case eMarker:
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(",", QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(",", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if ((tok.count() != 1) && (tok.count() != 2)) {
|
||||
return false;
|
||||
@ -227,7 +231,11 @@ bool PmuppAdminXMLParser::characters()
|
||||
fAdmin->setMarker(ival, dval);
|
||||
break;
|
||||
case eColor:
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(",", QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(",", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if ((tok.count() != 3) && (tok.count() != 4)) {
|
||||
return false;
|
||||
@ -533,8 +541,13 @@ void PmuppAdmin::saveRecentFiles()
|
||||
return;
|
||||
}
|
||||
fin.setDevice(&file);
|
||||
for (int i=0; i<data.size(); i++)
|
||||
for (int i=0; i<data.size(); i++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fin << data[i] << endl;
|
||||
#else
|
||||
fin << data[i] << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
file.close();
|
||||
} else {
|
||||
QString msg("Failed to write mupp_startup.xml. Neither a local nor a global copy found.");
|
||||
@ -592,7 +605,11 @@ void PmuppAdmin::createMuppStartupFile()
|
||||
QString line;
|
||||
while (!fin.atEnd()) {
|
||||
line = fin.readLine();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << line << endl;
|
||||
#else
|
||||
fout << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
@ -233,8 +233,7 @@ PVarErrorDialog::PVarErrorDialog(QString errMsg)
|
||||
* \param parent pointer to the parent object
|
||||
* \param f qt windows flags
|
||||
*/
|
||||
PmuppGui::PmuppGui( QStringList fln, QWidget *parent, Qt::WindowFlags f )
|
||||
: QMainWindow( parent, f )
|
||||
PmuppGui::PmuppGui(QStringList fln)
|
||||
{
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
fDatime = dt.toTime_t();
|
||||
@ -945,6 +944,7 @@ void PmuppGui::writeCmdHistory()
|
||||
|
||||
// write header
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "% mupp history file" << endl;
|
||||
fout << "% " << dt.toString("HH:mm:ss - yy/MM/dd") << endl;
|
||||
|
||||
@ -953,6 +953,16 @@ void PmuppGui::writeCmdHistory()
|
||||
fout << fCmdHistory[i] << endl;
|
||||
|
||||
fout << "% end mupp history file" << endl;
|
||||
#else
|
||||
fout << "% mupp history file" << Qt::endl;
|
||||
fout << "% " << dt.toString("HH:mm:ss - yy/MM/dd") << Qt::endl;
|
||||
|
||||
// write history
|
||||
for (int i=0; i<fCmdHistory.size(); i++)
|
||||
fout << fCmdHistory[i] << Qt::endl;
|
||||
|
||||
fout << "% end mupp history file" << Qt::endl;
|
||||
#endif
|
||||
|
||||
file.close();
|
||||
}
|
||||
@ -1304,7 +1314,7 @@ void PmuppGui::addVar()
|
||||
// call variable dialog
|
||||
if (fVarDlg != nullptr) {
|
||||
delete fVarDlg;
|
||||
fVarDlg == nullptr;
|
||||
fVarDlg = nullptr;
|
||||
}
|
||||
fVarDlg = new PVarDialog(collection_list, fDarkTheme);
|
||||
connect(fVarDlg, SIGNAL(check_request(QString,QVector<int>)), this, SLOT(check(QString,QVector<int>)));
|
||||
@ -1461,7 +1471,12 @@ QVector<double> PmuppGui::getValues(QString collName, QString paramName, bool &o
|
||||
for (int i=0; i<fVarHandler.size(); i++) {
|
||||
if ((fVarHandler[i].getCollName() == collName) &&
|
||||
(fVarHandler[i].getVarName() == paramName)) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
values = QVector<double>::fromStdVector(fVarHandler[i].getValues());
|
||||
#else
|
||||
QVector<double> qvec(fVarHandler[i].getValues().begin(), fVarHandler[i].getValues().end());
|
||||
values = qvec;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1495,7 +1510,12 @@ QVector<double> PmuppGui::getPosErr(QString collName, QString paramName, bool &o
|
||||
for (int i=0; i<fVarHandler.size(); i++) {
|
||||
if ((fVarHandler[i].getCollName() == collName) &&
|
||||
(fVarHandler[i].getVarName() == paramName)) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
values = QVector<double>::fromStdVector(fVarHandler[i].getErrors());
|
||||
#else
|
||||
QVector<double> qvec(fVarHandler[i].getErrors().begin(), fVarHandler[i].getErrors().end());
|
||||
values = qvec;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1529,7 +1549,12 @@ QVector<double> PmuppGui::getNegErr(QString collName, QString paramName, bool &o
|
||||
for (int i=0; i<fVarHandler.size(); i++) {
|
||||
if ((fVarHandler[i].getCollName() == collName) &&
|
||||
(fVarHandler[i].getVarName() == paramName)) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
values = QVector<double>::fromStdVector(fVarHandler[i].getErrors());
|
||||
#else
|
||||
QVector<double> qvec(fVarHandler[i].getErrors().begin(), fVarHandler[i].getErrors().end());
|
||||
values = qvec;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1823,6 +1848,7 @@ void PmuppGui::createMacro()
|
||||
|
||||
QTextStream fout(&file);
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "// " << fMacroName.toLatin1().data() << endl;
|
||||
fout << "// " << QDateTime::currentDateTime().toString("yy/MM/dd - HH:mm:ss") << endl;
|
||||
fout << "// " << endl;
|
||||
@ -1840,6 +1866,25 @@ void PmuppGui::createMacro()
|
||||
fout << " Double_t yy[512];" << endl;
|
||||
fout << " Double_t yyPosErr[512];" << endl;
|
||||
fout << " Double_t yyNegErr[512];" << endl;
|
||||
#else
|
||||
fout << "// " << fMacroName.toLatin1().data() << Qt::endl;
|
||||
fout << "// " << QDateTime::currentDateTime().toString("yy/MM/dd - HH:mm:ss") << Qt::endl;
|
||||
fout << "// " << Qt::endl;
|
||||
fout << "{" << Qt::endl;
|
||||
fout << " gROOT->Reset();" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
fout << " gStyle->SetOptTitle(0);" << Qt::endl;
|
||||
fout << " gStyle->SetOptDate(0);" << Qt::endl;
|
||||
fout << " gStyle->SetPadColor(TColor::GetColor(255,255,255)); // pad bkg to white" << Qt::endl;
|
||||
fout << " gStyle->SetCanvasColor(TColor::GetColor(255,255,255)); // canvas bkg to white" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
fout << " Int_t nn=0, i=0;" << Qt::endl;
|
||||
fout << " Double_t null[512];" << Qt::endl;
|
||||
fout << " Double_t xx[512];" << Qt::endl;
|
||||
fout << " Double_t yy[512];" << Qt::endl;
|
||||
fout << " Double_t yyPosErr[512];" << Qt::endl;
|
||||
fout << " Double_t yyNegErr[512];" << Qt::endl;
|
||||
#endif
|
||||
// create all the necessary TGraph's
|
||||
int collTag = -1, pos;
|
||||
QString collName("");
|
||||
@ -1894,40 +1939,98 @@ void PmuppGui::createMacro()
|
||||
yLabel = substituteDefaultLabels(yLabel);
|
||||
getMinMax(yy, yMin, yMax);
|
||||
// create TGraph objects
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl;
|
||||
snprintf(gLabel, sizeof(gLabel), "g_%d_%d", i, j);
|
||||
fout << " nn = " << xx.size() << ";" << endl;
|
||||
fout << endl;
|
||||
fout << " // null value vector" << endl;
|
||||
#else
|
||||
fout << Qt::endl;
|
||||
snprintf(gLabel, sizeof(gLabel), "g_%d_%d", i, j);
|
||||
fout << " nn = " << xx.size() << ";" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
fout << " // null value vector" << Qt::endl;
|
||||
#endif
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " null[" << k << "]=0.0;" << endl;
|
||||
#else
|
||||
fout << " null[" << k << "]=0.0;" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " // xx" << endl;
|
||||
#else
|
||||
fout << " // xx" << Qt::endl;
|
||||
#endif
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " xx[" << k << "]=" << xx[k] << ";" << endl;
|
||||
#else
|
||||
fout << " xx[" << k << "]=" << xx[k] << ";" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " // yy" << endl;
|
||||
#else
|
||||
fout << " // yy" << Qt::endl;
|
||||
#endif
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " yy[" << k << "]=" << yy[k] << ";" << endl;
|
||||
#else
|
||||
fout << " yy[" << k << "]=" << yy[k] << ";" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " // yyPosErr" << endl;
|
||||
#else
|
||||
fout << " // yyPosErr" << Qt::endl;
|
||||
#endif
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " yyPosErr[" << k << "]=" << yyPosErr[k] << ";" << endl;
|
||||
#else
|
||||
fout << " yyPosErr[" << k << "]=" << yyPosErr[k] << ";" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " // yyNegErr" << endl;
|
||||
#else
|
||||
fout << " // yyNegErr" << Qt::endl;
|
||||
#endif
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " yyNegErr[" << k << "]=" << fabs(yyNegErr[k]) << ";" << endl;
|
||||
#else
|
||||
fout << " yyNegErr[" << k << "]=" << fabs(yyNegErr[k]) << ";" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl;
|
||||
fout << " TGraphAsymmErrors *" << gLabel << " = new TGraphAsymmErrors(nn, xx, yy, null, null, yyNegErr, yyPosErr);" << endl;
|
||||
#else
|
||||
fout << Qt::endl;
|
||||
fout << " TGraphAsymmErrors *" << gLabel << " = new TGraphAsymmErrors(nn, xx, yy, null, null, yyNegErr, yyPosErr);" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl;
|
||||
fout << " //***************" << endl;
|
||||
fout << " // plotting " << endl;
|
||||
fout << " //***************" << endl;
|
||||
fout << " TCanvas *c1 = new TCanvas(\"c1\", \"" << fMacroName.toLatin1().data() << "\", 10, 10, 600, 700);" << endl;
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::endl;
|
||||
fout << " //***************" << Qt::endl;
|
||||
fout << " // plotting " << Qt::endl;
|
||||
fout << " //***************" << Qt::endl;
|
||||
fout << " TCanvas *c1 = new TCanvas(\"c1\", \"" << fMacroName.toLatin1().data() << "\", 10, 10, 600, 700);" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
int idx, r, g, b;
|
||||
PmuppMarker markerObj;
|
||||
for (int i=0; i<fXY.size(); i++) {
|
||||
@ -1945,20 +2048,41 @@ void PmuppGui::createMacro()
|
||||
snprintf(gLabel, sizeof(gLabel), "g_%d_%d", i, j);
|
||||
if ((i==0) && (j==0)) { // first graph
|
||||
if (idx < marker.size()) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << markerObj.getMarker() << ");" << endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(" << markerObj.getMarkerSize() << ");" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << markerObj.getMarker() << ");" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(" << markerObj.getMarkerSize() << ");" << Qt::endl;
|
||||
#endif
|
||||
} else {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerStyle(20); // bullet" << endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(1.5);" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerStyle(20); // bullet" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(1.5);" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
if (idx < color.size()) {
|
||||
color[idx].getRGB(r, g, b);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << endl;
|
||||
fout << " " << gLabel << "->SetLineColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetLineColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << Qt::endl;
|
||||
#endif
|
||||
} else {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerColor(kBlue);" << endl;
|
||||
fout << " " << gLabel << "->SetLineColor(kBlue);" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerColor(kBlue);" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetLineColor(kBlue);" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetFillColor(kWhite);" << endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetTitle(\"" << xLabel.toLatin1().data() << "\");" << endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetTitleSize(0.05);" << endl;
|
||||
@ -1969,28 +2093,69 @@ void PmuppGui::createMacro()
|
||||
fout << " " << gLabel << "->GetYaxis()->SetRangeUser(" << 0.95*yMin << ", " << 1.05*yMax << ");" << endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetDecimals(kTRUE);" << endl;
|
||||
fout << " " << gLabel << "->Draw(\"AP\");" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetFillColor(kWhite);" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetTitle(\"" << xLabel.toLatin1().data() << "\");" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetTitleSize(0.05);" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetRangeUser(" << 0.95*xMin << ", " << 1.05*xMax << ");" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetYaxis()->SetTitle(\"" << yLabel.toLatin1().data() << "\");" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetYaxis()->SetTitleSize(0.05);" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetYaxis()->SetTitleOffset(1.30);" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetYaxis()->SetRangeUser(" << 0.95*yMin << ", " << 1.05*yMax << ");" << Qt::endl;
|
||||
fout << " " << gLabel << "->GetXaxis()->SetDecimals(kTRUE);" << Qt::endl;
|
||||
fout << " " << gLabel << "->Draw(\"AP\");" << Qt::endl;
|
||||
#endif
|
||||
} else { // consecutive graphs
|
||||
if (idx < marker.size()) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << markerObj.getMarker() << ");" << endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(" << markerObj.getMarkerSize() << ");" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << markerObj.getMarker() << ");" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(" << markerObj.getMarkerSize() << ");" << Qt::endl;
|
||||
#endif
|
||||
} else {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << 21+j << ");" << endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(1.5);" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerStyle(" << 21+j << ");" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetMarkerSize(1.5);" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
if (idx < color.size()) {
|
||||
color[idx].getRGB(r, g, b);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << endl;
|
||||
fout << " " << gLabel << "->SetLineColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetLineColor(TColor::GetColor(" << r << "," << g << "," << b << "));" << Qt::endl;
|
||||
#endif
|
||||
} else {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetMarkerColor(kBlue);" << endl;
|
||||
fout << " " << gLabel << "->SetLineColor(kBlue);" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetMarkerColor(kBlue);" << Qt::endl;
|
||||
fout << " " << gLabel << "->SetLineColor(kBlue);" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " " << gLabel << "->SetFillColor(kWhite);" << endl;
|
||||
fout << " " << gLabel << "->Draw(\"Psame\");" << endl;
|
||||
#else
|
||||
fout << " " << gLabel << "->SetFillColor(kWhite);" << Qt::endl;
|
||||
fout << " " << gLabel << "->Draw(\"Psame\");" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "}" << endl;
|
||||
#else
|
||||
fout << "}" << Qt::endl;
|
||||
#endif
|
||||
|
||||
// clear macro name
|
||||
fMacroName = QString("");
|
||||
@ -2028,17 +2193,29 @@ void PmuppGui::plot()
|
||||
}
|
||||
QTextStream fout(&file);
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "% path file name: " << pathName << endl;
|
||||
fout << "% creation time : " << QDateTime::currentDateTime().toString("yyyy.MM.dd - hh:mm:ss") << endl;
|
||||
fout << "%" << endl;
|
||||
#else
|
||||
fout << "% path file name: " << pathName << Qt::endl;
|
||||
fout << "% creation time : " << QDateTime::currentDateTime().toString("yyyy.MM.dd - hh:mm:ss") << Qt::endl;
|
||||
fout << "%" << Qt::endl;
|
||||
#endif
|
||||
for (int i=0; i<fXY.size(); i++) {
|
||||
// header info
|
||||
collTag = fXY[i].getCollectionTag();
|
||||
collName = fColList->item(collTag)->text();
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "% ---------" << endl;
|
||||
fout << "% collName = " << collName << endl;
|
||||
fout << "% start ---" << endl;
|
||||
#else
|
||||
fout << "% ---------" << Qt::endl;
|
||||
fout << "% collName = " << collName << Qt::endl;
|
||||
fout << "% start ---" << Qt::endl;
|
||||
#endif
|
||||
|
||||
// x-label
|
||||
xLabel = fXY[i].getXlabel();
|
||||
@ -2113,7 +2290,11 @@ void PmuppGui::plot()
|
||||
yyyNegErr.push_back(yyNegErr);
|
||||
|
||||
yLabel = substituteDefaultLabels(yLabel);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "yLabel: " << yLabel << endl;
|
||||
#else
|
||||
fout << "yLabel: " << yLabel << Qt::endl;
|
||||
#endif
|
||||
|
||||
// normalize if wished
|
||||
if (fNormalize) {
|
||||
@ -2140,10 +2321,18 @@ void PmuppGui::plot()
|
||||
}
|
||||
idx = yyy.size()-1;
|
||||
fout << yyy[idx][j] << ", " << yyyPosErr[idx][j] << ", " << yyyNegErr[idx][j];
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "% end -----" << endl;
|
||||
#else
|
||||
fout << "% end -----" << Qt::endl;
|
||||
#endif
|
||||
|
||||
// clear collection related vectors
|
||||
yyy.clear();
|
||||
@ -2169,7 +2358,11 @@ void PmuppGui::plot()
|
||||
return;
|
||||
}
|
||||
fout.setDevice(&file);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << QCoreApplication::applicationFilePath().toLatin1().data() << endl;
|
||||
#else
|
||||
fout << QCoreApplication::applicationFilePath().toLatin1().data() << Qt::endl;
|
||||
#endif
|
||||
file.close();
|
||||
|
||||
key = ftok(QCoreApplication::applicationFilePath().toLatin1().data(), fMuppInstance);
|
||||
@ -2274,7 +2467,11 @@ void PmuppGui::handleCmds()
|
||||
} else if (!cmd.compare("plot", Qt::CaseInsensitive)) {
|
||||
plot();
|
||||
} else if (cmd.startsWith("macro")) { // cmd: macro <fln>
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
QMessageBox::critical(this, "ERROR", QString("wrong macro cmd: %1.\nPlease check the help.").arg(cmd));
|
||||
return;
|
||||
@ -2284,7 +2481,11 @@ void PmuppGui::handleCmds()
|
||||
} else if (cmd.startsWith("path")) { // cmd: path <macro_path>
|
||||
QMessageBox::information(0, "INFO", "set's eventually the path for the macros to be saved.");
|
||||
// will set the path to where to save the macro
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
QMessageBox::critical(this, "ERROR", QString("wrong path cmd: %1.\nPlease check the help.").arg(cmd));
|
||||
return;
|
||||
@ -2310,13 +2511,21 @@ void PmuppGui::handleCmds()
|
||||
} else if (cmd.startsWith("select") || cmd.startsWith("sc")) {
|
||||
selectCollection(cmd);
|
||||
} else if (cmd.startsWith("x")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() > 1)
|
||||
addX(tok[1]);
|
||||
else
|
||||
QMessageBox::critical(0, "ERROR", QString("Found command 'x' without variable."));
|
||||
} else if (cmd.startsWith("y")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() > 1)
|
||||
addY(tok[1]);
|
||||
else
|
||||
@ -2324,19 +2533,31 @@ void PmuppGui::handleCmds()
|
||||
} else if (cmd.startsWith("ditto")) {
|
||||
addDitto();
|
||||
} else if (cmd.startsWith("rmx")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() > 1)
|
||||
removeX(tok[1]);
|
||||
else
|
||||
QMessageBox::critical(0, "ERROR", QString("Found command 'rmx' without variable."));
|
||||
} else if (cmd.startsWith("rmy")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() > 1)
|
||||
removeY(tok[1]);
|
||||
else
|
||||
QMessageBox::critical(0, "ERROR", QString("Found command 'rmy' without variable."));
|
||||
} else if (cmd.startsWith("norm")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
QMessageBox::critical(this, "**ERROR**", "found wrong norm cmd, will ignore it.");
|
||||
return;
|
||||
|
@ -132,7 +132,7 @@ class PmuppGui : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PmuppGui(QStringList fln, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PmuppGui(QStringList fln);
|
||||
virtual ~PmuppGui();
|
||||
|
||||
public slots:
|
||||
|
@ -146,7 +146,11 @@ void PmuppScript::setLoadPath(const QString cmd)
|
||||
str = str.remove("loadPath ");
|
||||
|
||||
// tokenize path string
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split("/", QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split("/", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
// check if there is a bash variable which needs to be resolved
|
||||
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
|
||||
@ -180,7 +184,11 @@ void PmuppScript::setSavePath(const QString cmd)
|
||||
str = str.remove("savePath ");
|
||||
|
||||
// tokenize path string
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split("/", QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split("/", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
// check if there is a bash variable which needs to be resolved
|
||||
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
|
||||
@ -230,7 +238,11 @@ int PmuppScript::loadCollection(const QString str)
|
||||
int PmuppScript::select(const QString str)
|
||||
{
|
||||
QString cmd = str;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl << "**ERROR** wrong 'select' command syntax." << std::endl << std::endl;
|
||||
return -1;
|
||||
@ -287,7 +299,11 @@ int PmuppScript::selectAll()
|
||||
int PmuppScript::addX(const QString str)
|
||||
{
|
||||
QString cmd = str, label;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl << "**ERROR** in addX: number of tokens missmatch." << std::endl << std::endl;
|
||||
@ -377,7 +393,11 @@ int PmuppScript::addY(const QString str)
|
||||
{
|
||||
QString cmd = str;
|
||||
QVector<QString> label;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if (tok.size() < 2) {
|
||||
std::cerr << std::endl << "**ERROR** in addY: number of tokens < 2." << std::endl << std::endl;
|
||||
@ -484,7 +504,11 @@ int PmuppScript::addY(const QString str)
|
||||
int PmuppScript::plot(const QString str)
|
||||
{
|
||||
QString cmd = str;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl << "**ERROR** in plot: number of tokens != 2." << std::endl << std::endl;
|
||||
return -1;
|
||||
@ -542,7 +566,11 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
QVector<PmuppColor> color = fAdmin->getColors();
|
||||
|
||||
QString cmd = str;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl << "**ERROR** macro command with wrong number of arguments (" << tok.size() << ")." << std::endl << std::endl;
|
||||
return -1;
|
||||
@ -559,6 +587,7 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
QTextStream fout(&file);
|
||||
|
||||
// write header
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "// --------------------------" << endl;
|
||||
fout << "// " << fln.toLatin1().constData() << endl;
|
||||
fout << "// " << QDateTime::currentDateTime().toString("yy/MM/dd - HH:mm:ss") << endl;
|
||||
@ -578,6 +607,27 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
fout << " Double_t yyPosErr[512];" << endl;
|
||||
fout << " Double_t yyNegErr[512];" << endl;
|
||||
fout << endl;
|
||||
#else
|
||||
fout << "// --------------------------" << Qt::endl;
|
||||
fout << "// " << fln.toLatin1().constData() << Qt::endl;
|
||||
fout << "// " << QDateTime::currentDateTime().toString("yy/MM/dd - HH:mm:ss") << Qt::endl;
|
||||
fout << "// --------------------------" << Qt::endl;
|
||||
fout << "{" << Qt::endl;
|
||||
fout << " gROOT->Reset();" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
fout << " gStyle->SetOptTitle(0);" << Qt::endl;
|
||||
fout << " gStyle->SetOptDate(0);" << Qt::endl;
|
||||
fout << " gStyle->SetPadColor(TColor::GetColor(255,255,255)); // pad bkg to white" << Qt::endl;
|
||||
fout << " gStyle->SetCanvasColor(TColor::GetColor(255,255,255)); // canvas bkg to white" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
fout << " Int_t nn=0, i=0;" << Qt::endl;
|
||||
fout << " Double_t null[512];" << Qt::endl;
|
||||
fout << " Double_t xx[512];" << Qt::endl;
|
||||
fout << " Double_t yy[512];" << Qt::endl;
|
||||
fout << " Double_t yyPosErr[512];" << Qt::endl;
|
||||
fout << " Double_t yyNegErr[512];" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write data
|
||||
QVector<double> xx, yy, yyPosErr, yyNegErr;
|
||||
@ -597,7 +647,12 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
std::cerr << " This should never happens." << std::endl;
|
||||
return -3;
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
xx = QVector<double>::fromStdVector(fVarHandler[idx].getValues());
|
||||
#else
|
||||
QVector<double> qvec(fVarHandler[idx].getValues().begin(), fVarHandler[idx].getValues().end());
|
||||
xx = qvec;
|
||||
#endif
|
||||
}
|
||||
// get x-axis min/max
|
||||
minMax(xx, x_min, x_max);
|
||||
@ -623,9 +678,17 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
std::cerr << " This should never happens." << std::endl;
|
||||
return -3;
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
yy = QVector<double>::fromStdVector(fVarHandler[idx].getValues());
|
||||
yyPosErr = QVector<double>::fromStdVector(fVarHandler[idx].getErrors());
|
||||
yyNegErr = QVector<double>::fromStdVector(fVarHandler[idx].getErrors());
|
||||
#else
|
||||
QVector<double> qvecV(fVarHandler[idx].getValues().begin(), fVarHandler[idx].getValues().end());
|
||||
yy = qvecV;
|
||||
QVector<double> qvecE(fVarHandler[idx].getErrors().begin(), fVarHandler[idx].getErrors().end());
|
||||
yyPosErr = qvecE;
|
||||
yyNegErr = qvecE;
|
||||
#endif
|
||||
}
|
||||
// get y-axis min/max
|
||||
minMax(yy, y_min, y_max);
|
||||
@ -638,6 +701,7 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
if (y_max > y_max_new)
|
||||
y_max_new = y_max;
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " // " << ++count << ". data set" << endl;
|
||||
fout << " nn = " << xx.size() << ";" << endl;
|
||||
fout << " // null-values" << endl;
|
||||
@ -675,6 +739,45 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
fout << endl;
|
||||
fout << " TGraphAsymmErrors *g_" << i << "_" << j << " = new TGraphAsymmErrors(nn, xx, yy, null, null, yyNegErr, yyPosErr);" << endl;
|
||||
fout << endl;
|
||||
#else
|
||||
fout << " // " << ++count << ". data set" << Qt::endl;
|
||||
fout << " nn = " << xx.size() << ";" << Qt::endl;
|
||||
fout << " // null-values" << Qt::endl;
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
fout << " null[" << k << "]=0.0;" << Qt::endl;
|
||||
}
|
||||
fout << " // x-values" << Qt::endl;
|
||||
for (int k=0; k<xx.size(); k++) {
|
||||
fout << " xx[" << k << "]=" << xx[k] << ";" << Qt::endl;
|
||||
}
|
||||
fout << " // y-values" << Qt::endl;
|
||||
for (int k=0; k<yy.size(); k++) {
|
||||
dval = yy[k];
|
||||
if (fNorm) {
|
||||
dval /= y_max;
|
||||
if (dval < y_min_norm)
|
||||
y_min_norm = dval;
|
||||
}
|
||||
fout << " yy[" << k << "]=" << dval << ";" << Qt::endl;
|
||||
}
|
||||
fout << " // yyNegErr-values" << Qt::endl;
|
||||
for (int k=0; k<yyNegErr.size(); k++) {
|
||||
dval = fabs(yyNegErr[k]);
|
||||
if (fNorm)
|
||||
dval /= fabs(y_max);
|
||||
fout << " yyNegErr[" << k << "]=" << dval << ";" << Qt::endl;
|
||||
}
|
||||
fout << " // yyPosErr-values" << Qt::endl;
|
||||
for (int k=0; k<yyPosErr.size(); k++) {
|
||||
dval = fabs(yyPosErr[k]);
|
||||
if (fNorm)
|
||||
dval /= fabs(y_max);
|
||||
fout << " yyPosErr[" << k << "]=" << dval << ";" << Qt::endl;
|
||||
}
|
||||
fout << Qt::endl;
|
||||
fout << " TGraphAsymmErrors *g_" << i << "_" << j << " = new TGraphAsymmErrors(nn, xx, yy, null, null, yyNegErr, yyPosErr);" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,6 +799,7 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
}
|
||||
|
||||
// plotting
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << " //**********" << endl;
|
||||
fout << " // plotting " << endl;
|
||||
fout << " //**********" << endl;
|
||||
@ -755,6 +859,67 @@ int PmuppScript::macro(const QString str, const QString plotFln)
|
||||
fout << " c1->SaveAs(\"" << plotFln.toLatin1().constData() << "\");" << endl;
|
||||
}
|
||||
fout << "}" << endl;
|
||||
#else
|
||||
fout << " //**********" << Qt::endl;
|
||||
fout << " // plotting " << Qt::endl;
|
||||
fout << " //**********" << Qt::endl;
|
||||
fout << " TCanvas *c1 = new TCanvas(\"c1\", \"" << macroName.toLatin1().constData() << "\", 10, 10, 600, 700);" << Qt::endl;
|
||||
fout << Qt::endl;
|
||||
|
||||
count = 0;
|
||||
int rr, gg, bb;
|
||||
for (int i=0; i<fPlotInfo.size(); i++) {
|
||||
for (int j=0; j<fPlotInfo[i].yLabel.size(); j++) {
|
||||
if (count == 0) {
|
||||
if (count < marker.size()) {
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerStyle(" << marker[count].getMarker() << ");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerSize(" << marker[count].getMarkerSize() << ");" << Qt::endl;
|
||||
color[count].getRGB(rr, gg, bb);
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerColor(TColor::GetColor(" << rr << "," << gg << "," << bb << "));" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetLineColor(TColor::GetColor(" << rr << "," << gg << "," << bb << "));" << Qt::endl;
|
||||
} else {
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerStyle(20);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerSize(1.3);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerColor(TColor::GetColor(0,0,0));" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetLineColor(TColor::GetColor(0,0,0));" << Qt::endl;
|
||||
}
|
||||
fout << " g_" << i << "_" << j << "->SetFillColor(kWhite);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetXaxis()->SetTitle(\"" << getNicerLabel(fPlotInfo[0].xLabel).toLatin1().data() << "\");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetXaxis()->SetTitleSize(0.05);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetXaxis()->SetDecimals(kTRUE);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetXaxis()->SetLimits(" << x_min << "," << x_max << ");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetYaxis()->SetTitle(\"" << getNicerLabel(fPlotInfo[0].yLabel[0]).toLatin1().data() << "\");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetYaxis()->SetTitleSize(0.05);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetYaxis()->SetTitleOffset(1.30);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->GetYaxis()->SetRangeUser(" << y_min << "," << y_max << ");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->Draw(\"AP\");" << Qt::endl;
|
||||
} else {
|
||||
if (count < marker.size()) {
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerStyle(" << marker[count].getMarker() << ");" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerSize(" << marker[count].getMarkerSize() << ");" << Qt::endl;
|
||||
color[count].getRGB(rr, gg, bb);
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerColor(TColor::GetColor(" << rr << "," << gg << "," << bb << "));" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetLineColor(TColor::GetColor(" << rr << "," << gg << "," << bb << "));" << Qt::endl;
|
||||
} else {
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerStyle(20);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerSize(1.3);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetMarkerColor(TColor::GetColor(0,0,0));" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->SetLineColor(TColor::GetColor(0,0,0));" << Qt::endl;
|
||||
}
|
||||
fout << " g_" << i << "_" << j << "->SetFillColor(kWhite);" << Qt::endl;
|
||||
fout << " g_" << i << "_" << j << "->Draw(\"Psame\");" << Qt::endl;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
fout << " c1->SetMargin(0.15, 0.05, 0.12, 0.05);" << Qt::endl;
|
||||
fout << " c1->Update();" << Qt::endl;
|
||||
if (!plotFln.isEmpty()) {
|
||||
fout << Qt::endl;
|
||||
fout << " c1->SaveAs(\"" << plotFln.toLatin1().constData() << "\");" << Qt::endl;
|
||||
}
|
||||
fout << "}" << Qt::endl;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -771,7 +936,11 @@ int PmuppScript::var_cmd(const QString str)
|
||||
int idx=0;
|
||||
|
||||
// get linked collection index for further use
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok[1].endsWith("Err")) // error variable no need to do something
|
||||
return 0;
|
||||
idx = getCollectionIndex(tok[1]);
|
||||
@ -962,7 +1131,11 @@ int PmuppScript::getCollectionIndex(const QString var_name)
|
||||
cmd = fScript.at(i);
|
||||
if (cmd.startsWith("col")) {
|
||||
tok.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = cmd.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = cmd.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok[3] == var_name) {
|
||||
idx = tok[1].toInt(&ok);
|
||||
if (!ok) {
|
||||
|
@ -191,7 +191,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
tok.clear();
|
||||
str = list.at(i);
|
||||
if (str.startsWith("loadPath")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() < 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -216,7 +220,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
}
|
||||
}
|
||||
} else if (str.startsWith("load")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() < 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -226,7 +234,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
}
|
||||
noOfCollections++;
|
||||
} else if (str.startsWith("x")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -235,7 +247,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
return -1;
|
||||
}
|
||||
} else if (str.startsWith("y")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() < 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -244,7 +260,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
return -1;
|
||||
}
|
||||
} else if (str.startsWith("select ")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -261,7 +281,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
return -1;
|
||||
}
|
||||
} else if (str.startsWith("savePath")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -270,7 +294,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
return -1;
|
||||
}
|
||||
} else if (str.startsWith("plot")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -280,7 +308,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
}
|
||||
// check extension
|
||||
tok.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split('.', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split('.', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QString ext = tok.at(tok.size()-1);
|
||||
ext = ext.toLower();
|
||||
if ((ext != "pdf") && (ext != "jpg") && (ext != "png") && (ext != "svg") && (ext != "gif")) {
|
||||
@ -292,7 +324,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
return -2;
|
||||
}
|
||||
} else if (str.startsWith("macro")) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -302,7 +338,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
}
|
||||
// check extension
|
||||
tok.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split('.', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split('.', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QString ext = tok.at(tok.size()-1);
|
||||
ext = ext.toLower();
|
||||
if (ext != "c") {
|
||||
@ -317,7 +357,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
// nothing-to-be-done
|
||||
} else if (str.startsWith("var")) {
|
||||
tok.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() < 2) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
@ -332,7 +376,11 @@ int mupp_script_syntax_check(QStringList &list)
|
||||
// the parsing etc is dealt within the scripting class
|
||||
} else if (str.startsWith("col")) {
|
||||
tok.clear();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
tok = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
tok = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (tok.size() != 4) {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "****************" << std::endl;
|
||||
|
@ -478,7 +478,11 @@ int PMusrStep::readMsrFile()
|
||||
}
|
||||
|
||||
if (parameter) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
strL = str.split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
strL = str.split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if ((strL.size() != 5) && (strL.size() != 7)) {
|
||||
fin.close();
|
||||
return -2;
|
||||
|
@ -660,7 +660,11 @@ bool PInstrumentDefXMLParser::characters()
|
||||
fSetup->setLgb(ival);
|
||||
break;
|
||||
case eBkgRange:
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
strList = str.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
strList = str.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (strList.size() != 2) {
|
||||
errMsg = QString("Found wrong Asymmetry background range: '%1'").arg(str);
|
||||
QMessageBox::critical(0, "ERROR", errMsg);
|
||||
|
@ -920,7 +920,11 @@ void PTheoPage::checkTheory()
|
||||
return;
|
||||
}
|
||||
} else { // assume musrfit functions here
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList strList = line[i].split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList strList = line[i].split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
func = fAdmin->getMusrfitFunc(strList[0]);
|
||||
if (func.getName() == "UnDef") { // function not found
|
||||
QString str = QString("**ERROR** in line %1, '%2' is not a recognized musrfit function.").arg(i+1).arg(line[i]);
|
||||
@ -998,7 +1002,11 @@ QString PTheoPage::getTheoryFunction(int idx)
|
||||
*/
|
||||
bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = str.trimmed().split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = str.trimmed().split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
bool ok;
|
||||
// check if line is of the form 'funX' or 'mapX'
|
||||
@ -2070,6 +2078,7 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
QString line = QString("###############################################################");
|
||||
|
||||
// write title
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << fMsrData->getMsrFileName() << endl;
|
||||
fout << line << endl;
|
||||
|
||||
@ -2095,6 +2104,33 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
}
|
||||
#else
|
||||
fout << fMsrData->getMsrFileName() << Qt::endl;
|
||||
fout << line << Qt::endl;
|
||||
|
||||
// write parameter block
|
||||
fout << "FITPARAMETER" << Qt::endl;
|
||||
fout << "# Nr. Name Value Step Pos_Error Boundaries" << Qt::endl;
|
||||
PParam param;
|
||||
// global fit parameters
|
||||
for (int i=0; i<fMsrData->getNoOfParam(); i++) {
|
||||
param = fMsrData->getParam(i);
|
||||
fout << qSetFieldWidth(9);
|
||||
fout << Qt::right << param.getNumber();
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
fout << Qt::left << param.getName();
|
||||
fout << Qt::left << param.getValue();
|
||||
fout << Qt::left << param.getStep();
|
||||
fout << Qt::left << param.getPosErr();
|
||||
if (!param.getBoundLow().isEmpty())
|
||||
fout << Qt::left << param.getBoundLow();
|
||||
if (!param.getBoundHigh().isEmpty())
|
||||
fout << Qt::left << param.getBoundHigh();
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// detector specific fit parameters
|
||||
QString str;
|
||||
@ -2135,9 +2171,14 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
detector = setup->getDetector(i);
|
||||
detectorName = detector->getName();
|
||||
// name comment
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "# " << detectorName << endl;
|
||||
#else
|
||||
fout << "# " << detectorName << Qt::endl;
|
||||
#endif
|
||||
|
||||
// first all maps
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++) {
|
||||
map = fMsrData->getMap(j);
|
||||
fout << qSetFieldWidth(9);
|
||||
@ -2166,57 +2207,139 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
}
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++) {
|
||||
map = fMsrData->getMap(j);
|
||||
fout << qSetFieldWidth(9);
|
||||
fout << Qt::right << fMsrData->getNoOfParam() + 1 + j + (fMsrData->getNoOfMap()+2)*i;
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
str = map.getName() + QString("_%1").arg(detectorName);
|
||||
fout << Qt::left << str;
|
||||
if (map.getName().startsWith("ph", Qt::CaseInsensitive) ||
|
||||
map.getName().startsWith("relph", Qt::CaseInsensitive)) {
|
||||
fout << Qt::left << detector->getRelGeomPhase();
|
||||
// if RelPh is found, the first will be fixed to 0
|
||||
if (map.getName().startsWith("relph", Qt::CaseInsensitive) && (i==0))
|
||||
fout << Qt::left << 0.0;
|
||||
else
|
||||
fout << Qt::left << 12.3;
|
||||
fout << Qt::left << "none";
|
||||
} else {
|
||||
fout << Qt::left << map.getValue();
|
||||
fout << Qt::left << map.getStep();
|
||||
fout << Qt::left << map.getPosErr();
|
||||
if (map.getBoundLow() != "")
|
||||
fout << Qt::left << map.getBoundLow();
|
||||
if (map.getBoundHigh() != "")
|
||||
fout << Qt::left << map.getBoundHigh();
|
||||
}
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// write N0 and N_bkg
|
||||
fout << qSetFieldWidth(9);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << right << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 1 + (fMsrData->getNoOfMap()+2)*i;
|
||||
#else
|
||||
fout << Qt::right << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 1 + (fMsrData->getNoOfMap()+2)*i;
|
||||
#endif
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
str = QString("N0_%1").arg(detectorName);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << left << str;
|
||||
fout << left << "123.4";
|
||||
fout << left << "1.0";
|
||||
fout << left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::left << str;
|
||||
fout << Qt::left << "123.4";
|
||||
fout << Qt::left << "1.0";
|
||||
fout << Qt::left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
|
||||
fout << qSetFieldWidth(9);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << right << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 2 + (fMsrData->getNoOfMap()+2)*i;
|
||||
#else
|
||||
fout << Qt::right << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 2 + (fMsrData->getNoOfMap()+2)*i;
|
||||
#endif
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
str = QString("N_bkg_%1").arg(detectorName);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << left << str;
|
||||
fout << left << "1.234";
|
||||
fout << left << "0.1";
|
||||
fout << left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::left << str;
|
||||
fout << Qt::left << "1.234";
|
||||
fout << Qt::left << "0.1";
|
||||
fout << Qt::left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
fout.setFieldWidth(0);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write theory block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "THEORY" << endl;
|
||||
fout << fMsrData->getTheory() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "THEORY" << Qt::endl;
|
||||
fout << fMsrData->getTheory() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write functions block
|
||||
if (fMsrData->getNoOfFunc() > 0) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "FUNCTIONS" << endl;
|
||||
for (int i=0; i<fMsrData->getNoOfFunc(); i++) {
|
||||
fout << fMsrData->getFunc(fMsrData->getFuncNo(i)) << endl;
|
||||
}
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "FUNCTIONS" << Qt::endl;
|
||||
for (int i=0; i<fMsrData->getNoOfFunc(); i++) {
|
||||
fout << fMsrData->getFunc(fMsrData->getFuncNo(i)) << Qt::endl;
|
||||
}
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// write global block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "GLOBAL" << endl;
|
||||
fout << "fittype " << fMsrData->getFitType()-1 << endl;
|
||||
fout << "fit " << fMsrData->getFitStart() << " " << fMsrData->getFitEnd() << endl;
|
||||
fout << "packing " << fMsrData->getPacking() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "GLOBAL" << Qt::endl;
|
||||
fout << "fittype " << fMsrData->getFitType()-1 << Qt::endl;
|
||||
fout << "fit " << fMsrData->getFitStart() << " " << fMsrData->getFitEnd() << Qt::endl;
|
||||
fout << "packing " << fMsrData->getPacking() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write run block(s)
|
||||
int t0 = 0;
|
||||
@ -2229,15 +2352,26 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
for (int i=0; i<noOfDetec; i++) {
|
||||
detector = setup->getDetector(i);
|
||||
detectorNo = detector->getForwards();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "RUN " << runName << endl;
|
||||
#else
|
||||
fout << "RUN " << runName << Qt::endl;
|
||||
#endif
|
||||
fout << "map ";
|
||||
fout << qSetFieldWidth(10);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++)
|
||||
fout << left << fMsrData->getNoOfParam()+ 1 + (fMsrData->getNoOfMap()+2)*i + j;
|
||||
fout << qSetFieldWidth(0) << endl;
|
||||
#else
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++)
|
||||
fout << Qt::left << fMsrData->getNoOfParam()+ 1 + (fMsrData->getNoOfMap()+2)*i + j;
|
||||
fout << qSetFieldWidth(0) << Qt::endl;
|
||||
#endif
|
||||
fout << "forward ";
|
||||
for (int j=0; j<detectorNo.size()-1; j++)
|
||||
fout << detectorNo[j] << " ";
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << detectorNo[detectorNo.size()-1] << endl;
|
||||
fout << "norm " << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 1 + (fMsrData->getNoOfMap()+2)*i << endl;
|
||||
fout << "backgr.fit " << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 2 + (fMsrData->getNoOfMap()+2)*i << endl;
|
||||
@ -2252,32 +2386,77 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
||||
fout << "#-----------------------------------------------" << endl;
|
||||
else
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << detectorNo[detectorNo.size()-1] << Qt::endl;
|
||||
fout << "norm " << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 1 + (fMsrData->getNoOfMap()+2)*i << Qt::endl;
|
||||
fout << "backgr.fit " << fMsrData->getNoOfParam() + fMsrData->getNoOfMap() + 2 + (fMsrData->getNoOfMap()+2)*i << Qt::endl;
|
||||
if (fMsrData->getT0Tag() == T0_ENTER_WIZ) {
|
||||
fout << "data " << t0+fgbOffset << " " << lgb << Qt::endl;
|
||||
fout << "t0 " << t0 << Qt::endl;
|
||||
} else if (fMsrData->getT0Tag() == T0_FROM_MUSR_T0) {
|
||||
fout << "data 120 " << lgb << Qt::endl;
|
||||
fout << "t0 100 " << Qt::endl;
|
||||
}
|
||||
if (i<noOfDetec-1)
|
||||
fout << "#-----------------------------------------------" << Qt::endl;
|
||||
else
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// write command block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "COMMANDS" << endl;
|
||||
fout << fMsrData->getCmd() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "COMMANDS" << Qt::endl;
|
||||
fout << fMsrData->getCmd() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write plot block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "PLOT " << fMsrData->getFitType()-1 << endl;
|
||||
fout << "lifetimecorrection" << endl;
|
||||
fout << "runs 1-" << setup->getNoOfLogicalDetectors() << endl;
|
||||
fout << "range 0.0 " << fMsrData->getFitEnd() << endl;
|
||||
fout << "view_packing " << fMsrData->getPacking() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "PLOT " << fMsrData->getFitType()-1 << Qt::endl;
|
||||
fout << "lifetimecorrection" << Qt::endl;
|
||||
fout << "runs 1-" << setup->getNoOfLogicalDetectors() << Qt::endl;
|
||||
fout << "range 0.0 " << fMsrData->getFitEnd() << Qt::endl;
|
||||
fout << "view_packing " << fMsrData->getPacking() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write fourier block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "FOURIER" << endl;
|
||||
fout << "units MHz" << endl;
|
||||
fout << "fourier_power 12" << endl;
|
||||
fout << "apodization NONE" << endl;
|
||||
fout << "plot POWER" << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "FOURIER" << Qt::endl;
|
||||
fout << "units MHz" << Qt::endl;
|
||||
fout << "fourier_power 12" << Qt::endl;
|
||||
fout << "apodization NONE" << Qt::endl;
|
||||
fout << "plot POWER" << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write statistic block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "STATISTIC --- " << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss") << endl;
|
||||
fout << "*** FIT DID NOT CONVERGE ***" << endl;
|
||||
#else
|
||||
fout << "STATISTIC --- " << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss") << Qt::endl;
|
||||
fout << "*** FIT DID NOT CONVERGE ***" << Qt::endl;
|
||||
#endif
|
||||
|
||||
fln.close();
|
||||
|
||||
@ -2303,20 +2482,35 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
QString line = QString("###############################################################");
|
||||
|
||||
// write title
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << fMsrData->getMsrFileName() << endl;
|
||||
fout << line << endl;
|
||||
#else
|
||||
fout << fMsrData->getMsrFileName() << Qt::endl;
|
||||
fout << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write parameter block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "FITPARAMETER" << endl;
|
||||
fout << "# Nr. Name Value Step Pos_Error Boundaries" << endl;
|
||||
#else
|
||||
fout << "FITPARAMETER" << Qt::endl;
|
||||
fout << "# Nr. Name Value Step Pos_Error Boundaries" << Qt::endl;
|
||||
#endif
|
||||
PParam param;
|
||||
// global fit parameters
|
||||
for (int i=0; i<fMsrData->getNoOfParam(); i++) {
|
||||
param = fMsrData->getParam(i);
|
||||
fout << qSetFieldWidth(9);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << right << param.getNumber();
|
||||
#else
|
||||
fout << Qt::right << param.getNumber();
|
||||
#endif
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << left << param.getName();
|
||||
fout << left << param.getValue();
|
||||
fout << left << param.getStep();
|
||||
@ -2327,6 +2521,18 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
fout << left << param.getBoundHigh();
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::left << param.getName();
|
||||
fout << Qt::left << param.getValue();
|
||||
fout << Qt::left << param.getStep();
|
||||
fout << Qt::left << param.getPosErr();
|
||||
if (!param.getBoundLow().isEmpty())
|
||||
fout << Qt::left << param.getBoundLow();
|
||||
if (!param.getBoundHigh().isEmpty())
|
||||
fout << Qt::left << param.getBoundHigh();
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// detector specific fit parameters
|
||||
@ -2368,31 +2574,53 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
detector = setup->getAsymDetector(i);
|
||||
detectorName = detector->getName();
|
||||
// name comment
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "# " << detectorName << endl;
|
||||
#else
|
||||
fout << "# " << detectorName << Qt::endl;
|
||||
#endif
|
||||
|
||||
// first all maps
|
||||
|
||||
// write Alpha (mandatory)
|
||||
fout << qSetFieldWidth(9);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << right << fMsrData->getNoOfParam() + 1 + (fMsrData->getNoOfMap()+1)*i;
|
||||
#else
|
||||
fout << Qt::right << fMsrData->getNoOfParam() + 1 + (fMsrData->getNoOfMap()+1)*i;
|
||||
#endif
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
str = QString("Alpha_%1").arg(detectorName);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << left << str;
|
||||
fout << left << detector->getAlpha();
|
||||
fout << left << "0.01";
|
||||
fout << left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::left << str;
|
||||
fout << Qt::left << detector->getAlpha();
|
||||
fout << Qt::left << "0.01";
|
||||
fout << Qt::left << "none";
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write user defined maps
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++) {
|
||||
map = fMsrData->getMap(j);
|
||||
fout << qSetFieldWidth(9);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << right << fMsrData->getNoOfParam() + 2 + j + (fMsrData->getNoOfMap()+1)*i;
|
||||
#else
|
||||
fout << Qt::right << fMsrData->getNoOfParam() + 2 + j + (fMsrData->getNoOfMap()+1)*i;
|
||||
#endif
|
||||
fout << qSetFieldWidth(0) << " ";
|
||||
fout << qSetFieldWidth(11);
|
||||
str = map.getName() + QString("_%1").arg(detectorName);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << left << str;
|
||||
if (map.getName().startsWith("ph", Qt::CaseInsensitive) ||
|
||||
map.getName().startsWith("relph", Qt::CaseInsensitive)) {
|
||||
@ -2413,32 +2641,84 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
}
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << endl;
|
||||
#else
|
||||
fout << Qt::left << str;
|
||||
if (map.getName().startsWith("ph", Qt::CaseInsensitive) ||
|
||||
map.getName().startsWith("relph", Qt::CaseInsensitive)) {
|
||||
fout << Qt::left << detector->getRelGeomPhase();
|
||||
if (map.getName().startsWith("relph", Qt::CaseInsensitive) && (i==0))
|
||||
fout << Qt::left << 0.0;
|
||||
else
|
||||
fout << Qt::left << 12.3;
|
||||
fout << Qt::left << "none";
|
||||
} else {
|
||||
fout << Qt::left << map.getValue();
|
||||
fout << Qt::left << map.getStep();
|
||||
fout << Qt::left << map.getPosErr();
|
||||
if (map.getBoundLow() != "")
|
||||
fout << Qt::left << map.getBoundLow();
|
||||
if (map.getBoundHigh() != "")
|
||||
fout << Qt::left << map.getBoundHigh();
|
||||
}
|
||||
fout << qSetFieldWidth(0);
|
||||
fout << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
fout.setFieldWidth(0);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write theory block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "THEORY" << endl;
|
||||
fout << fMsrData->getTheory();
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "THEORY" << Qt::endl;
|
||||
fout << fMsrData->getTheory();
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write functions block
|
||||
if (fMsrData->getNoOfFunc() > 0) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "FUNCTIONS" << endl;
|
||||
#else
|
||||
fout << "FUNCTIONS" << Qt::endl;
|
||||
#endif
|
||||
for (int i=0; i<fMsrData->getNoOfFunc(); i++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << fMsrData->getFunc(fMsrData->getFuncNo(i)) << endl;
|
||||
#else
|
||||
fout << fMsrData->getFunc(fMsrData->getFuncNo(i)) << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// write global block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "GLOBAL" << endl;
|
||||
fout << "fittype " << fMsrData->getFitType()-1 << endl;
|
||||
fout << "fit " << fMsrData->getFitStart() << " " << fMsrData->getFitEnd() << endl;
|
||||
fout << "packing " << fMsrData->getPacking() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "GLOBAL" << Qt::endl;
|
||||
fout << "fittype " << fMsrData->getFitType()-1 << Qt::endl;
|
||||
fout << "fit " << fMsrData->getFitStart() << " " << fMsrData->getFitEnd() << Qt::endl;
|
||||
fout << "packing " << fMsrData->getPacking() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write run block(s)
|
||||
int t0 = 0;
|
||||
@ -2452,11 +2732,17 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
detector = setup->getAsymDetector(i);
|
||||
detectorNoF = detector->getForwards();
|
||||
detectorNoB = detector->getBackwards();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "RUN " << runName << endl;
|
||||
fout << "alpha " << fMsrData->getNoOfParam() + 1 + (fMsrData->getNoOfMap()+1)*i << endl;
|
||||
#else
|
||||
fout << "RUN " << runName << Qt::endl;
|
||||
fout << "alpha " << fMsrData->getNoOfParam() + 1 + (fMsrData->getNoOfMap()+1)*i << Qt::endl;
|
||||
#endif
|
||||
|
||||
fout << "map ";
|
||||
fout << qSetFieldWidth(10);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
if (fMsrData->getNoOfMap() == 0) {
|
||||
fout << left << "0 0 0 0 0 0 0 0 0 0";
|
||||
} else {
|
||||
@ -2464,34 +2750,76 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
fout << left << fMsrData->getNoOfParam() + 2 + (fMsrData->getNoOfMap()+1)*i + j;
|
||||
}
|
||||
fout << qSetFieldWidth(0) << endl;
|
||||
#else
|
||||
if (fMsrData->getNoOfMap() == 0) {
|
||||
fout << Qt::left << "0 0 0 0 0 0 0 0 0 0";
|
||||
} else {
|
||||
for (int j=0; j<fMsrData->getNoOfMap(); j++)
|
||||
fout << Qt::left << fMsrData->getNoOfParam() + 2 + (fMsrData->getNoOfMap()+1)*i + j;
|
||||
}
|
||||
fout << qSetFieldWidth(0) << Qt::endl;
|
||||
#endif
|
||||
fout << "forward ";
|
||||
for (int j=0; j<detectorNoF.size()-1; j++)
|
||||
fout << detectorNoF[j] << " ";
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << detectorNoF[detectorNoF.size()-1] << endl;
|
||||
#else
|
||||
fout << detectorNoF[detectorNoF.size()-1] << Qt::endl;
|
||||
#endif
|
||||
fout << "backward ";
|
||||
for (int j=0; j<detectorNoB.size()-1; j++)
|
||||
fout << detectorNoB[j] << " ";
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << detectorNoB[detectorNoB.size()-1] << endl;
|
||||
fout << "background " << setup->getBkgStartBin() << " " << setup->getBkgEndBin() << " " << setup->getBkgStartBin() << " " << setup->getBkgEndBin() << endl;
|
||||
#else
|
||||
fout << detectorNoB[detectorNoB.size()-1] << Qt::endl;
|
||||
fout << "background " << setup->getBkgStartBin() << " " << setup->getBkgEndBin() << " " << setup->getBkgStartBin() << " " << setup->getBkgEndBin() << Qt::endl;
|
||||
#endif
|
||||
if (fMsrData->getT0Tag() == T0_ENTER_WIZ) {
|
||||
fout << "data " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << endl;;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "data " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << endl;
|
||||
fout << "t0 " << t0 << " " << t0 << endl;
|
||||
#else
|
||||
fout << "data " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << " " << t0+fgbOffset << " " << lgb << Qt::endl;
|
||||
fout << "t0 " << t0 << " " << t0 << Qt::endl;
|
||||
#endif
|
||||
} else if (fMsrData->getT0Tag() == T0_FROM_MUSR_T0) { // musrt0 shall be called
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "data 120 " << lgb << " 120 " << lgb << endl;
|
||||
fout << "t0 100 100" << endl;
|
||||
#else
|
||||
fout << "data 120 " << lgb << " 120 " << lgb << Qt::endl;
|
||||
fout << "t0 100 100" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
if (i<noOfDetec-1)
|
||||
fout << "#-----------------------------------------------" << endl;
|
||||
else
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
if (i<noOfDetec-1)
|
||||
fout << "#-----------------------------------------------" << Qt::endl;
|
||||
else
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// write command block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "COMMANDS" << endl;
|
||||
fout << fMsrData->getCmd() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "COMMANDS" << Qt::endl;
|
||||
fout << fMsrData->getCmd() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write plot block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "PLOT " << fMsrData->getFitType()-1 << endl;
|
||||
fout << "lifetimecorrection" << endl;
|
||||
if (setup->getNoOfLogicalAsymDetectors() > 1)
|
||||
@ -2501,18 +2829,43 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
||||
fout << "range 0.0 " << fMsrData->getFitEnd() << endl;
|
||||
fout << "view_packing " << fMsrData->getPacking() << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "PLOT " << fMsrData->getFitType()-1 << Qt::endl;
|
||||
fout << "lifetimecorrection" << Qt::endl;
|
||||
if (setup->getNoOfLogicalAsymDetectors() > 1)
|
||||
fout << "runs 1-" << setup->getNoOfLogicalAsymDetectors() << Qt::endl;
|
||||
else
|
||||
fout << "runs 1" << Qt::endl;
|
||||
fout << "range 0.0 " << fMsrData->getFitEnd() << Qt::endl;
|
||||
fout << "view_packing " << fMsrData->getPacking() << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write fourier block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "FOURIER" << endl;
|
||||
fout << "units MHz" << endl;
|
||||
fout << "fourier_power 12" << endl;
|
||||
fout << "apodization NONE" << endl;
|
||||
fout << "plot POWER" << endl;
|
||||
fout << endl << line << endl;
|
||||
#else
|
||||
fout << "FOURIER" << Qt::endl;
|
||||
fout << "units MHz" << Qt::endl;
|
||||
fout << "fourier_power 12" << Qt::endl;
|
||||
fout << "apodization NONE" << Qt::endl;
|
||||
fout << "plot POWER" << Qt::endl;
|
||||
fout << Qt::endl << line << Qt::endl;
|
||||
#endif
|
||||
|
||||
// write statistic block
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << "STATISTIC --- " << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss") << endl;
|
||||
fout << "*** FIT DID NOT CONVERGE ***" << endl;
|
||||
#else
|
||||
fout << "STATISTIC --- " << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss") << Qt::endl;
|
||||
fout << "*** FIT DID NOT CONVERGE ***" << Qt::endl;
|
||||
#endif
|
||||
|
||||
fln.close();
|
||||
|
||||
|
@ -1,28 +1,12 @@
|
||||
#--- musredit for Qt > 5.0 ----------------------------------------------------
|
||||
|
||||
#--- check if Qt5WebEngine or Qt5WebKit is present ----------------------------
|
||||
find_package(Qt5WebEngine QUIET)
|
||||
find_package(Qt5WebKit QUIET)
|
||||
#find_package(Qt5WebEngine QUIET)
|
||||
#find_package(Qt5WebKit QUIET)
|
||||
|
||||
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Svg Qt5::PrintSupport)
|
||||
set(Qt5NoWeb 0)
|
||||
if (Qt5WebEngine_FOUND)
|
||||
message("-- Qt5WebEngine is present.")
|
||||
find_package(Qt5WebEngineWidgets QUIET CONFIG REQUIRED)
|
||||
set(qt_libs ${qt_libs} Qt5::WebEngine Qt5::WebEngineWidgets)
|
||||
# unset a potentially found Qt5Webkit
|
||||
unset(Qt5WebKit_FOUND)
|
||||
elseif (Qt5WebKit_FOUND)
|
||||
message("-- Qt5WebKit is present.")
|
||||
find_package(Qt5WebKitWidgets QUIET CONFIG REQUIRED)
|
||||
set(qt_libs ${qt_libs} Qt5::WebKit Qt5::WebKitWidgets)
|
||||
else (Qt5WebEngine_FOUND)
|
||||
message("-- Neither Qt5WebEngine nor Qt5WebKit found.")
|
||||
set(Qt5NoWeb 1)
|
||||
endif (Qt5WebEngine_FOUND)
|
||||
|
||||
set(musredit_src
|
||||
PHelp.cpp
|
||||
PTextEdit.cpp
|
||||
PSubTextEdit.cpp
|
||||
PAdmin.cpp
|
||||
|
@ -1017,8 +1017,13 @@ int PAdmin::savePrefs(QString pref_fln)
|
||||
return 0;
|
||||
}
|
||||
fin.setDevice(&file);
|
||||
for (int i=0; i<data.size(); i++)
|
||||
for (int i=0; i<data.size(); i++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fin << data[i] << endl;
|
||||
#else
|
||||
fin << data[i] << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
file.close();
|
||||
} else {
|
||||
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
||||
@ -1106,8 +1111,13 @@ void PAdmin::saveRecentFiles()
|
||||
return;
|
||||
}
|
||||
fin.setDevice(&file);
|
||||
for (int i=0; i<data.size(); i++)
|
||||
for (int i=0; i<data.size(); i++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fin << data[i] << endl;
|
||||
#else
|
||||
fin << data[i] << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
file.close();
|
||||
} else {
|
||||
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
||||
@ -1176,7 +1186,11 @@ void PAdmin::createMusreditStartupFile()
|
||||
line.replace("12", "16");
|
||||
}
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
fout << line << endl;
|
||||
#else
|
||||
fout << line << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
@ -318,15 +318,28 @@ void PChangeDefaultPathsDialog::saveDefaultPathList()
|
||||
if (!str.trimmed().startsWith("<data_path>")) {
|
||||
// if not data_path was present, add the new data_paths just before the end of the musrfit_start.xml close tag
|
||||
if ((dataPathPresent == false) && (str.trimmed().startsWith("</musrfit>"))) {
|
||||
for (int j=0; j<fSearchPath_listWidget->count(); j++)
|
||||
for (int j=0; j<fSearchPath_listWidget->count(); j++) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
out << " <data_path>" << fSearchPath_listWidget->item(j)->text() << "</data_path>" << endl;
|
||||
#else
|
||||
out << " <data_path>" << fSearchPath_listWidget->item(j)->text() << "</data_path>" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
out << fileContent[i] << endl;
|
||||
#else
|
||||
out << fileContent[i] << Qt::endl;
|
||||
#endif
|
||||
} else {
|
||||
if (first) {
|
||||
first = false;
|
||||
for (int j=0; j<fSearchPath_listWidget->count(); j++)
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
out << " <data_path>" << fSearchPath_listWidget->item(j)->text() << "</data_path>" << endl;
|
||||
#else
|
||||
out << " <data_path>" << fSearchPath_listWidget->item(j)->text() << "</data_path>" << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,12 @@ PDumpOutputHandler::PDumpOutputHandler(QVector<QString> &cmd)
|
||||
tr("Quit") );
|
||||
done(0);
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0))
|
||||
fProcPID = fProc->pid();
|
||||
#else
|
||||
fProcPID = fProc->processId();
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -97,7 +102,11 @@ PDumpOutputHandler::~PDumpOutputHandler()
|
||||
if (fProc->state() == QProcess::Running) {
|
||||
fProc->terminate();
|
||||
if (!fProc->waitForFinished()) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qDebug() << "fProc still running, will call kill." << endl;
|
||||
#else
|
||||
qDebug() << "fProc still running, will call kill." << Qt::endl;
|
||||
#endif
|
||||
fProc->kill();
|
||||
}
|
||||
fProc->waitForFinished();
|
||||
@ -105,7 +114,11 @@ PDumpOutputHandler::~PDumpOutputHandler()
|
||||
if (fProc->state() == QProcess::Running) {
|
||||
QString cmd = "kill -9 "+ QString("%1").arg(fProcPID);
|
||||
QString msg = "fProc still running even after Qt kill, will try system kill cmd: "+cmd;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qDebug() << msg << endl;
|
||||
#else
|
||||
qDebug() << msg << Qt::endl;
|
||||
#endif
|
||||
system(cmd.toLatin1());
|
||||
}
|
||||
if (fProc) {
|
||||
|
@ -44,8 +44,8 @@
|
||||
* \param parent pointer to the parent object
|
||||
* \param f qt specific window flags
|
||||
*/
|
||||
PFindDialog::PFindDialog(PFindReplaceData *data, const bool selection, QWidget *parent, Qt::WindowFlags f) :
|
||||
QDialog(parent, f), fData(data)
|
||||
PFindDialog::PFindDialog(PFindReplaceData *data, const bool selection, QWidget *parent) :
|
||||
QDialog(parent), fData(data)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class PFindDialog : public QDialog, private Ui::PFindDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PFindDialog(PFindReplaceData *data, const bool selection, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PFindDialog(PFindReplaceData *data, const bool selection, QWidget *parent = nullptr);
|
||||
virtual ~PFindDialog() {}
|
||||
|
||||
virtual PFindReplaceData *getData();
|
||||
|
@ -89,7 +89,11 @@ PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QVector<QString>
|
||||
tr("Quit") );
|
||||
done(0);
|
||||
}
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0))
|
||||
fProcPID = fProc->pid();
|
||||
#else
|
||||
fProcPID = fProc->processId();
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -101,7 +105,11 @@ PFitOutputHandler::~PFitOutputHandler()
|
||||
if (fProc->state() == QProcess::Running) {
|
||||
fProc->terminate();
|
||||
if (!fProc->waitForFinished()) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qDebug() << "fProc still running, will call kill." << endl;
|
||||
#else
|
||||
qDebug() << "fProc still running, will call kill." << Qt::endl;
|
||||
#endif
|
||||
fProc->kill();
|
||||
}
|
||||
fProc->waitForFinished();
|
||||
@ -109,7 +117,11 @@ PFitOutputHandler::~PFitOutputHandler()
|
||||
if (fProc->state() == QProcess::Running) {
|
||||
QString cmd = "kill -9 "+ QString("%1").arg(fProcPID);
|
||||
QString msg = "fProc still running even after Qt kill, will try system kill cmd: "+cmd;
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qDebug() << msg << endl;
|
||||
#else
|
||||
qDebug() << msg << Qt::endl;
|
||||
#endif
|
||||
system(cmd.toLatin1());
|
||||
}
|
||||
if (fProc) {
|
||||
@ -149,8 +161,13 @@ void PFitOutputHandler::readFromStdErr()
|
||||
*/
|
||||
void PFitOutputHandler::processDone(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
{
|
||||
if ((exitStatus == QProcess::CrashExit) && (exitCode != 0))
|
||||
if ((exitStatus == QProcess::CrashExit) && (exitCode != 0)) {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
qDebug() << "**ERROR** PFitOutputHandler::processDone: exitCode = " << exitCode << endl;
|
||||
#else
|
||||
qDebug() << "**ERROR** PFitOutputHandler::processDone: exitCode = " << exitCode << Qt::endl;
|
||||
#endif
|
||||
}
|
||||
fQuitButton->setText("Done");
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <QValidator>
|
||||
#include <QComboBox>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PGetAsymmetryRunBlockDialog.h"
|
||||
|
||||
@ -284,12 +284,14 @@ void PGetAsymmetryRunBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PGetFourierBlockDialog.h"
|
||||
|
||||
@ -132,12 +132,14 @@ void PGetFourierBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,11 +32,11 @@
|
||||
#include <QMessageBox>
|
||||
#include <QRegExp>
|
||||
#include <QEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#include "PHelp.h"
|
||||
|
||||
#include "PGetFunctionsBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -108,12 +108,14 @@ void PGetFunctionsBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,9 @@
|
||||
#include <QValidator>
|
||||
#include <QComboBox>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "PGetMusrFTOptionsDialog.h"
|
||||
|
||||
@ -330,7 +331,11 @@ QStringList PGetMusrFTOptionsDialog::getMusrFTOptions()
|
||||
// histo list
|
||||
if (fHistoList_lineEdit->text().length() > 0) {
|
||||
cmd << "--histo";
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
strList = fHistoList_lineEdit->text().split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
strList = fHistoList_lineEdit->text().split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
for (int i=0; i<strList.size(); i++)
|
||||
cmd << strList[i];
|
||||
}
|
||||
@ -346,7 +351,11 @@ QStringList PGetMusrFTOptionsDialog::getMusrFTOptions()
|
||||
// t0 list
|
||||
if (fT0_lineEdit->text().length() > 0) {
|
||||
cmd << "--t0";
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
strList = fT0_lineEdit->text().split(" ", QString::SkipEmptyParts);
|
||||
#else
|
||||
strList = fT0_lineEdit->text().split(" ", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
for (int i=0; i<strList.size(); i++)
|
||||
cmd << strList[i];
|
||||
}
|
||||
@ -586,11 +595,13 @@ void PGetMusrFTOptionsDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,9 @@
|
||||
#include <QValidator>
|
||||
#include <QComboBox>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetNonMusrRunBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -156,12 +157,14 @@ void PGetNonMusrRunBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,9 @@
|
||||
#include <QTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetParameterBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -219,12 +220,14 @@ void PGetParameterBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,9 @@
|
||||
#include <QSpinBox>
|
||||
#include <QTextEdit>
|
||||
#include <QComboBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetPlotBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -160,12 +161,14 @@ void PGetPlotBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,9 @@
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetSingleHistoRunBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -282,12 +283,14 @@ void PGetSingleHistoRunBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,11 @@
|
||||
#include <QComboBox>
|
||||
#include <QPixmap>
|
||||
#include <QImage>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetTheoryBlockDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -126,12 +127,14 @@ void PGetTheoryBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include "PGetTitleBlockDialog.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@ -54,12 +55,14 @@ void PGetTitleBlockDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,202 +0,0 @@
|
||||
/****************************************************************************
|
||||
|
||||
PHelp.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
#ifdef HAVE_QT_WEB_ENGINE
|
||||
#include <QWebEngineView>
|
||||
#endif
|
||||
#ifdef HAVE_QT_WEB_KIT
|
||||
#include <QtWebKitWidgets>
|
||||
#endif
|
||||
#ifdef HAVE_QT_NO_WEB
|
||||
#include <QPlainTextEdit>
|
||||
#endif
|
||||
#include <QNetworkProxyFactory>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#include "PHelp.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Constructor.
|
||||
*
|
||||
* \param url help url
|
||||
*/
|
||||
PHelp::PHelp(const QString &url, const bool isDarkTheme) :
|
||||
fDarkTheme(isDarkTheme)
|
||||
{
|
||||
fProgress = 0;
|
||||
|
||||
QString iconName("");
|
||||
if (fDarkTheme)
|
||||
iconName = QString(":/icons/musrfit-help-dark.svg");
|
||||
else
|
||||
iconName = QString(":/icons/musrfit-help-plain.svg");
|
||||
setWindowIcon( QIcon( QPixmap(iconName) ) );
|
||||
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
|
||||
#ifdef HAVE_QT_WEB_ENGINE
|
||||
fView = new QWebEngineView(this);
|
||||
#endif
|
||||
#ifdef HAVE_QT_WEB_KIT
|
||||
fView = new QWebView(this);
|
||||
#endif
|
||||
#ifdef HAVE_QT_NO_WEB
|
||||
fView = new QPlainTextEdit(this);
|
||||
#endif
|
||||
#ifndef HAVE_QT_NO_WEB
|
||||
fView->load(QUrl(url));
|
||||
connect(fView, SIGNAL(loadFinished(bool)), SLOT(adjustLocation()));
|
||||
connect(fView, SIGNAL(titleChanged(QString)), SLOT(adjustTitle()));
|
||||
connect(fView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
|
||||
connect(fView, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
|
||||
#else
|
||||
fView->setPlainText("Within the current setup there is NO Help available.");
|
||||
fView->appendPlainText("The necessary Qt web libs where not found when setting up musredit.");
|
||||
fView->setReadOnly(true);
|
||||
#endif
|
||||
|
||||
fLocationEdit = new QLineEdit(this);
|
||||
fLocationEdit->setSizePolicy(QSizePolicy::Expanding, fLocationEdit->sizePolicy().verticalPolicy());
|
||||
connect(fLocationEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
|
||||
|
||||
QToolBar *toolBar = addToolBar(tr("Navigation"));
|
||||
#ifdef HAVE_QT_WEB_ENGINE
|
||||
toolBar->addAction(fView->pageAction(QWebEnginePage::Back));
|
||||
toolBar->addAction(fView->pageAction(QWebEnginePage::Forward));
|
||||
toolBar->addAction(fView->pageAction(QWebEnginePage::Reload));
|
||||
toolBar->addAction(fView->pageAction(QWebEnginePage::Stop));
|
||||
#endif
|
||||
#ifdef HAVE_QT_WEB_KIT
|
||||
toolBar->addAction(fView->pageAction(QWebPage::Back));
|
||||
toolBar->addAction(fView->pageAction(QWebPage::Forward));
|
||||
toolBar->addAction(fView->pageAction(QWebPage::Reload));
|
||||
toolBar->addAction(fView->pageAction(QWebPage::Stop));
|
||||
#endif
|
||||
toolBar->addWidget(fLocationEdit);
|
||||
|
||||
QMenu *exitMenu = menuBar()->addMenu(tr("&File"));
|
||||
exitMenu->addAction("&Exit", this, SLOT(done()), QKeySequence(tr("Ctrl+Q")));
|
||||
|
||||
setCentralWidget(fView);
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
setMinimumSize(800, 700);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Destructor
|
||||
*/
|
||||
PHelp::~PHelp()
|
||||
{
|
||||
if (fView) {
|
||||
delete fView;
|
||||
fView = 0;
|
||||
}
|
||||
|
||||
if (fLocationEdit) {
|
||||
delete fLocationEdit;
|
||||
fLocationEdit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Called on exit (SLOT). Closes the web-browser help GUI.
|
||||
*/
|
||||
void PHelp::done()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Called after an url is loaded (SLOT). Adjusts the url address.
|
||||
*/
|
||||
void PHelp::adjustLocation()
|
||||
{
|
||||
#ifndef HAVE_QT_NO_WEB
|
||||
fLocationEdit->setText(fView->url().toString());
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Called when the url address in the line edit changed (SLOT). Will execute
|
||||
* the load of the new url.
|
||||
*/
|
||||
void PHelp::changeLocation()
|
||||
{
|
||||
QUrl url = QUrl(fLocationEdit->text());
|
||||
#ifndef HAVE_QT_NO_WEB
|
||||
fView->load(url);
|
||||
fView->setFocus();
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Called when the title changed (SLOT). Will change the window title according
|
||||
* to the state of the web-browser.
|
||||
*/
|
||||
void PHelp::adjustTitle()
|
||||
{
|
||||
#ifndef HAVE_QT_NO_WEB
|
||||
if (fProgress <= 0 || fProgress >= 100)
|
||||
setWindowTitle(fView->title());
|
||||
else
|
||||
setWindowTitle(QString("%1 (%2%)").arg(fView->title()).arg(fProgress));
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Adjusts the progess value while loading an url. Also calls adjustTitle().
|
||||
*/
|
||||
void PHelp::setProgress(int p)
|
||||
{
|
||||
fProgress = p;
|
||||
adjustTitle();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Ajusts the title when an url has been loaded.
|
||||
*/
|
||||
void PHelp::finishLoading(bool)
|
||||
{
|
||||
fProgress = 100;
|
||||
adjustTitle();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// end
|
||||
//---------------------------------------------------------------------------
|
@ -1,81 +0,0 @@
|
||||
/****************************************************************************
|
||||
|
||||
PHelp.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PHELP_H_
|
||||
#define _PHELP_H_
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#ifdef HAVE_QT_WEB_ENGINE
|
||||
class QWebEngineView;
|
||||
#endif
|
||||
#ifdef HAVE_QT_WEB_KIT
|
||||
class QWebView;
|
||||
#endif
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Class providing the help interface for the user. It opens the wiki docu
|
||||
* pages such that a user has the chance to read.
|
||||
*/
|
||||
class PHelp : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PHelp(const QString &url, const bool isDarkTheme=false);
|
||||
virtual ~PHelp();
|
||||
|
||||
protected slots:
|
||||
void done();
|
||||
void adjustLocation();
|
||||
void changeLocation();
|
||||
void adjustTitle();
|
||||
void setProgress(int p);
|
||||
void finishLoading(bool);
|
||||
|
||||
private:
|
||||
bool fDarkTheme;
|
||||
#ifdef HAVE_QT_WEB_ENGINE
|
||||
QWebEngineView *fView; ///< web viewer
|
||||
#endif
|
||||
#ifdef HAVE_QT_WEB_KIT
|
||||
QWebView *fView; ///< web viewer
|
||||
#endif
|
||||
#ifdef HAVE_QT_NO_WEB
|
||||
QPlainTextEdit *fView; ///< dialog stating that there is NO web viewer
|
||||
#endif
|
||||
QLineEdit *fLocationEdit; ///< url address line edit
|
||||
int fProgress; ///< progress value (0-100) while loading an url
|
||||
};
|
||||
|
||||
#endif // _PHELP_H_
|
@ -32,8 +32,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QTextEdit>
|
||||
#include <QCheckBox>
|
||||
|
||||
#include "PHelp.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "PMsr2DataDialog.h"
|
||||
|
||||
@ -224,12 +224,14 @@ void PMsr2DataDialog::helpContent()
|
||||
if (fHelpUrl.isEmpty()) {
|
||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
||||
} else {
|
||||
#ifdef _WIN32GCC
|
||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
||||
#else
|
||||
PHelp *help = new PHelp(fHelpUrl);
|
||||
help->show();
|
||||
#endif // _WIN32GCC
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
/**
|
||||
* <p>Handles the musredit about popup.
|
||||
*/
|
||||
PMusrEditAbout::PMusrEditAbout(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
||||
PMusrEditAbout::PMusrEditAbout(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
|
@ -38,7 +38,7 @@ class PMusrEditAbout : public QDialog, private Ui::PMusrEditAbout
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PMusrEditAbout(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PMusrEditAbout(QWidget *parent = nullptr);
|
||||
virtual ~PMusrEditAbout() {}
|
||||
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
* \param parent pointer to the parent object
|
||||
* \param f qt windows flags
|
||||
*/
|
||||
PReplaceConfirmationDialog::PReplaceConfirmationDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
||||
PReplaceConfirmationDialog::PReplaceConfirmationDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
|
@ -40,7 +40,7 @@ class PReplaceConfirmationDialog : public QDialog, public Ui::PReplaceConfirmati
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PReplaceConfirmationDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PReplaceConfirmationDialog(QWidget *parent = nullptr);
|
||||
virtual ~PReplaceConfirmationDialog() {}
|
||||
};
|
||||
|
||||
|
@ -42,8 +42,8 @@
|
||||
* \param parent pointer to the parent object
|
||||
* \param f qt windows flag
|
||||
*/
|
||||
PReplaceDialog::PReplaceDialog(PFindReplaceData *data, const bool selection, QWidget *parent, Qt::WindowFlags f) :
|
||||
QDialog(parent, f), fData(data)
|
||||
PReplaceDialog::PReplaceDialog(PFindReplaceData *data, const bool selection, QWidget *parent) :
|
||||
QDialog(parent), fData(data)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
|
@ -38,7 +38,7 @@ class PReplaceDialog : public QDialog, private Ui::PReplaceDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PReplaceDialog(PFindReplaceData *data, const bool selection, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
PReplaceDialog(PFindReplaceData *data, const bool selection, QWidget *parent = nullptr);
|
||||
virtual ~PReplaceDialog() {}
|
||||
|
||||
virtual PFindReplaceData *getData();
|
||||
|
@ -58,11 +58,13 @@
|
||||
#include <QTextDocumentFragment>
|
||||
#include <QTextList>
|
||||
#include <QProcess>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#include "PTextEdit.h"
|
||||
#include "PHelp.h"
|
||||
#include "PSubTextEdit.h"
|
||||
#include "PAdmin.h"
|
||||
#include "PFindDialog.h"
|
||||
@ -82,8 +84,8 @@
|
||||
* \param parent pointer to the parent object
|
||||
* \param f qt windows flags
|
||||
*/
|
||||
PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
|
||||
: QMainWindow( parent, f )
|
||||
PTextEdit::PTextEdit( QWidget *parent )
|
||||
: QMainWindow( parent )
|
||||
{
|
||||
bool gotTheme = getTheme();
|
||||
|
||||
@ -1741,7 +1743,7 @@ void PTextEdit::editFind()
|
||||
if (!fFindReplaceData->fromCursor)
|
||||
currentEditor()->textCursor().setPosition(0);
|
||||
|
||||
QTextDocument::FindFlags flags = nullptr;
|
||||
QTextDocument::FindFlags flags;
|
||||
if (fFindReplaceData->caseSensitive)
|
||||
flags |= QTextDocument::FindCaseSensitively;
|
||||
else if (fFindReplaceData->findBackwards)
|
||||
@ -1758,7 +1760,7 @@ void PTextEdit::editFind()
|
||||
*/
|
||||
void PTextEdit::editFindNext()
|
||||
{
|
||||
QTextDocument::FindFlags flags = nullptr;
|
||||
QTextDocument::FindFlags flags;
|
||||
if (fFindReplaceData->caseSensitive)
|
||||
flags |= QTextDocument::FindCaseSensitively;
|
||||
else if (fFindReplaceData->wholeWordsOnly)
|
||||
@ -1773,7 +1775,7 @@ void PTextEdit::editFindNext()
|
||||
*/
|
||||
void PTextEdit::editFindPrevious()
|
||||
{
|
||||
QTextDocument::FindFlags flags = nullptr;
|
||||
QTextDocument::FindFlags flags;
|
||||
if (fFindReplaceData->caseSensitive)
|
||||
flags |= QTextDocument::FindCaseSensitively;
|
||||
else if (fFindReplaceData->wholeWordsOnly)
|
||||
@ -2934,6 +2936,8 @@ void PTextEdit::mupp()
|
||||
cmd = QString("/Applications/mupp.app/Contents/MacOS/mupp");
|
||||
#endif
|
||||
|
||||
QStringList arg;
|
||||
|
||||
QProcess *proc = new QProcess(this);
|
||||
|
||||
QString workDir = QFileInfo(*fFilenames.find( currentEditor() )).absolutePath();
|
||||
@ -2943,7 +2947,7 @@ void PTextEdit::mupp()
|
||||
env.insert("LD_LIBRARY_PATH", env.value("ROOTSYS") + "/lib:" + env.value("LD_LIBRARY_PATH"));
|
||||
proc->setProcessEnvironment(env);
|
||||
proc->setWorkingDirectory(workDir);
|
||||
proc->start(cmd);
|
||||
proc->start(cmd, arg);
|
||||
if (!proc->waitForStarted()) {
|
||||
// error handling
|
||||
QString msg(tr("Could not execute the output command: ")+cmd);
|
||||
@ -2961,8 +2965,14 @@ void PTextEdit::mupp()
|
||||
*/
|
||||
void PTextEdit::helpContents()
|
||||
{
|
||||
PHelp *help = new PHelp(fAdmin->getHelpUrl("main"), fDarkMenuIcon);
|
||||
help->show();
|
||||
bool ok = QDesktopServices::openUrl(QUrl(fAdmin->getHelpUrl("main"), QUrl::TolerantMode));
|
||||
if (!ok) {
|
||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fAdmin->getHelpUrl("main"));
|
||||
QMessageBox::critical( nullptr,
|
||||
tr("Fatal Error"),
|
||||
msg,
|
||||
tr("Quit") );
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -3178,7 +3188,7 @@ void PTextEdit::replaceAll()
|
||||
currentEditor()->moveCursor(QTextCursor::Start);
|
||||
|
||||
// construct search flags
|
||||
QTextDocument::FindFlags flags = 0;
|
||||
QTextDocument::FindFlags flags;
|
||||
if (fFindReplaceData->caseSensitive)
|
||||
flags |= QTextDocument::FindCaseSensitively;
|
||||
else if (fFindReplaceData->findBackwards)
|
||||
@ -3349,10 +3359,18 @@ QStringList PTextEdit::getRunList(QString runListStr, bool &ok)
|
||||
ok = true;
|
||||
|
||||
// first split space separated parts
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList tok = runListStr.split(' ', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList tok = runListStr.split(' ', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
for (int i=0; i<tok.size(); i++) {
|
||||
if (tok[i].contains('-')) { // list given, hence need to expand
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList runListTok = tok[i].split('-', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList runListTok = tok[i].split('-', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
if (runListTok.size() != 2) { // error
|
||||
ok = false;
|
||||
result.clear();
|
||||
|
@ -64,7 +64,7 @@ class PTextEdit : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PTextEdit( QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||
PTextEdit( QWidget *parent = nullptr );
|
||||
virtual ~PTextEdit() {}
|
||||
|
||||
public slots:
|
||||
|
Loading…
x
Reference in New Issue
Block a user