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

GausFitObject.cpp

00001 #include "GausFitObject.h"
00002 #include "Sct/LogicErrors.h"
00003 
00004 #include <TF1.h>
00005 
00006 // Over-ride function...
00007 // Calls base-class equality operator then renames the parameters
00008 
00009 namespace SctData {
00010 
00014 vector<string> GausFitObject::createParNames() {
00015     vector<string> parNames(3);
00016     parNames[0] = "Prefact";
00017     parNames[1] = "Mean";
00018     parNames[2] = "Sigma";
00019     return parNames;
00020 }
00021 
00022 vector<string> GausFitObject::parNames = createParNames();
00023     
00024 GausFitObject::GausFitObject() : FitObject("gaus", 3, parNames) {
00025 }
00026 
00027 GausFitObject::GausFitObject(const TF1& f) : FitObject("gaus", 3, parNames, f){
00028 }
00029 
00030 shared_ptr<FitObject> GausFitObject::clone() const throw() {
00031     return shared_ptr<FitObject> (new GausFitObject(*this));
00032 }
00033 
00034 GausFitObject& GausFitObject::operator= (const TF1& rootfunc) throw(LogicError) {
00035     //      if (!strcmp(rootfunc.GetName(), "gaus")) {
00036     //    ostringstream os; os <<"GausFitObject::operator=(TF1&) not a gaus TF1: "
00037     //                 <<rootfunc.GetName();
00038     //    throw InvalidArgument(os.str());
00039     //      }
00040     this->FitObject::operator=(rootfunc);
00041     return (*this);
00042 }
00043 
00044 auto_ptr<TF1> GausFitObject::makeBasicRootTF1() const throw(LogicError) {
00045     auto_ptr<TF1> r ( new TF1("mygaus","gaus"));
00046     if (!r.get())
00047         throw InvariantViolatedError("GausFitObject::makeBasicRootTF1()", __FILE__, __LINE__);
00048     return r;
00049 }
00050 
00051 
00052 } // end of namespace SctData

Generated on Thu Jul 15 09:50:46 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5