00001 #ifndef __BCMODELOUTPUT__H 00002 #define __BCMODELOUTPUT__H 00003 00016 /* 00017 * Copyright (C) 2008, Daniel Kollar and Kevin Kroeninger. 00018 * All rights reserved. 00019 * 00020 * For the licensing terms see doc/COPYING. 00021 */ 00022 00023 // --------------------------------------------------------- 00024 00025 #include <vector> 00026 00027 // BAT classes 00028 class BCModel; 00029 00030 // ROOT classes 00031 class TTree; 00032 class TFile; 00033 class TObject; 00034 00035 const int MAXNPARAMETERS = 20; 00036 00037 // --------------------------------------------------------- 00038 00039 class BCModelOutput 00040 { 00041 public: 00042 00044 /* @{ */ 00045 00048 BCModelOutput(); 00049 00054 BCModelOutput(BCModel * model, const char * filenname); 00055 00058 BCModelOutput(const BCModelOutput & modeloutput); 00059 00062 virtual ~BCModelOutput(); 00063 00064 /* @} */ 00065 00067 /* @{ */ 00068 00071 BCModelOutput & operator = (const BCModelOutput & modeloutput); 00072 00073 /* @} */ 00074 00076 /* @{ */ 00077 00081 TTree * GetAnalysisTree() 00082 { return fAnalysisTree; }; 00083 00087 TFile * GetFile() 00088 { return fOutputFile; }; 00089 00090 /* @} */ 00091 00093 /* @{ */ 00094 00098 void SetModel(BCModel * model) 00099 { fModel = model; }; 00100 00104 void SetFile(const char * filename); 00105 00106 /* @} */ 00107 00109 /* @{ */ 00110 00114 void WriteMarkovChain(bool flag); 00115 00118 void FillAnalysisTree(); 00119 00122 void WriteMarginalizedDistributions(); 00123 00126 void WriteErrorBand(); 00127 00130 void Write(TObject * o); 00131 00134 void Close(); 00135 00136 /* @} */ 00137 00138 private: 00139 00140 /* 00141 * Copies this BCModelOutput into another one */ 00142 void Copy(BCModelOutput & modeloutput) const; 00143 00146 void InitializeAnalysisTree(); 00147 00150 void InitializeMarkovChainTrees(); 00151 00154 TTree * fAnalysisTree; 00155 00158 TTree * fMarkovChainTree; 00159 00160 /* 00161 * The trees containing the Markov chains. The length of the vector 00162 * is fMCMCNChains. */ 00163 std::vector<TTree *> fMarkovChainTrees; 00164 00167 const char * fFilename; 00168 00171 TFile * fOutputFile; 00172 00175 BCModel * fModel; 00176 00179 int fIndex; 00180 unsigned int fNParameters; 00181 double fProbability_apriori; 00182 double fProbability_aposteriori; 00183 double fMode_global[MAXNPARAMETERS]; 00184 double fMode_marginalized[MAXNPARAMETERS]; 00185 double fMean_marginalized[MAXNPARAMETERS]; 00186 double fMedian_marginalized[MAXNPARAMETERS]; 00187 double fQuantile_05[MAXNPARAMETERS]; 00188 double fQuantile_10[MAXNPARAMETERS]; 00189 double fQuantile_16[MAXNPARAMETERS]; 00190 double fQuantile_84[MAXNPARAMETERS]; 00191 double fQuantile_90[MAXNPARAMETERS]; 00192 double fQuantile_95[MAXNPARAMETERS]; 00193 00196 std::vector<double> * fParameters; 00197 std::vector<double> * fLogLikelihood; 00198 std::vector <int> * fIteration; 00199 00200 }; 00201 00202 // --------------------------------------------------------- 00203 00204 #endif