00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __BCMODELMANAGER__H
00024 #define __BCMODELMANAGER__H
00025
00026 #include "BCModel.h"
00027
00028
00029
00030 class BCModelManager
00031 {
00032
00033 public:
00034
00036
00037
00041 BCModelManager();
00042
00046 BCModelManager(const BCModelManager & modelmanager);
00047
00051 virtual ~BCModelManager();
00052
00053
00054
00056
00057
00061 BCModelManager & operator = (const BCModelManager & modelmanager);
00062
00063
00064
00066
00067
00071 int GetNModels()
00072 { return int(fModelContainer -> size()); };
00073
00079 BCModel * GetModel(int index)
00080 { return fModelContainer -> at(index); };
00081
00086 int GetNDataPoints()
00087 { return ((fDataSet) ? fDataSet -> GetNDataPoints() : -1); };
00088
00094 BCDataPoint * GetDataPoint(int index)
00095 { return fDataSet -> GetDataPoint(index); };
00096
00101 BCDataSet * GetDataSet()
00102 { return fDataSet; };
00103
00104
00105
00107
00108
00114 void SetDataSet(BCDataSet * dataset);
00115
00122 void SetSingleDataPoint(BCDataPoint * datapoint);
00123
00131 void SetSingleDataPoint(BCDataSet * dataset, int index);
00132
00133
00139
00140
00144 void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method);
00145
00149 void SetIntegrationMethod(BCIntegrate::BCIntegrationMethod method);
00150
00154 void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method);
00155
00160 void SetNiterationsPerDimension(int niterations);
00161
00166 void SetNSamplesPer2DBin(int n);
00167
00172 void SetRelativePrecision(double relprecision);
00173
00178 void SetNbins(int n);
00179
00184 void SetFitFunctionIndexX(int index);
00185
00190 void SetFitFunctionIndexY(int index);
00191
00192 void SetFitFunctionIndices(int indexx, int indexy);
00193
00198 void SetDataPointLowerBoundaries(BCDataPoint* datasetlowerboundaries);
00199
00204 void SetDataPointUpperBoundaries(BCDataPoint* datasetupperboundaries);
00205
00210 void SetDataPointLowerBoundary(int index, double lowerboundary);
00211
00216 void SetDataPointUpperBoundary(int index, double upperboundary);
00217
00222 void SetDataBoundaries(int index, double lowerboundary, double upperboundary);
00223
00224
00225
00226
00227 void FixDataAxis(int index, bool fixed);
00228
00229
00230
00231
00232 void SetNChains(int n);
00233
00234
00235
00236
00237 void SetFlagPCA(bool flag);
00238
00239
00240
00242
00243
00251 void AddModel(BCModel * model, double probability=0.);
00252
00257 void AddDataPoint(BCDataPoint * datapoint)
00258 { fDataSet -> AddDataPoint(datapoint); };
00259
00270 int ReadDataFromFileTree(const char * filename, const char * treename, const char * branchnames);
00271
00281 int ReadDataFromFileTxt(const char * filename, int nbranches);
00282
00294 int ReadDataFromFileUser(const char * filename, std::vector<int> options_int, std::vector<double> options_double);
00295
00300 void Normalize();
00301
00305 void FindMode();
00306
00311 void MarginalizeAll();
00312
00313
00314
00315
00316 void WriteMarkovChain(bool flag);
00317
00321 void ResetDataSet()
00322 { fDataSet -> Reset(); };
00323
00329 void PrintSummary(const char * filename=0);
00330
00331
00332
00333
00334 void PrintResults();
00335
00336
00337
00338
00339 void CalculatePValue(bool flag_histogram=false);
00340
00341
00342
00343 private:
00344
00345
00346
00347
00348 void Copy(BCModelManager & modelmanager) const;
00349
00353 BCModelContainer * fModelContainer;
00354
00358 BCDataSet * fDataSet;
00359
00360 };
00361
00362
00363
00364 #endif