musrfit
1.9.2
|
#include <iostream>
#include <fstream>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <TString.h>
#include <TObjArray.h>
#include <TObjString.h>
Go to the source code of this file.
Macros | |
#define | MSR_TAG_TITLE 0 |
#define | MSR_TAG_FITPARAMETER 1 |
#define | MSR_TAG_THEORY 2 |
#define | MSR_TAG_FUNCTIONS 3 |
#define | MSR_TAG_RUN 4 |
#define | MSR_TAG_COMMANDS 5 |
#define | MSR_TAG_PLOT 6 |
#define | MSR_TAG_STATISTIC 7 |
#define | MSR_TAG_NO_BLOCK 8 |
#define | MSR_THEORY_INTERN_FLD 0 |
#define | MSR_THEORY_INTERN_BESSEL 1 |
Functions | |
void | msr2msr_syntax () |
bool | msr2msr_run (char *str, const std::size_t size) |
bool | msr2msr_param (char *str) |
bool | msr2msr_theory (char *str, int &tag, int &noOfAddionalParams) |
bool | msr2msr_is_comment (char *str) |
bool | msr2msr_is_whitespace (char *str) |
void | msr2msr_replace (char *str, int paramNo) |
bool | msr2msr_finalize_theory (char *fln, int theoryTag, int noOfAddionalParams) |
bool | msr2msr_statistic (char *str, const std::size_t size) |
int | main (int argc, char *argv[]) |
#define MSR_TAG_COMMANDS 5 |
Definition at line 48 of file msr2msr.cpp.
#define MSR_TAG_FITPARAMETER 1 |
Definition at line 44 of file msr2msr.cpp.
Referenced by main(), and msr2msr_finalize_theory().
#define MSR_TAG_FUNCTIONS 3 |
Definition at line 46 of file msr2msr.cpp.
#define MSR_TAG_NO_BLOCK 8 |
Definition at line 51 of file msr2msr.cpp.
#define MSR_TAG_PLOT 6 |
Definition at line 49 of file msr2msr.cpp.
#define MSR_TAG_RUN 4 |
Definition at line 47 of file msr2msr.cpp.
Referenced by main().
#define MSR_TAG_STATISTIC 7 |
Definition at line 50 of file msr2msr.cpp.
Referenced by main().
#define MSR_TAG_THEORY 2 |
Definition at line 45 of file msr2msr.cpp.
Referenced by main(), and msr2msr_finalize_theory().
#define MSR_TAG_TITLE 0 |
Definition at line 43 of file msr2msr.cpp.
#define MSR_THEORY_INTERN_BESSEL 1 |
Definition at line 56 of file msr2msr.cpp.
Referenced by msr2msr_finalize_theory(), and msr2msr_theory().
#define MSR_THEORY_INTERN_FLD 0 |
Definition at line 55 of file msr2msr.cpp.
Referenced by msr2msr_finalize_theory(), and msr2msr_theory().
int main | ( | int | argc, |
char * | argv[] | ||
) |
msr2msr is needed to convert old WKM msr-files to musrfit msr-files. Eventhough the syntax is very close, there are some shortcomings in the WKM msr-files, which forced me to slightly change the file format.
argc | number of arguments |
argv | list of arguments |
Definition at line 641 of file msr2msr.cpp.
References msr2msr_finalize_theory(), msr2msr_param(), msr2msr_run(), msr2msr_statistic(), msr2msr_syntax(), msr2msr_theory(), MSR_TAG_FITPARAMETER, MSR_TAG_RUN, MSR_TAG_STATISTIC, and MSR_TAG_THEORY.
bool msr2msr_finalize_theory | ( | char * | fln, |
int | theoryTag, | ||
int | noOfAddionalParams | ||
) |
If a theory function was found which has newly a different number of parameters, this function will finalize the msr-file, i.e. replacing all temporarily set tags.
fln | file name |
theoryTag | theory tag if the changed function |
noOfAddionalParams | number of additional fit parameters |
Definition at line 511 of file msr2msr.cpp.
References msr2msr_is_comment(), msr2msr_is_whitespace(), msr2msr_replace(), MSR_TAG_FITPARAMETER, MSR_TAG_THEORY, MSR_THEORY_INTERN_BESSEL, and MSR_THEORY_INTERN_FLD.
Referenced by main().
bool msr2msr_is_comment | ( | char * | str | ) |
Checks if a msr-line is a comment line
return:
str | msr-file line |
Definition at line 425 of file msr2msr.cpp.
Referenced by msr2msr_finalize_theory().
bool msr2msr_is_whitespace | ( | char * | str | ) |
Checks if a msr-line consists only out of whitespaces.
return:
str | msr-file line |
Definition at line 454 of file msr2msr.cpp.
Referenced by msr2msr_finalize_theory().
bool msr2msr_param | ( | char * | str | ) |
Changes the fit parameter lines to the new msr-file format. In the new msr-file format there is an additional column "Pos_Error". Before a fit takes place the value is set to "none".
return:
str | msr-file fit parameter line |
Definition at line 158 of file msr2msr.cpp.
Referenced by main().
void msr2msr_replace | ( | char * | str, |
int | paramNo | ||
) |
Replaces temporarily set labels by the proper parameter number.
str | msr-file line |
paramNo | parameter number |
Definition at line 477 of file msr2msr.cpp.
Referenced by msr2msr_finalize_theory().
bool msr2msr_run | ( | char * | str, |
const std::size_t | size | ||
) |
If the msr-file line is the RUN line, change it to the new format.
return:
str | msr-file line |
size | size of str |
Definition at line 83 of file msr2msr.cpp.
Referenced by main().
bool msr2msr_statistic | ( | char * | str, |
const std::size_t | size | ||
) |
Filters out the old chi-square related informations. And sets them according to the new scheme.
return:
str | msr-file statistic block line |
size | size of str |
Definition at line 604 of file msr2msr.cpp.
References status.
Referenced by main().
void msr2msr_syntax | ( | ) |
Sends the usage description to the standard output.
Definition at line 62 of file msr2msr.cpp.
Referenced by main().
bool msr2msr_theory | ( | char * | str, |
int & | tag, | ||
int & | noOfAddionalParams | ||
) |
In the theory the table functions needs to be replaced by the numerical ones, and some functions have new a different parameterization.
return:
str | msr-file theory line |
tag | if a function has new some additional parameters, this flag will be set, such that these new parameters can be added to the fit parameter block |
noOfAddionalParams | counts the number of additional parameters needed. |
Definition at line 273 of file msr2msr.cpp.
References MSR_THEORY_INTERN_BESSEL, and MSR_THEORY_INTERN_FLD.
Referenced by main().