00001 #ifndef __BCMODELMANAGER__H
00002 #define __BCMODELMANAGER__H
00003
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "BAT/BCModel.h"
00027 #include "BAT/BCDataSet.h"
00028
00029
00030 class BCDataPoint;
00031
00032
00033
00034 class BCModelManager
00035 {
00036 public:
00037
00039
00040
00043 BCModelManager();
00044
00047 BCModelManager(const BCModelManager & modelmanager);
00048
00051 virtual ~BCModelManager();
00052
00053
00054
00056
00057
00060 BCModelManager & operator = (const BCModelManager & modelmanager);
00061
00062
00063
00065
00066
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
00098
00099
00101
00102
00107 void SetDataSet(BCDataSet * dataset);
00108
00114 void SetSingleDataPoint(BCDataPoint * datapoint);
00115
00122 void SetSingleDataPoint(BCDataSet * dataset, unsigned int index);
00123
00124
00129
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
00212
00213
00214 void FixDataAxis(int index, bool fixed);
00215
00216
00217
00218 void SetNChains(unsigned int n);
00219
00220
00221
00222 void SetFlagPCA(bool flag);
00223
00224
00225
00227
00228
00235 void AddModel(BCModel * model, double probability=0.);
00236
00240 void AddDataPoint(BCDataPoint * datapoint)
00241 { fDataSet -> AddDataPoint(datapoint); };
00242
00246 int ReadDataFromFile(const char * filename, const char * treename, const char * branchnames)
00247 { return this -> ReadDataFromFileTree(filename, treename, branchnames); };
00248
00249 int ReadDataFromFile(const char * filename, int nvariables)
00250 { return this -> ReadDataFromFileTxt(filename, nvariables); };
00251
00261 int ReadDataFromFileTree(const char * filename, const char * treename, const char * branchnames);
00262
00271 int ReadDataFromFileTxt(const char * filename, int nbranches);
00272
00276 void Normalize();
00277
00280 void FindMode();
00281
00285 void MarginalizeAll();
00286
00287
00288
00289 void WriteMarkovChain(bool flag);
00290
00293 void ResetDataSet()
00294 { fDataSet -> Reset(); };
00295
00300 void PrintModelComparisonSummary(const char * filename=0);
00301
00307 void PrintSummary(const char * filename=0);
00308
00309
00310
00311 void PrintResults();
00312
00313
00314
00315 void CalculatePValue(bool flag_histogram=false);
00316
00317
00318
00319 private:
00320
00321
00322
00323 void Copy(BCModelManager & modelmanager) const;
00324
00327 BCModelContainer * fModelContainer;
00328
00331 BCDataSet * fDataSet;
00332
00333 };
00334
00335
00336
00337 #endif