Added autotool-support for building musrfit - some additional tests are needed, the old Makefiles are still around
This commit is contained in:
25
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
25
src/external/TFitPofB-lib/classes/TBofZCalc.cpp
vendored
@@ -152,11 +152,16 @@ TLondon1D_1L::TLondon1D_1L(const vector<double> ¶m, unsigned int steps)
|
||||
fMinB = -1.0;
|
||||
|
||||
// thicknesses have to be greater or equal to zero
|
||||
for(unsigned int i(1); i<3; i++)
|
||||
assert(param[i]>=0.);
|
||||
for(unsigned int i(1); i<3; i++){
|
||||
if(param[i] < 0.){
|
||||
fParam[i] = 0.;
|
||||
}
|
||||
}
|
||||
|
||||
// lambdas have to be greater than zero
|
||||
assert(param[3]!=0.);
|
||||
if(param[3] < 0.1){
|
||||
fParam[3] = 0.1;
|
||||
}
|
||||
|
||||
// Calculate the coefficients of the exponentials
|
||||
double N0(param[0]/(1.0+exp(param[2]/param[3])));
|
||||
@@ -194,7 +199,10 @@ double TLondon1D_1L::GetBmin() const
|
||||
void TLondon1D_1L::SetBmin()
|
||||
{
|
||||
double b_a(fCoeff[1]/fCoeff[0]);
|
||||
assert (b_a>0.);
|
||||
// assert(b_a>0.);
|
||||
if(b_a<10E-7){
|
||||
b_a = 10E-7;
|
||||
}
|
||||
|
||||
double minZ;
|
||||
// check if the minimum is in the first layer
|
||||
@@ -205,7 +213,14 @@ void TLondon1D_1L::SetBmin()
|
||||
return;
|
||||
}
|
||||
|
||||
assert(fMinZ > 0. && fMinB > 0.);
|
||||
// assert(fMinZ > 0. && fMinB > 0.);
|
||||
if(fMinZ <= 0.){
|
||||
fMinZ = 0.;
|
||||
}
|
||||
if(fMinB <= 0.){
|
||||
fMinB = 0.;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
37
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
37
src/external/TFitPofB-lib/classes/TLondon1D.cpp
vendored
@@ -204,6 +204,8 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
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){
|
||||
@@ -217,7 +219,8 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
fParForBofZ.push_back(fPar[i]);
|
||||
// cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl;
|
||||
}
|
||||
fFirstCall=false;
|
||||
fFirstCall = false;
|
||||
dead_layer_changed = true;
|
||||
// cout << this << endl;
|
||||
}
|
||||
|
||||
@@ -232,11 +235,11 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
only_phase_changed = true;
|
||||
} else if (i == 3) {
|
||||
fDeadLayerChanged = true;
|
||||
only_phase_changed = false;
|
||||
} else {
|
||||
only_phase_changed = false;
|
||||
if (i == 3) {
|
||||
dead_layer_changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,12 +264,11 @@ 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(fDeadLayerChanged){
|
||||
if(dead_layer_changed){
|
||||
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();
|
||||
fDeadLayerChanged = false;
|
||||
}
|
||||
|
||||
TLondon1D_HS BofZ(fParForBofZ);
|
||||
@@ -615,7 +617,9 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(startupHandler->GetDeltat());
|
||||
fParForPofB.push_back(startupHandler->GetDeltaB());
|
||||
fParForPofB.push_back(0.0);
|
||||
// fParForPofB.push_back(0.0);
|
||||
fParForPofB.push_back(0.0); // Bkg-Field
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
|
||||
fImpProfile = x;
|
||||
@@ -652,6 +656,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
bool width_changed(false);
|
||||
bool dead_layer_changed(false);
|
||||
|
||||
if(fFirstCall){
|
||||
fPar = par;
|
||||
@@ -666,6 +671,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
fFirstCall=false;
|
||||
width_changed = true;
|
||||
dead_layer_changed = true;
|
||||
// cout << this << endl;
|
||||
}
|
||||
|
||||
@@ -685,6 +691,9 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
if (i == 7){
|
||||
width_changed = true;
|
||||
}
|
||||
if (i == 4){
|
||||
dead_layer_changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -705,11 +714,19 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
for (unsigned int i(2); i<fPar.size(); i++)
|
||||
fParForBofZ[i-2] = par[i];
|
||||
|
||||
fParForPofB[2] = par[1]; // energy
|
||||
|
||||
if(width_changed) { // Convolution of the implantation profile with Gaussian
|
||||
fImpProfile->ConvolveGss(par[7], par[1]);
|
||||
width_changed = false;
|
||||
}
|
||||
|
||||
fParForPofB[2] = par[1]; // energy
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(dead_layer_changed){
|
||||
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();
|
||||
}
|
||||
|
||||
TProximity1D_1LHS BofZ(fParForBofZ);
|
||||
|
||||
@@ -186,7 +186,8 @@ TPofBCalc::TPofBCalc( const TBofZCalcInverse &BofZ, const TTrimSPData &dataTrimS
|
||||
for (unsigned int i(firstZerosEnd); i<lastZerosStart; i++)
|
||||
fPB[i] /= pBsum;
|
||||
|
||||
AddBackground(para[3], para[4], para[5]);
|
||||
if(para.size() == 6)
|
||||
AddBackground(para[3], para[4], para[5]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ private:
|
||||
TPofTCalc *fPofT;
|
||||
mutable bool fCalcNeeded;
|
||||
mutable bool fFirstCall;
|
||||
mutable bool fDeadLayerChanged;
|
||||
mutable vector<double> fParForPofT;
|
||||
mutable vector<double> fParForBofZ;
|
||||
mutable vector<double> fParForPofB;
|
||||
|
||||
Reference in New Issue
Block a user