ErfFitObject.cpp

00001 #include "ErfFitObject.h"
00002 #include "FitFunctions.h"
00003 
00004 #include <TMath.h>
00005 #include <TH1.h>
00006 #include <TF1.h>
00007 
00008 using namespace std;
00009 using namespace Sct;
00010 
00011 namespace SctData {
00012 
00016 vector<string> ErfFitObject::createParNames() {
00017     vector<string> parNames(3);
00018     parNames[0] = "Prefact";
00019     parNames[1] = "Mean";
00020     parNames[2] = "Sigma";
00021     return parNames;
00022 }
00023 
00024 vector<string> ErfFitObject::parNames = ErfFitObject::createParNames();
00025     
00026 ErfFitObject::ErfFitObject() : FitObject("erf", 3, parNames) {
00027 }
00028 
00029 ErfFitObject::ErfFitObject(const TF1& f) : FitObject("erf", 3, parNames, f) {
00030 }
00031 
00032 shared_ptr<FitObject> ErfFitObject::clone() const throw() {
00033     return shared_ptr<FitObject>(new ErfFitObject(*this));
00034 }
00035 
00036 ErfFitObject& ErfFitObject::operator= (const TF1& f) throw(LogicError) {
00037     this->FitObject::operator=(f);
00038     return *this;
00039 }
00040 
00041 // Call the appropriate constructor for making a ROOT TF1 object from this ErfFitObject::
00042 auto_ptr<TF1> ErfFitObject::makeBasicRootTF1() const throw(LogicError) {
00043     auto_ptr<TF1> r( new ::TF1("myerf", erf, this->getVarMin(0), this->getVarMax(0), 3));
00044     if (!r.get())
00045         throw InvariantViolatedError("ErfFitObject::makeBasicRootTF1()", __FILE__, __LINE__);
00046     return r;
00047 }
00048 
00049 }  // end of namespace SctData
00050 

Generated on Mon Feb 6 14:01:19 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6