more work on Raw -> Smart Pointers for external libs.
This commit is contained in:
195
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
195
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
@ -147,7 +147,7 @@ TLondon1D3LS::~TLondon1D3LS() {
|
||||
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -158,16 +158,16 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0); // phase
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@ -203,18 +203,18 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// 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);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool dead_layer_changed(false);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -230,7 +230,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -253,7 +253,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -264,8 +264,8 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(dead_layer_changed){
|
||||
vector<double> interfaces;
|
||||
if (dead_layer_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||
interfaces.clear();
|
||||
@ -286,7 +286,6 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -298,7 +297,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -309,16 +308,16 @@ TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
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
|
||||
//------------------
|
||||
|
||||
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);
|
||||
|
||||
@ -362,7 +361,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
// Count the number of function calls
|
||||
// fCallCounter++;
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@ -370,7 +369,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -389,7 +388,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -413,7 +412,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -424,12 +423,12 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(6); i<8; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(6); i<8; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@ -439,8 +438,8 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead 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
|
||||
@ -484,7 +483,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -495,16 +494,16 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@ -540,11 +539,11 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// 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);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@ -552,7 +551,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -570,7 +569,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -594,7 +593,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -605,13 +604,13 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(8); i<11; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(8); i<11; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@ -621,8 +620,8 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead 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
|
||||
@ -646,7 +645,6 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -657,7 +655,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -668,16 +666,16 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@ -713,18 +711,18 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// 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);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
bool dead_layer_changed(false);
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -740,14 +738,14 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
only_phase_changed = true;
|
||||
} else {
|
||||
only_phase_changed = false;
|
||||
if (i == 4){
|
||||
if (i == 4) {
|
||||
dead_layer_changed = true;
|
||||
}
|
||||
}
|
||||
@ -763,7 +761,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -774,8 +772,8 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(dead_layer_changed){
|
||||
vector<double> interfaces;
|
||||
if (dead_layer_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[4]);// dead layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||
interfaces.clear();
|
||||
@ -797,7 +795,6 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -807,7 +804,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -818,16 +815,16 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@ -863,11 +860,11 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// 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);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@ -875,7 +872,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -893,7 +890,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -917,7 +914,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -928,14 +925,14 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
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]+par[6]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(10); i<14; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(10); i<14; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@ -945,8 +942,8 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
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
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -979,7 +975,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
@ -990,16 +986,16 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@ -1035,11 +1031,11 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// 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);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@ -1047,7 +1043,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@ -1065,7 +1061,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -1089,7 +1085,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@ -1100,14 +1096,14 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
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]+par[6]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(9); i<13; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(9); i<13; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@ -1117,8 +1113,8 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
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
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
// //------------------
|
||||
|
@ -553,7 +553,7 @@ void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const std::
|
||||
if (fill_index < fPBSize) {
|
||||
fPB[fill_index] += 1.0;
|
||||
} else {
|
||||
cout << "Field over the limit..." << endl;
|
||||
std::cout << "Field over the limit..." << std::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)
|
||||
//---------------------
|
||||
|
||||
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
|
||||
unsigned int numHist(0);
|
||||
|
@ -64,9 +64,9 @@ TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
410
src/external/libFitPofB/classes/TVortex.cpp
vendored
410
src/external/libFitPofB/classes/TVortex.cpp
vendored
@ -52,12 +52,6 @@ ClassImp(TBulkAnisotropicTriVortexAGL)
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -69,12 +63,6 @@ TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
||||
//------------------
|
||||
|
||||
TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -86,12 +74,6 @@ TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexML::~TBulkTriVortexML() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -103,12 +85,6 @@ TBulkTriVortexML::~TBulkTriVortexML() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -120,12 +96,6 @@ TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -137,12 +107,6 @@ TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexNGL::~TBulkTriVortexNGL() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -159,18 +123,18 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -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: 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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -219,18 +173,18 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -250,21 +204,11 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -277,12 +221,12 @@ double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8); // normal, +BkgWeight, +VortexWeighting, +AFfield
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@ -342,7 +286,7 @@ double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -422,7 +366,7 @@ double TBulkSqVortexLondon::operator()(double t, const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -449,18 +393,18 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -480,21 +424,11 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -507,12 +441,12 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@ -547,7 +481,7 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@ -561,7 +495,7 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -574,7 +508,6 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -588,18 +521,18 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -619,21 +552,11 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -646,12 +569,12 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@ -686,7 +609,7 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@ -700,7 +623,7 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -713,7 +636,6 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -726,18 +648,18 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -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: 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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -786,12 +698,12 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@ -826,7 +738,7 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@ -851,7 +763,7 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -864,7 +776,6 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -877,18 +788,18 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -908,21 +819,11 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -935,12 +836,12 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@ -975,7 +876,7 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@ -989,7 +890,7 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -1002,7 +903,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@ -1010,12 +910,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexLondonGlobal::~TBulkAnisotropicTriVortexLondonGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -1032,18 +926,18 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -1063,21 +957,11 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par) const {
|
||||
@ -1090,7 +974,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@ -1127,7 +1011,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@ -1141,7 +1025,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@ -1198,7 +1082,7 @@ void TBulkAnisotropicTriVortexLondon::SetGlobalPart(std::vector<void *> &globalP
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexLondonGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
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
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexLondonGlobal*>(fGlobalUserFcn);
|
||||
@ -1238,7 +1122,7 @@ double TBulkAnisotropicTriVortexLondon::operator()(double t, const std::vector<d
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
@ -1252,12 +1136,6 @@ double TBulkAnisotropicTriVortexLondon::operator()(double t, const std::vector<d
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexMLGlobal::~TBulkAnisotropicTriVortexMLGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -1274,18 +1152,18 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -1305,21 +1183,11 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) const {
|
||||
@ -1332,7 +1200,7 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@ -1347,7 +1215,7 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -1369,9 +1237,9 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
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++) {
|
||||
fParForVortex[i] = par[i+1];
|
||||
@ -1383,11 +1251,11 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* 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);
|
||||
@ -1440,7 +1308,7 @@ void TBulkAnisotropicTriVortexML::SetGlobalPart(std::vector<void *> &globalPart,
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexMLGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
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
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexMLGlobal*>(fGlobalUserFcn);
|
||||
@ -1480,7 +1348,7 @@ double TBulkAnisotropicTriVortexML::operator()(double t, const std::vector<doubl
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
@ -1494,12 +1362,6 @@ double TBulkAnisotropicTriVortexML::operator()(double t, const std::vector<doubl
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexAGLGlobal::~TBulkAnisotropicTriVortexAGLGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@ -1516,18 +1378,18 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// 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
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@ -1547,21 +1409,11 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
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);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) const {
|
||||
@ -1574,7 +1426,7 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@ -1589,7 +1441,7 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@ -1611,9 +1463,9 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
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++) {
|
||||
fParForVortex[i] = par[i+1];
|
||||
@ -1625,11 +1477,11 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* 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);
|
||||
@ -1683,7 +1535,7 @@ void TBulkAnisotropicTriVortexAGL::SetGlobalPart(std::vector<void *> &globalPart
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexAGLGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
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
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexAGLGlobal*>(fGlobalUserFcn);
|
||||
@ -1723,7 +1575,7 @@ double TBulkAnisotropicTriVortexAGL::operator()(double t, const std::vector<doub
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
|
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)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(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 fTBin; ///< time resolution
|
||||
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
|
||||
|
||||
};
|
||||
|
62
src/external/libFitPofB/include/TVortex.h
vendored
62
src/external/libFitPofB/include/TVortex.h
vendored
@ -29,6 +29,8 @@
|
||||
#ifndef _TVortex_H_
|
||||
#define _TVortex_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "TPofTCalc.h"
|
||||
|
||||
@ -47,9 +49,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -76,9 +78,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkSqVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkSqVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -105,9 +107,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -134,9 +136,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -163,9 +165,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLIIFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexAGLIIFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -192,9 +194,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexNGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexNGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -223,14 +225,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -287,14 +289,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
@ -351,14 +353,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
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 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)
|
||||
|
Reference in New Issue
Block a user