4 #ifndef tools_sg_fit2plot
5 #define tools_sg_fit2plot
20 static const std::string& s_empty() {
21 static const std::string s_v(
"");
30 virtual void*
cast(
const std::string& a_class)
const {
31 if(
void* p = cmp_cast<fit2plot>(
this,a_class)) {
return p;}
39 virtual const std::string&
title()
const {
return s_empty();}
43 virtual void infos(
const std::string& a_opts,std::string& a_sinfos)
const {
45 std::string f_lf(
"\n");
46 std::vector<std::string> ws;
47 words(a_opts,
" ",
false,ws);
48 std::vector<std::string>::const_iterator it;
50 bool show_fit_ndf =
false;
51 {
for(it=ws.begin();it!=ws.end();++it) {
52 if((*it)==
"fit_ndf") {show_fit_ndf =
true;
break;}
54 bool show_fit_errors =
false;
55 {
for(it=ws.begin();it!=ws.end();++it) {
56 if((*it)==
"fit_errors") {show_fit_errors =
true;
break;}
59 for(it=ws.begin();it!=ws.end();++it) {
60 if(((*it)==
"name") &&
m_name.size()) {
61 if(a_sinfos.size()) a_sinfos += f_lf;
66 }
else if((*it)==
"fit_quality") {
68 if(a_sinfos.size()) a_sinfos += f_lf;
69 a_sinfos +=
"[h]^2! / ndf";
71 if(!numas<double>(
m_output[0],a_sinfos)){}
73 if(!numas<double>(
m_output[1],a_sinfos)){}
75 if(a_sinfos.size()) a_sinfos += f_lf;
78 if(!numas<double>(
m_output[0],a_sinfos)){}
81 }
else if((*it)==
"fit_parameters") {
83 for(
size_t iparam=0;iparam<nparam;iparam++) {
85 if(a_sinfos.size()) a_sinfos += f_lf;
88 if(!numas<double>(
m_output[2+4*iparam+0],a_sinfos)){}
90 if(!numas<double>(
m_output[2+4*iparam+1],a_sinfos)){}
92 if(a_sinfos.size()) a_sinfos += f_lf;
95 if(!numas<double>(
m_output[2+4*iparam+0],a_sinfos)){}
103 const std::vector<double>& a_output)
108 mem::increment(
s_class().c_str());
110 size_t nparam = (
m_output.size()-2)/4;
119 mem::decrement(
s_class().c_str());
131 mem::increment(
s_class().c_str());