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