]>
Commit | Line | Data |
---|---|---|
f67e2651 | 1 | |
2 | /* this c-file implemtes the usage of a special FResult type */ | |
3 | /* it is call jk in honor of Jaanus Krabi who used the values first */ | |
4 | ||
5 | ||
6 | #include <string.h> | |
7 | ||
8 | #include "rdmc.h" | |
9 | ||
10 | ||
11 | const array_hdef_t rdmc_jk_fit_def = | |
12 | { | |
13 | 0, "rdmc-jk" , 8 , 0, { "id" , "rchi2" , "prob", "sigth" | |
14 | , "covmin", "covmax", "cutflag" , "chi2"} | |
15 | , { "" } | |
16 | }; | |
17 | ||
18 | void rdmc_jk_to_fitdef(array_hdef_t *jk_def, int id){ | |
19 | rdmc_cp_hdef(jk_def,&rdmc_jk_fit_def); | |
20 | jk_def->id = id; | |
21 | } | |
22 | ||
23 | void rdmc_init_fit_jk(mevt_special_t *r,int id){ | |
24 | ||
25 | r->id = id; | |
26 | r->nval = 8; | |
27 | r->val[JK_FITID]=RDMC_NA; | |
28 | r->val[JK_CUTFLAG] = -1; | |
29 | r->val[JK_CHI2] | |
30 | = r->val[JK_RCHI2] | |
31 | = r->val[JK_PROB] | |
32 | = r->val[JK_SIGTH] | |
33 | = r->val[JK_COVMIN] | |
34 | = r->val[JK_COVMAX] | |
35 | = RDMC_NA; | |
36 | ||
37 | } | |
38 | ||
39 | int rdmc_is_fresult_jk(const array *ar,const mevt *ev, int ifit){ | |
40 | int idef; | |
41 | if ((ifit >= ev->nfit) | |
42 | || (ifit < 0)) | |
43 | return 0; | |
44 | idef = ev->fresult[ifit].id; | |
45 | if ((idef >= ar->n_fit) | |
46 | || (idef < 0)) | |
47 | return 0; | |
48 | return rdmc_is_this_jk(&(ar->def_fit[idef]),&(ev->fresult[ifit])); | |
49 | } | |
50 | ||
51 | ||
52 | int rdmc_is_this_jk(const array_hdef_t *rd,const mevt_special_t *res){ | |
53 | int ret = 0; | |
54 | if ( (strcmp(rd->tag,"rdmc-jk") == 0) | |
55 | && (res->nval == 8 )){ | |
56 | ret=1; | |
57 | } | |
58 | return ret; | |
59 | ||
60 | } | |
61 | ||
62 | int rdmc_is_fitdef_jk(const array *ar,int idef){ | |
63 | int ret = 0; | |
64 | if ( (idef<0) || (idef>= ar->n_fit) ) | |
65 | ret=0; | |
66 | else{ | |
67 | if (strcmp(ar->def_fit[idef].tag,"rdmc-jk") == 0) | |
68 | ret=1; | |
69 | } | |
70 | ||
71 | return ret; | |
72 | ||
73 | } | |
74 |