00001 #include "ErfcFitObject.h"
00002 #include "FitFunctions.h"
00003 #include "ObjectPool.h"
00004
00005 #include <TMath.h>
00006 #include <TF1.h>
00007
00008 using namespace std;
00009 using namespace Sct;
00010
00011 namespace SctData {
00012
00016 vector<string> ErfcFitObject::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> ErfcFitObject::parNames = ErfcFitObject::createParNames();
00025
00026 shared_ptr<ErfcFitObject> ErfcFitObject::create() {
00027 static ObjectPool<ErfcFitObject> pool;
00028 return pool.get();
00029 }
00030
00031 ErfcFitObject::ErfcFitObject() : FitObject("erfc", 3, parNames) {
00032
00033 }
00034
00035 shared_ptr<FitObject> ErfcFitObject::clone() const throw() {
00036 return create();
00037
00038 }
00039
00040 ErfcFitObject& ErfcFitObject::operator=(const TF1& f)throw(LogicError) {
00041 this->FitObject::operator=(f);
00042 return *this;
00043 }
00044
00045 ErfcFitObject::ErfcFitObject(const TF1& f) : FitObject("erfc", 3, parNames, f) {
00046 }
00047
00048
00049
00050 auto_ptr<TF1> ErfcFitObject::makeBasicRootTF1() const throw(LogicError) {
00051 auto_ptr<TF1> r( new TF1(0, SctData::erfc, this->getVarMin(0), this->getVarMax(0), 3));
00052 if (!r.get())
00053 throw InvariantViolatedError("ErfcFitObject::makeBasicRootTF1()", __FILE__, __LINE__);
00054 return r;
00055 }
00056
00057 }
00058