inlib
1.2.0
|
Classes | |
class | fitter |
class | point |
class | parameter |
class | command |
class | func_fitter |
Functions | |
template<class T > | |
T | TMath_Min (const T &a, const T &b) |
template<class T > | |
T | TMath_Max (const T &a, const T &b) |
double | TMath_Log (double a) |
double | TMath_Log10 (double a) |
double | TMath_Sqrt (double a) |
double | TMath_Power (double a, double b) |
double | TMath_Abs (double a) |
double | TMath_Sin (double a) |
double | TMath_Cos (double a) |
double | TMath_ATan (double a) |
double | TMath_ASin (double a) |
int | TMath_int_abs (int a) |
std::string | Form (const char *aFormat,...) |
void | Printf (std::ostream *a_out, const char *aFormat,...) |
bool | fit_data (std::ostream &a_out, const std::vector< inlib::f2cmn::point > &a_data, const std::vector< inlib::f2cmn::parameter > &a_params, inlib::fit_func &a_func, std::vector< double > &a_output, const std::vector< command > &a_cmds=std::vector< command >(1, command("MIGRAD"))) |
template<class T > | |
bool | fit_1D (std::ostream &a_out, T &a_histo, const std::vector< inlib::f2cmn::parameter > &a_params, inlib::fit_func &a_func, std::vector< double > &a_output, const std::vector< command > &a_cmds=std::vector< command >(1, command("MIGRAD"))) |
template<class T > | |
bool | fit_xve (std::ostream &a_out, const std::vector< T > &a_xs, const std::vector< T > &a_vs, const std::vector< T > &a_es, const std::vector< inlib::f2cmn::parameter > &a_params, inlib::fit_func &a_func, std::vector< double > &a_output, const std::vector< command > &a_cmds=std::vector< command >(1, command("MIGRAD"))) |
bool inlib::f2cmn::fit_1D | ( | std::ostream & | a_out, |
T & | a_histo, | ||
const std::vector< inlib::f2cmn::parameter > & | a_params, | ||
inlib::fit_func & | a_func, | ||
std::vector< double > & | a_output, | ||
const std::vector< command > & | a_cmds = std::vector<command>(1,command("MIGRAD")) |
||
) | [inline] |
Definition at line 7857 of file f2cmn.
{ //NOTE : the size of a_output is : // 2 + a_params.size() * 4 // with : // a_output[0] = chi2 // a_output[1] = number of degree of freedom if(a_histo.entries()==0) { a_out << "inlib::f2cmn::fit_1D :" << " histogram has no entries." << std::endl; return false; } int nbin = a_histo.axis().bins(); if(nbin<=0) { a_out << "inlib::f2cmn::fit_1D :" << " has no bins." << std::endl; return false; } std::vector<double> pt; pt.resize(1,0); std::vector< inlib::f2cmn::point > data; for(int index=0;index<nbin;index++) { int nent = a_histo.bin_entries(index); if(nent==0) continue; // Do not take bin without entry. // Take middle of bin. double xx = (a_histo.axis().bin_lower_edge(index)+ a_histo.axis().bin_upper_edge(index))/2.; double val = a_histo.bin_height(index); double err = ::sqrt(::fabs(val)); // Take statistical error. if(err==0.) { a_out << "inlib::f2cmn::fit_1D :" << " null error for bin " << index << " x " << xx << " value " << val << ". Set error to 0.01." << std::endl; //return 0; err = 0.01; //FIXME } inlib::f2cmn::point fpt; pt[0] = xx; fpt.m_coords = pt; fpt.m_value = val; fpt.m_error = err; data.push_back(fpt); } if(data.empty()) { a_out << "inlib::f2cmn::fit_1D :" << " no starting points." << std::endl; return false; } if(!func_fitter::fit(a_out,data,a_params,a_func,a_output,a_cmds)) { a_out << "inlib::f2cmn::fit_1D :" << " fit failed." << std::endl; return false; } return true; }
bool inlib::f2cmn::fit_data | ( | std::ostream & | a_out, |
const std::vector< inlib::f2cmn::point > & | a_data, | ||
const std::vector< inlib::f2cmn::parameter > & | a_params, | ||
inlib::fit_func & | a_func, | ||
std::vector< double > & | a_output, | ||
const std::vector< command > & | a_cmds = std::vector<command>(1,command("MIGRAD")) |
||
) | [inline] |
Definition at line 7824 of file f2cmn.
{ //NOTE : the size of a_output is : // 2 + a_params.size() * 4 // with : // a_output[0] = chi2 // a_output[1] = number of degree of freedom if(a_data.empty()) { a_out << "inlib::f2cmn::fit_data :" << " no starting points." << std::endl; return false; } if(!func_fitter::fit(a_out,a_data,a_params,a_func,a_output,a_cmds)) { a_out << "inlib::f2cmn::fit_data :" << " fit failed." << std::endl; return false; } return true; }
bool inlib::f2cmn::fit_xve | ( | std::ostream & | a_out, |
const std::vector< T > & | a_xs, | ||
const std::vector< T > & | a_vs, | ||
const std::vector< T > & | a_es, | ||
const std::vector< inlib::f2cmn::parameter > & | a_params, | ||
inlib::fit_func & | a_func, | ||
std::vector< double > & | a_output, | ||
const std::vector< command > & | a_cmds = std::vector<command>(1,command("MIGRAD")) |
||
) | [inline] |
Definition at line 7934 of file f2cmn.
{ //NOTE : the size of a_output is : // 2 + a_params.size() * 4 // with : // a_output[0] = chi2 // a_output[1] = number of degree of freedom if(a_vs.size() != a_xs.size() ) { a_out << "inlib::f2cmn::fit_xve :" << " coordinate and value vectors have different sizes." << std::endl; return false; } if(a_es.size() != a_xs.size() ) { a_out << "inlib::f2cmn::fit_xve :" << " coordinate and error vectors have different sizes." << std::endl; return false; } int nbin = a_xs.size(); std::vector<double> pt; pt.resize(1,0); std::vector< inlib::f2cmn::point > data; for(int index=0;index<nbin;index++) { inlib::f2cmn::point fpt; pt[0] = a_xs[index]; fpt.m_coords = pt; fpt.m_value = a_vs[index]; fpt.m_error = a_es[index]; data.push_back(fpt); } if(data.empty()) { a_out << "inlib::f2cmn::fit_xve :" << " no starting points." << std::endl; return false; } if(!func_fitter::fit(a_out,data,a_params,a_func,a_output,a_cmds)) { a_out << "inlib::f2cmn::fit_xve :" << " fit failed." << std::endl; return false; } return true; }
std::string inlib::f2cmn::Form | ( | const char * | aFormat, |
... | |||
) | [inline] |
void inlib::f2cmn::Printf | ( | std::ostream * | a_out, |
const char * | aFormat, | ||
... | |||
) | [inline] |
double inlib::f2cmn::TMath_Abs | ( | double | a | ) | [inline] |
double inlib::f2cmn::TMath_ASin | ( | double | a | ) | [inline] |
double inlib::f2cmn::TMath_ATan | ( | double | a | ) | [inline] |
double inlib::f2cmn::TMath_Cos | ( | double | a | ) | [inline] |
int inlib::f2cmn::TMath_int_abs | ( | int | a | ) | [inline] |
double inlib::f2cmn::TMath_Log | ( | double | a | ) | [inline] |
Definition at line 274 of file f2cmn.
{return ::log(a);}
double inlib::f2cmn::TMath_Log10 | ( | double | a | ) | [inline] |
T inlib::f2cmn::TMath_Max | ( | const T & | a, |
const T & | b | ||
) | [inline] |
T inlib::f2cmn::TMath_Min | ( | const T & | a, |
const T & | b | ||
) | [inline] |
double inlib::f2cmn::TMath_Power | ( | double | a, |
double | b | ||
) | [inline] |
double inlib::f2cmn::TMath_Sin | ( | double | a | ) | [inline] |