First step in reorganizing the installation of the musrfit documentation (further commits will follow)

This commit is contained in:
Bastian M. Wojek
2011-08-06 09:51:21 +00:00
parent 4490f103f3
commit 254d849079
241 changed files with 39 additions and 18 deletions

View File

@@ -42,7 +42,7 @@ using namespace std;
// 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) {
TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool debug, unsigned int highRes) {
// 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!
@@ -101,6 +101,12 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
vnzz.clear();
goodFile = false;
fIsNormalized.push_back(false);
if (highRes) {
UseHighResolution(iter->first);
}
} else {
cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << endl;
continue;
@@ -113,9 +119,6 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
fOrigDataNZ = fDataNZ;
for(unsigned int i(0); i<fEnergy.size();++i)
fIsNormalized.push_back(false);
fEnergyIter = fEnergy.end();
}
@@ -146,7 +149,7 @@ void TTrimSPData::UseHighResolution(double e) {
}
fDataZ[i] = vecZ;
fDataNZ[i] = vecNZ;
fOrigDataNZ[i] = vecNZ;
//fOrigDataNZ[i] = vecNZ;
fDZ[i] = 1.;
fIsNormalized[i] = false;
return;
@@ -494,7 +497,7 @@ void TTrimSPData::ConvolveGss(double w, double e) const {
if(fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
z = fDataZ[i];
nz = fOrigDataNZ[i];
nz = fDataNZ[i];
for(unsigned int k(0); k<z.size(); k++) {
gss.push_back(exp(-z[k]*z[k]/200.0/w/w));

View File

@@ -43,7 +43,7 @@ class TTrimSPData {
public:
TTrimSPData(const string&, map<double, string>&, bool debug = false);
TTrimSPData(const string&, map<double, string>&, bool debug = false, unsigned int highRes = 0);
~TTrimSPData() {
fDataZ.clear();
@@ -60,6 +60,7 @@ public:
vector<double> OrigDataNZ(double) const;
double DataDZ(double) const;
void UseHighResolution(double);
void SetOriginal() {fOrigDataNZ = fDataNZ;}
void WeightLayers(double, const vector<double>&, const vector<double>&) const;
double LayerFraction(double, unsigned int, const vector<double>&) const;
double GetNofZ(double, double) const;

View File

@@ -33,6 +33,7 @@
#include <functional>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
#include <TSAXParser.h>
@@ -257,7 +258,7 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
string rge_path(startupHandler->GetDataPath());
map<double, string> energy_vec(startupHandler->GetEnergies());
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug(), 1);
// clean up
if (saxParser) {
@@ -272,10 +273,16 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
}
// Operator-method that returns the mean field for a given implantation energy
// Parameters: field, deadlayer, layer1, layer2, lambda1, lambda2, weight1 (deadlayer), weight2, weight3, weight4 (substrate)
// Parameters: field, deadlayer, layer1, layer2, lambda1, lambda2, weight1 (deadlayer), weight2, weight3, weight4 (substrate),
// [Gss width for profile convolution]
double TMeanFieldsForScBilayer::operator()(double E, const vector<double> &par_vec) const{
double width(0.0);
if (par_vec.size() == 11) {
width = par_vec[10];
}
vector<double> interfaces;
interfaces.push_back(par_vec[1]);
interfaces.push_back(par_vec[1]+par_vec[2]);
@@ -299,12 +306,12 @@ double TMeanFieldsForScBilayer::operator()(double E, const vector<double> &par_v
energyIter = find(energies.begin(), energies.end(), E);
if (energyIter != energies.end()) { // implantation profile found - no interpolation needed
return CalcMeanB(E, interfaces, weights, BofZ);
return CalcMeanB(E, interfaces, weights, BofZ, width);
} else {
if (E < energies.front())
return CalcMeanB(energies.front(), interfaces, weights, BofZ);
return CalcMeanB(energies.front(), interfaces, weights, BofZ, width);
if (E > energies.back())
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
return CalcMeanB(energies.back(), interfaces, weights, BofZ, width);
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
@@ -312,22 +319,32 @@ double TMeanFieldsForScBilayer::operator()(double E, const vector<double> &par_v
double E1(*(energyIter - 1));
double E2(*(energyIter));
double B1(CalcMeanB(E1, interfaces, weights, BofZ));
double B2(CalcMeanB(E2, interfaces, weights, BofZ));
double B1(CalcMeanB(E1, interfaces, weights, BofZ, width));
double B2(CalcMeanB(E2, interfaces, weights, BofZ, width));
return B1 + (B2-B1)/(E2-E1)*(E-E1);
}
}
double TMeanFieldsForScBilayer::CalcMeanB (double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_2L& BofZ) const {
//calcData->UseHighResolution(E);
double TMeanFieldsForScBilayer::CalcMeanB (double E, const vector<double>& interfaces, const vector<double>& weights, const TLondon1D_2L& BofZ, double width=0.0) const {
//fImpProfile->UseHighResolution(E);
//fImpProfile->ConvolveGss(width, E);
//fImpProfile->SetOriginal();
fImpProfile->WeightLayers(E, interfaces, weights);
fImpProfile->ConvolveGss(width, E);
fImpProfile->Normalize(E);
vector<double> z(fImpProfile->DataZ(E));
vector<double> nz(fImpProfile->DataNZ(E));
double dz(fImpProfile->DataDZ(E));
if (E==20.0){
ofstream of("Implantation-profile-normal.dat");
for (unsigned int i(0); i<z.size(); i++) {
of << z[i] << " " << nz[i] << endl;
}
of.close();
}
// calculate mean field
double meanB(0.);

View File

@@ -85,7 +85,7 @@ public:
virtual Bool_t GlobalPartIsValid() const { return true; }
double operator()(double, const vector<double>&) const;
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_2L&) const;
double CalcMeanB (double, const vector<double>&, const vector<double>&, const TLondon1D_2L&, double) const;
private:
TTrimSPData *fImpProfile;