• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

BCModelManager.h

Go to the documentation of this file.
00001 #ifndef __BCMODELMANAGER__H
00002 #define __BCMODELMANAGER__H
00003 
00024 // ---------------------------------------------------------
00025 
00026 #include "BCModel.h"
00027 #include "BCDataSet.h"
00028 
00029 // BAT classes
00030 class BCDataPoint;
00031 
00032 // ---------------------------------------------------------
00033 
00034 class BCModelManager
00035 {
00036    public:
00037 
00043       BCModelManager();
00044 
00047       BCModelManager(const BCModelManager & modelmanager);
00048 
00051       virtual ~BCModelManager();
00052 
00060       BCModelManager & operator = (const BCModelManager & modelmanager);
00061 
00069       unsigned int GetNModels()
00070          { return fModelContainer -> size(); };
00071 
00076       BCModel * GetModel(int index)
00077          { return fModelContainer -> at(index); };
00078 
00082       int GetNDataPoints()
00083          { return (fDataSet) ? fDataSet -> GetNDataPoints() : 0; };
00084 
00089       BCDataPoint * GetDataPoint(int index)
00090          { return fDataSet -> GetDataPoint(index); };
00091 
00095       BCDataSet * GetDataSet()
00096          { return fDataSet; };
00097 
00107       void SetDataSet(BCDataSet * dataset);
00108 
00114       void SetSingleDataPoint(BCDataPoint * datapoint);
00115 
00122       void SetSingleDataPoint(BCDataSet * dataset, unsigned int index);
00123 
00124       // DEBUG DELETE?
00129       //   void SetNIterationsMax(int niterations);
00130 
00133       void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method);
00134 
00137       void SetIntegrationMethod(BCIntegrate::BCIntegrationMethod method);
00138 
00141       void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method);
00142 
00146       void SetNiterationsPerDimension(unsigned int niterations);
00147 
00151       void SetNSamplesPer2DBin(unsigned int n);
00152 
00156       void SetRelativePrecision(double relprecision);
00157 
00161       void SetNbins(unsigned int n);
00162 
00167       void SetFillErrorBand(bool flag = true);
00168 
00172       void UnetFillErrorBand()
00173          { SetFillErrorBand(false); };
00174 
00178       void SetFitFunctionIndexX(int index);
00179 
00183       void SetFitFunctionIndexY(int index);
00184 
00185       void SetFitFunctionIndices(int indexx, int indexy);
00186 
00190       void SetDataPointLowerBoundaries(BCDataPoint * datasetlowerboundaries);
00191 
00195       void SetDataPointUpperBoundaries(BCDataPoint* datasetupperboundaries);
00196 
00200       void SetDataPointLowerBoundary(int index, double lowerboundary);
00201 
00205       void SetDataPointUpperBoundary(int index, double upperboundary);
00206 
00210       void SetDataBoundaries(int index, double lowerboundary, double upperboundary);
00211 
00214       void FixDataAxis(int index, bool fixed);
00215 
00218       void SetNChains(unsigned int n);
00219 
00231       void AddModel(BCModel * model, double probability=0.);
00232 
00236       void AddDataPoint(BCDataPoint * datapoint)
00237          { fDataSet -> AddDataPoint(datapoint); };
00238 
00242       int ReadDataFromFile(const char * filename, const char * treename, const char * branchnames)
00243          { return this ->  ReadDataFromFileTree(filename, treename, branchnames); };
00244 
00245       int ReadDataFromFile(const char * filename, int nvariables)
00246          { return this -> ReadDataFromFileTxt(filename, nvariables); };
00247 
00257       int ReadDataFromFileTree(const char * filename, const char * treename, const char * branchnames);
00258 
00267       int ReadDataFromFileTxt(const char * filename, int nbranches);
00268 
00272       void Normalize();
00273 
00279       double BayesFactor(const unsigned int imodel1, const unsigned int imodel2);
00280 
00283       void FindMode();
00284 
00288       void MarginalizeAll();
00289 
00292       void WriteMarkovChain(bool flag);
00293 
00296       void ResetDataSet()
00297          { fDataSet -> Reset(); };
00298 
00303       void PrintModelComparisonSummary(const char * filename=0);
00304 
00310       void PrintSummary(const char * filename=0);
00311 
00314       void PrintResults();
00315 
00318       void CalculatePValue(bool flag_histogram=false);
00319 
00322    private:
00323 
00326       void Copy(BCModelManager & modelmanager) const;
00327 
00330       BCModelContainer * fModelContainer;
00331 
00334       BCDataSet * fDataSet;
00335 
00336 };
00337 
00338 // ---------------------------------------------------------
00339 
00340 #endif

Generated by  doxygen 1.7.1