Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

GausFitObject.cpp

Go to the documentation of this file.
00001 #include "GausFitObject.h"
00002 #include "TF1.h"
00003 #include "Sct/LogicErrors.h"
00004 
00005 // Over-ride function...
00006 // Calls base-class equality operator then renames the parameters
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     //      if (!strcmp(rootfunc.GetName(), "gaus")) {
00027     //    ostringstream os; os <<"GausFitObject::operator=(TF1&) not a gaus TF1: "
00028     //                 <<rootfunc.GetName();
00029     //    throw InvalidArgument(os.str());
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     //Throw away LogicError that should never happen
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 } // end of namespace SctData

Generated on Mon Dec 15 19:36:04 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3