more docu, and a bug fix in the Abragam function
This commit is contained in:
@ -1207,6 +1207,7 @@ Double_t PMsrRunBlock::GetFitRange(UInt_t 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
|
||||
*/
|
||||
void PMsrRunBlock::SetFitRange(Double_t dval, UInt_t idx)
|
||||
|
@ -197,7 +197,7 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
/**
|
||||
* <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)
|
||||
{
|
||||
@ -268,7 +268,7 @@ void PRunAsymmetry::CalcTheory()
|
||||
/**
|
||||
* <p>Prepare data for fitting or viewing. What is already processed at this stage:
|
||||
* - get all needed forward/backward histograms
|
||||
* - get timeresolution
|
||||
* - get time resolution
|
||||
* - 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.)
|
||||
* - 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$.
|
||||
*
|
||||
* \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])
|
||||
{
|
||||
|
@ -1949,7 +1949,7 @@ Bool_t PRunDataHandler::ReadAsciiFile()
|
||||
*
|
||||
* <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.
|
||||
*
|
||||
* <b>return:</b>
|
||||
|
@ -37,8 +37,7 @@
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Constructor
|
||||
*/
|
||||
PRunMuMinus::PRunMuMinus() : PRunBase()
|
||||
{
|
||||
@ -53,10 +52,12 @@ PRunMuMinus::PRunMuMinus() : PRunBase()
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Constructor
|
||||
*
|
||||
* \param msrInfo pointer to the msr info structure
|
||||
* \param runNo number of the run of the msr-file
|
||||
* \param msrInfo pointer to the msr-file handler
|
||||
* \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)
|
||||
{
|
||||
@ -72,8 +73,7 @@ PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Destructor
|
||||
*/
|
||||
PRunMuMinus::~PRunMuMinus()
|
||||
{
|
||||
@ -83,9 +83,12 @@ PRunMuMinus::~PRunMuMinus()
|
||||
// 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)
|
||||
{
|
||||
@ -99,9 +102,12 @@ Double_t PRunMuMinus::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
// 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)
|
||||
{
|
||||
@ -114,8 +120,7 @@ Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
// CalcTheory
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Calculate theory for a given set of fit-parameters. <b>(Not yet implemented)</b>
|
||||
*/
|
||||
void PRunMuMinus::CalcTheory()
|
||||
{
|
||||
@ -125,8 +130,11 @@ void PRunMuMinus::CalcTheory()
|
||||
// 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()
|
||||
{
|
||||
|
@ -37,8 +37,7 @@
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Constructor.
|
||||
*/
|
||||
PRunNonMusr::PRunNonMusr() : PRunBase()
|
||||
{
|
||||
@ -55,10 +54,12 @@ PRunNonMusr::PRunNonMusr() : PRunBase()
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Constructor
|
||||
*
|
||||
* \param msrInfo pointer to the msr info structure
|
||||
* \param runNo number of the run of the msr-file
|
||||
* \param msrInfo pointer to the msr-file handler
|
||||
* \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)
|
||||
{
|
||||
@ -79,8 +80,7 @@ PRunNonMusr::PRunNonMusr(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Destructor
|
||||
*/
|
||||
PRunNonMusr::~PRunNonMusr()
|
||||
{
|
||||
@ -90,9 +90,12 @@ PRunNonMusr::~PRunNonMusr()
|
||||
// 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)
|
||||
{
|
||||
@ -114,8 +117,6 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
}
|
||||
}
|
||||
|
||||
//cout << endl << ">> chisq=" << chisq;
|
||||
|
||||
return chisq;
|
||||
}
|
||||
|
||||
@ -123,9 +124,9 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
// 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)
|
||||
{
|
||||
@ -138,8 +139,7 @@ Double_t PRunNonMusr::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
// CalcTheory
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Calculate theory for a given set of fit-parameters.
|
||||
*/
|
||||
void PRunNonMusr::CalcTheory()
|
||||
{
|
||||
@ -149,15 +149,16 @@ void PRunNonMusr::CalcTheory()
|
||||
// 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 success = true;
|
||||
|
||||
//cout << endl << "in PRunNonMusr::PrepareData(): will feed fFitData";
|
||||
|
||||
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;
|
||||
}
|
||||
@ -176,8 +177,11 @@ Bool_t PRunNonMusr::PrepareData()
|
||||
// PrepareFitData
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Prepare data for fitting.
|
||||
*
|
||||
* <b>return:</b>
|
||||
* - true if everthing went smooth
|
||||
* - false, otherwise.
|
||||
*/
|
||||
Bool_t PRunNonMusr::PrepareFitData()
|
||||
{
|
||||
@ -190,21 +194,17 @@ Bool_t PRunNonMusr::PrepareFitData()
|
||||
// get x-, y-index
|
||||
UInt_t xIndex = GetXIndex();
|
||||
UInt_t yIndex = GetYIndex();
|
||||
// cout << endl << ">> xIndex=" << xIndex << ", yIndex=" << yIndex;
|
||||
|
||||
// pack the raw data
|
||||
Double_t value = 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++) {
|
||||
// cout << endl << ">> i=" << i << ", packing=" << fRunInfo->GetPacking();
|
||||
if (fRunInfo->GetPacking() == 1) {
|
||||
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i));
|
||||
fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i));
|
||||
fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i));
|
||||
} else { // packed data, i.e. fRunInfo->GetPacking() > 1
|
||||
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.AppendValue(value);
|
||||
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);
|
||||
}
|
||||
}
|
||||
// cout << endl << ">> fData.fValue.size()=" << fData.fValue.size();
|
||||
|
||||
// count the number of bins to be fitted
|
||||
fNoOfFitBins=0;
|
||||
@ -226,7 +225,6 @@ Bool_t PRunNonMusr::PrepareFitData()
|
||||
if ((x >= fFitStartTime) && (x <= fFitStopTime))
|
||||
fNoOfFitBins++;
|
||||
}
|
||||
// cout << endl << ">> fNoOfFitBins=" << fNoOfFitBins;
|
||||
|
||||
return success;
|
||||
}
|
||||
@ -235,34 +233,31 @@ Bool_t PRunNonMusr::PrepareFitData()
|
||||
// PrepareViewData
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Prepare data for viewing.
|
||||
*
|
||||
* <b>return:</b>
|
||||
* - true if everthing went smooth
|
||||
* - false, otherwise.
|
||||
*/
|
||||
Bool_t PRunNonMusr::PrepareViewData()
|
||||
{
|
||||
Bool_t success = true;
|
||||
|
||||
// cout << endl << ">> fRunInfo->fRunName = " << fRunInfo->fRunName[0].Data();
|
||||
|
||||
// get x-, y-index
|
||||
UInt_t xIndex = GetXIndex();
|
||||
UInt_t yIndex = GetYIndex();
|
||||
// cout << endl << "PRunNonMusr::PrepareViewData: xIndex=" << xIndex << ", yIndex=" << yIndex << endl;
|
||||
|
||||
// fill data histo
|
||||
// pack the raw data
|
||||
Double_t value = 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++) {
|
||||
// cout << endl << ">> i=" << i << ", packing=" << fRunInfo->GetPacking();
|
||||
if (fRunInfo->GetPacking() == 1) {
|
||||
fData.AppendXValue(fRawRunData->fDataNonMusr.GetData()->at(xIndex).at(i));
|
||||
fData.AppendValue(fRawRunData->fDataNonMusr.GetData()->at(yIndex).at(i));
|
||||
fData.AppendErrorValue(fRawRunData->fDataNonMusr.GetErrData()->at(yIndex).at(i));
|
||||
} else { // packed data, i.e. fRunInfo->GetPacking() > 1
|
||||
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.AppendValue(value);
|
||||
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);
|
||||
}
|
||||
}
|
||||
// cout << endl << ">> fData.fValue.size()=" << fData.fValue.size();
|
||||
|
||||
// count the number of bins to be fitted
|
||||
fNoOfFitBins = fData.GetValue()->size();
|
||||
// cout << endl << ">> fNoOfFitBins=" << fNoOfFitBins;
|
||||
|
||||
// fill theory histo
|
||||
// feed the parameter vector
|
||||
@ -291,7 +284,6 @@ Bool_t PRunNonMusr::PrepareViewData()
|
||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||
}
|
||||
|
||||
// cout << endl << ">> after parameter fill" << endl;
|
||||
// get plot range
|
||||
PMsrPlotList *plotList;
|
||||
PMsrPlotStructure plotBlock;
|
||||
@ -306,15 +298,9 @@ Bool_t PRunNonMusr::PrepareViewData()
|
||||
Double_t xMin = 0.0, xMax = 0.0;
|
||||
Double_t xAbsMin = 0.0, xAbsMax = 0.0;
|
||||
Bool_t first = true;
|
||||
// cout << endl << ">> plotList->size()=" << plotList->size();
|
||||
for (UInt_t i=0; i<plotList->size(); i++) {
|
||||
plotBlock = plotList->at(i);
|
||||
// cout << endl << ">> plotBlock.fRuns.size()=" << plotBlock.fRuns.size() << endl;
|
||||
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 (first) {
|
||||
first = false;
|
||||
@ -322,7 +308,6 @@ Bool_t PRunNonMusr::PrepareViewData()
|
||||
xMax = plotBlock.fTmax[0];
|
||||
xAbsMin = xMin;
|
||||
xAbsMax = xMax;
|
||||
// cout << endl << ">> first: xMin=" << xMin << ", xMax=" << xMax << endl;
|
||||
} else {
|
||||
if (fabs(xMax-xMin) > fabs(plotBlock.fTmax[0]-plotBlock.fTmin[0])) {
|
||||
xMin = plotBlock.fTmin[0];
|
||||
@ -332,13 +317,10 @@ Bool_t PRunNonMusr::PrepareViewData()
|
||||
xAbsMin = xMin;
|
||||
if (xMax > xAbsMax)
|
||||
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
|
||||
Double_t xStep;
|
||||
@ -367,31 +349,26 @@ Bool_t PRunNonMusr::PrepareViewData()
|
||||
// GetXIndex
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Returns the x-axis data index.
|
||||
*
|
||||
* <b>return:</b>
|
||||
* - x-index
|
||||
*/
|
||||
UInt_t PRunNonMusr::GetXIndex()
|
||||
{
|
||||
UInt_t index = 0;
|
||||
Bool_t found = false;
|
||||
|
||||
//cout << endl << ">> PRunNonMusr::GetXIndex: fRawRunData->fDataNonMusr.fFromAscii = " << fRawRunData->fDataNonMusr.fFromAscii;
|
||||
if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format
|
||||
//cout << endl << ">> PRunNonMusr::GetXIndex: ascii-file format";
|
||||
index = 0;
|
||||
found = true;
|
||||
} else { // db-file format
|
||||
//cout << endl << ">> PRunNonMusr::GetXIndex: db-file format";
|
||||
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 ...
|
||||
found = true;
|
||||
} 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++) {
|
||||
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;
|
||||
found = true;
|
||||
break;
|
||||
@ -413,15 +390,16 @@ UInt_t PRunNonMusr::GetXIndex()
|
||||
// GetYIndex
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Returns the y-axis data index.
|
||||
*
|
||||
* <b>return:</b>
|
||||
* - y-index
|
||||
*/
|
||||
UInt_t PRunNonMusr::GetYIndex()
|
||||
{
|
||||
UInt_t index = 0;
|
||||
Bool_t found = false;
|
||||
|
||||
// cout << endl << ">> PRunNonMusr::GetYIndex:";
|
||||
if (fRawRunData->fDataNonMusr.FromAscii()) { // ascii-file format
|
||||
index = 1;
|
||||
found = true;
|
||||
@ -432,8 +410,6 @@ UInt_t PRunNonMusr::GetYIndex()
|
||||
} else { // xy-data data tags which needs to be converted to an index
|
||||
for (UInt_t i=0; i<fRawRunData->fDataNonMusr.GetDataTags()->size(); i++) {
|
||||
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;
|
||||
found = true;
|
||||
break;
|
||||
|
@ -39,8 +39,7 @@
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Constructor
|
||||
*/
|
||||
PRunSingleHisto::PRunSingleHisto() : PRunBase()
|
||||
{
|
||||
@ -53,10 +52,12 @@ PRunSingleHisto::PRunSingleHisto() : PRunBase()
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Constructor
|
||||
*
|
||||
* \param msrInfo pointer to the msr info structure
|
||||
* \param runNo number of the run of the msr-file
|
||||
* \param msrInfo pointer to the msr-file handler
|
||||
* \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)
|
||||
{
|
||||
@ -72,8 +73,7 @@ PRunSingleHisto::PRunSingleHisto(PMsrHandler *msrInfo, PRunDataHandler *rawData,
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Destructor
|
||||
*/
|
||||
PRunSingleHisto::~PRunSingleHisto()
|
||||
{
|
||||
@ -83,15 +83,12 @@ PRunSingleHisto::~PRunSingleHisto()
|
||||
// CalcChiSquare
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Calculate chi-square.
|
||||
*
|
||||
* The return value is chisq * fRunInfo->GetPacking(), the reason is:
|
||||
* the data d_i and the theory t_i are scaled by the packing, i.e. d_i -> d_i / packing.
|
||||
* 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.
|
||||
* <b>return:</b>
|
||||
* - chisq value
|
||||
*
|
||||
* \param par parameter vector iterated by minuit
|
||||
* \param par parameter vector iterated by minuit2
|
||||
*/
|
||||
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
|
||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||
Int_t funcNo = fMsrInfo->GetFuncNo(i);
|
||||
//cout << ">> i = " << i << ", funcNo = " << funcNo << endl;
|
||||
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par);
|
||||
}
|
||||
|
||||
@ -154,13 +150,16 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
// 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 mllh = 0.0; // maximum log likelihood assuming poisson distribution for the single bin
|
||||
Double_t mllh = 0.0; // maximum log likelihood assuming poisson distribution for the single bin
|
||||
|
||||
Double_t N0;
|
||||
|
||||
@ -225,8 +224,7 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
// CalcTheory
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* <p>Calculate theory for a given set of fit-parameters.
|
||||
*/
|
||||
void PRunSingleHisto::CalcTheory()
|
||||
{
|
||||
@ -290,12 +288,20 @@ void PRunSingleHisto::CalcTheory()
|
||||
// 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()
|
||||
{
|
||||
// cout << endl << "in PRunSingleHisto::PrepareData(): will feed fData";
|
||||
Bool_t success = true;
|
||||
|
||||
// get the proper run
|
||||
@ -489,15 +495,25 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
// 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)
|
||||
{
|
||||
// keep start/stop time for fit
|
||||
fFitStartTime = fRunInfo->GetFitRange(0);
|
||||
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):
|
||||
// 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
|
||||
fNoOfFitBins=0;
|
||||
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++) {
|
||||
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
|
||||
if ((time >= fFitStartTime) && (time <= fFitStopTime))
|
||||
@ -618,8 +633,20 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN
|
||||
// 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)
|
||||
{
|
||||
@ -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.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;
|
||||
for (Int_t i=start; i<end; i++) {
|
||||
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;
|
||||
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;
|
||||
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
|
||||
fData.SetTheoryTimeStep(fTimeResolution*factor);
|
||||
@ -790,6 +810,14 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
|
||||
// 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
|
||||
* \f[ N(t) = N_0 e^{-t/\tau} [ 1 + A(t) ] + \mathrm{Bkg} \f]
|
||||
* 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.
|
||||
* \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.
|
||||
*
|
||||
* <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)
|
||||
{
|
||||
@ -877,7 +912,6 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
|
||||
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||
else
|
||||
tau = PMUON_LIFETIME;
|
||||
//cout << endl << ">> tau = " << tau;
|
||||
|
||||
// get background
|
||||
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.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 gammaRRF = 0.0, wRRF = 0.0, phaseRRF = 0.0;
|
||||
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;
|
||||
expval = TMath::Exp(+time/tau)/N0;
|
||||
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));
|
||||
//cout << endl << ">> " << time << ", " << expval << ", " << -1.0+expval*(value-bkg) << ", " << expval*TMath::Sqrt(value/packing);
|
||||
value = 0.0;
|
||||
}
|
||||
value += runData->GetDataBin(histoNo)->at(i);
|
||||
@ -1062,7 +1088,13 @@ cout << endl << "--------------------------------" << endl;
|
||||
// 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)
|
||||
{
|
||||
@ -1123,7 +1155,6 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
|
||||
Double_t bkg = 0.0;
|
||||
|
||||
// forward
|
||||
//cout << endl << ">> bkg start=" << start << ", end=" << end;
|
||||
for (UInt_t i=start; i<end; i++)
|
||||
bkg += runData->GetDataBin(histoNo)->at(i);
|
||||
bkg /= static_cast<Double_t>(end - start + 1);
|
||||
|
@ -46,7 +46,7 @@ ClassImpQ(PStartupHandler)
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Constructor. Check if the musrfit_startup.xml file is found in some standard search paths
|
||||
*/
|
||||
PStartupHandler::PStartupHandler()
|
||||
{
|
||||
@ -86,7 +86,7 @@ PStartupHandler::PStartupHandler()
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Destructor
|
||||
*/
|
||||
PStartupHandler::~PStartupHandler()
|
||||
{
|
||||
@ -100,7 +100,7 @@ PStartupHandler::~PStartupHandler()
|
||||
// OnStartDocument
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Called on start of the XML file reading. Initializes all necessary variables.
|
||||
*/
|
||||
void PStartupHandler::OnStartDocument()
|
||||
{
|
||||
@ -124,7 +124,7 @@ void PStartupHandler::OnStartDocument()
|
||||
// OnEndDocument
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Called on end of XML file reading.
|
||||
*/
|
||||
void PStartupHandler::OnEndDocument()
|
||||
{
|
||||
@ -136,10 +136,11 @@ void PStartupHandler::OnEndDocument()
|
||||
// OnStartElement
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Called when a XML start element is found. Filters out the needed elements
|
||||
* and sets a proper key.
|
||||
*
|
||||
* \param str
|
||||
* \param attributes
|
||||
* \param str XML element name
|
||||
* \param attributes not used
|
||||
*/
|
||||
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
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <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)
|
||||
{
|
||||
@ -181,9 +182,10 @@ void PStartupHandler::OnEndElement(const Char_t *str)
|
||||
// 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)
|
||||
{
|
||||
@ -352,9 +354,9 @@ void PStartupHandler::OnCharacters(const Char_t *str)
|
||||
// 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)
|
||||
{
|
||||
@ -365,9 +367,9 @@ void PStartupHandler::OnComment(const Char_t *str)
|
||||
// OnWarning
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Called when the XML parser emits a warning.
|
||||
*
|
||||
* \param str
|
||||
* \param str warning string
|
||||
*/
|
||||
void PStartupHandler::OnWarning(const Char_t *str)
|
||||
{
|
||||
@ -379,9 +381,9 @@ void PStartupHandler::OnWarning(const Char_t *str)
|
||||
// OnError
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Called when the XML parser emits an error.
|
||||
*
|
||||
* \param str
|
||||
* \param str error string
|
||||
*/
|
||||
void PStartupHandler::OnError(const Char_t *str)
|
||||
{
|
||||
@ -393,9 +395,9 @@ void PStartupHandler::OnError(const Char_t *str)
|
||||
// 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)
|
||||
{
|
||||
@ -407,9 +409,9 @@ void PStartupHandler::OnFatalError(const Char_t *str)
|
||||
// OnCdataBlock
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Not used.
|
||||
*
|
||||
* \param str
|
||||
* \param str not used
|
||||
*/
|
||||
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
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Check if the default lists are present and if not, feed them with some default settings
|
||||
*
|
||||
*/
|
||||
void PStartupHandler::CheckLists()
|
||||
@ -428,17 +430,20 @@ void PStartupHandler::CheckLists()
|
||||
// check if anything was set, and if not set some default stuff
|
||||
|
||||
// check if any data path is given
|
||||
//cout << endl << ">> check data path list ...";
|
||||
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/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
|
||||
//cout << endl << ">> check marker list ...";
|
||||
if (fMarkerList.size() == 0) {
|
||||
//cout << endl << ">> marker list empty, will set default ones";
|
||||
fMarkerList.push_back(24); // open circle
|
||||
fMarkerList.push_back(25); // open square
|
||||
fMarkerList.push_back(26); // open triangle
|
||||
@ -456,9 +461,7 @@ void PStartupHandler::CheckLists()
|
||||
}
|
||||
|
||||
// check if any colors are given
|
||||
//cout << endl << ">> check color list ...";
|
||||
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(255, 0, 0)); // kRed
|
||||
fColorList.push_back(TColor::GetColor(0, 255, 0)); // kGreen
|
||||
@ -476,8 +479,13 @@ void PStartupHandler::CheckLists()
|
||||
// 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)
|
||||
{
|
||||
|
@ -52,38 +52,43 @@ using namespace std;
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> Constructor.
|
||||
*
|
||||
* <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.
|
||||
* Example:
|
||||
* Theory block:
|
||||
* a 1
|
||||
* tf 2 3
|
||||
* se 4
|
||||
* +
|
||||
* a 5
|
||||
* tf 6 7
|
||||
* se 8
|
||||
* +
|
||||
* a 9
|
||||
* tf 10 11
|
||||
* \verbatim
|
||||
Theory block:
|
||||
a 1
|
||||
tf 2 3
|
||||
se 4
|
||||
+
|
||||
a 5
|
||||
tf 6 7
|
||||
se 8
|
||||
+
|
||||
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
|
||||
* +/ \*
|
||||
* a 5 tf 2 3
|
||||
* + / \* \ *
|
||||
* a 9 a 5 se 4
|
||||
* \* \*
|
||||
* 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
|
||||
* \param msrInfo msr-file handler
|
||||
* \param runNo msr-file run number
|
||||
* \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
|
||||
* true means this is part of an already existing object tree
|
||||
*/
|
||||
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 ((fType == THEORY_USER_FCN) && ((i == 1) || (i == 2))) {
|
||||
//cout << endl << ">> userFcn: i=" << i << ", str=" << str.Data() << endl;
|
||||
if (i == 1) {
|
||||
fUserFcnSharedLibName = str;
|
||||
}
|
||||
@ -275,7 +279,6 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
|
||||
// invoke user function object
|
||||
fUserFcn = 0;
|
||||
fUserFcn = (PUserFcnBase*)TClass::GetClass(fUserFcnClassName.Data())->New();
|
||||
//cout << endl << ">> fUserFcn = " << fUserFcn << endl;
|
||||
if (fUserFcn == 0) {
|
||||
cerr << endl << "**ERROR**: PTheory: user function object could not be invoked. See line no " << line->fLineNo;
|
||||
cerr << endl;
|
||||
@ -296,12 +299,10 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Destructor
|
||||
*/
|
||||
PTheory::~PTheory()
|
||||
{
|
||||
//cout << endl << "PTheory::~PTheory() ..." << endl;
|
||||
|
||||
fParamNo.clear();
|
||||
fUserParam.clear();
|
||||
|
||||
@ -321,8 +322,11 @@ PTheory::~PTheory()
|
||||
// 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()
|
||||
{
|
||||
@ -346,10 +350,14 @@ Bool_t PTheory::IsValid()
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
* <p>Evaluates the theory tree.
|
||||
*
|
||||
* \param t
|
||||
* \param paramValues
|
||||
* <b>return:</b>
|
||||
* - 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
|
||||
{
|
||||
@ -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 destructor gets called recursively!
|
||||
*
|
||||
* \param theo
|
||||
* \param theo pointer to the theory object
|
||||
*/
|
||||
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)
|
||||
{
|
||||
@ -722,9 +734,10 @@ Int_t PTheory::SearchDataBase(TString name)
|
||||
// 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)
|
||||
{
|
||||
@ -812,9 +825,10 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
|
||||
// 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)
|
||||
{
|
||||
@ -824,8 +838,6 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
|
||||
TObjString *ostr;
|
||||
Char_t substr[256];
|
||||
|
||||
//cout << endl << ">> MakeCleanAndTidyPolynom: " << (*fullTheoryBlock)[i].fLine.Data();
|
||||
|
||||
// init tidy
|
||||
tidy = TString("polynom ");
|
||||
// get the line to be prettyfied
|
||||
@ -870,9 +882,10 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
|
||||
// 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)
|
||||
{
|
||||
@ -881,8 +894,6 @@ void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
|
||||
TObjArray *tokens = 0;
|
||||
TObjString *ostr;
|
||||
|
||||
//cout << endl << ">> MakeCleanAndTidyUserFcn: " << (*fullTheoryBlock)[i].fLine.Data();
|
||||
|
||||
// init tidy
|
||||
tidy = TString("userFcn ");
|
||||
// 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]
|
||||
*
|
||||
* \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
|
||||
{
|
||||
@ -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-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
|
||||
* PTheory::PTheory.
|
||||
* <b>meaning of paramValues:</b> \f$\lambda\f$ [, \f$t_{\rm shift}\f$]
|
||||
*
|
||||
* \param t time in \f$(\mu\mathrm{s})\f$
|
||||
* \param paramValues parameter values: depolarization rate \f$\lambda\f$
|
||||
* in \f$(1/\mu\mathrm{s})\f$, optionally \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::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$
|
||||
* \param paramValues
|
||||
* <b>meaning of paramValues:</b> \f$\lambda\f$, \f$\beta\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::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$
|
||||
* \param paramValues
|
||||
* <b>meaning of paramValues:</b> \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::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$
|
||||
* \param paramValues
|
||||
* <b>meaning of paramValues:</b> \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::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$
|
||||
* \param paramValues
|
||||
* \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] +
|
||||
\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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty}
|
||||
* \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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = 1/3 + 2/3 [1 - \lambda t] \exp(-\lambda t) \f]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = 1-\frac{a}{2\pi\nu}j_1(2\pi\nu t)\exp\left(-at\right)-
|
||||
* \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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty}
|
||||
* \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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = 1/3 + 2/3 \left(1-(\sigma t)^2-\lambda t\right) \exp\left(-1/2(\sigma t)^2-\lambda t\right)\f]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \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]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \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]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = \exp\left[-\frac{\sigma^2}{\gamma^2}\left(e^{-\gamma t}-1+\gamma t\right)\right] \f]
|
||||
* 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
|
||||
{
|
||||
@ -1581,15 +1704,23 @@ Double_t PTheory::Abragam(register Double_t t, const PDoubleVector& paramValues,
|
||||
Double_t gamma_t = tt*val[1];
|
||||
|
||||
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$
|
||||
* \param paramValues
|
||||
* \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]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = \cos(2\pi\nu t + \varphi) \f]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f[ = j_0(2\pi\nu t + \varphi) \f]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \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]
|
||||
* 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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues
|
||||
* \f{eqnarray*}{ &=& \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+\\
|
||||
* & & \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
|
||||
{
|
||||
@ -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$
|
||||
* \param paramValues tshift, p0, p1, ..., pn
|
||||
* \f[ = \sum_{k=0}^n a_k (t-t_{\rm shift})^k \f]
|
||||
*
|
||||
* <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
|
||||
{
|
||||
@ -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$
|
||||
* \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::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
|
||||
for (UInt_t i=0; i<fUserParam.size(); i++) {
|
||||
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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <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.
|
||||
*/
|
||||
@ -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.
|
||||
*/
|
||||
@ -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)
|
||||
*/
|
||||
@ -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
|
||||
* t_sampling = T/16 (i.e. 16 points on 1 period)
|
||||
* 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)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user