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