00001 #include "ErfFitObject.h"
00002
00003 using namespace Sct;
00004
00005 namespace SctData {
00006 ErfFitObject::ErfFitObject() throw() {
00007 this->init();
00008 this->reset();
00009 }
00010
00011 ErfFitObject::ErfFitObject(const TF1& f) throw(LogicError) {
00012 this->init();
00013 this->reset();
00014 *this=f;
00015 }
00016
00017 auto_ptr<FitObject> ErfFitObject::clone() const throw() {
00018 return auto_ptr<FitObject>(new ErfFitObject(*this));
00019 }
00020
00021 ErfFitObject& ErfFitObject::operator= (const TF1& f) throw(LogicError) {
00022 this->FitObject::operator=(f);
00023 return *this;
00024 }
00025
00026 void ErfFitObject::init() throw() {
00027 this->setNDim(1);
00028 this->setNPar(3);
00029 try {
00030 this->setParName(0,"Prefact");
00031 this->setParName(1,"Mean");
00032 this->setParName(2,"Sigma");
00033 } catch (LogicError&) {}
00034 this->setFormula("erf");
00035 }
00036
00037
00038 auto_ptr<TF1> ErfFitObject::makeBasicRootTF1() const throw(LogicError) {
00039 auto_ptr<TF1> r( new ::TF1("myerf", erf, this->getVarMin(0), this->getVarMax(0), 3));
00040 if (!r.get())
00041 throw InvariantViolatedError("ErfFitObject::makeBasicRootTF1()", __FILE__, __LINE__);
00042 return r;
00043 }
00044
00045 }
00046