15 #include <QMessageBox>
16 #include <QStringList>
18 #include <QtConcurrentRun>
19 #include <QFutureSynchronizer>
20 #include <QFutureWatcher>
23 #include <QProgressBar>
28 enum ObjTyp{funtyp,partyp,maptyp,numtyp,runspecificparameter};
29 enum ParameterTyp{pObj,pDISTR, pDISTREXT,pMEM,pHR};
30 enum MSTyp{SHcrystal,afmBexpowder,fmBexpowder,PseudoVoigt,MLR,SHpowder,mSSH,BL, FeCal, FeCaltriang,AnyFit,FeAspowder,DynDiagDiagDiag,DynDiagDiag,Dyn};
31 enum AdditionalFunTypes{TAbsDeb,TQuadDop,SwaveSFD,Hc2WHH,GLBrandttriang,GLBrandtquad,Errorfunction,OrderParameterDistrTN};
44 Obj(QString name,
double i);
49 bool operator<(
const Obj o2)
const;
72 void init(
int Speccount,
int MEMsamplecount);
121 AdditionalFunTypes typ;
193 short from_fld(
char* filename,
double** xdata,
double** ydata,
207 void update_fit_progressbar(
int ID,
int citer,
double chi2);
208 void finish_fitting(
int ID);
209 void error_message(
int runi, QString message);
217 void reset_error(
int runi,
int parai,
bool fit);
231 void interprete_commands(
int* linkOK);
232 void parse_functions(
int* linkOK);
233 int find_obj(QString name);
235 int set_obj(
int i,
int irun,
double v);
236 int set_error(
int i,
int irun,
double v);
239 QString ErrorMessage;
241 int read_fitparameters(FILE*f);
242 int read_functions(FILE*f);
243 int read_theory(FILE*f);
244 int read_run(
char* mbspath, FILE*f);
245 int read_plot(FILE*f);
246 int read_commands(FILE*f);
249 int process_theory();
251 bool blockend(
char* line);
252 bool validline(
char* line);
253 void print_fitdata();
254 short from_fld(
char* filename,
double** xdata,
double** ydata,
256 double**yerror,
int* count);
268 void build_iterator(
double* p,
int ip,
int spectrumi,
271 double weight,
double* integratedweight,
272 double **MEMIm,
int MEMIndex,
int maxMEMIndex);
274 void build_spectrum(
double* p,
int ip,
int spectrumi,
277 double weight,
double* integratedweight,
278 double **MEMIm,
int MEMIndex,
int maxMEMIndex);
280 void WeightSum(
double* p,
int ip,
int spectrumi,
int irun,
int ims,
281 double weight,
double* integratedweight);
283 short load_run(
char* mbspath,
char* T,
int index);
286 int load_run(
char* fldpath,
double UseT,
int index);
293 double KSconfidence(
int irun);
295 void anyfit(
int irun,
int ims);
300 double eval_error(
int iobj,
int irun);
301 double eval(
int iobj,
int irun);
302 double fv(
int ir,
int ifun);
305 void get_MEMcode(
int istep,
char* code);
307 double get_MEMcode(
int istep,
int ipara);
310 int pc(
int spectrumi);
311 int ac(ParameterTyp m);
312 void restrict_fitrange(
double* mins,
double* maxs,
int crange,
int irun);
345 ParameterTyp Distrtyp;
404 QString sautoI0, sautoA, sMEMsteps, sMaxIter, sconv, sMEMmaxlambda, sMEMmaxlambdaI0,
405 sMEMtollerance, sMEMstepsize,sta,somegasrc,somegaabs,sfr,sHR,sHRc,sMCi;
409 int autoI0, autoA, MEMsteps, MaxIter, conv, MEMmaxlambda, MEMmaxlambdaI0,
410 MEMtollerance, MEMstepsize,ta,omegasrc,omegaabs,fr,HR,HRc,MCi;
415 QList<double> plotrunlist;
432 QProgressDialog pbinstance;
446 int is_seriell_fit();
455 void fgetss(
char* buffer,
int max,FILE* f);
void hide_run(int i)
set initial value from parameter declaration if fit, else set -1
Definition: fitmodel.cpp:2779
information of the subspectra defined in the THEORY block of a mbs file
Definition: fitmodel.h:105
ObjTyp typ
specifies how to evaluate this Obj
Definition: fitmodel.h:52
double dnumber
float value if it is const. number
Definition: fitmodel.h:50
double step
stepsize, 0 corresponds to "const"
Definition: fitmodel.h:113
void fit()
creates fitthread instances to fit the whole data set
Definition: fitmodel - Kopie.cpp:1544
double calc_changed_runs()
Definition: fitmodel - Kopie.cpp:1649
int arg[6]
argument refer. to fitmodel::obj
Definition: fitmodel.h:123
thread class to perform fitting and error calculation tasks
Definition: fitthread.h:95
void ready_to_plot()
indicates that data is processed and can be viewed
void close_fmpa()
Definition: fitmodel - Kopie.cpp:2167
void add_noise()
statistical noise to current model
Definition: fitmodel.cpp:2840
contains all information related to the run
Definition: fitmodel.h:68
calculation of moessbauer spectra
Definition: Moesscalc.h:65
specific functions which are available for FUNCTIONS defintions
Definition: fitmodel.h:120
int get_affect(int i)
returns, which run is affected by the i-th parameter
Definition: fitmodel - Kopie.cpp:1679
int ref
index to fitmodel::rData it belongs to
Definition: fitmodel.h:53
fmPara * fmp
fitparameters used in model, count saved in fitmodel::cpara
Definition: fitmodel.h:200
void view_run_only(int i)
show only run i on the plot
Definition: fitmodel.cpp:2774
fmPanel * get_pannel()
return pointer to fitmodel::fmpa, used by mainwindow to set up widget
Definition: fitmodel.cpp:2837
RUN * run
runs used in model, count saved in fitmodel::crun
Definition: fitmodel.h:204
int printDigits
number of digits at FITDATA output
Definition: fitmodel.h:116
QList< int > arg
argument refer. to fitmodel::obj
Definition: fitmodel.h:131
Obj(QString name, ObjTyp typ, int i)
create am onject of specific type, with reference i fitmodel::rData
Definition: fitmodel - Kopie.cpp:2270
QString body
function body string
Definition: fitmodel.h:129
FunctionParser f
parser working upon body
Definition: fitmodel.h:130
double A
preestimated/updated spectral area
Definition: fitmodel.h:94
enable sorting of data in RUN
Definition: fitmodel.h:136
double * err2rec
Definition: fitmodel.h:78
double get_run_chi2(int runi)
chi2 value of the runi-th run
Definition: fitmodel - Kopie.cpp:1670
double get_total_chi2()
sum of chi2 values of all runs
Definition: fitmodel - Kopie.cpp:1664
double * rho
MEM-distribution.
Definition: fitmodel.h:96
double MEMstatus[5]
latest statistics of MEM calcul.
Definition: fitmodel.h:98
functions as defined on FUNCTIONS block of a mbs file
Definition: fitmodel.h:127
double * v
x-data (i.e. velocity for Moessb.)
Definition: fitmodel.h:76
QString name
declaration name
Definition: fitmodel.h:51
int cpara
count of fit parameters of model, size of fitmodel::fmp array
Definition: fitmodel.h:198
double T
run specif. param. (usual. temp.)
Definition: fitmodel.h:73
void view_run(int i)
add run i to the plot
Definition: fitmodel.cpp:2768
QString name
user defined parameter name
Definition: fitmodel.h:114
Definition: fitmodel.h:55
void generate_default(QStringList flds)
generates default mbs-file working upon the flds files
Definition: fitmodel.cpp:2793
int cpara
argument count
Definition: fitmodel.h:122
QList< AdditionalFun > addfunlist
list of used preimplemented funct.
Definition: fitmodel.h:132
double chi2
current fit quality measure
Definition: fitmodel.h:95
QStringList maplist
map parameter names
Definition: fitmodel.h:91
MSTyp typ
model to describe the spectrum
Definition: fitmodel.h:106
void panel_input(int irun, int ipara)
< parameter ipara of run irun was modified, recalc model
Definition: fitmodel - Kopie.cpp:2155
double * nI
normalized data
Definition: fitmodel.h:85
void all_fitting_finished()
uses in fit_hidden_wait() to stop QEventLoop and proceed in code
void fit_hidden_wait()
like fit, but without progressbar
Definition: fitmodel.cpp:2041
double I0
preestimate data base line
Definition: fitmodel.h:93
Graphical User Interface generated upon fitmodel.
Definition: fmpanel.h:20
double * rhoerror
MEM-dostribution errors.
Definition: fitmodel.h:97
int calc_run(int i)
recalculates the i-th run
Definition: fitmodel - Kopie.cpp:1038
void errors()
like fit, but error calculation
Definition: fitmodel - Kopie.cpp:1594
fitmodel parameters, as defines in the FITPARAMETER block of a mbs file
Definition: fitmodel.h:111
bool runspecific
name does not start with "global_"
Definition: fitmodel.h:115
double * nIth
Definition: fitmodel.h:86
symbol class to organize complex us er imput
Definition: fitmodel.h:40
Parameter p[MAX_PC]
parameters of the specific model
Definition: fitmodel.h:107
double * I
y-data (i.e. intensity for Moessb.)
Definition: fitmodel.h:77
int cc
channel count (= data point count)
Definition: fitmodel.h:74
bool operator==(QString name)
to compare Obj with each other
Definition: fitmodel - Kopie.cpp:2299
int is_valid()
returns fitmodel::isvalid
Definition: fitmodel - Kopie.cpp:992
int * map
map indeces in fitmodel::obj
Definition: fitmodel.h:92
short from_fld(char *filename, double **xdata, double **ydata, int *count)
Definition: fitmodel - Kopie.cpp:156
int crun
count of runs in the model, size of fitmodel::run array
Definition: fitmodel.h:202
double value
initial value
Definition: fitmodel.h:112
parser and handler of user input mbs-files
Definition: fitmodel.h:159
Definition: fparser.hh:185
double ** Ith
simulated spectra including RUN::cmbs subspectra
Definition: fitmodel.h:84
int ccr
channel count, restricted by user
Definition: fitmodel.h:75