more work on Raw -> Smart Pointers for external libs.
This commit is contained in:
parent
7691ef2815
commit
af13e78c52
17
src/external/BMWtools/BMWIntegrator.h
vendored
17
src/external/BMWtools/BMWIntegrator.h
vendored
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -88,10 +89,8 @@ inline double T2Integrator::IntegrateFunc(double x1, double x2, const std::vecto
|
|||||||
ptrPair.first = (this);
|
ptrPair.first = (this);
|
||||||
ptrPair.second = ∥
|
ptrPair.second = ∥
|
||||||
|
|
||||||
ROOT::Math::GSLIntegrator *integrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
std::unique_ptr<ROOT::Math::GSLIntegrator> integrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||||
double value(integrator->Integral(&T2Integrator::FuncAtXgsl, static_cast<void*>(&ptrPair), x1, x2));
|
double value(integrator->Integral(&T2Integrator::FuncAtXgsl, static_cast<void*>(&ptrPair), x1, x2));
|
||||||
delete integrator;
|
|
||||||
integrator = nullptr;
|
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -115,7 +114,7 @@ class TIntegrator {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static double FuncAtXgsl(double, void *);
|
static double FuncAtXgsl(double, void *);
|
||||||
ROOT::Math::GSLIntegrator *fIntegrator; ///< pointer to the GSL integrator
|
std::unique_ptr<ROOT::Math::GSLIntegrator> fIntegrator; ///< pointer to the GSL integrator
|
||||||
mutable double (*fFunc)(double, void *); ///< pointer to the integrand function
|
mutable double (*fFunc)(double, void *); ///< pointer to the integrand function
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -125,7 +124,7 @@ class TIntegrator {
|
|||||||
* Allocation of memory for an integration using the adaptive 31 point Gauss-Kronrod rule
|
* Allocation of memory for an integration using the adaptive 31 point Gauss-Kronrod rule
|
||||||
*/
|
*/
|
||||||
inline TIntegrator::TIntegrator() : fFunc(0) {
|
inline TIntegrator::TIntegrator() : fFunc(0) {
|
||||||
fIntegrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
fIntegrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -135,8 +134,6 @@ inline TIntegrator::TIntegrator() : fFunc(0) {
|
|||||||
*/
|
*/
|
||||||
inline TIntegrator::~TIntegrator(){
|
inline TIntegrator::~TIntegrator(){
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
delete fIntegrator;
|
|
||||||
fIntegrator=nullptr;
|
|
||||||
fFunc=0;
|
fFunc=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +187,7 @@ class TMCIntegrator {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static double FuncAtXgsl(double *, size_t, void *);
|
static double FuncAtXgsl(double *, size_t, void *);
|
||||||
ROOT::Math::GSLMCIntegrator *fMCIntegrator; ///< pointer to the GSL integrator
|
std::unique_ptr<ROOT::Math::GSLMCIntegrator> fMCIntegrator; ///< pointer to the GSL integrator
|
||||||
mutable double (*fFunc)(double *, size_t, void *); ///< pointer to the integrand function
|
mutable double (*fFunc)(double *, size_t, void *); ///< pointer to the integrand function
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -200,7 +197,7 @@ class TMCIntegrator {
|
|||||||
* Allocation of memory for an integration using the MISER algorithm of Press and Farrar
|
* Allocation of memory for an integration using the MISER algorithm of Press and Farrar
|
||||||
*/
|
*/
|
||||||
inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
||||||
fMCIntegrator = new ROOT::Math::GSLMCIntegrator(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
|
fMCIntegrator = std::make_unique<ROOT::Math::GSLMCIntegrator>(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -210,8 +207,6 @@ inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
|||||||
*/
|
*/
|
||||||
inline TMCIntegrator::~TMCIntegrator(){
|
inline TMCIntegrator::~TMCIntegrator(){
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
delete fMCIntegrator;
|
|
||||||
fMCIntegrator=nullptr;
|
|
||||||
fFunc=0;
|
fFunc=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
96
src/external/BMWtools/TTrimSPDataHandler.cpp
vendored
96
src/external/BMWtools/TTrimSPDataHandler.cpp
vendored
@ -33,35 +33,31 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//--------------------
|
//--------------------
|
||||||
// Constructor of the TrimSPData class -- reading all available trim.SP-rge-files with a given name into std::vectors
|
// Constructor of the TrimSPData class -- reading all available trim.SP-rge-files with a given name into std::vectors
|
||||||
//--------------------
|
//--------------------
|
||||||
|
|
||||||
TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool debug, unsigned int highRes) {
|
TTrimSPData::TTrimSPData(const std::string &path, std::map<double, std::string> &energies, bool debug, unsigned int highRes) {
|
||||||
|
|
||||||
// sort the energies in ascending order - this might be useful for later applications (energy-interpolations etc.)
|
// sort the energies in ascending order - this might be useful for later applications (energy-interpolations etc.)
|
||||||
// after the change from the vector to the map this is not necessary any more - since maps are always ordered!
|
// after the change from the vector to the map this is not necessary any more - since maps are always ordered!
|
||||||
// sort(energies.begin(), energies.end());
|
// sort(energies.begin(), energies.end());
|
||||||
|
|
||||||
double zz(0.0), nzz(0.0);
|
double zz(0.0), nzz(0.0);
|
||||||
vector<double> vzz, vnzz;
|
std::vector<double> vzz, vnzz;
|
||||||
string word, energyStr;
|
std::string word, energyStr;
|
||||||
bool goodFile(false);
|
bool goodFile(false);
|
||||||
|
|
||||||
for ( map<double, string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
|
for ( std::map<double, std::string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
|
||||||
|
|
||||||
energyStr = path + iter->second + ".rge";
|
energyStr = path + iter->second + ".rge";
|
||||||
|
|
||||||
ifstream *rgeFile = new ifstream(energyStr.c_str());
|
std::unique_ptr<std::ifstream> rgeFile = std::make_unique<std::ifstream>(energyStr.c_str());
|
||||||
if(! *rgeFile) {
|
if (rgeFile == nullptr) {
|
||||||
cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << endl;
|
std::cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << std::endl;
|
||||||
delete rgeFile;
|
|
||||||
rgeFile = 0;
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
while (*rgeFile >> word) {
|
while (*rgeFile >> word) {
|
||||||
if (word == "PARTICLES") {
|
if (word == "PARTICLES") {
|
||||||
goodFile = true;
|
goodFile = true;
|
||||||
@ -92,8 +88,6 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
|||||||
|
|
||||||
|
|
||||||
rgeFile->close();
|
rgeFile->close();
|
||||||
delete rgeFile;
|
|
||||||
rgeFile = 0;
|
|
||||||
|
|
||||||
vzz.clear();
|
vzz.clear();
|
||||||
vnzz.clear();
|
vnzz.clear();
|
||||||
@ -106,14 +100,14 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << endl;
|
std::cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << endl;
|
std::cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << std::endl;
|
||||||
|
|
||||||
fOrigDataNZ = fDataNZ;
|
fOrigDataNZ = fDataNZ;
|
||||||
|
|
||||||
@ -139,8 +133,8 @@ void TTrimSPData::UseHighResolution(double e) {
|
|||||||
|
|
||||||
if (fEnergyIter != fEnergy.end()) {
|
if (fEnergyIter != fEnergy.end()) {
|
||||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||||
vector<double> vecZ;
|
std::vector<double> vecZ;
|
||||||
vector<double> vecNZ;
|
std::vector<double> vecNZ;
|
||||||
for (double zz(1.); zz<2100.; zz+=1.) {
|
for (double zz(1.); zz<2100.; zz+=1.) {
|
||||||
vecZ.push_back(zz);
|
vecZ.push_back(zz);
|
||||||
vecNZ.push_back(GetNofZ(zz/10.0, e));
|
vecNZ.push_back(GetNofZ(zz/10.0, e));
|
||||||
@ -153,7 +147,7 @@ void TTrimSPData::UseHighResolution(double e) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << endl;
|
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +155,7 @@ void TTrimSPData::UseHighResolution(double e) {
|
|||||||
// Method returning z-vector calculated by trim.SP for given energy[keV]
|
// Method returning z-vector calculated by trim.SP for given energy[keV]
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
vector<double> TTrimSPData::DataZ(double e) const {
|
std::vector<double> TTrimSPData::DataZ(double e) const {
|
||||||
|
|
||||||
FindEnergy(e);
|
FindEnergy(e);
|
||||||
|
|
||||||
@ -170,7 +164,7 @@ vector<double> TTrimSPData::DataZ(double e) const {
|
|||||||
return fDataZ[i];
|
return fDataZ[i];
|
||||||
}
|
}
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||||
return fDataZ[0];
|
return fDataZ[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +173,7 @@ vector<double> TTrimSPData::DataZ(double e) const {
|
|||||||
// potentially altered by the WeightLayers- or the Normalize-method for given energy[keV]
|
// potentially altered by the WeightLayers- or the Normalize-method for given energy[keV]
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
vector<double> TTrimSPData::DataNZ(double e) const {
|
std::vector<double> TTrimSPData::DataNZ(double e) const {
|
||||||
|
|
||||||
FindEnergy(e);
|
FindEnergy(e);
|
||||||
|
|
||||||
@ -188,16 +182,16 @@ vector<double> TTrimSPData::DataNZ(double e) const {
|
|||||||
return fDataNZ[i];
|
return fDataNZ[i];
|
||||||
}
|
}
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
std::cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||||
return fDataNZ[0];
|
|
||||||
|
|
||||||
|
return fDataNZ[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------
|
//---------------------
|
||||||
// Method returning original n(z)-vector calculated by trim.SP for given energy[keV]
|
// Method returning original n(z)-vector calculated by trim.SP for given energy[keV]
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
vector<double> TTrimSPData::OrigDataNZ(double e) const {
|
std::vector<double> TTrimSPData::OrigDataNZ(double e) const {
|
||||||
|
|
||||||
FindEnergy(e);
|
FindEnergy(e);
|
||||||
|
|
||||||
@ -206,9 +200,9 @@ vector<double> TTrimSPData::OrigDataNZ(double e) const {
|
|||||||
return fOrigDataNZ[i];
|
return fOrigDataNZ[i];
|
||||||
}
|
}
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
std::cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||||
return fOrigDataNZ[0];
|
|
||||||
|
|
||||||
|
return fOrigDataNZ[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
double TTrimSPData::DataDZ(double e) const {
|
double TTrimSPData::DataDZ(double e) const {
|
||||||
@ -220,9 +214,9 @@ double TTrimSPData::DataDZ(double e) const {
|
|||||||
return fDZ[i];
|
return fDZ[i];
|
||||||
}
|
}
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << endl;
|
std::cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << std::endl;
|
||||||
return 0.0;
|
|
||||||
|
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------
|
//---------------------
|
||||||
@ -230,10 +224,10 @@ double TTrimSPData::DataDZ(double e) const {
|
|||||||
// Parameters: Energy[keV], LayerNumber[1], Interfaces[nm]
|
// Parameters: Energy[keV], LayerNumber[1], Interfaces[nm]
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<double>& interface) const {
|
double TTrimSPData::LayerFraction(double e, unsigned int layno, const std::vector<double>& interface) const {
|
||||||
|
|
||||||
if (layno < 1 && layno > (interface.size()+1)) {
|
if (layno < 1 && layno > (interface.size()+1)) {
|
||||||
cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << endl;
|
std::cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << std::endl;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,9 +261,9 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
|
|||||||
}
|
}
|
||||||
|
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << endl;
|
std::cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << std::endl;
|
||||||
return 0.0;
|
|
||||||
|
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------
|
//---------------------
|
||||||
@ -280,22 +274,22 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
|
|||||||
// the first and last layers get the full n(z), where only one third of the muons in the second layer will be taken into account
|
// the first and last layers get the full n(z), where only one third of the muons in the second layer will be taken into account
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const vector<double>& weight) const {
|
void TTrimSPData::WeightLayers(double e, const std::vector<double>& interface, const std::vector<double>& weight) const {
|
||||||
|
|
||||||
if (weight.size()-interface.size()-1) {
|
if (weight.size()-interface.size()-1) {
|
||||||
cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << endl;
|
std::cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << std::endl;
|
||||||
cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << endl;
|
std::cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i(0); i<interface.size(); i++) {
|
for (unsigned int i(0); i<interface.size(); i++) {
|
||||||
if (interface[i]<0.0) {
|
if (interface[i]<0.0) {
|
||||||
cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << endl;
|
std::cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (i>1) {
|
else if (i>1) {
|
||||||
if (interface[i]<interface[i-1]) {
|
if (interface[i]<interface[i-1]) {
|
||||||
cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << endl;
|
std::cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -303,7 +297,7 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
|||||||
|
|
||||||
for (unsigned int i(0); i<weight.size(); i++) {
|
for (unsigned int i(0); i<weight.size(); i++) {
|
||||||
if (weight[i]>1.0 || weight[i]<0.0) {
|
if (weight[i]>1.0 || weight[i]<0.0) {
|
||||||
cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << endl;
|
std::cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -343,7 +337,7 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << endl;
|
std::cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +347,7 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
|||||||
|
|
||||||
double TTrimSPData::GetNofZ(double zz, double e) const {
|
double TTrimSPData::GetNofZ(double zz, double e) const {
|
||||||
|
|
||||||
vector<double> z, nz;
|
std::vector<double> z, nz;
|
||||||
|
|
||||||
FindEnergy(e);
|
FindEnergy(e);
|
||||||
|
|
||||||
@ -362,7 +356,7 @@ double TTrimSPData::GetNofZ(double zz, double e) const {
|
|||||||
z = fDataZ[i];
|
z = fDataZ[i];
|
||||||
nz = fDataNZ[i];
|
nz = fDataNZ[i];
|
||||||
} else {
|
} else {
|
||||||
cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << endl;
|
std::cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,9 +402,9 @@ void TTrimSPData::Normalize(double e) const {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// default
|
// default
|
||||||
cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << endl;
|
std::cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << std::endl;
|
||||||
return;
|
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------
|
//---------------------
|
||||||
@ -425,7 +419,7 @@ bool TTrimSPData::IsNormalized(double e) const {
|
|||||||
return fIsNormalized[i];
|
return fIsNormalized[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << endl;
|
std::cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +442,7 @@ double TTrimSPData::MeanRange(double e) const {
|
|||||||
return mean;
|
return mean;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
|
std::cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
|
||||||
return -1.;
|
return -1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,18 +457,18 @@ double TTrimSPData::PeakRange(double e) const {
|
|||||||
if (fEnergyIter != fEnergy.end()) {
|
if (fEnergyIter != fEnergy.end()) {
|
||||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||||
|
|
||||||
vector<double>::const_iterator nziter;
|
std::vector<double>::const_iterator nziter;
|
||||||
nziter = max_element(fDataNZ[i].begin(),fDataNZ[i].end());
|
nziter = max_element(fDataNZ[i].begin(),fDataNZ[i].end());
|
||||||
|
|
||||||
if (nziter != fDataNZ[i].end()){
|
if (nziter != fDataNZ[i].end()){
|
||||||
unsigned int j(nziter - fDataNZ[i].begin());
|
unsigned int j(nziter - fDataNZ[i].begin());
|
||||||
return fDataZ[i][j]/10.0;
|
return fDataZ[i][j]/10.0;
|
||||||
}
|
}
|
||||||
cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << endl;
|
std::cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << std::endl;
|
||||||
return -1.;
|
return -1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
|
std::cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
|
||||||
return -1.;
|
return -1.;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,7 +481,7 @@ void TTrimSPData::ConvolveGss(double w, double e) const {
|
|||||||
if (!w)
|
if (!w)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vector<double> z, nz, gss;
|
std::vector<double> z, nz, gss;
|
||||||
double nn;
|
double nn;
|
||||||
|
|
||||||
FindEnergy(e);
|
FindEnergy(e);
|
||||||
@ -514,6 +508,6 @@ void TTrimSPData::ConvolveGss(double w, double e) const {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << endl;
|
std::cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
29
src/external/BMWtools/TTrimSPDataHandler.h
vendored
29
src/external/BMWtools/TTrimSPDataHandler.h
vendored
@ -32,7 +32,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Class used to handle a set of low energy muon implantation profiles
|
* <p>Class used to handle a set of low energy muon implantation profiles
|
||||||
@ -41,7 +40,7 @@ class TTrimSPData {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TTrimSPData(const string&, map<double, string>&, bool debug = false, unsigned int highRes = 0);
|
TTrimSPData(const std::string&, std::map<double, std::string>&, bool debug = false, unsigned int highRes = 0);
|
||||||
|
|
||||||
~TTrimSPData() {
|
~TTrimSPData() {
|
||||||
fDataZ.clear();
|
fDataZ.clear();
|
||||||
@ -52,15 +51,15 @@ public:
|
|||||||
fIsNormalized.clear();
|
fIsNormalized.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<double> Energy() const {return fEnergy;}
|
std::vector<double> Energy() const {return fEnergy;}
|
||||||
vector<double> DataZ(double) const;
|
std::vector<double> DataZ(double) const;
|
||||||
vector<double> DataNZ(double) const;
|
std::vector<double> DataNZ(double) const;
|
||||||
vector<double> OrigDataNZ(double) const;
|
std::vector<double> OrigDataNZ(double) const;
|
||||||
double DataDZ(double) const;
|
double DataDZ(double) const;
|
||||||
void UseHighResolution(double);
|
void UseHighResolution(double);
|
||||||
void SetOriginal() {fOrigDataNZ = fDataNZ;}
|
void SetOriginal() {fOrigDataNZ = fDataNZ;}
|
||||||
void WeightLayers(double, const vector<double>&, const vector<double>&) const;
|
void WeightLayers(double, const std::vector<double>&, const std::vector<double>&) const;
|
||||||
double LayerFraction(double, unsigned int, const vector<double>&) const;
|
double LayerFraction(double, unsigned int, const std::vector<double>&) const;
|
||||||
double GetNofZ(double, double) const;
|
double GetNofZ(double, double) const;
|
||||||
void Normalize(double) const;
|
void Normalize(double) const;
|
||||||
bool IsNormalized(double) const;
|
bool IsNormalized(double) const;
|
||||||
@ -71,13 +70,13 @@ public:
|
|||||||
private:
|
private:
|
||||||
void FindEnergy(double) const;
|
void FindEnergy(double) const;
|
||||||
|
|
||||||
vector<double> fEnergy; ///< vector holding all available muon energies
|
std::vector<double> fEnergy; ///< vector holding all available muon energies
|
||||||
vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
|
std::vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
|
||||||
vector< vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
|
std::vector< std::vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
|
||||||
mutable vector< vector<double> > fDataNZ; ///< n(z) for all energies
|
mutable std::vector< std::vector<double> > fDataNZ; ///< n(z) for all energies
|
||||||
vector< vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
|
std::vector< std::vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
|
||||||
mutable vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
|
mutable std::vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
|
||||||
mutable vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
|
mutable std::vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _TTrimSPDataHandler_H_
|
#endif // _TTrimSPDataHandler_H_
|
||||||
|
@ -59,14 +59,14 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
|||||||
|
|
||||||
// read XML startup file
|
// read XML startup file
|
||||||
char startup_path_name[128];
|
char startup_path_name[128];
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
PMPStartupHandler *fStartupHandler = new PMPStartupHandler();
|
fStartupHandler = std::make_unique<PMPStartupHandler>();
|
||||||
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
|
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
|
||||||
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler);
|
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler.get());
|
||||||
//Int_t status = saxParser->ParseFile(startup_path_name);
|
//Int_t status = saxParser->ParseFile(startup_path_name);
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
Int_t status = parseXmlFile(saxParser, startup_path_name);
|
Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
|
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
|
||||||
@ -74,12 +74,6 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
|||||||
fValid = false;
|
fValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if everything went fine with the startup handler
|
// check if everything went fine with the startup handler
|
||||||
if (!fStartupHandler->IsValid()) {
|
if (!fStartupHandler->IsValid()) {
|
||||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||||
@ -89,7 +83,7 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load all the TRIM.SP rge-files
|
// load all the TRIM.SP rge-files
|
||||||
fRgeHandler = new PRgeHandler();
|
fRgeHandler = std::make_unique<PRgeHandler>();
|
||||||
if (!fRgeHandler->IsValid()) {
|
if (!fRgeHandler->IsValid()) {
|
||||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||||
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||||
@ -109,15 +103,6 @@ PMagProximityFitterGlobal::~PMagProximityFitterGlobal()
|
|||||||
fPreviousParam.clear();
|
fPreviousParam.clear();
|
||||||
|
|
||||||
fField.clear();
|
fField.clear();
|
||||||
|
|
||||||
if (fRgeHandler) {
|
|
||||||
delete fRgeHandler;
|
|
||||||
fRgeHandler = nullptr;
|
|
||||||
}
|
|
||||||
if (fStartupHandler) {
|
|
||||||
delete fStartupHandler;
|
|
||||||
fStartupHandler = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#ifndef _PMAGPROXIMITYFITTER_H_
|
#ifndef _PMAGPROXIMITYFITTER_H_
|
||||||
#define _PMAGPROXIMITYFITTER_H_
|
#define _PMAGPROXIMITYFITTER_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "PUserFcnBase.h"
|
#include "PUserFcnBase.h"
|
||||||
#include "PMPStartupHandler.h"
|
#include "PMPStartupHandler.h"
|
||||||
#include "PRgeHandler.h"
|
#include "PRgeHandler.h"
|
||||||
@ -49,8 +51,8 @@ class PMagProximityFitterGlobal
|
|||||||
private:
|
private:
|
||||||
Bool_t fValid;
|
Bool_t fValid;
|
||||||
|
|
||||||
PMPStartupHandler *fStartupHandler;
|
std::unique_ptr<PMPStartupHandler> fStartupHandler;
|
||||||
PRgeHandler *fRgeHandler;
|
std::unique_ptr<PRgeHandler> fRgeHandler;
|
||||||
|
|
||||||
mutable std::vector<Double_t> fPreviousParam;
|
mutable std::vector<Double_t> fPreviousParam;
|
||||||
|
|
||||||
|
2
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
2
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
@ -1507,7 +1507,7 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path)
|
|||||||
|
|
||||||
if (!obj) { // required object not present, create it
|
if (!obj) { // required object not present, create it
|
||||||
TObjArray *oarray = new TObjArray();
|
TObjArray *oarray = new TObjArray();
|
||||||
if (!oarray) {
|
if (oarray == nullptr) {
|
||||||
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << std::endl;
|
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -50,33 +50,22 @@ TMeanFieldsForScHalfSpace::TMeanFieldsForScHalfSpace() {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator-method that returns the mean field for a given implantation energy
|
// Operator-method that returns the mean field for a given implantation energy
|
||||||
@ -141,33 +130,22 @@ TMeanFieldsForScSingleLayer::TMeanFieldsForScSingleLayer() {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator-method that returns the mean field for a given implantation energy
|
// Operator-method that returns the mean field for a given implantation energy
|
||||||
@ -240,33 +218,22 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug(), 1);
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator-method that returns the mean field for a given implantation energy
|
// Operator-method that returns the mean field for a given implantation energy
|
||||||
@ -336,9 +303,9 @@ double TMeanFieldsForScBilayer::CalcMeanB (double E, const std::vector<double>&
|
|||||||
double dz(fImpProfile->DataDZ(E));
|
double dz(fImpProfile->DataDZ(E));
|
||||||
|
|
||||||
if (E==20.0) {
|
if (E==20.0) {
|
||||||
ofstream of("Implantation-profile-normal.dat");
|
std::ofstream of("Implantation-profile-normal.dat");
|
||||||
for (unsigned int i(0); i<z.size(); i++) {
|
for (unsigned int i(0); i<z.size(); i++) {
|
||||||
of << z[i] << " " << nz[i] << endl;
|
of << z[i] << " " << nz[i] << std::endl;
|
||||||
}
|
}
|
||||||
of.close();
|
of.close();
|
||||||
}
|
}
|
||||||
@ -359,33 +326,22 @@ TMeanFieldsForScTrilayer::TMeanFieldsForScTrilayer() {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator-method that returns the mean field for a given implantation energy
|
// Operator-method that returns the mean field for a given implantation energy
|
||||||
@ -464,33 +420,22 @@ TMeanFieldsForScTrilayerWithInsulator::TMeanFieldsForScTrilayerWithInsulator() {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operator-method that returns the mean field for a given implantation energy
|
// Operator-method that returns the mean field for a given implantation energy
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#ifndef _TCalcMeanFieldsLEM_H_
|
#ifndef _TCalcMeanFieldsLEM_H_
|
||||||
#define _TCalcMeanFieldsLEM_H_
|
#define _TCalcMeanFieldsLEM_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "TLondon1D.h"
|
#include "TLondon1D.h"
|
||||||
|
|
||||||
class TMeanFieldsForScHalfSpace : public PUserFcnBase {
|
class TMeanFieldsForScHalfSpace : public PUserFcnBase {
|
||||||
@ -36,13 +38,12 @@ class TMeanFieldsForScHalfSpace : public PUserFcnBase {
|
|||||||
public:
|
public:
|
||||||
// default constructor
|
// default constructor
|
||||||
TMeanFieldsForScHalfSpace();
|
TMeanFieldsForScHalfSpace();
|
||||||
~TMeanFieldsForScHalfSpace() {delete fImpProfile; fImpProfile = 0;}
|
|
||||||
|
|
||||||
double operator()(double, const std::vector<double>&) const;
|
double operator()(double, const std::vector<double>&) const;
|
||||||
double CalcMeanB (double, const TLondon1D_HS&) const;
|
double CalcMeanB (double, const TLondon1D_HS&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTrimSPData *fImpProfile;
|
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||||
|
|
||||||
ClassDef(TMeanFieldsForScHalfSpace,1)
|
ClassDef(TMeanFieldsForScHalfSpace,1)
|
||||||
};
|
};
|
||||||
@ -52,13 +53,12 @@ class TMeanFieldsForScSingleLayer : public PUserFcnBase {
|
|||||||
public:
|
public:
|
||||||
// default constructor
|
// default constructor
|
||||||
TMeanFieldsForScSingleLayer();
|
TMeanFieldsForScSingleLayer();
|
||||||
~TMeanFieldsForScSingleLayer() {delete fImpProfile; fImpProfile = 0;}
|
|
||||||
|
|
||||||
double operator()(double, const std::vector<double>&) const;
|
double operator()(double, const std::vector<double>&) const;
|
||||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_1L&) const;
|
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_1L&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTrimSPData *fImpProfile;
|
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||||
|
|
||||||
ClassDef(TMeanFieldsForScSingleLayer,1)
|
ClassDef(TMeanFieldsForScSingleLayer,1)
|
||||||
};
|
};
|
||||||
@ -68,13 +68,12 @@ class TMeanFieldsForScBilayer : public PUserFcnBase {
|
|||||||
public:
|
public:
|
||||||
// default constructor
|
// default constructor
|
||||||
TMeanFieldsForScBilayer();
|
TMeanFieldsForScBilayer();
|
||||||
~TMeanFieldsForScBilayer() {delete fImpProfile; fImpProfile = 0;}
|
|
||||||
|
|
||||||
double operator()(double, const std::vector<double>&) const;
|
double operator()(double, const std::vector<double>&) const;
|
||||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_2L&, double) const;
|
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_2L&, double) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTrimSPData *fImpProfile;
|
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||||
|
|
||||||
ClassDef(TMeanFieldsForScBilayer,1)
|
ClassDef(TMeanFieldsForScBilayer,1)
|
||||||
};
|
};
|
||||||
@ -84,13 +83,12 @@ class TMeanFieldsForScTrilayer : public PUserFcnBase {
|
|||||||
public:
|
public:
|
||||||
// default constructor
|
// default constructor
|
||||||
TMeanFieldsForScTrilayer();
|
TMeanFieldsForScTrilayer();
|
||||||
~TMeanFieldsForScTrilayer() {delete fImpProfile; fImpProfile = 0;}
|
|
||||||
|
|
||||||
double operator()(double, const std::vector<double>&) const;
|
double operator()(double, const std::vector<double>&) const;
|
||||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3L&) const;
|
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3L&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTrimSPData *fImpProfile;
|
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||||
|
|
||||||
ClassDef(TMeanFieldsForScTrilayer,1)
|
ClassDef(TMeanFieldsForScTrilayer,1)
|
||||||
};
|
};
|
||||||
@ -100,13 +98,12 @@ class TMeanFieldsForScTrilayerWithInsulator : public PUserFcnBase {
|
|||||||
public:
|
public:
|
||||||
// default constructor
|
// default constructor
|
||||||
TMeanFieldsForScTrilayerWithInsulator();
|
TMeanFieldsForScTrilayerWithInsulator();
|
||||||
~TMeanFieldsForScTrilayerWithInsulator() {delete fImpProfile; fImpProfile = 0;}
|
|
||||||
|
|
||||||
double operator()(double, const std::vector<double>&) const;
|
double operator()(double, const std::vector<double>&) const;
|
||||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3LwInsulator&) const;
|
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3LwInsulator&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTrimSPData *fImpProfile;
|
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||||
|
|
||||||
ClassDef(TMeanFieldsForScTrilayerWithInsulator,1)
|
ClassDef(TMeanFieldsForScTrilayerWithInsulator,1)
|
||||||
};
|
};
|
||||||
|
117
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
117
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
@ -147,7 +147,7 @@ TLondon1D3LS::~TLondon1D3LS() {
|
|||||||
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -158,16 +158,16 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0); // phase
|
fParForPofT.push_back(0.0); // phase
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -203,7 +203,7 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TLondon1DHS
|
// Parameters: all the parameters for the function to be fitted through TLondon1DHS
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
double TLondon1DHS::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 5);
|
assert(par.size() == 5);
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (dead_layer_changed) {
|
if (dead_layer_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]);// dead layer
|
interfaces.push_back(par[3]);// dead layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||||
interfaces.clear();
|
interfaces.clear();
|
||||||
@ -286,7 +286,6 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -298,7 +297,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
|||||||
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -309,16 +308,16 @@ TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -354,7 +353,7 @@ TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TLondon1D1L
|
// Parameters: all the parameters for the function to be fitted through TLondon1D1L
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D1L::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 6 || par.size() == 8);
|
assert(par.size() == 6 || par.size() == 8);
|
||||||
|
|
||||||
@ -425,10 +424,10 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (weights_changed) {
|
if (weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]+par[4]);
|
interfaces.push_back(par[3]+par[4]);
|
||||||
|
|
||||||
vector<double> weights;
|
std::vector<double> weights;
|
||||||
for (unsigned int i(6); i<8; i++)
|
for (unsigned int i(6); i<8; i++)
|
||||||
weights.push_back(par[i]);
|
weights.push_back(par[i]);
|
||||||
|
|
||||||
@ -440,7 +439,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bkg_fraction_changed || weights_changed) {
|
if (bkg_fraction_changed || weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]);// dead layer
|
interfaces.push_back(par[3]);// dead layer
|
||||||
interfaces.push_back(par[3] + par[4]);// dead layer + first layer
|
interfaces.push_back(par[3] + par[4]);// dead layer + first layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||||
@ -484,7 +483,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -495,16 +494,16 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -540,7 +539,7 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TLondon1D2L
|
// Parameters: all the parameters for the function to be fitted through TLondon1D2L
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D2L::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 8 || par.size() == 11);
|
assert(par.size() == 8 || par.size() == 11);
|
||||||
|
|
||||||
@ -606,11 +605,11 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (weights_changed) {
|
if (weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]+par[4]);
|
interfaces.push_back(par[3]+par[4]);
|
||||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||||
|
|
||||||
vector<double> weights;
|
std::vector<double> weights;
|
||||||
for (unsigned int i(8); i<11; i++)
|
for (unsigned int i(8); i<11; i++)
|
||||||
weights.push_back(par[i]);
|
weights.push_back(par[i]);
|
||||||
|
|
||||||
@ -622,7 +621,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bkg_fraction_changed || weights_changed) {
|
if (bkg_fraction_changed || weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]);// dead layer
|
interfaces.push_back(par[3]);// dead layer
|
||||||
interfaces.push_back(par[3] + par[4] + par[5]);// dead layer + first layer + second layer
|
interfaces.push_back(par[3] + par[4] + par[5]);// dead layer + first layer + second layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||||
@ -646,7 +645,6 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -657,7 +655,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
|||||||
TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
|
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -668,16 +666,16 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -713,7 +711,7 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TProximity1D1LHS
|
// Parameters: all the parameters for the function to be fitted through TProximity1D1LHS
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
double TProximity1D1LHS::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 7);
|
assert(par.size() == 7);
|
||||||
|
|
||||||
@ -775,7 +773,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (dead_layer_changed) {
|
if (dead_layer_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[4]);// dead layer
|
interfaces.push_back(par[4]);// dead layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||||
interfaces.clear();
|
interfaces.clear();
|
||||||
@ -797,7 +795,6 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -807,7 +804,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -818,16 +815,16 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -863,7 +860,7 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TLondon1D3L
|
// Parameters: all the parameters for the function to be fitted through TLondon1D3L
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
double TLondon1D3L::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 10 || par.size() == 14);
|
assert(par.size() == 10 || par.size() == 14);
|
||||||
|
|
||||||
@ -929,12 +926,12 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (weights_changed) {
|
if (weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]+par[4]);
|
interfaces.push_back(par[3]+par[4]);
|
||||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||||
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
||||||
|
|
||||||
vector<double> weights;
|
std::vector<double> weights;
|
||||||
for (unsigned int i(10); i<14; i++)
|
for (unsigned int i(10); i<14; i++)
|
||||||
weights.push_back(par[i]);
|
weights.push_back(par[i]);
|
||||||
|
|
||||||
@ -946,7 +943,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bkg_fraction_changed || weights_changed) {
|
if (bkg_fraction_changed || weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]);// dead layer
|
interfaces.push_back(par[3]);// dead layer
|
||||||
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||||
@ -969,7 +966,6 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -979,7 +975,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
|||||||
|
|
||||||
TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||||
// read startup file
|
// read startup file
|
||||||
string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
TSAXParser *saxParser = new TSAXParser();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||||
@ -990,16 +986,16 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fNSteps = startupHandler->GetNSteps();
|
fNSteps = startupHandler->GetNSteps();
|
||||||
fWisdom = startupHandler->GetWisdomFile();
|
fWisdom = startupHandler->GetWisdomFile();
|
||||||
string rge_path(startupHandler->GetDataPath());
|
std::string rge_path(startupHandler->GetDataPath());
|
||||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||||
|
|
||||||
fParForPofT.push_back(0.0);
|
fParForPofT.push_back(0.0);
|
||||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||||
@ -1035,7 +1031,7 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// Parameters: all the parameters for the function to be fitted through TLondon1D3LS
|
// Parameters: all the parameters for the function to be fitted through TLondon1D3LS
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
double TLondon1D3LS::operator()(double t, const std::vector<double> &par) const {
|
||||||
|
|
||||||
assert(par.size() == 9 || par.size() == 13);
|
assert(par.size() == 9 || par.size() == 13);
|
||||||
|
|
||||||
@ -1101,12 +1097,12 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
|||||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||||
|
|
||||||
if (weights_changed) {
|
if (weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]+par[4]);
|
interfaces.push_back(par[3]+par[4]);
|
||||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||||
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
||||||
|
|
||||||
vector<double> weights;
|
std::vector<double> weights;
|
||||||
for (unsigned int i(9); i<13; i++)
|
for (unsigned int i(9); i<13; i++)
|
||||||
weights.push_back(par[i]);
|
weights.push_back(par[i]);
|
||||||
|
|
||||||
@ -1118,7 +1114,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bkg_fraction_changed || weights_changed) {
|
if (bkg_fraction_changed || weights_changed) {
|
||||||
vector<double> interfaces;
|
std::vector<double> interfaces;
|
||||||
interfaces.push_back(par[3]);// dead layer
|
interfaces.push_back(par[3]);// dead layer
|
||||||
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
||||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||||
@ -1141,7 +1137,6 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// //------------------
|
// //------------------
|
||||||
|
@ -553,7 +553,7 @@ void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const std::
|
|||||||
if (fill_index < fPBSize) {
|
if (fill_index < fPBSize) {
|
||||||
fPB[fill_index] += 1.0;
|
fPB[fill_index] += 1.0;
|
||||||
} else {
|
} else {
|
||||||
cout << "Field over the limit..." << endl;
|
std::cout << "Field over the limit..." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// of << endl;
|
// of << endl;
|
||||||
|
@ -217,7 +217,7 @@ double TPofTCalc::Eval(double t) const {
|
|||||||
// Parameters: output filename, par(dt, dB, timeres, channels, asyms, phases, t0s, N0s, bgs) optPar(field, energy)
|
// Parameters: output filename, par(dt, dB, timeres, channels, asyms, phases, t0s, N0s, bgs) optPar(field, energy)
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<double> &par, const std::vector<double> *optPar = 0) {
|
void TPofTCalc::FakeData(const std::string &rootOutputFileName, const std::vector<double> &par, const std::vector<double> *optPar = 0) {
|
||||||
|
|
||||||
//determine the number of histograms to be built
|
//determine the number of histograms to be built
|
||||||
unsigned int numHist(0);
|
unsigned int numHist(0);
|
||||||
|
@ -64,9 +64,9 @@ TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
360
src/external/libFitPofB/classes/TVortex.cpp
vendored
360
src/external/libFitPofB/classes/TVortex.cpp
vendored
@ -52,12 +52,6 @@ ClassImp(TBulkAnisotropicTriVortexAGL)
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -69,12 +63,6 @@ TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -86,12 +74,6 @@ TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkTriVortexML::~TBulkTriVortexML() {
|
TBulkTriVortexML::~TBulkTriVortexML() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -103,12 +85,6 @@ TBulkTriVortexML::~TBulkTriVortexML() {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -120,12 +96,6 @@ TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -137,12 +107,6 @@ TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkTriVortexNGL::~TBulkTriVortexNGL() {
|
TBulkTriVortexNGL::~TBulkTriVortexNGL() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -159,18 +123,18 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,21 +156,11 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
|||||||
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
||||||
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
||||||
|
|
||||||
fVortex = new TBulkTriVortexLondonFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkTriVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -219,18 +173,18 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,21 +204,11 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkSqVortexLondonFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkSqVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -342,7 +286,7 @@ double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -422,7 +366,7 @@ double TBulkSqVortexLondon::operator()(double t, const std::vector<double> &par)
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -449,18 +393,18 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,21 +424,11 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkTriVortexMLFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkTriVortexMLFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -561,7 +495,7 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -574,7 +508,6 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -588,18 +521,18 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,21 +552,11 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkTriVortexAGLFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkTriVortexAGLFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -700,7 +623,7 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -713,7 +636,6 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -726,18 +648,18 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,21 +681,11 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
|||||||
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
||||||
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
||||||
|
|
||||||
fVortex = new TBulkTriVortexAGLIIFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkTriVortexAGLIIFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -851,7 +763,7 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -864,7 +776,6 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -877,18 +788,18 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,21 +819,11 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkTriVortexNGLFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkTriVortexNGLFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -989,7 +890,7 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -1002,7 +903,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fPofT->Eval(t);
|
return fPofT->Eval(t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
@ -1010,12 +910,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkAnisotropicTriVortexLondonGlobal::~TBulkAnisotropicTriVortexLondonGlobal() {
|
TBulkAnisotropicTriVortexLondonGlobal::~TBulkAnisotropicTriVortexLondonGlobal() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -1032,18 +926,18 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,21 +957,11 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkAnisotropicTriVortexLondonFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkAnisotropicTriVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par) const {
|
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par) const {
|
||||||
@ -1141,7 +1025,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
@ -1198,7 +1082,7 @@ void TBulkAnisotropicTriVortexLondon::SetGlobalPart(std::vector<void *> &globalP
|
|||||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexLondonGlobal();
|
fGlobalUserFcn = new TBulkAnisotropicTriVortexLondonGlobal();
|
||||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||||
fValid = false;
|
fValid = false;
|
||||||
cerr << endl << ">> TBulkAnisotropicTriVortexLondon::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexLondon::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||||
globalPart.resize(fIdxGlobal+1);
|
globalPart.resize(fIdxGlobal+1);
|
||||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexLondonGlobal*>(fGlobalUserFcn);
|
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexLondonGlobal*>(fGlobalUserFcn);
|
||||||
@ -1252,12 +1136,6 @@ double TBulkAnisotropicTriVortexLondon::operator()(double t, const std::vector<d
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkAnisotropicTriVortexMLGlobal::~TBulkAnisotropicTriVortexMLGlobal() {
|
TBulkAnisotropicTriVortexMLGlobal::~TBulkAnisotropicTriVortexMLGlobal() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -1274,18 +1152,18 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1305,21 +1183,11 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkAnisotropicTriVortexMLFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkAnisotropicTriVortexMLFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) const {
|
void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) const {
|
||||||
@ -1371,7 +1239,7 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
|||||||
|
|
||||||
if (!only_phase_changed) {
|
if (!only_phase_changed) {
|
||||||
|
|
||||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||||
|
|
||||||
for (unsigned int i(0); i < 5; i++) {
|
for (unsigned int i(0); i < 5; i++) {
|
||||||
fParForVortex[i] = par[i+1];
|
fParForVortex[i] = par[i+1];
|
||||||
@ -1383,11 +1251,11 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
@ -1440,7 +1308,7 @@ void TBulkAnisotropicTriVortexML::SetGlobalPart(std::vector<void *> &globalPart,
|
|||||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexMLGlobal();
|
fGlobalUserFcn = new TBulkAnisotropicTriVortexMLGlobal();
|
||||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||||
fValid = false;
|
fValid = false;
|
||||||
cerr << endl << ">> TBulkAnisotropicTriVortexML::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexML::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||||
globalPart.resize(fIdxGlobal+1);
|
globalPart.resize(fIdxGlobal+1);
|
||||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexMLGlobal*>(fGlobalUserFcn);
|
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexMLGlobal*>(fGlobalUserFcn);
|
||||||
@ -1494,12 +1362,6 @@ double TBulkAnisotropicTriVortexML::operator()(double t, const std::vector<doubl
|
|||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
TBulkAnisotropicTriVortexAGLGlobal::~TBulkAnisotropicTriVortexAGLGlobal() {
|
TBulkAnisotropicTriVortexAGLGlobal::~TBulkAnisotropicTriVortexAGLGlobal() {
|
||||||
delete fPofT;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fPofB;
|
|
||||||
fPofT = 0;
|
|
||||||
delete fVortex;
|
|
||||||
fVortex = 0;
|
|
||||||
fPar.clear();
|
fPar.clear();
|
||||||
fParForVortex.clear();
|
fParForVortex.clear();
|
||||||
fParForPofB.clear();
|
fParForPofB.clear();
|
||||||
@ -1516,18 +1378,18 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
|||||||
// read startup file
|
// read startup file
|
||||||
std::string startup_path_name("BMW_startup.xml");
|
std::string startup_path_name("BMW_startup.xml");
|
||||||
|
|
||||||
TSAXParser *saxParser = new TSAXParser();
|
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||||
// parsing the file as above seems to lead to problems in certain environments;
|
// parsing the file as above seems to lead to problems in certain environments;
|
||||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||||
// check for parse errors
|
// check for parse errors
|
||||||
if (status) { // error
|
if (status) { // error
|
||||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||||
<< endl;
|
<< std::endl;
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1547,21 +1409,11 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
|||||||
fParForPofB.push_back(0.005); // Bkg-width
|
fParForPofB.push_back(0.005); // Bkg-width
|
||||||
fParForPofB.push_back(0.0); // Bkg-weight
|
fParForPofB.push_back(0.0); // Bkg-weight
|
||||||
|
|
||||||
fVortex = new TBulkAnisotropicTriVortexAGLFieldCalc(fWisdom, fGridSteps);
|
fVortex = std::make_unique<TBulkAnisotropicTriVortexAGLFieldCalc>(fWisdom, fGridSteps);
|
||||||
|
|
||||||
fPofB = new TPofBCalc(fParForPofB);
|
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||||
|
|
||||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||||
|
|
||||||
// clean up
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) const {
|
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) const {
|
||||||
@ -1613,7 +1465,7 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
|||||||
|
|
||||||
if (!only_phase_changed) {
|
if (!only_phase_changed) {
|
||||||
|
|
||||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||||
|
|
||||||
for (unsigned int i(0); i < 5; i++) {
|
for (unsigned int i(0); i < 5; i++) {
|
||||||
fParForVortex[i] = par[i+1];
|
fParForVortex[i] = par[i+1];
|
||||||
@ -1625,11 +1477,11 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
|||||||
fVortex->SetParameters(fParForVortex);
|
fVortex->SetParameters(fParForVortex);
|
||||||
fVortex->CalculateGrid();
|
fVortex->CalculateGrid();
|
||||||
fPofB->UnsetPBExists();
|
fPofB->UnsetPBExists();
|
||||||
fPofB->Calculate(fVortex, fParForPofB);
|
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||||
fPofT->DoFFT();
|
fPofT->DoFFT();
|
||||||
|
|
||||||
}/* else {
|
}/* else {
|
||||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
fPofT->CalcPol(fParForPofT);
|
fPofT->CalcPol(fParForPofT);
|
||||||
@ -1683,7 +1535,7 @@ void TBulkAnisotropicTriVortexAGL::SetGlobalPart(std::vector<void *> &globalPart
|
|||||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexAGLGlobal();
|
fGlobalUserFcn = new TBulkAnisotropicTriVortexAGLGlobal();
|
||||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||||
fValid = false;
|
fValid = false;
|
||||||
cerr << endl << ">> TBulkAnisotropicTriVortexAGL::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexAGL::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||||
globalPart.resize(fIdxGlobal+1);
|
globalPart.resize(fIdxGlobal+1);
|
||||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexAGLGlobal*>(fGlobalUserFcn);
|
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexAGLGlobal*>(fGlobalUserFcn);
|
||||||
|
8
src/external/libFitPofB/include/TLondon1D.h
vendored
8
src/external/libFitPofB/include/TLondon1D.h
vendored
@ -52,10 +52,10 @@ private:
|
|||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||||
string fWisdom; ///< file name of the FFTW wisdom file
|
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||||
|
|
||||||
ClassDef(TLondon1DHS,1)
|
ClassDef(TLondon1DHS,1)
|
||||||
|
2
src/external/libFitPofB/include/TPofTCalc.h
vendored
2
src/external/libFitPofB/include/TPofTCalc.h
vendored
@ -66,7 +66,7 @@ private:
|
|||||||
double *fPT; ///< array containing the discrete values of the polarization p(t)
|
double *fPT; ///< array containing the discrete values of the polarization p(t)
|
||||||
double fTBin; ///< time resolution
|
double fTBin; ///< time resolution
|
||||||
int fNFFT; ///< length of the discrete 1D Fourier transform
|
int fNFFT; ///< length of the discrete 1D Fourier transform
|
||||||
const string fWisdom; ///< file name of the FFTW wisdom file
|
const std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||||
bool fUseWisdom; ///< tag determining if a FFTW wisdom file is used
|
bool fUseWisdom; ///< tag determining if a FFTW wisdom file is used
|
||||||
|
|
||||||
};
|
};
|
||||||
|
62
src/external/libFitPofB/include/TVortex.h
vendored
62
src/external/libFitPofB/include/TVortex.h
vendored
@ -29,6 +29,8 @@
|
|||||||
#ifndef _TVortex_H_
|
#ifndef _TVortex_H_
|
||||||
#define _TVortex_H_
|
#define _TVortex_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "PUserFcnBase.h"
|
#include "PUserFcnBase.h"
|
||||||
#include "TPofTCalc.h"
|
#include "TPofTCalc.h"
|
||||||
|
|
||||||
@ -47,9 +49,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -76,9 +78,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkSqVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkSqVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -105,9 +107,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -134,9 +136,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -163,9 +165,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkTriVortexAGLIIFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkTriVortexAGLIIFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -192,9 +194,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutable std::vector<double> fPar; ///< parameters of the model
|
mutable std::vector<double> fPar; ///< parameters of the model
|
||||||
TBulkTriVortexNGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkTriVortexNGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -223,14 +225,14 @@ public:
|
|||||||
|
|
||||||
void Calc(const std::vector<double>&) const;
|
void Calc(const std::vector<double>&) const;
|
||||||
|
|
||||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||||
mutable std::vector<double> fPar; ///< parameter vector
|
mutable std::vector<double> fPar; ///< parameter vector
|
||||||
TBulkAnisotropicTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkAnisotropicTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -287,14 +289,14 @@ public:
|
|||||||
|
|
||||||
void Calc(const std::vector<double>&) const;
|
void Calc(const std::vector<double>&) const;
|
||||||
|
|
||||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||||
mutable std::vector<double> fPar; ///< parameter vector
|
mutable std::vector<double> fPar; ///< parameter vector
|
||||||
TBulkAnisotropicTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkAnisotropicTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
@ -351,14 +353,14 @@ public:
|
|||||||
|
|
||||||
void Calc(const std::vector<double>&) const;
|
void Calc(const std::vector<double>&) const;
|
||||||
|
|
||||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||||
mutable std::vector<double> fPar; ///< parameter vector
|
mutable std::vector<double> fPar; ///< parameter vector
|
||||||
TBulkAnisotropicTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
std::unique_ptr<TBulkAnisotropicTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user