5 using std::stringstream;
31 o<<
"fFunction.fName"<<
"\t"<<
fFunction.GetName()<<endl;
32 o<<
"fFunction.fTitle"<<
"\t"<<
fFunction.GetTitle()<<endl;
33 o<<
"fFunction.fNpar"<<
"\t"<<
fFunction.GetNpar()<<endl;
34 for(Int_t i=0; i<
fFunction.GetNpar(); i++) {
35 o<<
"fFunction.fPar["<<i<<
"]\t";
39 o<<
"fFunction.fChisquare"<<
"\t"<<
fFunction.GetChisquare()<<endl;
43 o<<
"fSource"<<
"\t"<<
fSource<<endl;
46 o<<
"fResiduals.fSize"<<
"\t"<<
fResiduals.size()<<endl;
48 o<<
"fResiduals["<<i<<
"]\t";
55 o<<
"fSourceRuns.size"<<
"\t"<<
fSourceRuns.size()<<endl;
60 o<<
"fSourceRuns["<<j<<
"]"<<
"\t"<<
fSourceRuns[j]<<
"\t"<< endl;
70 std::string tag, name, formula, source;
71 int npar, nres, size, run;
72 Double_t chisq, chisqndf;
73 Double_t par, par_err;
74 Double_t ene, res, res_err;
78 if(tag !=
"fFunction.fName") {
80 err.SetDescription(
"Expected tag fFunction.fName");
84 if(tag !=
"fFunction.fTitle") {
86 err.SetDescription(
"Expected tag fFunction.fTitle");
90 if(tag !=
"fFunction.fNpar") {
92 err.SetDescription(
"Expected tag fFunction.fNpar");
96 TF1 f(name.c_str(),formula.c_str());
99 for(Int_t i=0; i<npar; i++) {
100 ob >> tag >> par >> par_err;
101 if(tag != Form(
"%s%d%s",
"fFunction.fPar[",i,
"]")) {
103 err.SetDescription(
"Expected tag fFunction.fPar");
111 if(tag !=
"fFunction.fChisquare") {
113 err.SetDescription(
"Expected tag fFunction.fChisquare");
118 ob >> tag >> chisqndf;
119 if(tag !=
"fChisquareNdf") {
121 err.SetDescription(
"Expected tag fChisquareNdf");
128 if(tag !=
"fSource") {
130 err.SetDescription(
"Expected tag fSource");
138 if(tag !=
"fResiduals.fSize") {
140 err.SetDescription(
"Expected tag fResiduals");
145 for(Int_t i=0; i<nres; i++) {
146 ob >> tag >> ene >> res >> res_err;
148 tagstr<<
"fResiduals["<<i<<
"]";
149 if(tag != tagstr.str()) {
151 err.SetDescription(
string(
"Expected tag ")+tagstr.str());
161 if(tag !=
"fSourceRuns.size") {
163 err.SetDescription(
"Expected tag fSourceRuns.size");
169 for(Int_t i=0; i<size; i++) {
171 snprintf(s,50,
"fSourceRuns[%d]",i);
174 err.SetDescription(
"Expected tag fSourceRuns");
QObjectImp(QCalibrationParameters)
object containing calibration data (function, coefficients, source and residuals) and run numbers of ...
std::vector< int > fSourceRuns
QError ReadFromStream(std::istream &ob)
std::vector< QCalibrationResiduals > fResiduals
QError WriteOnStream(std::ostream &o) const
error class with error type and description