11 double addMeas(int id, double val)
15 tmpmeas.val.push_back(val);
16 mymeas.push_back(tmpmeas);
20 double* addMeas(int id, double *val, int valsize)
24 for( int ival=0; ival<valsize; ival++ ) tmpmeas.val.push_back( val[ival] );
25 mymeas.push_back(tmpmeas);
29 double meanval(int id)
32 int vecsize = mymeas.size();
34 for (int i=0; i<vecsize; i++)
36 if ( mymeas.at(i).id == id )
38 meanval += mymeas.at(i).val[0];
45 double meanerr(int id)
48 int vecsize = mymeas.size();
49 double mymean = meanval(id);
52 for (int i=0; i<vecsize; i++)
54 if ( mymeas.at(i).id == id )
56 meanerr += pow(mymeas.at(i).val[0]-mymean, 2);
61 meanerr = meanerr / ( ivals*(ivals-1) );
68 tmp.mean = meanval(id);
69 tmp.err = meanerr(id);
73 obsa jackObs(int id, double (*func)(vector<double> vals))
76 vector<double> mymeans;
77 int vecsize = mymeas.size();
82 for (int ijack=0; ijack < nmeas || nmeas == 0; ijack++)
86 vector<double> myvals;
88 for (int i=0; i<vecsize; i++)
90 if ( mymeas.at(i).id == id )
93 if ( i == ijack ) continue;
94 myvals.push_back( mymeas.at(i).val[0] );
98 mymeans.push_back( func(myvals) );
99 jackobs.mean += mymeans.at(mymeans.size()-1);
102 jackobs.mean /= nmeas;
104 /* compute jack error */
105 vecsize = mymeans.size();
107 for (int i=0; i<vecsize; i++)
109 jackobs.err += pow(mymeans.at(i) - jackobs.mean, 2);
111 jackobs.err *= (double)(nmeas-1)/nmeas;
112 jackobs.err = sqrt(jackobs.err);
117 obsa jackObs(int id, double (*func)(vector< vector<double> > vals))
120 vector<double> mymeans;
121 int vecsize = mymeas.size();
126 for (int ijack=0; ijack < nmeas || nmeas == 0; ijack++)
130 vector< vector<double> > myvals;
132 for (int i=0; i<vecsize; i++)
134 if ( mymeas.at(i).id == id )
137 if ( i == ijack ) continue;
138 myvals.push_back( mymeas[i].val );
142 mymeans.push_back( func(myvals) );
143 jackobs.mean += mymeans.at(mymeans.size()-1);
146 jackobs.mean /= nmeas;
148 /* compute jack error */
149 vecsize = mymeans.size();
151 for (int i=0; i<vecsize; i++)
153 jackobs.err += pow(mymeans.at(i) - jackobs.mean, 2);
155 jackobs.err *= (double)(nmeas-1)/nmeas;
156 jackobs.err = sqrt(jackobs.err);