more docu

This commit is contained in:
nemu 2010-06-01 07:08:04 +00:00
parent 912f1f48e8
commit 25693d6c44
8 changed files with 328 additions and 161 deletions

92
doc/musrfit.dox Normal file
View File

@ -0,0 +1,92 @@
/*********************************************************************************************
name: musrfit.dox
created by: Andreas Suter, 2010/05/31
content: Description of musrfit framework.
$Id$
**********************************************************************************************/
/**
\mainpage musrfit - a framework to analyse muSR data.
<p>This pages here are meant to explain the software structure of the musrfit framework.
<p>People merely intrested in the handling of the programs should check this link:
\htmlonly
<a href="https://intranet.psi.ch/MUSR/MusrFit">musrfit user manual</a>
\endhtmlonly
\latexonly
musrfit user manual: \texttt{https://intranet.psi.ch/MUSR/MusrFit}
\endlatexonly
<p>People which would like to know how to install the musrfit framework, please check this link:
\htmlonly
<a href="https://intranet.psi.ch/MUSR/MusrFitSetup">How to setup musrfit on different platforms</a>
\endhtmlonly
\latexonly
How to setup musrfit on different platforms: \texttt{https://intranet.psi.ch/MUSR/MusrFitSetup}
\endlatexonly
//****************************************************************************************************
\section overview Overview
<p>The purpose of the musrfit framework is to provide software to analyze muSR spectra, in a very flexible and sound way. The musrfit framework is free software, published under the General Public License Version 2 or later. It is currently running under Linux, Mac OS X, and (with some more work) under Windows. The musrfit framework heavily relies on the \htmlonly <a href="http://root.cern.ch">ROOT</a>\endhtmlonly \latexonly ROOT: \texttt{http://root.cern.ch}\endlatexonly framework from CERN
<p>The musrfit framework provies the following programs:
- \ref musrfit Carries out fits based on a msr-file.
- \ref musrview Is used show the data in a graphical representation.
- \ref musrt0 Is used to set graphically t0's, background and data ranges off raw histogram data.
- \ref musrparam Can be used to generate ascii output files with extracted fit-parameters (from msr-files) and independent additional variables like temperature, field, ... The ascii output files can than be used to plot parameters, e.g. by gnuplot.
- \ref msr2data A program (originally written by Bastian M. Wojek). Its purpose is to process/generate multiple musrfit msr-files with the same parameters and summarize the fitting results either in a TRIUMF DB or a column ASCII file.
- \ref msr2msr Old WKM like msr-files can be transformed into musrfit style msr-files with this little program.
- \ref musrgui An editor to handle msr-files, calling musrfit, etc. from within the editor, based on Qt3.x.
Only bug fixing will be done on this version, and if you have >= Qt4.6 available you should use musredit instead.
- \ref musredit An editor to handle msr-files, calling musrfit, etc. from within a simple text editor, based
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.
\section roadmap Roadmap
\section bugs How to report bugs
//****************************************************************************************************
\page musrfitPage
\section musrfit musrfit
//****************************************************************************************************
\page musrviewPage
\section musrview musrview
//****************************************************************************************************
\page musrt0Page
\section musrt0 musrt0
//****************************************************************************************************
\page musrparamPage
\section musrparam musrparam
//****************************************************************************************************
\page msr2dataPage
\section msr2data msr2data
//****************************************************************************************************
\page msr2msrPage
\section msr2msr msr2msr
//****************************************************************************************************
\page musrguiPage
\section musrgui musrgui
//****************************************************************************************************
\page musreditPage
\section musredit musredit
//****************************************************************************************************
\page MuSRFitPage
\section MuSRFit MuSRFit
*/

View File

@ -459,7 +459,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/include/PFitterFcn.h \
INPUT = musrfit.dox \
../src/include/PFitterFcn.h \
../src/include/PFitter.h \
../src/include/PFourier.h \
../src/include/PFunctionGrammar.h \
@ -796,7 +797,7 @@ TREEVIEW_WIDTH = 250
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be

View File

@ -47,8 +47,7 @@
// Constructor
//--------------------------------------------------------------------------
/**
* <p> needed otherwise vector's cannot be generated ;-)
*
* <p>Constructor. Needed otherwise vector's cannot be generated ;-)
*/
PRunBase::PRunBase()
{
@ -65,29 +64,26 @@ PRunBase::PRunBase()
// Constructor
//--------------------------------------------------------------------------
/**
* <p>
* <p>Constructor.
*
* \param msrInfo pointer to the msr info structure
* \param rawData
* \param runNo
* \param tag
* \param msrInfo pointer to the msr-file handler
* \param rawData pointer to the raw-data handler
* \param runNo msr-file run number
* \param tag tag telling if fit, view, or rrf representation is whished.
*/
PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag)
PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) :
fHandleTag(tag), fMsrInfo(msrInfo), fRawData(rawData)
{
fValid = true;
fHandleTag = tag;
fRunNo = static_cast<Int_t>(runNo);
if ((runNo < 0) || (runNo > msrInfo->GetMsrRunList()->size())) {
if ((runNo < 0) || (runNo > fMsrInfo->GetMsrRunList()->size())) {
fRunInfo = 0;
return;
}
// keep pointer to the msr-file handler
fMsrInfo = msrInfo;
// keep the run header info for this run
fRunInfo = &(*msrInfo->GetMsrRunList())[runNo];
fRunInfo = &(*fMsrInfo->GetMsrRunList())[runNo];
// check the parameter and map range of the functions
if (!fMsrInfo->CheckMapAndParamRange(fRunInfo->GetMap()->size(), fMsrInfo->GetNoOfParams())) {
@ -95,16 +91,13 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
exit(0);
}
// keep the raw data of the runs
fRawData = rawData;
// init private variables
fTimeResolution = -1.0;
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++)
fFuncValues.push_back(0.0);
// generate theory
fTheory = new PTheory(msrInfo, runNo);
fTheory = new PTheory(fMsrInfo, runNo);
if (fTheory == 0) {
cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: Couldn't create an instance of PTheory :-(, will quit" << endl;
exit(0);
@ -119,8 +112,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
// Destructor
//--------------------------------------------------------------------------
/**
* <p>
*
* <p>Destructor.
*/
PRunBase::~PRunBase()
{
@ -135,8 +127,7 @@ PRunBase::~PRunBase()
// CleanUp
//--------------------------------------------------------------------------
/**
* <p> Clean up all localy allocate memory
*
* <p> Clean up all locally allocate memory
*/
void PRunBase::CleanUp()
{
@ -150,14 +141,14 @@ void PRunBase::CleanUp()
// CalculateKaiserFilterCoeff (protected)
//--------------------------------------------------------------------------
/**
* <p> Calculates the Kaiser filter coefficients for a low pass filter with
* <p>Calculates the Kaiser filter coefficients for a low pass filter with
* a cut off frequency wc.
* For details see "Zeitdiskrete Signalverarbeitung", A.V. Oppenheim, R.W. Schafer, J.R. Buck. Pearson 2004.
*
* \param wc cut off frequency
* \param A defined as \f[ A = -\log_{10}(\delta) \f], where \f[\delta\f] is the tolerance band.
* \param dw defined as \f[ \Delta\omega = \omega_{\rm S} - \omega_{\rm P} \f], where \f[ \omega_{\rm S} \f] is the
* stop band frequency, and \f[ \omega_{\rm P} \f] is the pass band frequency.
* \param A defined as \f$ A = -\log_{10}(\delta) \f$, where \f$\delta\f$ is the tolerance band.
* \param dw defined as \f$ \Delta\omega = \omega_{\rm S} - \omega_{\rm P} \f$, where \f$ \omega_{\rm S} \f$ is the
* stop band frequency, and \f$ \omega_{\rm P} \f$ is the pass band frequency.
*/
void PRunBase::CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw)
{
@ -191,19 +182,13 @@ void PRunBase::CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw)
for (UInt_t i=0; i<=m; i++) {
fKaiserFilter[i] /= dsum;
}
/*
for (UInt_t i=0; i<=m; i++)
cout << endl << ">> " << i << ", fKaiserFilter[" << i << "]=" << fKaiserFilter[i];
cout << endl;
*/
}
//--------------------------------------------------------------------------
// FilterTheo (protected)
//--------------------------------------------------------------------------
/**
* <p> Filters the theory with a Kaiser FIR filter.
* <p>Filters the theory with a Kaiser FIR filter.
*/
void PRunBase::FilterTheo()
{

View File

@ -54,8 +54,9 @@ using namespace std;
// Constructor
//--------------------------------------------------------------------------
/**
* <p> Constructor, reading the data histogramm files.
* <p>Constructor, reading the data histogramm files.
*
* \param msrInfo pointer to the msr-file handler
*/
PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo) : fMsrInfo(msrInfo)
{
@ -72,6 +73,9 @@ PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo) : fMsrInfo(msrInfo)
/**
* <p> Constructor, reading the data histogramm files, and keeping a copy
* of potential search paths.
*
* \param msrInfo pointer to the msr-file handler
* \param dataPath vector containing search paths where to find raw data files.
*/
PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataPath) :
fMsrInfo(msrInfo), fDataPath(dataPath)
@ -88,7 +92,6 @@ PRunDataHandler::PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataP
//--------------------------------------------------------------------------
/**
* <p> Destructor.
*
*/
PRunDataHandler::~PRunDataHandler()
{
@ -99,10 +102,11 @@ PRunDataHandler::~PRunDataHandler()
// GetRunData
//--------------------------------------------------------------------------
/**
* <p> Checks if runName is found.
* <p>Checks if runName is found.
*
* <b>return:</b> if data are found: pointer to the data.
* otherwise the null pointer will be returned.
* <b>return:</b>
* - if data are found: pointer to the data.
* - otherwise the null pointer will be returned.
*
* \param runName run name, e.g. 2009/lem09_his_1234
*/
@ -128,7 +132,9 @@ PRawRunData* PRunDataHandler::GetRunData(const TString &runName)
* <p> The main read file routine which is filtering what read sub-routine
* needs to be called.
*
* <b>return:</b> true if reading was successful, false if reading failed.
* <b>return:</b>
* - true if reading was successful,
* - false if reading failed.
*/
Bool_t PRunDataHandler::ReadFile()
{
@ -188,7 +194,11 @@ Bool_t PRunDataHandler::ReadFile()
* <p> Checks if a file has been already read in order to prevent multiple
* reading of data files.
*
* <b>return:</b> true if the file has been read before, otherwise false.
* <b>return:</b>
* - true if the file has been read before,
* - otherwise false.
*
* \param runName run name to be check if the corresponding file is already read.
*/
Bool_t PRunDataHandler::FileAlreadyRead(TString runName)
{
@ -205,12 +215,14 @@ Bool_t PRunDataHandler::FileAlreadyRead(TString runName)
// FileExistsCheck
//--------------------------------------------------------------------------
/**
* <p> Checks if a given data file exists.
* <p>Checks if a given data file exists.
*
* <b>return:</b>
* - true if data file exists,
* - otherwise false.
*
* \param runInfo reference to the msr-run-structure
* \param idx index of the run (needed for ADDRUN feature).
*
* <b>return:</b> true if data file exists, otherwise false.
*/
Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
{
@ -408,10 +420,12 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
/**
* <p> Reads the LEM-data ROOT-files.
*
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*
* \param notPostPileup This flag is used as a switch between "Not Post Pileup Corrected"
* and "Post Pileup Corrected" histogramms.
*
* <b>return:</b> true at successful reading, otherwise false.
*/
Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup)
{
@ -634,12 +648,13 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup)
/**
* <p> Will read the NeXuS File Format as soon as PSI will have an implementation.
*
*
* <b>return:</b> true at successful reading, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadNexusFile()
{
cout << endl << "PRunDataHandler::ReadNexusFile(): Sorry, not yet implemented, ask Alex Amato ...";
cout << endl << "PRunDataHandler::ReadNexusFile(): Sorry, not yet implemented, ask Alex Amato and Stephen Cottrell ...";
return false;
}
@ -650,7 +665,9 @@ Bool_t PRunDataHandler::ReadNexusFile()
* <p> Reads, for backwards compatibility, the ascii-wkm-file data format.
* The routine is clever enough to distinguish the different wkm-flavours (argh).
*
* <b>return:</b> true at successful reading, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadWkmFile()
{
@ -924,7 +941,9 @@ Bool_t PRunDataHandler::ReadWkmFile()
* <p> Reads the old-fashioned PSI-BIN data-files. The MuSR_td_PSI_bin class
* of Alex Amato is used. In case of problems, please contact alex.amato@psi.ch.
*
* <b>return:</b> true at successful reading, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadPsiBinFile()
{
@ -1046,9 +1065,11 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
// ReadMudFile
//--------------------------------------------------------------------------
/**
* <p> Reads the triumf mud-file format. <b>Not yet implemented, sorry</b>.
* <p> Reads the triumf mud-file format.
*
* <b>return:</b> true at successful reading, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadMudFile()
{
@ -1282,23 +1303,6 @@ Bool_t PRunDataHandler::ReadMudFile()
MUD_closeRead(fh);
/*
cout << endl << "fRunName : " << runData.GetRunName()->Data();
cout << endl << "fRunTitle : " << runData.GetRunTitle()->Data();
cout << endl << "fSetup : " << runData.GetSetup()->Data();
cout << endl << "fField : " << runData.GetField();
cout << endl << "fTemp : " << runData.GetTemperature(1);
cout << endl << "noOfHistos : " << noOfHistos;
cout << endl << "fTimeResolution : " << runData.GetTimeResolution();
for (Int_t i=0; i<noOfHistos; i++) {
cout << endl << "------";
cout << endl << i << " : t0 = " << runData.GetT0(i);
cout << endl << i << " : bkg bins = " << runData.GetBkgBin(i).first << "..." << runData.GetBkgBin(i).second;
cout << endl << i << " : good bins = " << runData.GetGoodDataBin(i).first << "..." << runData.GetGoodDataBin(i).second;
}
cout << endl;
*/
// add run to the run list
fData.push_back(runData);
@ -1330,6 +1334,9 @@ cout << endl;
*
* \endverbatim
*
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadMduAsciiFile()
{
@ -1638,7 +1645,9 @@ Bool_t PRunDataHandler::ReadMduAsciiFile()
* where spaces, column, are a tab are possible separations.
* If no error in y is present, the weighting in the fit will be equal.
*
* <b>return:</b> true at successful reading, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadAsciiFile()
{
@ -1942,6 +1951,10 @@ Bool_t PRunDataHandler::ReadAsciiFile()
*
* <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>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::ReadDBFile()
{
@ -2288,7 +2301,9 @@ Bool_t PRunDataHandler::ReadDBFile()
*
* \param str string to be stripped. It will be modified directly on success.
*
* <b>return:</b> true at success, otherwise false.
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*/
Bool_t PRunDataHandler::StripWhitespace(TString &str)
{
@ -2353,12 +2368,14 @@ Bool_t PRunDataHandler::StripWhitespace(TString &str)
// IsWhitespace (private)
//--------------------------------------------------------------------------
/**
* <p> Check is a string consists only of white spaces, i.e. spaces and/or
* <p> Check if a string consists only of white spaces, i.e. spaces and/or
* ctrl-characters.
*
* \param str string to be checked
* <b>return:</b>
* - true at successful reading,
* - otherwise false.
*
* <b>return:</b> true if string consist only of white spaces, otherwise false.
* \param str string to be checked
*/
Bool_t PRunDataHandler::IsWhitespace(const Char_t *str)
{
@ -2382,10 +2399,12 @@ Bool_t PRunDataHandler::IsWhitespace(const Char_t *str)
/**
* <p> Convert a string to a Double_t.
*
* <b>return:</b>
* - returns the converted string
* - otherwise 0.0 with ok==false
*
* \param str string to be converted
* \param ok true on success, otherwise false.
*
* <b>return:</b> returns the converted string, or 0.0 in case of ok==false
*/
Double_t PRunDataHandler::ToDouble(TString &str, Bool_t &ok)
{
@ -2430,10 +2449,12 @@ Double_t PRunDataHandler::ToDouble(TString &str, Bool_t &ok)
/**
* <p> Convert a string to an Int_t.
*
* <b>return:</b>
* - returns the converted string
* - otherwise 0.0 with ok==false
*
* \param str string to be converted
* \param ok true on success, otherwise false.
*
* <b>return:</b> returns the converted string, or 0 in case of ok==false
*/
Int_t PRunDataHandler::ToInt(TString &str, Bool_t &ok)
{
@ -2476,12 +2497,14 @@ Int_t PRunDataHandler::ToInt(TString &str, Bool_t &ok)
// GetDataTagIndex (private)
//--------------------------------------------------------------------------
/**
* <p> Checks is str is in a list of data tags
* <p> Checks if str is in a list of data tags
*
* <b>return:</b>
* - if found returns the data tag index (from the dataTags vector),
* - otherwise -1
*
* \param str data tag string (see description of nonMusr db-data)
* \param dataTags vector of all data tags
*
* <b>return:</b> if found returns the data tag index (from the dataTags vector), otherwise -1
*/
Int_t PRunDataHandler::GetDataTagIndex(TString &str, const PStringVector* dataTags)
{

View File

@ -37,13 +37,12 @@
// Constructor
//--------------------------------------------------------------------------
/**
* <p>
* <p>Constructor.
*
* \param msrInfo pointer to the msr info structure
* \param data
* \param msrInfo pointer to the msr-file handler
* \param data pointer to the run-data handler
*/
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data) \
: fMsrInfo(msrInfo), fData(data)
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data) : fMsrInfo(msrInfo), fData(data)
{
}
@ -51,34 +50,28 @@ PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *da
// Destructor
//--------------------------------------------------------------------------
/**
* <p>
*
* <p>Destructor
*/
PRunListCollection::~PRunListCollection()
{
//cout << endl << "in ~PRunListCollection() ..." << endl;
//cout << endl << ">> fRunSingleHistoList.size() = " << fRunSingleHistoList.size();
for (UInt_t i=0; i<fRunSingleHistoList.size(); i++) {
fRunSingleHistoList[i]->CleanUp();
fRunSingleHistoList[i]->~PRunSingleHisto();
}
fRunSingleHistoList.clear();
//cout << endl << ">> fRunAsymmetryList.size() = " << fRunAsymmetryList.size();
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++) {
fRunAsymmetryList[i]->CleanUp();
fRunAsymmetryList[i]->~PRunAsymmetry();
}
fRunAsymmetryList.clear();
//cout << endl << ">> fRunMuMinusList.size() = " << fRunMuMinusList.size();
for (UInt_t i=0; i<fRunMuMinusList.size(); i++) {
fRunMuMinusList[i]->CleanUp();
fRunMuMinusList[i]->~PRunMuMinus();
}
fRunMuMinusList.clear();
//cout << endl << ">> fRunNonMusrList.size() = " << fRunNonMusrList.size();
for (UInt_t i=0; i<fRunNonMusrList.size(); i++) {
fRunNonMusrList[i]->CleanUp();
fRunNonMusrList[i]->~PRunNonMusr();
@ -90,21 +83,19 @@ PRunListCollection::~PRunListCollection()
// Add
//--------------------------------------------------------------------------
/**
* <p>
* <p>Adds a processed set of data to the handler.
*
* \param runNo
* \param tag
* <b>return:</b>
* - true if a processed data set could be added successfully
* - false otherwise
*
* \param runNo msr-file run number
* \param tag tag showing what shall be done: kFit == fitting, kView == viewing
*/
Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag)
{
Bool_t success = true;
// PMsrRunStructure *runList = &(*fMsrInfo->GetMsrRunList())[runNo];
// cout << endl << "PRunListCollection::Add(): will add run no " << runNo;
// cout << ", name = " << runList->fRunName.Data();
// cout << ", type = " << runList->fFitType;
Int_t fitType = (*fMsrInfo->GetMsrRunList())[runNo].GetFitType();
switch (fitType) {
@ -140,7 +131,12 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag)
// GetSingleHistoChisq
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates chi-square of <em>all</em> single histogram runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all single histogram runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetSingleHistoChisq(const std::vector<Double_t>& par) const
{
@ -156,7 +152,12 @@ Double_t PRunListCollection::GetSingleHistoChisq(const std::vector<Double_t>& pa
// GetAsymmetryChisq
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates chi-square of <em>all</em> asymmetry runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all asymmetry runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetAsymmetryChisq(const std::vector<Double_t>& par) const
{
@ -172,7 +173,12 @@ Double_t PRunListCollection::GetAsymmetryChisq(const std::vector<Double_t>& par)
// GetMuMinusChisq
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates chi-square of <em>all</em> mu minus runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all mu minus runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetMuMinusChisq(const std::vector<Double_t>& par) const
{
@ -188,7 +194,12 @@ Double_t PRunListCollection::GetMuMinusChisq(const std::vector<Double_t>& par) c
// GetNonMusrChisq
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates chi-square of <em>all</em> non-muSR runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all non-muSR runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetNonMusrChisq(const std::vector<Double_t>& par) const
{
@ -204,7 +215,12 @@ Double_t PRunListCollection::GetNonMusrChisq(const std::vector<Double_t>& par) c
// GetSingleHistoMaximumLikelihood
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates log max-likelihood of <em>all</em> single histogram runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all single histogram runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector<Double_t>& par) const
{
@ -222,6 +238,11 @@ Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector<D
/**
* <p> Since it is not clear yet how to handle asymmetry fits with max likelihood
* the chi square will be used!
*
* <b>return:</b>
* - chi-square of all asymmetry runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<Double_t>& par) const
{
@ -237,7 +258,12 @@ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<Dou
// GetMuMinusMaximumLikelihood
//--------------------------------------------------------------------------
/**
* <p>
* <p>Calculates log max-likelihood of <em>all</em> mu minus runs of a msr-file.
*
* <b>return:</b>
* - chi-square of all mu minus runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetMuMinusMaximumLikelihood(const std::vector<Double_t>& par) const
{
@ -255,6 +281,11 @@ Double_t PRunListCollection::GetMuMinusMaximumLikelihood(const std::vector<Doubl
/**
* <p> Since it is not clear yet how to handle non musr fits with max likelihood
* the chi square will be used!
*
* <b>return:</b>
* - chi-square of all asymmetry runs of the msr-file
*
* \param par fit parameter vector
*/
Double_t PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector<Double_t>& par) const
{
@ -270,7 +301,10 @@ Double_t PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector<Doubl
// GetTotalNoOfBinsFitted
//--------------------------------------------------------------------------
/**
* <p>
* <p>Counts the total number of bins to be fitted.
*
* <b>return:</b>
* - total number of bins fitted.
*/
UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const
{
@ -288,7 +322,6 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const
for (UInt_t i=0; i<fRunNonMusrList.size(); i++)
counts += fRunNonMusrList[i]->GetNoOfFitBins();
// cout << endl << "Total No of Bins Fitted = " << counts;
return counts;
}
@ -296,9 +329,13 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const
// GetSingleHisto
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get a processed single histogram data set.
*
* \param index
* <b>return:</b>
* - pointer to the run data set (processed data) if data set is found
* - null pointer otherwise
*
* \param index msr-file run index
* \param tag kIndex -> data at index, kRunNo -> data of given run no
*/
PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag)
@ -307,7 +344,7 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag)
switch (tag) {
case kIndex:
if ((index < 0) || (index > fRunSingleHistoList.size())) {
if ((index < 0) || (index >= fRunSingleHistoList.size())) {
cerr << endl << "PRunListCollection::GetSingleHisto: **ERROR** index = " << index << " out of bounds";
cerr << endl;
return 0;
@ -335,9 +372,13 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag)
// GetAsymmetry
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get a processed asymmetry data set.
*
* \param index
* <b>return:</b>
* - pointer to the run data set (processed data) if data set is found
* - null pointer otherwise
*
* \param index msr-file run index
* \param tag kIndex -> data at index, kRunNo -> data of given run no
*/
PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag)
@ -374,9 +415,13 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag)
// GetMuMinus
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get a processed mu minus data set.
*
* \param index
* <b>return:</b>
* - pointer to the run data set (processed data) if data set is found
* - null pointer otherwise
*
* \param index msr-file run index
* \param tag kIndex -> data at index, kRunNo -> data of given run no
*/
PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag)
@ -410,9 +455,13 @@ PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag)
// GetNonMusr
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get a processed non-muSR data set.
*
* \param index
* <b>return:</b>
* - pointer to the run data set (processed data) if data set is found
* - null pointer otherwise
*
* \param index msr-file run index
* \param tag kIndex -> data at index, kRunNo -> data of given run no
*/
PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag)
@ -446,9 +495,12 @@ PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag)
// GetTemp
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the temperature from the data set.
*
* \param runName
* <b>return:</b>
* - temperature pair (T, dT) vector from temperatures stored in the data file.
*
* \param runName name of the run from which to extract the temperature
*/
const PDoublePairVector* PRunListCollection::GetTemp(const TString &runName) const
{
@ -459,9 +511,12 @@ const PDoublePairVector* PRunListCollection::GetTemp(const TString &runName) con
// GetField
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the magnetic field from the data set.
*
* \param runName
* <b>return:</b>
* - magnetic field stored in the data file.
*
* \param runName name of the run from which to extract the magnetic field
*/
Double_t PRunListCollection::GetField(const TString &runName) const
{
@ -472,9 +527,12 @@ Double_t PRunListCollection::GetField(const TString &runName) const
// GetEnergy
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the muon implantation energy from the data set.
*
* \param runName
* <b>return:</b>
* - muon implantation energy stored in the data file.
*
* \param runName name of the run from which to extract the muon implantation energy
*/
Double_t PRunListCollection::GetEnergy(const TString &runName) const
{
@ -485,9 +543,12 @@ Double_t PRunListCollection::GetEnergy(const TString &runName) const
// GetSetup
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the setup information from the data set.
*
* \param runName
* <b>return:</b>
* - setup information stored in the data file.
*
* \param runName name of the run from which to extract the setup information
*/
const Char_t* PRunListCollection::GetSetup(const TString &runName) const
{
@ -498,17 +559,16 @@ const Char_t* PRunListCollection::GetSetup(const TString &runName) const
// GetXAxisTitle
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the x-axis title (used with non-muSR fit).
*
* <b>return:</b>
* - x-axis title
*
* \param runName name of the run file
* \param idx msr-file run index
*/
const Char_t* PRunListCollection::GetXAxisTitle(const TString &runName, const UInt_t idx) const
{
//cout << endl << ">> PRunListCollection::GetXAxisTitle: runName = " << runName.Data() << ", idx = " << idx;
//cout << endl << ">> PRunListCollection::GetXAxisTitle: fRunNonMusrList.size() = " << fRunNonMusrList.size();
//cout << endl;
PRawRunData *runData = fData->GetRunData(runName);
const Char_t *result = 0;
@ -532,16 +592,16 @@ const Char_t* PRunListCollection::GetXAxisTitle(const TString &runName, const UI
// GetYAxisTitle
//--------------------------------------------------------------------------
/**
* <p>
* <p>Get the y-axis title (used with non-muSR fit).
*
* <b>return:</b>
* - y-axis title
*
* \param runName name of the run file
* \param idx msr-file run index
*/
const Char_t* PRunListCollection::GetYAxisTitle(const TString &runName, const UInt_t idx) const
{
//cout << endl << ">> PRunListCollection::GetYAxisTitle: runName = " << runName.Data() << ", idx = " << idx;
//cout << endl;
PRawRunData *runData = fData->GetRunData(runName);
const Char_t *result = 0;

View File

@ -44,7 +44,7 @@ using namespace std;
//------------------------------------------------------------------------------------------
/**
* <p>
* <p>The run base class is enforcing a common interface to all supported fit-types.
*/
class PRunBase
{
@ -53,24 +53,24 @@ class PRunBase
PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag);
virtual ~PRunBase();
virtual Double_t CalcChiSquare(const vector<Double_t>& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
virtual Double_t CalcMaxLikelihood(const vector<Double_t>& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
virtual Double_t CalcChiSquare(const vector<Double_t>& par) = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual Double_t CalcMaxLikelihood(const vector<Double_t>& par) = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void CalcTheory() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void CalcTheory() = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual UInt_t GetRunNo() { return fRunNo; }
virtual PRunData* GetData() { return &fData; }
virtual UInt_t GetRunNo() { return fRunNo; } ///< returns the number of runs of the msr-file
virtual PRunData* GetData() { return &fData; } ///< returns the data to be fitted
virtual void CleanUp();
virtual Bool_t IsValid() { return fValid; }
virtual Bool_t IsValid() { return fValid; } ///< returns if the state is valid
protected:
Bool_t fValid;
Bool_t fValid; ///< flag showing if the state of the class is valid
EPMusrHandleTag fHandleTag; ///< tag telling whether this is used for fit, view, ...
Int_t fRunNo; ///< number of the run within the msr file
PMsrHandler *fMsrInfo; ///< msr-file handler
PMsrRunBlock *fRunInfo; ///< run info used to filter out needed infos for the run
PMsrRunBlock *fRunInfo; ///< run info used to filter out needed infos of a run
PRunDataHandler *fRawData; ///< holds the raw run data
PIntVector fParamNo; ///< vector of parameter numbers for the specifc run
@ -82,9 +82,9 @@ class PRunBase
PDoubleVector fFuncValues; ///< is keeping the values of the functions from the FUNCTIONS block
PTheory *fTheory; ///< theory needed to calculate chi-square
PDoubleVector fKaiserFilter;
PDoubleVector fKaiserFilter; ///< stores the Kaiser filter vector (needed for the RRF).
virtual Bool_t PrepareData() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
virtual Bool_t PrepareData() = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw);
virtual void FilterTheo();

View File

@ -40,6 +40,9 @@ using namespace std;
#include "PMusr.h"
#include "PMsrHandler.h"
/**
* <p>Handler class needed to read/handle raw data files.
*/
class PRunDataHandler
{
public:
@ -51,8 +54,8 @@ class PRunDataHandler
virtual PRawRunData* GetRunData(const TString &runName);
private:
PMsrHandler *fMsrInfo;
PStringVector fDataPath;
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
PStringVector fDataPath; ///< vector containing all the search paths where to look for data files
Bool_t fAllDataAvailable; ///< flag indicating if all data sets could be read
TString fRunName; ///< current run name

View File

@ -43,6 +43,9 @@ using namespace std;
#include "PRunMuMinus.h"
#include "PRunNonMusr.h"
/**
* <p>Handler class handling all processed data of an msr-file. All calls of minuit2 are going through this class.
*/
class PRunListCollection
{
public:
@ -65,10 +68,10 @@ class PRunListCollection
virtual UInt_t GetTotalNoOfBinsFitted() const;
virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); }
virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); }
virtual UInt_t GetNoOfMuMinus() const { return fRunMuMinusList.size(); }
virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); }
virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); } ///< returns the number of single histogram data sets present in the msr-file
virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); } ///< returns the number of asymmetry data sets present in the msr-file
virtual UInt_t GetNoOfMuMinus() const { return fRunMuMinusList.size(); } ///< returns the number of mu minus data sets present in the msr-file
virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); } ///< returns the number of non-muSR data sets present in the msr-file
virtual PRunData* GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex);
virtual PRunData* GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex);
@ -83,13 +86,13 @@ class PRunListCollection
virtual const Char_t* GetYAxisTitle(const TString &runName, const UInt_t idx) const;
private:
PMsrHandler *fMsrInfo; ///< keeps all msr file info
PRunDataHandler *fData; ///< handles all raw data
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
PRunDataHandler *fData; ///< pointer to the run-data handler
vector<PRunSingleHisto*> fRunSingleHistoList;
vector<PRunAsymmetry*> fRunAsymmetryList;
vector<PRunMuMinus*> fRunMuMinusList;
vector<PRunNonMusr*> fRunNonMusrList;
vector<PRunSingleHisto*> fRunSingleHistoList; ///< stores all precessed single histogram data
vector<PRunAsymmetry*> fRunAsymmetryList; ///< stores all precessed asymmetry data
vector<PRunMuMinus*> fRunMuMinusList; ///< stores all precessed mu-minus data
vector<PRunNonMusr*> fRunNonMusrList; ///< stores all precessed non-muSR data
};
#endif // _PRUNLISTCOLLECTION_H_