00001 // @(#)root/minuit2:$Id: GaussFcn.h 20880 2007-11-19 11:23:41Z rdm $ 00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 00003 00004 /********************************************************************** 00005 * * 00006 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * 00007 * * 00008 **********************************************************************/ 00009 00010 #ifndef MN_GaussFcn_H_ 00011 #define MN_GaussFcn_H_ 00012 00013 #include "Minuit2/FCNBase.h" 00014 00015 #include <vector> 00016 00017 namespace ROOT { 00018 00019 namespace Minuit2 { 00020 00021 00022 class GaussFcn : public FCNBase { 00023 00024 public: 00025 00026 GaussFcn(const std::vector<double>& meas, 00027 const std::vector<double>& pos, 00028 const std::vector<double>& mvar) : fMeasurements(meas), 00029 fPositions(pos), 00030 fMVariances(mvar), 00031 fErrorDef(1.) {} 00032 00033 ~GaussFcn() {} 00034 00035 virtual double Up() const {return fErrorDef;} 00036 virtual double operator()(const std::vector<double>&) const; 00037 00038 std::vector<double> Measurements() const {return fMeasurements;} 00039 std::vector<double> Positions() const {return fPositions;} 00040 std::vector<double> Variances() const {return fMVariances;} 00041 00042 void SetErrorDef(double def) {fErrorDef = def;} 00043 00044 private: 00045 00046 00047 std::vector<double> fMeasurements; 00048 std::vector<double> fPositions; 00049 std::vector<double> fMVariances; 00050 double fErrorDef; 00051 }; 00052 00053 } // namespace Minuit2 00054 00055 } // namespace ROOT 00056 00057 #endif //MN_GaussFcn_H_