more docu, and a bug fix in the Abragam function

This commit is contained in:
nemu 2010-06-02 20:18:22 +00:00
parent 32d2cab3aa
commit f938e4ed27
14 changed files with 563 additions and 328 deletions

View File

@ -50,7 +50,26 @@ How to setup musrfit on different platforms: \texttt{https://intranet.psi.ch/MUS
on >= Qt4.6. on >= Qt4.6.
- \ref MuSRFit A graphical user interface based on PerlQt (written by Z. Salman) for an easy to use interface to the musrfit framework. Compared to the more general approach of writting msr-files, it has some limitations, though it might be easier for a first user of the musrfit framework. - \ref MuSRFit A graphical user interface based on PerlQt (written by Z. Salman) for an easy to use interface to the musrfit framework. Compared to the more general approach of writting msr-files, it has some limitations, though it might be easier for a first user of the musrfit framework.
\section roadmap Roadmap \section roadmap Road map and missing features
<p>The following features should eventually be implemented, but are still missing:
- support for NeXuS files. Reason: As soon as ISIS and PSI will support this file type, musrfit will do as well
- there are still issues with MUD files on 64bit systems which should eventually be fixed.
- non-muSR: The plan is to add an option to fit/plot \f$f(x_1,\ldots,x_n)\f$ versus \f$g(x_1,\ldots,x_n)\f$, where \f$x_i\f$ is a given data set element.
- mu-Minus: The handling for \f$\mu_{-}\f$ fits is still missing and should be implemented.
- as soon as ROOT will properly support MS Windows platforms, some better support for MS Windows will be added. Currently only the cygwin version will be supported.
- check if it is possible to add FIR filtering for muSR data
- add an interface to maxent
- we will provide rpm's for various linux flavours.
\section shortComings Short comings of the current musrfit design
<p>The musrfit framework has some shortcomings which will shortly discussed here:
-# musrfit is not thread save do to the current implementation of LF in PTheory. Perhaps this part should be redesigned at some point to resolve this problem.
-# Currently each msr-file run holds its one theory object. This is not very nice for costly user functions which will need to setup internal things for each run, even though resources could be shared.
This two points are somewhat contradictory, and currently it is not clear which way to go.
\section bugs How to report bugs \section bugs How to report bugs

View File

@ -1207,6 +1207,7 @@ Double_t PMsrRunBlock::GetFitRange(UInt_t idx)
/** /**
* <p> set fit range value at position idx * <p> set fit range value at position idx
* *
* \param dval value to be set
* \param idx index of the fit range value to be set * \param idx index of the fit range value to be set
*/ */
void PMsrRunBlock::SetFitRange(Double_t dval, UInt_t idx) void PMsrRunBlock::SetFitRange(Double_t dval, UInt_t idx)

View File

@ -197,7 +197,7 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
/** /**
* <p>NOT IMPLEMENTED!! * <p>NOT IMPLEMENTED!!
* *
* \param par parameter vector iterated by minuit * \param par parameter vector iterated by minuit2
*/ */
Double_t PRunAsymmetry::CalcMaxLikelihood(const std::vector<Double_t>& par) Double_t PRunAsymmetry::CalcMaxLikelihood(const std::vector<Double_t>& par)
{ {
@ -268,7 +268,7 @@ void PRunAsymmetry::CalcTheory()
/** /**
* <p>Prepare data for fitting or viewing. What is already processed at this stage: * <p>Prepare data for fitting or viewing. What is already processed at this stage:
* - get all needed forward/backward histograms * - get all needed forward/backward histograms
* - get timeresolution * - get time resolution
* - get start/stop fit time * - get start/stop fit time
* - get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.) * - get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.)
* - add runs (if addruns are present) * - add runs (if addruns are present)
@ -1203,7 +1203,7 @@ Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2])
* -# filter \f$ T_R(t) \f$. * -# filter \f$ T_R(t) \f$.
* *
* \param runData raw run data needed to perform some crosschecks * \param runData raw run data needed to perform some crosschecks
* \param histNo array of the histo numbers form which to build the asymmetry * \param histoNo array of the histo numbers form which to build the asymmetry
*/ */
Bool_t PRunAsymmetry::PrepareRRFViewData(PRawRunData* runData, UInt_t histoNo[2]) Bool_t PRunAsymmetry::PrepareRRFViewData(PRawRunData* runData, UInt_t histoNo[2])
{ {

View File

@ -1949,7 +1949,7 @@ Bool_t PRunDataHandler::ReadAsciiFile()
* *
* <p>will <b>not</b> work! * <p>will <b>not</b> work!
* *
* <p>Some db-files do have a '\-e' or '\e' label just between the DATA tag line and the real data. * <p>Some db-files do have a '\\-e' or '\\e' label just between the DATA tag line and the real data.
* This tag will just be ignored. * This tag will just be ignored.
* *
* <b>return:</b> * <b>return:</b>

View File

@ -37,8 +37,7 @@
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor
*
*/ */
PRunMuMinus::PRunMuMinus() : PRunBase() PRunMuMinus::PRunMuMinus() : PRunBase()
{ {
@ -53,10 +52,12 @@ PRunMuMinus::PRunMuMinus() : PRunBase()
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor
* *
* \param msrInfo pointer to the msr info structure * \param msrInfo pointer to the msr-file handler
* \param runNo number of the run of the msr-file * \param rawData raw run data
* \param runNo number of the run within the msr-file
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
*/ */
PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
{ {
@ -72,8 +73,7 @@ PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
// Destructor // Destructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Destructor
*
*/ */
PRunMuMinus::~PRunMuMinus() PRunMuMinus::~PRunMuMinus()
{ {
@ -83,9 +83,12 @@ PRunMuMinus::~PRunMuMinus()
// CalcChiSquare // CalcChiSquare
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate chi-square. <b>(Not yet implemented)</b>
* *
* \param par parameter vector iterated by minuit * <b>return:</b>
* - chisq value
*
* \param par parameter vector iterated by minuit2
*/ */
Double_t PRunMuMinus::CalcChiSquare(const std::vector<Double_t>& par) Double_t PRunMuMinus::CalcChiSquare(const std::vector<Double_t>& par)
{ {
@ -99,9 +102,12 @@ Double_t PRunMuMinus::CalcChiSquare(const std::vector<Double_t>& par)
// CalcMaxLikelihood // CalcMaxLikelihood
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate log max-likelihood. <b>(Not yet implemented)</b>
* *
* \param par parameter vector iterated by minuit * <b>return:</b>
* - log max-likelihood value
*
* \param par parameter vector iterated by minuit2
*/ */
Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par) Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
{ {
@ -114,8 +120,7 @@ Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
// CalcTheory // CalcTheory
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate theory for a given set of fit-parameters. <b>(Not yet implemented)</b>
*
*/ */
void PRunMuMinus::CalcTheory() void PRunMuMinus::CalcTheory()
{ {
@ -125,8 +130,11 @@ void PRunMuMinus::CalcTheory()
// PrepareData // PrepareData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prepare data for fitting or viewing. <b>(Not yet implemented)</b>
* *
* <b>return:</b>
* - true if everthing went smooth
* - false, otherwise.
*/ */
Bool_t PRunMuMinus::PrepareData() Bool_t PRunMuMinus::PrepareData()
{ {

View File

@ -37,8 +37,7 @@
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor.
*
*/ */
PRunNonMusr::PRunNonMusr() : PRunBase() PRunNonMusr::PRunNonMusr() : PRunBase()
{ {
@ -55,10 +54,12 @@ PRunNonMusr::PRunNonMusr() : PRunBase()
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor
* *
* \param msrInfo pointer to the msr info structure * \param msrInfo pointer to the msr-file handler
* \param runNo number of the run of the msr-file * \param rawData raw run data
* \param runNo number of the run within the msr-file
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
*/ */
PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
{ {
@ -79,8 +80,7 @@ PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
// Destructor // Destructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Destructor
*
*/ */
PRunNonMusr::~PRunNonMusr() PRunNonMusr::~PRunNonMusr()
{ {
@ -90,9 +90,12 @@ PRunNonMusr::~PRunNonMusr()
// CalcChiSquare // CalcChiSquare
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate chi-square.
* *
* \param par parameter vector iterated by minuit * <b>return:</b>
* - chisq value
*
* \param par parameter vector iterated by minuit2
*/ */
Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par) Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
{ {
@ -114,8 +117,6 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
} }
} }
//cout << endl << ">> chisq=" << chisq;
return chisq; return chisq;
} }
@ -123,9 +124,9 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
// CalcMaxLikelihood // CalcMaxLikelihood
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>NOT IMPLEMENTED!!
* *
* \param par parameter vector iterated by minuit * \param par parameter vector iterated by minuit2
*/ */
Double_t PRunNonMusr::CalcMaxLikelihood(const std::vector<Double_t>& par) Double_t PRunNonMusr::CalcMaxLikelihood(const std::vector<Double_t>& par)
{ {
@ -138,8 +139,7 @@ Double_t PRunNonMusr::CalcMaxLikelihood(const std::vector<Double_t>& par)
// CalcTheory // CalcTheory
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate theory for a given set of fit-parameters.
*
*/ */
void PRunNonMusr::CalcTheory() void PRunNonMusr::CalcTheory()
{ {
@ -149,15 +149,16 @@ void PRunNonMusr::CalcTheory()
// PrepareData // PrepareData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prepare data for fitting or viewing.
* *
* <b>return:</b>
* - true if everthing went smooth
* - false, otherwise.
*/ */
Bool_t PRunNonMusr::PrepareData() Bool_t PRunNonMusr::PrepareData()
{ {
Bool_t success = true; Bool_t success = true;
//cout << endl << "in PRunNonMusr::PrepareData(): will feed fFitData";
if (fRunInfo->GetRunNameSize() > 1) { // ADDRUN present which is not supported for NonMusr if (fRunInfo->GetRunNameSize() > 1) { // ADDRUN present which is not supported for NonMusr
cerr << endl << ">> PRunNonMusr::PrepareData(): **WARNING** ADDRUN NOT SUPPORTED FOR THIS FIT TYPE, WILL IGNORE IT." << endl; cerr << endl << ">> PRunNonMusr::PrepareData(): **WARNING** ADDRUN NOT SUPPORTED FOR THIS FIT TYPE, WILL IGNORE IT." << endl;
} }
@ -176,8 +177,11 @@ Bool_t PRunNonMusr::PrepareData()
// PrepareFitData // PrepareFitData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prepare data for fitting.
* *
* <b>return:</b>
* - true if everthing went smooth
* - false, otherwise.
*/ */
Bool_t PRunNonMusr::PrepareFitData() Bool_t PRunNonMusr::PrepareFitData()
{ {
@ -190,21 +194,17 @@ Bool_t PRunNonMusr::PrepareFitData()
// get x-, y-index // get x-, y-index
UInt_t xIndex = GetXIndex(); UInt_t xIndex = GetXIndex();
UInt_t yIndex = GetYIndex(); UInt_t yIndex = GetYIndex();
// cout << endl << ">> xIndex=" << xIndex << ", yIndex=" << yIndex;
// pack the raw data // pack the raw data
Double_t value = 0.0; Double_t value = 0.0;
Double_t err = 0.0; Double_t err = 0.0;
// cout << endl << ">> fRawRunData->fDataNonMusr.fData[" << xIndex << "].size()=" << fRawRunData->fDataNonMusr.fData[xIndex].size();
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetData()->at(xIndex).size(); i++) { for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetData()->at(xIndex).size(); i++) {
// cout << endl << ">> i=" << i << ", packing=" << fRunInfo->GetPacking();
if (fRunInfo->GetPacking() == 1) { if (fRunInfo->GetPacking() == 1) {
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)); fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i));
fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i)); fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i));
fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)); fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i));
} else { // packed data, i.e. fRunInfo->GetPacking() > 1 } else { // packed data, i.e. fRunInfo->GetPacking() > 1
if ((i % fRunInfo->GetPacking() == 0) && (i != 0)) { // fill data if ((i % fRunInfo->GetPacking() == 0) && (i != 0)) { // fill data
// cout << endl << "-> i=" << i;
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i-fRunInfo->GetPacking()))/2.0); fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i-fRunInfo->GetPacking()))/2.0);
fData.AppendValue(value); fData.AppendValue(value);
fData.AppendErrorValue(TMath::Sqrt(err)); fData.AppendErrorValue(TMath::Sqrt(err));
@ -216,7 +216,6 @@ Bool_t PRunNonMusr::PrepareFitData()
err += fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)*fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i); err += fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)*fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i);
} }
} }
// cout << endl << ">> fData.fValue.size()=" << fData.fValue.size();
// count the number of bins to be fitted // count the number of bins to be fitted
fNoOfFitBins=0; fNoOfFitBins=0;
@ -226,7 +225,6 @@ Bool_t PRunNonMusr::PrepareFitData()
if ((x >= fFitStartTime) && (x <= fFitStopTime)) if ((x >= fFitStartTime) && (x <= fFitStopTime))
fNoOfFitBins++; fNoOfFitBins++;
} }
// cout << endl << ">> fNoOfFitBins=" << fNoOfFitBins;
return success; return success;
} }
@ -235,34 +233,31 @@ Bool_t PRunNonMusr::PrepareFitData()
// PrepareViewData // PrepareViewData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prepare data for viewing.
* *
* <b>return:</b>
* - true if everthing went smooth
* - false, otherwise.
*/ */
Bool_t PRunNonMusr::PrepareViewData() Bool_t PRunNonMusr::PrepareViewData()
{ {
Bool_t success = true; Bool_t success = true;
// cout << endl << ">> fRunInfo->fRunName = " << fRunInfo->fRunName[0].Data();
// get x-, y-index // get x-, y-index
UInt_t xIndex = GetXIndex(); UInt_t xIndex = GetXIndex();
UInt_t yIndex = GetYIndex(); UInt_t yIndex = GetYIndex();
// cout << endl << "PRunNonMusr::PrepareViewData: xIndex=" << xIndex << ", yIndex=" << yIndex << endl;
// fill data histo // fill data histo
// pack the raw data // pack the raw data
Double_t value = 0.0; Double_t value = 0.0;
Double_t err = 0.0; Double_t err = 0.0;
// cout << endl << ">> fRawRunData->fDataNonMusr.fData[" << xIndex << "].size()=" << fRawRunData->fDataNonMusr.fData[xIndex].size();
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetData()->at(xIndex).size(); i++) { for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetData()->at(xIndex).size(); i++) {
// cout << endl << ">> i=" << i << ", packing=" << fRunInfo->GetPacking();
if (fRunInfo->GetPacking() == 1) { if (fRunInfo->GetPacking() == 1) {
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)); fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i));
fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i)); fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i));
fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)); fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i));
} else { // packed data, i.e. fRunInfo->GetPacking() > 1 } else { // packed data, i.e. fRunInfo->GetPacking() > 1
if ((i % fRunInfo->GetPacking() == 0) && (i != 0)) { // fill data if ((i % fRunInfo->GetPacking() == 0) && (i != 0)) { // fill data
// cout << endl << "-> i=" << i;
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i-fRunInfo->GetPacking()))/2.0); fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i)-fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i-fRunInfo->GetPacking()))/2.0);
fData.AppendValue(value); fData.AppendValue(value);
fData.AppendErrorValue(TMath::Sqrt(err)); fData.AppendErrorValue(TMath::Sqrt(err));
@ -274,11 +269,9 @@ Bool_t PRunNonMusr::PrepareViewData()
err += fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)*fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i); err += fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i)*fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i);
} }
} }
// cout << endl << ">> fData.fValue.size()=" << fData.fValue.size();
// count the number of bins to be fitted // count the number of bins to be fitted
fNoOfFitBins = fData.GetValue()->size(); fNoOfFitBins = fData.GetValue()->size();
// cout << endl << ">> fNoOfFitBins=" << fNoOfFitBins;
// fill theory histo // fill theory histo
// feed the parameter vector // feed the parameter vector
@ -291,7 +284,6 @@ Bool_t PRunNonMusr::PrepareViewData()
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
} }
// cout << endl << ">> after parameter fill" << endl;
// get plot range // get plot range
PMsrPlotList *plotList; PMsrPlotList *plotList;
PMsrPlotStructure plotBlock; PMsrPlotStructure plotBlock;
@ -306,15 +298,9 @@ Bool_t PRunNonMusr::PrepareViewData()
Double_t xMin = 0.0, xMax = 0.0; Double_t xMin = 0.0, xMax = 0.0;
Double_t xAbsMin = 0.0, xAbsMax = 0.0; Double_t xAbsMin = 0.0, xAbsMax = 0.0;
Bool_t first = true; Bool_t first = true;
// cout << endl << ">> plotList->size()=" << plotList->size();
for (UInt_t i=0; i<plotList->size(); i++) { for (UInt_t i=0; i<plotList->size(); i++) {
plotBlock = plotList->at(i); plotBlock = plotList->at(i);
// cout << endl << ">> plotBlock.fRuns.size()=" << plotBlock.fRuns.size() << endl;
for (UInt_t j=0; j<plotBlock.fRuns.size(); j++) { for (UInt_t j=0; j<plotBlock.fRuns.size(); j++) {
// cout << endl << ">> j=" << j;
// cout << endl << ">> fRunNo=" << fRunNo;
// cout << endl << ">> plotBlock.fRuns[j]=" << plotBlock.fRuns[j];
// cout << endl;
if (fRunNo == plotBlock.fRuns[j]-1) { // run found if (fRunNo == plotBlock.fRuns[j]-1) { // run found
if (first) { if (first) {
first = false; first = false;
@ -322,7 +308,6 @@ Bool_t PRunNonMusr::PrepareViewData()
xMax = plotBlock.fTmax[0]; xMax = plotBlock.fTmax[0];
xAbsMin = xMin; xAbsMin = xMin;
xAbsMax = xMax; xAbsMax = xMax;
// cout << endl << ">> first: xMin=" << xMin << ", xMax=" << xMax << endl;
} else { } else {
if (fabs(xMax-xMin) > fabs(plotBlock.fTmax[0]-plotBlock.fTmin[0])) { if (fabs(xMax-xMin) > fabs(plotBlock.fTmax[0]-plotBlock.fTmin[0])) {
xMin = plotBlock.fTmin[0]; xMin = plotBlock.fTmin[0];
@ -332,13 +317,10 @@ Bool_t PRunNonMusr::PrepareViewData()
xAbsMin = xMin; xAbsMin = xMin;
if (xMax > xAbsMax) if (xMax > xAbsMax)
xAbsMax = xMax; xAbsMax = xMax;
// cout << endl << ">> !first: xMin=" << xMin << ", xMax=" << xMax << endl;
}
// cout << endl << ">> xMin=" << xMin << ", xMax=" << xMax << endl;
} }
} }
} }
// cout << endl << ">> after the xmin/xmax loop." << endl; }
// typically take 1000 points to calculate the theory, except if there are more data points, than take that number // typically take 1000 points to calculate the theory, except if there are more data points, than take that number
Double_t xStep; Double_t xStep;
@ -367,31 +349,26 @@ Bool_t PRunNonMusr::PrepareViewData()
// GetXIndex // GetXIndex
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Returns the x-axis data index.
* *
* <b>return:</b>
* - x-index
*/ */
UInt_t PRunNonMusr::GetXIndex() UInt_t PRunNonMusr::GetXIndex()
{ {
UInt_t index = 0; UInt_t index = 0;
Bool_t found = false; Bool_t found = false;
//cout << endl << ">> PRunNonMusr::GetXIndex: fRawRunData->fDataNonMusr.fFromAscii = " << fRawRunData->fDataNonMusr.fFromAscii;
if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format
//cout << endl << ">> PRunNonMusr::GetXIndex: ascii-file format";
index = 0; index = 0;
found = true; found = true;
} else { // db-file format } else { // db-file format
//cout << endl << ">> PRunNonMusr::GetXIndex: db-file format";
if (fRunInfo->GetXDataIndex() > 0) { // xy-data already indices if (fRunInfo->GetXDataIndex() > 0) { // xy-data already indices
//cout << endl << ">> PRunNonMusr::GetXIndex: xy-data are already indices, i.e. not labels";
index = fRunInfo->GetXDataIndex()-1; // since xy-data start with 1 ... index = fRunInfo->GetXDataIndex()-1; // since xy-data start with 1 ...
found = true; found = true;
} else { // xy-data data tags which needs to be converted to an index } else { // xy-data data tags which needs to be converted to an index
//cout << endl << ">> fDataTags.size()=" << fRawRunData->fDataNonMusr.fDataTags.size();
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetDataTags()->size(); i++) { for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetDataTags()->size(); i++) {
if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(*fRunInfo->GetXDataLabel()) == 0) { if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(*fRunInfo->GetXDataLabel()) == 0) {
//cout << endl << ">> i=" << i << ", fRawRunData->fDataNonMusr.fDataTags[i]=" << fRawRunData->fDataNonMusr.fDataTags[i].Data();
//cout << endl << ">> fRunInfo->fXYDataLabel[0]=" << fRunInfo->fXYDataLabel[0].Data();
index = i; index = i;
found = true; found = true;
break; break;
@ -413,15 +390,16 @@ UInt_t PRunNonMusr::GetXIndex()
// GetYIndex // GetYIndex
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Returns the y-axis data index.
* *
* <b>return:</b>
* - y-index
*/ */
UInt_t PRunNonMusr::GetYIndex() UInt_t PRunNonMusr::GetYIndex()
{ {
UInt_t index = 0; UInt_t index = 0;
Bool_t found = false; Bool_t found = false;
// cout << endl << ">> PRunNonMusr::GetYIndex:";
if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format
index = 1; index = 1;
found = true; found = true;
@ -432,8 +410,6 @@ UInt_t PRunNonMusr::GetYIndex()
} else { // xy-data data tags which needs to be converted to an index } else { // xy-data data tags which needs to be converted to an index
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetDataTags()->size(); i++) { for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetDataTags()->size(); i++) {
if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(*fRunInfo->GetYDataLabel()) == 0) { if (fRawRunData->fDataNonMusr.GetDataTags()->at(i).CompareTo(*fRunInfo->GetYDataLabel()) == 0) {
// cout << endl << ">> i=" << i << ", fRawRunData->fDataNonMusr.fDataTags[i]=" << fRawRunData->fDataNonMusr.fDataTags[i].Data();
// cout << endl << ">> fRunInfo->fXYDataLabel[1]=" << fRunInfo->fXYDataLabel[1].Data();
index = i; index = i;
found = true; found = true;
break; break;

View File

@ -39,8 +39,7 @@
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor
*
*/ */
PRunSingleHisto::PRunSingleHisto() : PRunBase() PRunSingleHisto::PRunSingleHisto() : PRunBase()
{ {
@ -53,10 +52,12 @@ PRunSingleHisto::PRunSingleHisto() : PRunBase()
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor
* *
* \param msrInfo pointer to the msr info structure * \param msrInfo pointer to the msr-file handler
* \param runNo number of the run of the msr-file * \param rawData raw run data
* \param runNo number of the run within the msr-file
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
*/ */
PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag)
{ {
@ -72,8 +73,7 @@ PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData,
// Destructor // Destructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Destructor
*
*/ */
PRunSingleHisto::~PRunSingleHisto() PRunSingleHisto::~PRunSingleHisto()
{ {
@ -83,15 +83,12 @@ PRunSingleHisto::~PRunSingleHisto()
// CalcChiSquare // CalcChiSquare
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate chi-square.
* *
* The return value is chisq * fRunInfo->GetPacking(), the reason is: * <b>return:</b>
* the data d_i and the theory t_i are scaled by the packing, i.e. d_i -> d_i / packing. * - chisq value
* Since the error is 1/sqrt(d_i) and hence error^2 = d_i it follows that
* (d_i - t_i)^2 ~ 1/packing^2 and error^2 ~ 1/packing, and hence the chisq needs
* to be scaled by packing.
* *
* \param par parameter vector iterated by minuit * \param par parameter vector iterated by minuit2
*/ */
Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par) Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
{ {
@ -132,7 +129,6 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
// calculate functions // calculate functions
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) { for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
Int_t funcNo = fMsrInfo->GetFuncNo(i); Int_t funcNo = fMsrInfo->GetFuncNo(i);
//cout << ">> i = " << i << ", funcNo = " << funcNo << endl;
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par); fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par);
} }
@ -154,9 +150,12 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
// CalcMaxLikelihood // CalcMaxLikelihood
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate log maximum-likelihood.
* *
* \param par parameter vector iterated by minuit * <b>return:</b>
* - log maximum-likelihood value
*
* \param par parameter vector iterated by minuit2
*/ */
Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par) Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
{ {
@ -225,8 +224,7 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
// CalcTheory // CalcTheory
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculate theory for a given set of fit-parameters.
*
*/ */
void PRunSingleHisto::CalcTheory() void PRunSingleHisto::CalcTheory()
{ {
@ -290,12 +288,20 @@ void PRunSingleHisto::CalcTheory()
// PrepareData // PrepareData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prepare data for fitting or viewing. What is already processed at this stage:
* -# get proper raw run data
* -# get all needed forward histograms
* -# get time resolution
* -# get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.)
* -# add runs (if addruns are present)
* -# group histograms (if grouping is present)
* *
* <b>return:</b>
* - true if everthing went smooth
* - false, otherwise.
*/ */
Bool_t PRunSingleHisto::PrepareData() Bool_t PRunSingleHisto::PrepareData()
{ {
// cout << endl << "in PRunSingleHisto::PrepareData(): will feed fData";
Bool_t success = true; Bool_t success = true;
// get the proper run // get the proper run
@ -489,15 +495,25 @@ Bool_t PRunSingleHisto::PrepareData()
// PrepareFitData // PrepareFitData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for fitting.
* The following steps are preformed:
* -# get fit start/stop time
* -# check that 'first good data bin', 'last good data bin', and 't0' make any sense
* -# check how the background shall be handled, i.e. fitted, subtracted from background estimate data range, or subtacted from a given fixed background.
* -# packing (i.e rebinning)
* *
* <b>return:</b>
* - true, if everything went smooth
* - false, otherwise
*
* \param runData raw run data handler
* \param histoNo forward histogram number
*/ */
Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoNo) Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoNo)
{ {
// keep start/stop time for fit // keep start/stop time for fit
fFitStartTime = fRunInfo->GetFitRange(0); fFitStartTime = fRunInfo->GetFitRange(0);
fFitStopTime = fRunInfo->GetFitRange(1); fFitStopTime = fRunInfo->GetFitRange(1);
//cout << endl << "start/stop (fit): " << fFitStartTime << ", " << fFitStopTime;
// transform raw histo data. This is done the following way (for details see the manual): // transform raw histo data. This is done the following way (for details see the manual):
// for the single histo fit, just the rebinned raw data are copied // for the single histo fit, just the rebinned raw data are copied
@ -604,7 +620,6 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN
// count the number of bins to be fitted // count the number of bins to be fitted
fNoOfFitBins=0; fNoOfFitBins=0;
Double_t time; Double_t time;
//cout << endl << ">> size=" << fData.GetValue()->size() << ", fDataTimeStart=" << fData.GetDataTimeStart() << ", fDataTimeStep=" << fData.GetDataTimeStep() << ", fFitStartTime=" << fFitStartTime << ", fFitStopTime=" << fFitStopTime;
for (UInt_t i=0; i<fData.GetValue()->size(); i++) { for (UInt_t i=0; i<fData.GetValue()->size(); i++) {
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
if ((time >= fFitStartTime) && (time <= fFitStopTime)) if ((time >= fFitStartTime) && (time <= fFitStopTime))
@ -618,8 +633,20 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN
// PrepareRawViewData // PrepareRawViewData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> Muon raw data * <p>Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for viewing
* without any life time correction.
* <p>The following steps are preformed:
* -# check if view packing is whished.
* -# check that 'first good data bin', 'last good data bin', and 't0' makes any sense
* -# packing (i.e. rebinnig)
* -# calculate theory
* *
* <b>return:</b>
* - true, if everything went smooth
* - false, otherwise.
*
* \param runData raw run data handler
* \param histoNo forward histogram number
*/ */
Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo) Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo)
{ {
@ -670,12 +697,6 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi
fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0)); fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0));
fData.SetDataTimeStep(fTimeResolution*packing); fData.SetDataTimeStep(fTimeResolution*packing);
/*
cout << endl << ">> time resolution = " << fTimeResolution;
cout << endl << ">> start = " << start << ", t0 = " << t0 << ", packing = " << packing;
cout << endl << ">> data start time = " << fData.GetDataTimeStart();
*/
Double_t normalizer = 1.0; Double_t normalizer = 1.0;
for (Int_t i=start; i<end; i++) { for (Int_t i=start; i<end; i++) {
if (((i-start) % packing == 0) && (i != start)) { // fill data if (((i-start) % packing == 0) && (i != start)) { // fill data
@ -767,7 +788,6 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
size = fData.GetValue()->size() * 10; size = fData.GetValue()->size() * 10;
factor = (Double_t)runData->GetDataBin(histoNo)->size() / (Double_t)size; factor = (Double_t)runData->GetDataBin(histoNo)->size() / (Double_t)size;
} }
//cout << endl << ">> runData->GetDataBin(histoNo).size() = " << runData->GetDataBin(histoNo)->size() << ", fData.GetValue()->size() * 10 = " << fData.GetValue()->size() * 10 << ", size = " << size << ", factor = " << factor << endl;
Double_t theoryValue; Double_t theoryValue;
fData.SetTheoryTimeStart(fData.GetDataTimeStart()); fData.SetTheoryTimeStart(fData.GetDataTimeStart());
fData.SetTheoryTimeStep(fTimeResolution*factor); fData.SetTheoryTimeStep(fTimeResolution*factor);
@ -790,6 +810,14 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
// PrepareViewData // PrepareViewData
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p>Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for viewing
* with life time correction, i.e. the exponential decay is removed.
* <p>The following steps are preformed:
* -# check if view packing is whished.
* -# check that 'first good data bin', 'last good data bin', and 't0' makes any sense
* -# transform data sets (see below).
* -# calculate theory
*
* <p> Muon life time corrected data: Starting from * <p> Muon life time corrected data: Starting from
* \f[ N(t) = N_0 e^{-t/\tau} [ 1 + A(t) ] + \mathrm{Bkg} \f] * \f[ N(t) = N_0 e^{-t/\tau} [ 1 + A(t) ] + \mathrm{Bkg} \f]
* it follows that * it follows that
@ -799,6 +827,13 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
* where \f$ p \f$ is the packing, and \f$ N(t) \f$ are the packed data, i.e. * where \f$ p \f$ is the packing, and \f$ N(t) \f$ are the packed data, i.e.
* \f[ N(t_i) = \frac{1}{p}\, \sum_{j=i}^{i+p} n_j \f] * \f[ N(t_i) = \frac{1}{p}\, \sum_{j=i}^{i+p} n_j \f]
* with \f$ n_j \f$ the raw histogram data bins. * with \f$ n_j \f$ the raw histogram data bins.
*
* <b>return:</b>
* - true, if everything went smooth
* - false, otherwise
*
* \param runData raw run data handler
* \param histoNo forward histogram number
*/ */
Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histoNo) Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histoNo)
{ {
@ -877,7 +912,6 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
tau = par[fRunInfo->GetLifetimeParamNo()-1]; tau = par[fRunInfo->GetLifetimeParamNo()-1];
else else
tau = PMUON_LIFETIME; tau = PMUON_LIFETIME;
//cout << endl << ">> tau = " << tau;
// get background // get background
Double_t bkg; Double_t bkg;
@ -913,12 +947,6 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0)); fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0));
fData.SetDataTimeStep(fTimeResolution*packing); fData.SetDataTimeStep(fTimeResolution*packing);
/*
cout << endl << ">> start time = " << fData.GetDataTimeStart() << ", step = " << fData.GetDataTimeStep();
cout << endl << ">> start = " << start << ", end = " << end;
cout << endl << "--------------------------------" << endl;
*/
Double_t normalizer = 1.0; Double_t normalizer = 1.0;
Double_t gammaRRF = 0.0, wRRF = 0.0, phaseRRF = 0.0; Double_t gammaRRF = 0.0, wRRF = 0.0, phaseRRF = 0.0;
if (fMsrInfo->GetMsrPlotList()->at(0).fRRFFreq == 0.0) { // normal Data representation if (fMsrInfo->GetMsrPlotList()->at(0).fRRFFreq == 0.0) { // normal Data representation
@ -931,9 +959,7 @@ cout << endl << "--------------------------------" << endl;
time = (((Double_t)i-(Double_t)(packing-1)/2.0)-t0)*fTimeResolution; time = (((Double_t)i-(Double_t)(packing-1)/2.0)-t0)*fTimeResolution;
expval = TMath::Exp(+time/tau)/N0; expval = TMath::Exp(+time/tau)/N0;
fData.AppendValue(-1.0+expval*(value-bkg)); fData.AppendValue(-1.0+expval*(value-bkg));
//cout << endl << ">> i=" << i << ",t0=" << t0 << ",time=" << time << ",expval=" << expval << ",value=" << value << ",bkg=" << bkg << ",expval*(value-bkg)-1=" << expval*(value-bkg)-1.0;
fData.AppendErrorValue(expval*TMath::Sqrt(value/normalizer)); fData.AppendErrorValue(expval*TMath::Sqrt(value/normalizer));
//cout << endl << ">> " << time << ", " << expval << ", " << -1.0+expval*(value-bkg) << ", " << expval*TMath::Sqrt(value/packing);
value = 0.0; value = 0.0;
} }
value += runData->GetDataBin(histoNo)->at(i); value += runData->GetDataBin(histoNo)->at(i);
@ -1062,7 +1088,13 @@ cout << endl << "--------------------------------" << endl;
// EstimatBkg // EstimatBkg
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Estimate the background for a given interval.
*
* <b>return:</b>
* - true, if everything went smooth
* - false, otherwise
*
* \param histoNo forward histogram number of the run
*/ */
Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo) Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
{ {
@ -1123,7 +1155,6 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
Double_t bkg = 0.0; Double_t bkg = 0.0;
// forward // forward
//cout << endl << ">> bkg start=" << start << ", end=" << end;
for (UInt_t i=start; i<end; i++) for (UInt_t i=start; i<end; i++)
bkg += runData->GetDataBin(histoNo)->at(i); bkg += runData->GetDataBin(histoNo)->at(i);
bkg /= static_cast<Double_t>(end - start + 1); bkg /= static_cast<Double_t>(end - start + 1);

View File

@ -46,7 +46,7 @@ ClassImpQ(PStartupHandler)
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Constructor. Check if the musrfit_startup.xml file is found in some standard search paths
*/ */
PStartupHandler::PStartupHandler() PStartupHandler::PStartupHandler()
{ {
@ -86,7 +86,7 @@ PStartupHandler::PStartupHandler()
// Destructor // Destructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Destructor
*/ */
PStartupHandler::~PStartupHandler() PStartupHandler::~PStartupHandler()
{ {
@ -100,7 +100,7 @@ PStartupHandler::~PStartupHandler()
// OnStartDocument // OnStartDocument
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called on start of the XML file reading. Initializes all necessary variables.
*/ */
void PStartupHandler::OnStartDocument() void PStartupHandler::OnStartDocument()
{ {
@ -124,7 +124,7 @@ void PStartupHandler::OnStartDocument()
// OnEndDocument // OnEndDocument
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called on end of XML file reading.
*/ */
void PStartupHandler::OnEndDocument() void PStartupHandler::OnEndDocument()
{ {
@ -136,10 +136,11 @@ void PStartupHandler::OnEndDocument()
// OnStartElement // OnStartElement
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when a XML start element is found. Filters out the needed elements
* and sets a proper key.
* *
* \param str * \param str XML element name
* \param attributes * \param attributes not used
*/ */
void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes) void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes)
{ {
@ -168,9 +169,9 @@ void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes)
// OnEndElement // OnEndElement
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when a XML end element is found. Resets the handler key.
* *
* \param str * \param str not used
*/ */
void PStartupHandler::OnEndElement(const Char_t *str) void PStartupHandler::OnEndElement(const Char_t *str)
{ {
@ -181,9 +182,10 @@ void PStartupHandler::OnEndElement(const Char_t *str)
// OnCharacters // OnCharacters
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Content of a given XML element. Filters out the data and feeds them to
* the internal variables.
* *
* \param str * \param str XML element string
*/ */
void PStartupHandler::OnCharacters(const Char_t *str) void PStartupHandler::OnCharacters(const Char_t *str)
{ {
@ -352,9 +354,9 @@ void PStartupHandler::OnCharacters(const Char_t *str)
// OnComment // OnComment
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when a XML comment is found. Not used.
* *
* \param str * \param str not used.
*/ */
void PStartupHandler::OnComment(const Char_t *str) void PStartupHandler::OnComment(const Char_t *str)
{ {
@ -365,9 +367,9 @@ void PStartupHandler::OnComment(const Char_t *str)
// OnWarning // OnWarning
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when the XML parser emits a warning.
* *
* \param str * \param str warning string
*/ */
void PStartupHandler::OnWarning(const Char_t *str) void PStartupHandler::OnWarning(const Char_t *str)
{ {
@ -379,9 +381,9 @@ void PStartupHandler::OnWarning(const Char_t *str)
// OnError // OnError
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when the XML parser emits an error.
* *
* \param str * \param str error string
*/ */
void PStartupHandler::OnError(const Char_t *str) void PStartupHandler::OnError(const Char_t *str)
{ {
@ -393,9 +395,9 @@ void PStartupHandler::OnError(const Char_t *str)
// OnFatalError // OnFatalError
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Called when the XML parser emits a fatal error.
* *
* \param str * \param str fatal error string
*/ */
void PStartupHandler::OnFatalError(const Char_t *str) void PStartupHandler::OnFatalError(const Char_t *str)
{ {
@ -407,9 +409,9 @@ void PStartupHandler::OnFatalError(const Char_t *str)
// OnCdataBlock // OnCdataBlock
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Not used.
* *
* \param str * \param str not used
*/ */
void PStartupHandler::OnCdataBlock(const Char_t *str, Int_t len) void PStartupHandler::OnCdataBlock(const Char_t *str, Int_t len)
{ {
@ -420,7 +422,7 @@ void PStartupHandler::OnCdataBlock(const Char_t *str, Int_t len)
// CheckLists // CheckLists
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Check if the default lists are present and if not, feed them with some default settings
* *
*/ */
void PStartupHandler::CheckLists() void PStartupHandler::CheckLists()
@ -428,17 +430,20 @@ void PStartupHandler::CheckLists()
// check if anything was set, and if not set some default stuff // check if anything was set, and if not set some default stuff
// check if any data path is given // check if any data path is given
//cout << endl << ">> check data path list ...";
if (fDataPathList.size() == 0) { if (fDataPathList.size() == 0) {
//cout << endl << ">> data path list empty, will set default ones";
fDataPathList.push_back(TString("/mnt/data/nemu/his")); fDataPathList.push_back(TString("/mnt/data/nemu/his"));
fDataPathList.push_back(TString("/mnt/data/nemu/wkm")); fDataPathList.push_back(TString("/mnt/data/nemu/wkm"));
fDataPathList.push_back(TString("/afs/psi.ch/project/nemu/data/his"));
fDataPathList.push_back(TString("/afs/psi.ch/project/nemu/data/wkm"));
fDataPathList.push_back(TString("/afs/psi.ch/project/bulkmusr/data/gps"));
fDataPathList.push_back(TString("/afs/psi.ch/project/bulkmusr/data/dolly"));
fDataPathList.push_back(TString("/afs/psi.ch/project/bulkmusr/data/gpd"));
fDataPathList.push_back(TString("/afs/psi.ch/project/bulkmusr/data/ltf"));
fDataPathList.push_back(TString("/afs/psi.ch/project/bulkmusr/data/alc"));
} }
// check if any markers are given // check if any markers are given
//cout << endl << ">> check marker list ...";
if (fMarkerList.size() == 0) { if (fMarkerList.size() == 0) {
//cout << endl << ">> marker list empty, will set default ones";
fMarkerList.push_back(24); // open circle fMarkerList.push_back(24); // open circle
fMarkerList.push_back(25); // open square fMarkerList.push_back(25); // open square
fMarkerList.push_back(26); // open triangle fMarkerList.push_back(26); // open triangle
@ -456,9 +461,7 @@ void PStartupHandler::CheckLists()
} }
// check if any colors are given // check if any colors are given
//cout << endl << ">> check color list ...";
if (fColorList.size() == 0) { if (fColorList.size() == 0) {
//cout << endl << ">> color list empty, will set default ones";
fColorList.push_back(TColor::GetColor(0, 0, 0)); // kBlack fColorList.push_back(TColor::GetColor(0, 0, 0)); // kBlack
fColorList.push_back(TColor::GetColor(255, 0, 0)); // kRed fColorList.push_back(TColor::GetColor(255, 0, 0)); // kRed
fColorList.push_back(TColor::GetColor(0, 255, 0)); // kGreen fColorList.push_back(TColor::GetColor(0, 255, 0)); // kGreen
@ -476,8 +479,13 @@ void PStartupHandler::CheckLists()
// StartupFileExists // StartupFileExists
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Checks if a file is present on the disc.
* *
* <b>return:</b>
* - true, if the file is present
* - false, otherwise
*
* \param fln file name
*/ */
Bool_t PStartupHandler::StartupFileExists(Char_t *fln) Bool_t PStartupHandler::StartupFileExists(Char_t *fln)
{ {

View File

@ -52,38 +52,43 @@ using namespace std;
// Constructor // Constructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> Constructor.
*
* <p> The theory block his parsed and mapped to a tree. Every line (except the '+') * <p> The theory block his parsed and mapped to a tree. Every line (except the '+')
* is a theory object by itself, i.e. the whole theory is build up recursivly. * is a theory object by itself, i.e. the whole theory is build up recursivly.
* Example: * Example:
* Theory block: * \verbatim
* a 1 Theory block:
* tf 2 3 a 1
* se 4 tf 2 3
* + se 4
* a 5 +
* tf 6 7 a 5
* se 8 tf 6 7
* + se 8
* a 9 +
* tf 10 11 a 9
tf 10 11
\endverbatim
* *
* This is mapped into the following binary tree: * <p> This is mapped into the following binary tree:
* \verbatim
a 1
+/ \*
a 5 tf 2 3
+ / \* \ *
a 9 a 5 se 4
\* \*
tf 10 11 tf 6 7
\*
se 8
\endverbatim
* *
* a 1 * \param msrInfo msr-file handler
* +/ \* * \param runNo msr-file run number
* a 5 tf 2 3 * \param hasParent flag needed in order to know if PTheory is the root object or a child
* + / \* \ * * false (default) means this is the root object
* a 9 a 5 se 4 * true means this is part of an already existing object tree
* \* \*
* tf 10 11 tf 6 7
* \*
* se 8
*
* \param msrInfo
* \param runNo
* \param parent needed in order to know if PTheory is the root object or a child
* false (default) -> this is the root object
* true -> this is part of an already existing object tree
*/ */
PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent) PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
{ {
@ -174,7 +179,6 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
// if userFcn, the first entry is the function name and needs to be handled specially // if userFcn, the first entry is the function name and needs to be handled specially
if ((fType == THEORY_USER_FCN) && ((i == 1) || (i == 2))) { if ((fType == THEORY_USER_FCN) && ((i == 1) || (i == 2))) {
//cout << endl << ">> userFcn: i=" << i << ", str=" << str.Data() << endl;
if (i == 1) { if (i == 1) {
fUserFcnSharedLibName = str; fUserFcnSharedLibName = str;
} }
@ -275,7 +279,6 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
// invoke user function object // invoke user function object
fUserFcn = 0; fUserFcn = 0;
fUserFcn = (PUserFcnBase*)TClass::GetClass(fUserFcnClassName.Data())->New(); fUserFcn = (PUserFcnBase*)TClass::GetClass(fUserFcnClassName.Data())->New();
//cout << endl << ">> fUserFcn = " << fUserFcn << endl;
if (fUserFcn == 0) { if (fUserFcn == 0) {
cerr << endl << "**ERROR**: PTheory: user function object could not be invoked. See line no " << line->fLineNo; cerr << endl << "**ERROR**: PTheory: user function object could not be invoked. See line no " << line->fLineNo;
cerr << endl; cerr << endl;
@ -296,12 +299,10 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
// Destructor // Destructor
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Destructor
*/ */
PTheory::~PTheory() PTheory::~PTheory()
{ {
//cout << endl << "PTheory::~PTheory() ..." << endl;
fParamNo.clear(); fParamNo.clear();
fUserParam.clear(); fUserParam.clear();
@ -321,8 +322,11 @@ PTheory::~PTheory()
// IsValid // IsValid
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p>Checks if the theory tree is valid. Needs to be implemented!! * <p>Checks if the theory tree is valid.
* *
* <b>return:</b>
* - true if valid
* - false otherwise
*/ */
Bool_t PTheory::IsValid() Bool_t PTheory::IsValid()
{ {
@ -346,10 +350,14 @@ Bool_t PTheory::IsValid()
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Evaluates the theory tree.
* *
* \param t * <b>return:</b>
* \param paramValues * - theory value for the given sets of parameters
*
* \param t time for single histogram, asymmetry, and mu-minus fits, x-axis value non-muSR fits
* \param paramValues vector with the parameters
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -681,7 +689,7 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
* the COOLEST part is that if right is a non-null pointer, * the COOLEST part is that if right is a non-null pointer,
* the destructor gets called recursively! * the destructor gets called recursively!
* *
* \param theo * \param theo pointer to the theory object
*/ */
void PTheory::CleanUp(PTheory *theo) void PTheory::CleanUp(PTheory *theo)
{ {
@ -698,9 +706,13 @@ void PTheory::CleanUp(PTheory *theo)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Searches the internal look up table for the theory name, and if found
* set some internal variables to proper values.
* *
* \param name * <b>return:</b>
* - index of the theory function
*
* \param name theory name
*/ */
Int_t PTheory::SearchDataBase(TString name) Int_t PTheory::SearchDataBase(TString name)
{ {
@ -722,9 +734,10 @@ Int_t PTheory::SearchDataBase(TString name)
// MakeCleanAndTidyTheoryBlock private // MakeCleanAndTidyTheoryBlock private
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Takes the theory block form the msr-file, and makes a nicely formated
* theory block.
* *
* \param fullTheoryBlock * \param fullTheoryBlock msr-file text lines of the theory block
*/ */
void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock) void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
{ {
@ -812,9 +825,10 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
// MakeCleanAndTidyPolynom private // MakeCleanAndTidyPolynom private
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prettifies a polynom theory line.
* *
* \param fullTheoryBlock * \param i line index of the theory polynom line to be prettified
* \param fullTheoryBlock msr-file text lines of the theory block
*/ */
void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock) void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
{ {
@ -824,8 +838,6 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
TObjString *ostr; TObjString *ostr;
Char_t substr[256]; Char_t substr[256];
//cout << endl << ">> MakeCleanAndTidyPolynom: " << (*fullTheoryBlock)[i].fLine.Data();
// init tidy // init tidy
tidy = TString("polynom "); tidy = TString("polynom ");
// get the line to be prettyfied // get the line to be prettyfied
@ -870,9 +882,10 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
// MakeCleanAndTidyUserFcn private // MakeCleanAndTidyUserFcn private
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Prettifies a user function theory line.
* *
* \param fullTheoryBlock * \param i line index of the user function line to be prettified
* \param fullTheoryBlock msr-file text lines of the theory block
*/ */
void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock) void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
{ {
@ -881,8 +894,6 @@ void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
TObjArray *tokens = 0; TObjArray *tokens = 0;
TObjString *ostr; TObjString *ostr;
//cout << endl << ">> MakeCleanAndTidyUserFcn: " << (*fullTheoryBlock)[i].fLine.Data();
// init tidy // init tidy
tidy = TString("userFcn "); tidy = TString("userFcn ");
// get the line to be prettyfied // get the line to be prettyfied
@ -910,10 +921,15 @@ void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> Asymmetry * <p> theory function: Asymmetry
* \f[ = A \f] * \f[ = A \f]
* *
* \param paramValues * <b>meaning of paramValues:</b> \f$A\f$
*
* <b>return:</b> function value
*
* \param paramValues vector with the parameters
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -933,16 +949,17 @@ Double_t PTheory::Asymmetry(const PDoubleVector& paramValues, const PDoubleVecto
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> Simple exponential * <p> theory function: simple exponential
* \f[ = \exp\left(-\lambda t\right) \f] or * \f[ = \exp\left(-\lambda t\right) \f] or
* \f[ = \exp\left(-\lambda (t-t_{\rm shift} \right) \f] * \f[ = \exp\left(-\lambda [t-t_{\rm shift}] \right) \f]
* *
* <p> For details concerning fParamNo and paramValues see PTheory::Asymmetry and * <b>meaning of paramValues:</b> \f$\lambda\f$ [, \f$t_{\rm shift}\f$]
* PTheory::PTheory.
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * <b>return:</b> function value
* \param paramValues parameter values: depolarization rate \f$\lambda\f$ *
* in \f$(1/\mu\mathrm{s})\f$, optionally \f$t_{\rm shift}\f$ * \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::SimpleExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::SimpleExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -972,10 +989,17 @@ Double_t PTheory::SimpleExp(register Double_t t, const PDoubleVector& paramValue
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: generalized exponential
* \f[ = \exp\left(-[\lambda t]^\beta\right) \f] or
* \f[ = \exp\left(-[\lambda (t-t_{\rm shift})]^\beta\right) \f]
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * <b>meaning of paramValues:</b> \f$\lambda\f$, \f$\beta\f$ [, \f$t_{\rm shift}\f$]
* \param paramValues *
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::GeneralExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::GeneralExp(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1013,10 +1037,17 @@ Double_t PTheory::GeneralExp(register Double_t t, const PDoubleVector& paramValu
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: simple Gaussian
* \f[ = \exp\left(-1/2 [\sigma t]^2\right) \f] or
* \f[ = \exp\left(-1/2 [\sigma (t-t_{\rm shift})]^2\right) \f]
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * <b>meaning of paramValues:</b> \f$\sigma\f$ [, \f$t_{\rm shift}\f$]
* \param paramValues *
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::SimpleGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::SimpleGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1046,10 +1077,17 @@ Double_t PTheory::SimpleGauss(register Double_t t, const PDoubleVector& paramVal
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: static Gaussian Kubo-Toyabe in zero applied field
* \f[ = \frac{1}{3} + \frac{2}{3} \left[1-(\sigma t)^2\right] \exp\left[-1/2 (\sigma t)^2\right] \f] or
* \f[ = \frac{1}{3} + \frac{2}{3} \left[1-(\sigma \{t-t_{\rm shift}\})^2\right] \exp\left[-1/2 (\sigma \{t-t_{\rm shift}\})^2\right] \f]
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * <b>meaning of paramValues:</b> \f$\sigma\f$ [, \f$t_{\rm shift}\f$]
* \param paramValues *
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::StaticGaussKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::StaticGaussKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1079,10 +1117,19 @@ Double_t PTheory::StaticGaussKT(register Double_t t, const PDoubleVector& paramV
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: static Gaussian Kubo-Toyabe in longitudinal applied field
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = 1-\frac{2\sigma^2}{(2\pi\nu)^2}\left[1-\exp\left(-1/2 \{\sigma t\}^2\right)\cos(2\pi\nu t)\right] +
* \param paramValues \frac{2\sigma^4}{(2\pi\nu)^3}\int^t_0 \exp\left(-1/2 \{\sigma \tau\}^2\right)\sin(2\pi\nu\tau)\mathrm{d}\tau \f]
* or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\sigma\f$, \f$\nu\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::StaticGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::StaticGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1147,10 +1194,22 @@ Double_t PTheory::StaticGaussKTLF(register Double_t t, const PDoubleVector& para
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: dynamic Gaussian Kubo-Toyabe in longitudinal applied field
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty}
* \param paramValues * \frac{f_{\mathrm{G}}(s+\Gamma)}{1-\Gamma f_{\mathrm{G}}(s+\Gamma)} \exp(s t) \mathrm{d}s,
* \mathrm{~where~}\,f_{\mathrm{G}}(s)\equiv \int_0^{\infty}G_{\mathrm{G,LF}}(t)\exp(-s t) \mathrm{d}t\f]
* or the time shifted version of it. \f$G_{\mathrm{G,LF}}(t)\f$ is the static Gaussian Kubo-Toyabe in longitudinal applied field.
*
* <p>The current implementation is not realized via the above formulas, but ...
*
* <b>meaning of paramValues:</b> \f$\sigma\f$, \f$\nu\f$, \f$\Gamma\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::DynamicGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::DynamicGaussKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1229,10 +1288,18 @@ Double_t PTheory::DynamicGaussKTLF(register Double_t t, const PDoubleVector& par
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> (see Uemura et al. PRB 31, 546 (85)) * <p> theory function: static Lorentzain Kubo-Toyabe in zero applied field (see Uemura et al. PRB 31, 546 (85)).
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = 1/3 + 2/3 [1 - \lambda t] \exp(-\lambda t) \f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\lambda\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::StaticLorentzKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::StaticLorentzKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1262,10 +1329,20 @@ Double_t PTheory::StaticLorentzKT(register Double_t t, const PDoubleVector& para
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: static Lorentzain Kubo-Toyabe in longitudinal applied field (see Uemura et al. PRB 31, 546 (85)).
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = 1-\frac{a}{2\pi\nu}j_1(2\pi\nu t)\exp\left(-at\right)-
* \param paramValues * \left(\frac{a}{2\pi\nu}\right)^2 \left[j_0(2\pi\nu t)\exp\left(-at\right)-1\right]-
* a\left[1+\left(\frac{a}{2\pi\nu}\right)^2\right]\int^t_0 \exp\left(-a\tau\right)j_0(2\pi\nu\tau)\mathrm{d}\tau) \f]
* or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$a\f$, \f$\nu\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::StaticLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::StaticLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1340,10 +1417,24 @@ Double_t PTheory::StaticLorentzKTLF(register Double_t t, const PDoubleVector& pa
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: dynamic Lorentzain Kubo-Toyabe in longitudinal applied field
* (see R. S. Hayano et al., Phys. Rev. B 20 (1979) 850; P. Dalmas de Reotier and A. Yaouanc,
* J. Phys.: Condens. Matter 4 (1992) 4533; A. Keren, Phys. Rev. B 50 (1994) 10039).
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty}
* \param paramValues * \frac{f_{\mathrm{L}}(s+\Gamma)}{1-\Gamma f_{\mathrm{L}}(s+\Gamma)} \exp(s t) \mathrm{d}s,
* \mathrm{~where~}\,f_{\mathrm{L}}(s)\equiv \int_0^{\infty}G_{\mathrm{L,LF}}(t)\exp(-s t) \mathrm{d}t\f]
* or the time shifted version of it. \f$G_{\mathrm{L,LF}}(t)\f$ is the static Lorentzain Kubo-Toyabe function in longitudinal field
*
* <p>The current implementation is not realized via the above formulas, but ...
*
* <b>meaning of paramValues:</b> \f$a\f$, \f$\nu\f$, \f$\Gamma\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::DynamicLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::DynamicLorentzKTLF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1433,10 +1524,18 @@ Double_t PTheory::DynamicLorentzKTLF(register Double_t t, const PDoubleVector& p
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: dynamic Lorentzain Kubo-Toyabe in longitudinal applied field
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = 1/3 + 2/3 \left(1-(\sigma t)^2-\lambda t\right) \exp\left(-1/2(\sigma t)^2-\lambda t\right)\f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\lambda\f$, \f$\sigma\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::CombiLGKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::CombiLGKT(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1470,10 +1569,18 @@ Double_t PTheory::CombiLGKT(register Double_t t, const PDoubleVector& paramValue
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: spin glass function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \frac{1}{3}\exp\left(-\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}}\right)+\frac{2}{3}\left(1-\frac{q\lambda^2t^2}{\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}+q\lambda^2t^2}}\right)\exp\left(-\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}+q\lambda^2t^2}\right)\f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\lambda\f$, \f$\gamma\f$, \f$q\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::SpinGlass(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::SpinGlass(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1513,10 +1620,18 @@ Double_t PTheory::SpinGlass(register Double_t t, const PDoubleVector& paramValue
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p>Where does this come from ??? please give a reference * <p> theory function: random anisotropic hyperfine function (see R. E. Turner and D. R. Harshman, Phys. Rev. B 34 (1986) 4467)
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \frac{1}{6}\left(1-\frac{\nu t}{2}\right)\exp\left(-\frac{\nu t}{2}\right)+\frac{1}{3}\left(1-\frac{\nu t}{4}\right)\exp\left(-\frac{\nu t + 2.44949\lambda t}{4}\right)\f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\nu\f$, \f$\lambda\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::RandomAnisotropicHyperfine(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::RandomAnisotropicHyperfine(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1550,10 +1665,18 @@ Double_t PTheory::RandomAnisotropicHyperfine(register Double_t t, const PDoubleV
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: Abragam function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \exp\left[-\frac{\sigma^2}{\gamma^2}\left(e^{-\gamma t}-1+\gamma t\right)\right] \f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\sigma\f$, \f$\gamma\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::Abragam(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::Abragam(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1581,15 +1704,23 @@ Double_t PTheory::Abragam(register Double_t t, const PDoubleVector& paramValues,
Double_t gamma_t = tt*val[1]; Double_t gamma_t = tt*val[1];
return TMath::Exp(-TMath::Power(val[0]/val[1],2.0)* return TMath::Exp(-TMath::Power(val[0]/val[1],2.0)*
(TMath::Exp(-gamma_t)-1.0-gamma_t)); (TMath::Exp(-gamma_t)-1.0+gamma_t));
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: internal field function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \alpha\,\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\exp\left(-\lambda_{\mathrm{T}}t\right)+(1-\alpha)\,\exp\left(-\lambda_{\mathrm{L}}t\right)\f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\alpha\f$, \f$\varphi\f$, \f$\nu\f$, \f$\lambda_{\rm T}\f$, \f$\lambda_{\rm L}\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::InternalField(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::InternalField(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1620,10 +1751,18 @@ Double_t PTheory::InternalField(register Double_t t, const PDoubleVector& paramV
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: cosine including phase
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \cos(2\pi\nu t + \varphi) \f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\nu\f$, \f$\varphi\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::TFCos(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::TFCos(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1653,10 +1792,18 @@ Double_t PTheory::TFCos(register Double_t t, const PDoubleVector& paramValues, c
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: spherical bessel function including phase
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = j_0(2\pi\nu t + \varphi) \f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\nu\f$, \f$\varphi\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::Bessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::Bessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1686,10 +1833,18 @@ Double_t PTheory::Bessel(register Double_t t, const PDoubleVector& paramValues,
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: internal field bessel function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \alpha\,j_0\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\exp\left(-\lambda_{\mathrm{T}}t\right)+(1-\alpha)\,\exp\left(-\lambda_{\mathrm{L}}t\right)\f]
* \param paramValues * or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\alpha\f$, \f$\varphi\f$, \f$\nu\f$, \f$\lambda_{\rm T}\f$, \f$\lambda_{\rm L}\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::InternalBessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::InternalBessel(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1721,10 +1876,24 @@ Double_t PTheory::InternalBessel(register Double_t t, const PDoubleVector& param
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: skewed Gaussian function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f{eqnarray*}{ &=& \frac{\sigma_{-}}{\sigma_{+}+\sigma_{-}}\exp\left[-\frac{\sigma_{-}^2t^2}{2}\right]
* \param paramValues * \left\lbrace\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)+
* \sin\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\mathrm{Erfi}\left(\frac{\sigma_{-}t}{\sqrt{2}}\right)\right\rbrace+\\
* & & \frac{\sigma_{+}}{\sigma_{+}+\sigma_{-}}
* \exp\left[-\frac{\sigma_{+}^2t^2}{2}\right]\left\lbrace\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)-
* \sin\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\mathrm{Erfi}\left(\frac{\sigma_{+}t}{\sqrt{2}}\right)\right\rbrace
* \f}
* or the time shifted version of it.
*
* <b>meaning of paramValues:</b> \f$\varphi\f$, \f$\nu\f$, \f$\sigma_{-}\f$, \f$\sigma_{+}\f$ [, \f$t_{\rm shift}\f$]
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::SkewedGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::SkewedGauss(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1775,10 +1944,17 @@ Double_t PTheory::SkewedGauss(register Double_t t, const PDoubleVector& paramVal
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: polynom
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * \f[ = \sum_{k=0}^n a_k (t-t_{\rm shift})^k \f]
* \param paramValues tshift, p0, p1, ..., pn *
* <b>meaning of paramValues:</b> \f$t_{\rm shift}\f$, \f$a_0\f$, \f$a_1\f$, \f$\ldots\f$, \f$a_n\f$
*
* <b>return:</b> function value
*
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::Polynom(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::Polynom(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
@ -1809,24 +1985,16 @@ Double_t PTheory::Polynom(register Double_t t, const PDoubleVector& paramValues,
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p> theory function: user function
* *
* \param t time in \f$(\mu\mathrm{s})\f$ * <b>return:</b> function value
* \param paramValues *
* \param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/ */
Double_t PTheory::UserFcn(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const Double_t PTheory::UserFcn(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{ {
/*
static Bool_t first = true;
if (first) {
cout << endl << ">> UserFcn: fParamNo.size()=" << fParamNo.size() << ", fUserParam.size()=" << fUserParam.size();
for (UInt_t i=0; i<fParamNo.size(); i++) {
cout << endl << ">> " << i << ": " << fParamNo[i]+1;
}
cout << endl;
}
*/
// check if FUNCTIONS are used // check if FUNCTIONS are used
for (UInt_t i=0; i<fUserParam.size(); i++) { for (UInt_t i=0; i<fUserParam.size(); i++) {
if (fParamNo[i] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map if (fParamNo[i] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map
@ -1836,23 +2004,18 @@ if (first) {
} }
} }
/*
if (first) {
first = false;
for (UInt_t i=0; i<fUserParam.size(); i++) {
cout << endl << "-> " << i << ": " << fUserParam[i];
}
cout << endl;
cout << endl << ">> t=" << t << ", function value=" << (*fUserFcn)(t, fUserParam);
cout << endl;
}
*/
return (*fUserFcn)(t, fUserParam); return (*fUserFcn)(t, fUserParam);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p>The fLFIntegral is given in steps of 1 ns, e.g. index i=100 coresponds to t=100ns * <p>Calculates the non-analytic integral of the static Gaussian Kubo-Toyabe in longitudinal field, i.e.
* \f[ G_{\rm G,LF}(t) = \int^t_0 \exp\left[-1/2 (\sigma\tau)^2\right]\sin(2\pi\nu\tau)\mathrm{d}\tau \f]
* and stores \f$G_{\rm G,LF}(t)\f$ in a vector, fLFIntegral, from \f$t=0\ldots 20\f$ us with a time resolution of 1 ns.
*
* The fLFIntegral is given in steps of 1 ns, e.g. index i=100 coresponds to t=100ns
*
* <b>meaning of val:</b> val[0]=\f$\nu\f$, val[1]=\f$\sigma\f$
* *
* \param val parameters needed to calculate the non-analytic integral of the static Gauss LF function. * \param val parameters needed to calculate the non-analytic integral of the static Gauss LF function.
*/ */
@ -1887,7 +2050,13 @@ void PTheory::CalculateGaussLFIntegral(const Double_t *val) const
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Calculates the non-analytic integral of the static Lorentzian Kubo-Toyabe in longitudinal field, i.e.
* \f[ G_{\rm L,LF}(t) = \int^t_0 \exp\left[-a \tau \right] j_0(2\pi\nu\tau)\mathrm{d}\tau \f]
* and stores \f$G_{\rm L,LF}(t)\f$ in a vector, fLFIntegral, from \f$t=0\ldots 20\f$ us with a time resolution of 1 ns.
*
* The fLFIntegral is given in steps of 1 ns, e.g. index i=100 coresponds to t=100ns
*
* <b>meaning of val:</b> val[0]=\f$\nu\f$, val[1]=\f$a\f$
* *
* \param val parameters needed to calculate the non-analytic integral of the static Lorentz LF function. * \param val parameters needed to calculate the non-analytic integral of the static Lorentz LF function.
*/ */
@ -1926,7 +2095,9 @@ void PTheory::CalculateLorentzLFIntegral(const Double_t *val) const
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Gets value of the non-analytic static LF integral.
*
* <b>return:</b> value of the non-analytic static LF integral
* *
* \param t time in (usec) * \param t time in (usec)
*/ */
@ -1948,6 +2119,8 @@ Double_t PTheory::GetLFIntegralValue(const Double_t t) const
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p><b>Docu of this function still missing!!</b>
*
* <p>Number of sampling points is estimated according to w0: w0 T = 2 pi * <p>Number of sampling points is estimated according to w0: w0 T = 2 pi
* t_sampling = T/16 (i.e. 16 points on 1 period) * t_sampling = T/16 (i.e. 16 points on 1 period)
* N = 8/pi w0 Tmax = 16 nu0 Tmax * N = 8/pi w0 Tmax = 16 nu0 Tmax
@ -2074,7 +2247,9 @@ void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/** /**
* <p> * <p>Gets value of the dynamic Kubo-Toyabe LF function.
*
* <b>return:</b> function value
* *
* \param t time in (usec) * \param t time in (usec)
*/ */

View File

@ -34,6 +34,9 @@
#include "PRunBase.h" #include "PRunBase.h"
/**
* <p>Will eventually handle the \f$\mu^{-}\f$ fitting etc.
*/
class PRunMuMinus : public PRunBase class PRunMuMinus : public PRunBase
{ {
public: public:
@ -51,9 +54,9 @@ class PRunMuMinus : public PRunBase
virtual Bool_t PrepareData(); virtual Bool_t PrepareData();
private: private:
Double_t fFitStartTime; Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; Double_t fFitStopTime; ///< fit end time
UInt_t fNoOfFitBins; UInt_t fNoOfFitBins; ///< number of bins to be fitted
}; };
#endif // _PRUNMUMINUS_H_ #endif // _PRUNMUMINUS_H_

View File

@ -35,6 +35,9 @@
#include "PMusr.h" #include "PMusr.h"
#include "PRunBase.h" #include "PRunBase.h"
/**
* <p>Class handling the non-muSR fit type
*/
class PRunNonMusr : public PRunBase class PRunNonMusr : public PRunBase
{ {
public: public:
@ -46,7 +49,7 @@ class PRunNonMusr : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par); virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory(); virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } ///< returns the number of fitted bins
virtual UInt_t GetXIndex(); virtual UInt_t GetXIndex();
virtual UInt_t GetYIndex(); virtual UInt_t GetYIndex();
@ -57,11 +60,11 @@ class PRunNonMusr : public PRunBase
virtual Bool_t PrepareViewData(); virtual Bool_t PrepareViewData();
private: private:
PRawRunData *fRawRunData; PRawRunData *fRawRunData; ///< raw run data handler
Double_t fFitStartTime; Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; Double_t fFitStopTime; ///< fit stop time
UInt_t fNoOfFitBins; UInt_t fNoOfFitBins; ///< number of bins to be be fitted
}; };
#endif // _PRUNNONMUSR_H_ #endif // _PRUNNONMUSR_H_

View File

@ -34,6 +34,9 @@
#include "PRunBase.h" #include "PRunBase.h"
/**
* <p>Class handling single histogram fit type.
*/
class PRunSingleHisto : public PRunBase class PRunSingleHisto : public PRunBase
{ {
public: public:
@ -45,7 +48,7 @@ class PRunSingleHisto : public PRunBase
virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par); virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
virtual void CalcTheory(); virtual void CalcTheory();
virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } virtual UInt_t GetNoOfFitBins() { return fNoOfFitBins; } ///< returns the number of bins fitted
protected: protected:
virtual Bool_t PrepareData(); virtual Bool_t PrepareData();
@ -54,10 +57,10 @@ class PRunSingleHisto : public PRunBase
virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo); virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo);
private: private:
Double_t fFitStartTime; Double_t fFitStartTime; ///< fit start time
Double_t fFitStopTime; Double_t fFitStopTime; ///< fit stop time
UInt_t fNoOfFitBins; UInt_t fNoOfFitBins; ///< number of bins to be fitted
Double_t fBackground; ///< needed if background range is given. In units per bin Double_t fBackground; ///< needed if background range is given (units: 1/bin)
Bool_t EstimateBkg(UInt_t histoNo); Bool_t EstimateBkg(UInt_t histoNo);
}; };

View File

@ -39,6 +39,14 @@
#include "PMusr.h" #include "PMusr.h"
/**
* <p>Handles the XML musrfit startup file (musrfit_startup.xml) in which default settings
* are stored:
* - list of search paths for the data files
* - Fourier transform default settings
* - marker list for plotting
* - color list for plotting
*/
class PStartupHandler : public TObject, public TQObject class PStartupHandler : public TObject, public TQObject
{ {
public: public:
@ -56,29 +64,29 @@ class PStartupHandler : public TObject, public TQObject
virtual void OnFatalError(const Char_t*); // SLOT virtual void OnFatalError(const Char_t*); // SLOT
virtual void OnCdataBlock(const Char_t*, Int_t); // SLOT virtual void OnCdataBlock(const Char_t*, Int_t); // SLOT
virtual Bool_t StartupFileFound() { return fStartupFileFound; } virtual Bool_t StartupFileFound() { return fStartupFileFound; } ///< true = musrfit_startup.xml found
virtual TString GetStartupFilePath() { return fStartupFilePath; } virtual TString GetStartupFilePath() { return fStartupFilePath; } ///< returns FULLPATH/musrfit_startup.xml, where FULLPATH=path were the musrfit_startup.xml is found
virtual void CheckLists(); virtual void CheckLists();
virtual PMsrFourierStructure GetFourierDefaults() { return fFourierDefaults; } virtual PMsrFourierStructure GetFourierDefaults() { return fFourierDefaults; } ///< returns the Fourier defaults
virtual const PStringVector GetDataPathList() const { return fDataPathList; } virtual const PStringVector GetDataPathList() const { return fDataPathList; } ///< returns the search data path list
virtual const PIntVector GetMarkerList() const { return fMarkerList; } virtual const PIntVector GetMarkerList() const { return fMarkerList; } ///< returns the marker list
virtual const PIntVector GetColorList() const { return fColorList; } virtual const PIntVector GetColorList() const { return fColorList; } ///< returns the color list
private: private:
enum EKeyWords {eEmpty, eComment, eDataPath, enum EKeyWords {eEmpty, eComment, eDataPath,
eFourierSettings, eUnits, eFourierPower, eApodization, ePlot, ePhase, ePhaseIncrement, eFourierSettings, eUnits, eFourierPower, eApodization, ePlot, ePhase, ePhaseIncrement,
eRootSettings, eMarkerList, eMarker, eRootSettings, eMarkerList, eMarker,
eColorList, eColor}; eColorList, eColor};
EKeyWords fKey; EKeyWords fKey; ///< xml filter key
Bool_t fStartupFileFound; Bool_t fStartupFileFound; ///< startup file found flag
TString fStartupFilePath; TString fStartupFilePath; ///< full musrfit_startup.xml startup file paths
PMsrFourierStructure fFourierDefaults; PMsrFourierStructure fFourierDefaults; ///< Fourier defaults
PStringVector fDataPathList; PStringVector fDataPathList; ///< search data path list
PIntVector fMarkerList; PIntVector fMarkerList; ///< marker list
PIntVector fColorList; PIntVector fColorList; ///< color list
Bool_t StartupFileExists(Char_t *fln); Bool_t StartupFileExists(Char_t *fln);

View File

@ -117,7 +117,7 @@ typedef struct theo_data_base {
} PTheoDataBase; } PTheoDataBase;
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
/*! /**
* <p> Holds the functions available for the user. * <p> Holds the functions available for the user.
*/ */
static PTheoDataBase fgTheoDataBase[THEORY_MAX] = { static PTheoDataBase fgTheoDataBase[THEORY_MAX] = {
@ -187,7 +187,7 @@ static PTheoDataBase fgTheoDataBase[THEORY_MAX] = {
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
/** /**
* <p> * <p>Class handling a theory of a msr-file.
*/ */
class PTheory class PTheory
{ {
@ -234,23 +234,23 @@ class PTheory
virtual Double_t GetDynKTLFValue(const Double_t t) const; virtual Double_t GetDynKTLFValue(const Double_t t) const;
// variables // variables
Bool_t fValid; Bool_t fValid; ///< flag to tell if the theory is valid
UInt_t fType; UInt_t fType; ///< function tag
vector<UInt_t> fParamNo; ///< holds the parameter numbers for the theory (including maps and functions, see constructor desciption) vector<UInt_t> fParamNo; ///< holds the parameter numbers for the theory (including maps and functions, see constructor desciption)
UInt_t fNoOfParam; UInt_t fNoOfParam; ///< number of parameters for the given function
PTheory *fAdd, *fMul; PTheory *fAdd, *fMul; ///< pointers to the add-sub-function or the multiply-sub-function
TString fUserFcnClassName; ///< name of the user function class for within root TString fUserFcnClassName; ///< name of the user function class for within root
TString fUserFcnSharedLibName; ///< name of the shared lib to which the user function belongs TString fUserFcnSharedLibName; ///< name of the shared lib to which the user function belongs
PUserFcnBase *fUserFcn; ///< pointer to the user function object PUserFcnBase *fUserFcn; ///< pointer to the user function object
mutable PDoubleVector fUserParam; ///< vector holding the resolved user function parameters, i.e. map and function resolved. mutable PDoubleVector fUserParam; ///< vector holding the resolved user function parameters, i.e. map and function resolved.
PMsrHandler *fMsrInfo; PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
mutable Double_t fPrevParam[THEORY_MAX_PARAM]; ///< needed for LF-stuff mutable Double_t fPrevParam[THEORY_MAX_PARAM]; ///< needed for LF. Keeps the previous fitting parameters
mutable PDoubleVector fLFIntegral; ///< needed for LF-stuff. Keeps the non-analytic integral values mutable PDoubleVector fLFIntegral; ///< needed for LF. Keeps the non-analytic integral values
mutable Double_t fDynLFdt; mutable Double_t fDynLFdt; ///< needed for LF. Keeps the time step for the dynamic LF calculation, used in the integral equation approach
mutable PDoubleVector fDynLFFuncValue; ///< needed for LF-stuff. Keeps the dynamic LF KT function values mutable PDoubleVector fDynLFFuncValue; ///< needed for LF. Keeps the dynamic LF KT function values
}; };
#endif // _PTHEORY_H_ #endif // _PTHEORY_H_