00001 00013 /* 00014 * Copyright (C) 2008, Daniel Kollar and Kevin Kroeninger. 00015 * All rights reserved. 00016 * 00017 * For the licensing terms see doc/COPYING. 00018 */ 00019 00020 // --------------------------------------------------------- 00021 00022 #ifndef __BCMODELOUTPUT__H 00023 #define __BCMODELOUTPUT__H 00024 00025 const int MAXNPARAMETERS = 20; 00026 00027 #include "BCModel.h" 00028 00029 #include <TTree.h> 00030 #include <TFile.h> 00031 00032 // --------------------------------------------------------- 00033 00034 class BCModelOutput 00035 { 00036 00037 public: 00038 00040 /* @{ */ 00041 00045 BCModelOutput(); 00046 00052 BCModelOutput(BCModel * model, const char * filenname); 00053 00057 BCModelOutput(const BCModelOutput & modeloutput); 00058 00062 virtual ~BCModelOutput(); 00063 00064 /* @} */ 00065 00067 /* @{ */ 00068 00072 BCModelOutput & operator = (const BCModelOutput & modeloutput); 00073 00074 /* @} */ 00075 00077 /* @{ */ 00078 00083 TTree * GetAnalysisTree() 00084 { return fAnalysisTree; }; 00085 00090 TFile * GetFile() 00091 { return fOutputFile; }; 00092 00093 /* @} */ 00094 00096 /* @{ */ 00097 00102 void SetModel(BCModel * model) 00103 { fModel = model; }; 00104 00109 void SetFile(const char * filename); 00110 00111 /* @} */ 00112 00114 /* @{ */ 00115 00120 void WriteMarkovChain(bool flag); 00121 00125 void FillAnalysisTree(); 00126 00130 void WriteMarginalizedDistributions(); 00131 00135 void Close(); 00136 00137 /* @} */ 00138 00139 private: 00140 00141 /* 00142 * Copies this BCModelOutput into another one 00143 */ 00144 void Copy(BCModelOutput & modeloutput) const; 00145 00149 void InitializeAnalysisTree(); 00150 00154 void InitializeMarkovChainTrees(); 00155 00159 TTree * fAnalysisTree; 00160 00164 TTree * fMarkovChainTree; 00165 00166 /* 00167 * The trees containing the Markov chains. The length of the vector 00168 * is fMCMCNChains. 00169 */ 00170 std::vector<TTree *> fMarkovChainTrees; 00171 00175 const char * fFilename; 00176 00180 TFile * fOutputFile; 00181 00185 BCModel * fModel; 00186 00190 int fIndex; 00191 int fNParameters; 00192 double fProbability_apriori; 00193 double fProbability_aposteriori; 00194 double fMode_global[MAXNPARAMETERS]; 00195 double fMode_marginalized[MAXNPARAMETERS]; 00196 double fMean_marginalized[MAXNPARAMETERS]; 00197 double fMedian_marginalized[MAXNPARAMETERS]; 00198 double fQuantile_05[MAXNPARAMETERS]; 00199 double fQuantile_10[MAXNPARAMETERS]; 00200 double fQuantile_16[MAXNPARAMETERS]; 00201 double fQuantile_84[MAXNPARAMETERS]; 00202 double fQuantile_90[MAXNPARAMETERS]; 00203 double fQuantile_95[MAXNPARAMETERS]; 00204 00208 std::vector<double> * fParameters; 00209 std::vector<double> * fLogLikelihood; 00210 std::vector <int> * fIteration; 00211 00212 }; 00213 00214 // --------------------------------------------------------- 00215 00216 #endif