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 Sct;
00009
00010 namespace SctData {
00011
00015 vector<string> ErfcFitObject::createParNames() {
00016 vector<string> parNames(3);
00017 parNames[0] = "Prefact";
00018 parNames[1] = "Mean";
00019 parNames[2] = "Sigma";
00020 return parNames;
00021 }
00022
00023 vector<string> ErfcFitObject::parNames = ErfcFitObject::createParNames();
00024
00025 shared_ptr<ErfcFitObject> ErfcFitObject::create() {
00026 static ObjectPool<ErfcFitObject> pool;
00027 return pool.get();
00028 }
00029
00030 ErfcFitObject::ErfcFitObject() : FitObject("erfc", 3, parNames) {
00031
00032 }
00033
00034 shared_ptr<FitObject> ErfcFitObject::clone() const throw() {
00035 return create();
00036
00037 }
00038
00039 ErfcFitObject& ErfcFitObject::operator=(const TF1& f)throw(LogicError) {
00040 this->FitObject::operator=(f);
00041 return *this;
00042 }
00043
00044 ErfcFitObject::ErfcFitObject(const TF1& f) : FitObject("erfc", 3, parNames, f) {
00045 }
00046
00047
00048
00049 auto_ptr<TF1> ErfcFitObject::makeBasicRootTF1() const throw(LogicError) {
00050 auto_ptr<TF1> r( new TF1(0, SctData::erfc, this->getVarMin(0), this->getVarMax(0), 3));
00051 if (!r.get())
00052 throw InvariantViolatedError("ErfcFitObject::makeBasicRootTF1()", __FILE__, __LINE__);
00053 return r;
00054 }
00055
00056 }
00057