diff --git a/doc/musrfit.dox b/doc/musrfit.dox new file mode 100644 index 00000000..727fb3ec --- /dev/null +++ b/doc/musrfit.dox @@ -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. + +

This pages here are meant to explain the software structure of the musrfit framework. + +

People merely intrested in the handling of the programs should check this link: +\htmlonly +musrfit user manual +\endhtmlonly +\latexonly +musrfit user manual: \texttt{https://intranet.psi.ch/MUSR/MusrFit} +\endlatexonly + +

People which would like to know how to install the musrfit framework, please check this link: +\htmlonly +How to setup musrfit on different platforms +\endhtmlonly +\latexonly +How to setup musrfit on different platforms: \texttt{https://intranet.psi.ch/MUSR/MusrFitSetup} +\endlatexonly + +//**************************************************************************************************** +\section overview Overview + +

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 ROOT\endhtmlonly \latexonly ROOT: \texttt{http://root.cern.ch}\endlatexonly framework from CERN + +

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 +*/ diff --git a/doc/musrfit_dox.cfg b/doc/musrfit_dox.cfg index a44f06e9..190b86d1 100644 --- a/doc/musrfit_dox.cfg +++ b/doc/musrfit_dox.cfg @@ -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 diff --git a/src/classes/PRunBase.cpp b/src/classes/PRunBase.cpp index 37bb1db2..aa10a28a 100644 --- a/src/classes/PRunBase.cpp +++ b/src/classes/PRunBase.cpp @@ -47,8 +47,7 @@ // Constructor //-------------------------------------------------------------------------- /** - *

needed otherwise vector's cannot be generated ;-) - * + *

Constructor. Needed otherwise vector's cannot be generated ;-) */ PRunBase::PRunBase() { @@ -65,29 +64,26 @@ PRunBase::PRunBase() // Constructor //-------------------------------------------------------------------------- /** - *

+ *

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(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; iGetNoOfFuncs(); 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 //-------------------------------------------------------------------------- /** - *

- * + *

Destructor. */ PRunBase::~PRunBase() { @@ -135,8 +127,7 @@ PRunBase::~PRunBase() // CleanUp //-------------------------------------------------------------------------- /** - *

Clean up all localy allocate memory - * + *

Clean up all locally allocate memory */ void PRunBase::CleanUp() { @@ -150,14 +141,14 @@ void PRunBase::CleanUp() // CalculateKaiserFilterCoeff (protected) //-------------------------------------------------------------------------- /** - *

Calculates the Kaiser filter coefficients for a low pass filter with + *

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) //-------------------------------------------------------------------------- /** - *

Filters the theory with a Kaiser FIR filter. + *

Filters the theory with a Kaiser FIR filter. */ void PRunBase::FilterTheo() { diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index dd9176f9..354d52a1 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -54,8 +54,9 @@ using namespace std; // Constructor //-------------------------------------------------------------------------- /** - *

Constructor, reading the data histogramm files. + *

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) /** *

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 //-------------------------------------------------------------------------- /** *

Destructor. - * */ PRunDataHandler::~PRunDataHandler() { @@ -99,10 +102,11 @@ PRunDataHandler::~PRunDataHandler() // GetRunData //-------------------------------------------------------------------------- /** - *

Checks if runName is found. + *

Checks if runName is found. * - * return: if data are found: pointer to the data. - * otherwise the null pointer will be returned. + * return: + * - 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) *

The main read file routine which is filtering what read sub-routine * needs to be called. * - * return: true if reading was successful, false if reading failed. + * return: + * - true if reading was successful, + * - false if reading failed. */ Bool_t PRunDataHandler::ReadFile() { @@ -188,7 +194,11 @@ Bool_t PRunDataHandler::ReadFile() *

Checks if a file has been already read in order to prevent multiple * reading of data files. * - * return: true if the file has been read before, otherwise false. + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

Checks if a given data file exists. + *

Checks if a given data file exists. + * + * return: + * - 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). - * - * return: 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) /** *

Reads the LEM-data ROOT-files. * + * return: + * - 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. - * - * return: true at successful reading, otherwise false. */ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) { @@ -634,12 +648,13 @@ Bool_t PRunDataHandler::ReadRootFile(Bool_t notPostPileup) /** *

Will read the NeXuS File Format as soon as PSI will have an implementation. * - * - * return: true at successful reading, otherwise false. + * return: + * - 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() *

Reads, for backwards compatibility, the ascii-wkm-file data format. * The routine is clever enough to distinguish the different wkm-flavours (argh). * - * return: true at successful reading, otherwise false. + * return: + * - true at successful reading, + * - otherwise false. */ Bool_t PRunDataHandler::ReadWkmFile() { @@ -924,7 +941,9 @@ Bool_t PRunDataHandler::ReadWkmFile() *

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. * - * return: true at successful reading, otherwise false. + * return: + * - true at successful reading, + * - otherwise false. */ Bool_t PRunDataHandler::ReadPsiBinFile() { @@ -1046,9 +1065,11 @@ Bool_t PRunDataHandler::ReadPsiBinFile() // ReadMudFile //-------------------------------------------------------------------------- /** - *

Reads the triumf mud-file format. Not yet implemented, sorry. + *

Reads the triumf mud-file format. * - * return: true at successful reading, otherwise false. + * return: + * - 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; ireturn: + * - 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. * - * return: true at successful reading, otherwise false. + * return: + * - true at successful reading, + * - otherwise false. */ Bool_t PRunDataHandler::ReadAsciiFile() { @@ -1942,6 +1951,10 @@ Bool_t PRunDataHandler::ReadAsciiFile() * *

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. + * + * return: + * - 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. * - * return: true at success, otherwise false. + * return: + * - true at successful reading, + * - otherwise false. */ Bool_t PRunDataHandler::StripWhitespace(TString &str) { @@ -2353,12 +2368,14 @@ Bool_t PRunDataHandler::StripWhitespace(TString &str) // IsWhitespace (private) //-------------------------------------------------------------------------- /** - *

Check is a string consists only of white spaces, i.e. spaces and/or + *

Check if a string consists only of white spaces, i.e. spaces and/or * ctrl-characters. * - * \param str string to be checked + * return: + * - true at successful reading, + * - otherwise false. * - * return: 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) /** *

Convert a string to a Double_t. * + * return: + * - returns the converted string + * - otherwise 0.0 with ok==false + * * \param str string to be converted * \param ok true on success, otherwise false. - * - * return: 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) /** *

Convert a string to an Int_t. * + * return: + * - returns the converted string + * - otherwise 0.0 with ok==false + * * \param str string to be converted * \param ok true on success, otherwise false. - * - * return: 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) //-------------------------------------------------------------------------- /** - *

Checks is str is in a list of data tags + *

Checks if str is in a list of data tags + * + * return: + * - 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 - * - * return: if found returns the data tag index (from the dataTags vector), otherwise -1 */ Int_t PRunDataHandler::GetDataTagIndex(TString &str, const PStringVector* dataTags) { diff --git a/src/classes/PRunListCollection.cpp b/src/classes/PRunListCollection.cpp index 46d9d7f5..d8eaf188 100644 --- a/src/classes/PRunListCollection.cpp +++ b/src/classes/PRunListCollection.cpp @@ -37,13 +37,12 @@ // Constructor //-------------------------------------------------------------------------- /** - *

+ *

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 //-------------------------------------------------------------------------- /** - *

- * + *

Destructor */ PRunListCollection::~PRunListCollection() { -//cout << endl << "in ~PRunListCollection() ..." << endl; -//cout << endl << ">> fRunSingleHistoList.size() = " << fRunSingleHistoList.size(); for (UInt_t i=0; iCleanUp(); fRunSingleHistoList[i]->~PRunSingleHisto(); } fRunSingleHistoList.clear(); -//cout << endl << ">> fRunAsymmetryList.size() = " << fRunAsymmetryList.size(); for (UInt_t i=0; iCleanUp(); fRunAsymmetryList[i]->~PRunAsymmetry(); } fRunAsymmetryList.clear(); -//cout << endl << ">> fRunMuMinusList.size() = " << fRunMuMinusList.size(); for (UInt_t i=0; iCleanUp(); fRunMuMinusList[i]->~PRunMuMinus(); } fRunMuMinusList.clear(); -//cout << endl << ">> fRunNonMusrList.size() = " << fRunNonMusrList.size(); for (UInt_t i=0; iCleanUp(); fRunNonMusrList[i]->~PRunNonMusr(); @@ -90,21 +83,19 @@ PRunListCollection::~PRunListCollection() // Add //-------------------------------------------------------------------------- /** - *

+ *

Adds a processed set of data to the handler. * - * \param runNo - * \param tag + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Calculates chi-square of all single histogram runs of a msr-file. + * + * return: + * - chi-square of all single histogram runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetSingleHistoChisq(const std::vector& par) const { @@ -156,7 +152,12 @@ Double_t PRunListCollection::GetSingleHistoChisq(const std::vector& pa // GetAsymmetryChisq //-------------------------------------------------------------------------- /** - *

+ *

Calculates chi-square of all asymmetry runs of a msr-file. + * + * return: + * - chi-square of all asymmetry runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetAsymmetryChisq(const std::vector& par) const { @@ -172,7 +173,12 @@ Double_t PRunListCollection::GetAsymmetryChisq(const std::vector& par) // GetMuMinusChisq //-------------------------------------------------------------------------- /** - *

+ *

Calculates chi-square of all mu minus runs of a msr-file. + * + * return: + * - chi-square of all mu minus runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetMuMinusChisq(const std::vector& par) const { @@ -188,7 +194,12 @@ Double_t PRunListCollection::GetMuMinusChisq(const std::vector& par) c // GetNonMusrChisq //-------------------------------------------------------------------------- /** - *

+ *

Calculates chi-square of all non-muSR runs of a msr-file. + * + * return: + * - chi-square of all non-muSR runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetNonMusrChisq(const std::vector& par) const { @@ -204,7 +215,12 @@ Double_t PRunListCollection::GetNonMusrChisq(const std::vector& par) c // GetSingleHistoMaximumLikelihood //-------------------------------------------------------------------------- /** - *

+ *

Calculates log max-likelihood of all single histogram runs of a msr-file. + * + * return: + * - chi-square of all single histogram runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector& par) const { @@ -222,6 +238,11 @@ Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector Since it is not clear yet how to handle asymmetry fits with max likelihood * the chi square will be used! + * + * return: + * - chi-square of all asymmetry runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector& par) const { @@ -237,7 +258,12 @@ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector + *

Calculates log max-likelihood of all mu minus runs of a msr-file. + * + * return: + * - chi-square of all mu minus runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetMuMinusMaximumLikelihood(const std::vector& par) const { @@ -255,6 +281,11 @@ Double_t PRunListCollection::GetMuMinusMaximumLikelihood(const std::vector Since it is not clear yet how to handle non musr fits with max likelihood * the chi square will be used! + * + * return: + * - chi-square of all asymmetry runs of the msr-file + * + * \param par fit parameter vector */ Double_t PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector& par) const { @@ -270,7 +301,10 @@ Double_t PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector + *

Counts the total number of bins to be fitted. + * + * return: + * - total number of bins fitted. */ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const { @@ -288,7 +322,6 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const for (UInt_t i=0; iGetNoOfFitBins(); -// cout << endl << "Total No of Bins Fitted = " << counts; return counts; } @@ -296,9 +329,13 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const // GetSingleHisto //-------------------------------------------------------------------------- /** - *

+ *

Get a processed single histogram data set. * - * \param index + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get a processed asymmetry data set. * - * \param index + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get a processed mu minus data set. * - * \param index + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get a processed non-muSR data set. * - * \param index + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the temperature from the data set. * - * \param runName + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the magnetic field from the data set. * - * \param runName + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the muon implantation energy from the data set. * - * \param runName + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the setup information from the data set. * - * \param runName + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the x-axis title (used with non-muSR fit). + * + * return: + * - 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 //-------------------------------------------------------------------------- /** - *

+ *

Get the y-axis title (used with non-muSR fit). + * + * return: + * - 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; diff --git a/src/include/PRunBase.h b/src/include/PRunBase.h index 78055fda..f6fb3252 100644 --- a/src/include/PRunBase.h +++ b/src/include/PRunBase.h @@ -44,7 +44,7 @@ using namespace std; //------------------------------------------------------------------------------------------ /** - *

+ *

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& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! - virtual Double_t CalcMaxLikelihood(const vector& par) = 0; // pure virtual, i.e. needs to be implemented by the deriving class!! + virtual Double_t CalcChiSquare(const vector& par) = 0; ///< pure virtual, i.e. needs to be implemented by the deriving class!! + virtual Double_t CalcMaxLikelihood(const vector& 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(); diff --git a/src/include/PRunDataHandler.h b/src/include/PRunDataHandler.h index 7ceba2bf..19a68ad3 100644 --- a/src/include/PRunDataHandler.h +++ b/src/include/PRunDataHandler.h @@ -40,6 +40,9 @@ using namespace std; #include "PMusr.h" #include "PMsrHandler.h" +/** + *

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 diff --git a/src/include/PRunListCollection.h b/src/include/PRunListCollection.h index 5d3a9795..c997fdd3 100644 --- a/src/include/PRunListCollection.h +++ b/src/include/PRunListCollection.h @@ -43,6 +43,9 @@ using namespace std; #include "PRunMuMinus.h" #include "PRunNonMusr.h" +/** + *

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 fRunSingleHistoList; - vector fRunAsymmetryList; - vector fRunMuMinusList; - vector fRunNonMusrList; + vector fRunSingleHistoList; ///< stores all precessed single histogram data + vector fRunAsymmetryList; ///< stores all precessed asymmetry data + vector fRunMuMinusList; ///< stores all precessed mu-minus data + vector fRunNonMusrList; ///< stores all precessed non-muSR data }; #endif // _PRUNLISTCOLLECTION_H_