// @(#)root/roostats:$Id$
// Authors: Kevin Belasco        17/06/2009
// Authors: Kyle Cranmer         17/06/2009
/*************************************************************************
 * Project: RooStats                                                     *
 * Package: RooFit/RooStats                                              *
 *************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOSTATS_MCMCIntervalPlot
#define ROOSTATS_MCMCIntervalPlot

#ifndef ROO_PRINTABLE
#include "RooPrintable.h"
#endif
#ifndef ROO_ARG_SET
#include "RooArgSet.h"
#endif
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TH1
#include "TH1.h"
#endif
#ifndef RooStats_MCMCInterval
#include "RooStats/MCMCInterval.h"
#endif
#ifndef ROO_KEYS_PDF
#include "RooNDKeysPdf.h"
#endif
#ifndef ROO_PRODUCT
#include "RooProduct.h"
#endif

namespace RooStats {

   class MCMCIntervalPlot : public TNamed, public RooPrintable {

   public:
      MCMCIntervalPlot();
      MCMCIntervalPlot(MCMCInterval& interval);

      // Destructor of SamplingDistribution
      virtual ~MCMCIntervalPlot();

      void SetMCMCInterval(MCMCInterval& interval);
      void SetLineColor(Color_t color) {fLineColor = color;}
      void SetLineWidth(Int_t width) {fLineWidth = width;}
      void SetShadeColor(Color_t color) {fShadeColor = color;}
      void SetShowBurnIn(Bool_t showBurnIn) { fShowBurnIn = showBurnIn; }

      void Draw(const Option_t* options = NULL);

      void DrawChainScatter(RooRealVar& xVar, RooRealVar& yVar);
      void DrawParameterVsTime(RooRealVar& param);
      void DrawNLLVsTime();
      void DrawNLLHist(const Option_t* options = NULL);
      void DrawWeightHist(const Option_t* options = NULL);

   private:

      MCMCInterval *fInterval;
      RooArgSet *fParameters;
      TH1* fPosteriorHist;
      RooNDKeysPdf* fPosteriorKeysPdf;
      RooProduct* fPosteriorKeysProduct;
      TH1* fNLLHist;
      TH1* fWeightHist;
      TH1* fPosteriorHistHistCopy;
      TH1* fPosteriorHistTFCopy;
      Int_t fDimension;
      Color_t fLineColor;
      Color_t fShadeColor;
      Int_t fLineWidth;
      Bool_t fShowBurnIn;
      TGraph* fWalk;
      TGraph* fBurnIn;
      TGraph* fFirst;
      TGraph* fParamGraph;
      TGraph* fNLLGraph;

   protected:
      void DrawPosterior(const Option_t* options = NULL);
      void* DrawPosteriorHist(const Option_t* options = NULL,
            const char* title = NULL, Bool_t scale = kTRUE);
      void* DrawPosteriorKeysPdf(const Option_t* options = NULL);
      void* DrawPosteriorKeysProduct(const Option_t* options = NULL);

      void DrawInterval(const Option_t* options = NULL);
      void DrawShortestInterval(const Option_t* options = NULL);
      void DrawHistInterval(const Option_t* options = NULL);
      void DrawKeysPdfInterval(const Option_t* options = NULL);
      void DrawTailFractionInterval(const Option_t* options = NULL);

      ClassDef(MCMCIntervalPlot,1)  // Class containing the results of the MCMCCalculator
   };
}

#endif
 MCMCIntervalPlot.h:1
 MCMCIntervalPlot.h:2
 MCMCIntervalPlot.h:3
 MCMCIntervalPlot.h:4
 MCMCIntervalPlot.h:5
 MCMCIntervalPlot.h:6
 MCMCIntervalPlot.h:7
 MCMCIntervalPlot.h:8
 MCMCIntervalPlot.h:9
 MCMCIntervalPlot.h:10
 MCMCIntervalPlot.h:11
 MCMCIntervalPlot.h:12
 MCMCIntervalPlot.h:13
 MCMCIntervalPlot.h:14
 MCMCIntervalPlot.h:15
 MCMCIntervalPlot.h:16
 MCMCIntervalPlot.h:17
 MCMCIntervalPlot.h:18
 MCMCIntervalPlot.h:19
 MCMCIntervalPlot.h:20
 MCMCIntervalPlot.h:21
 MCMCIntervalPlot.h:22
 MCMCIntervalPlot.h:23
 MCMCIntervalPlot.h:24
 MCMCIntervalPlot.h:25
 MCMCIntervalPlot.h:26
 MCMCIntervalPlot.h:27
 MCMCIntervalPlot.h:28
 MCMCIntervalPlot.h:29
 MCMCIntervalPlot.h:30
 MCMCIntervalPlot.h:31
 MCMCIntervalPlot.h:32
 MCMCIntervalPlot.h:33
 MCMCIntervalPlot.h:34
 MCMCIntervalPlot.h:35
 MCMCIntervalPlot.h:36
 MCMCIntervalPlot.h:37
 MCMCIntervalPlot.h:38
 MCMCIntervalPlot.h:39
 MCMCIntervalPlot.h:40
 MCMCIntervalPlot.h:41
 MCMCIntervalPlot.h:42
 MCMCIntervalPlot.h:43
 MCMCIntervalPlot.h:44
 MCMCIntervalPlot.h:45
 MCMCIntervalPlot.h:46
 MCMCIntervalPlot.h:47
 MCMCIntervalPlot.h:48
 MCMCIntervalPlot.h:49
 MCMCIntervalPlot.h:50
 MCMCIntervalPlot.h:51
 MCMCIntervalPlot.h:52
 MCMCIntervalPlot.h:53
 MCMCIntervalPlot.h:54
 MCMCIntervalPlot.h:55
 MCMCIntervalPlot.h:56
 MCMCIntervalPlot.h:57
 MCMCIntervalPlot.h:58
 MCMCIntervalPlot.h:59
 MCMCIntervalPlot.h:60
 MCMCIntervalPlot.h:61
 MCMCIntervalPlot.h:62
 MCMCIntervalPlot.h:63
 MCMCIntervalPlot.h:64
 MCMCIntervalPlot.h:65
 MCMCIntervalPlot.h:66
 MCMCIntervalPlot.h:67
 MCMCIntervalPlot.h:68
 MCMCIntervalPlot.h:69
 MCMCIntervalPlot.h:70
 MCMCIntervalPlot.h:71
 MCMCIntervalPlot.h:72
 MCMCIntervalPlot.h:73
 MCMCIntervalPlot.h:74
 MCMCIntervalPlot.h:75
 MCMCIntervalPlot.h:76
 MCMCIntervalPlot.h:77
 MCMCIntervalPlot.h:78
 MCMCIntervalPlot.h:79
 MCMCIntervalPlot.h:80
 MCMCIntervalPlot.h:81
 MCMCIntervalPlot.h:82
 MCMCIntervalPlot.h:83
 MCMCIntervalPlot.h:84
 MCMCIntervalPlot.h:85
 MCMCIntervalPlot.h:86
 MCMCIntervalPlot.h:87
 MCMCIntervalPlot.h:88
 MCMCIntervalPlot.h:89
 MCMCIntervalPlot.h:90
 MCMCIntervalPlot.h:91
 MCMCIntervalPlot.h:92
 MCMCIntervalPlot.h:93
 MCMCIntervalPlot.h:94
 MCMCIntervalPlot.h:95
 MCMCIntervalPlot.h:96
 MCMCIntervalPlot.h:97
 MCMCIntervalPlot.h:98
 MCMCIntervalPlot.h:99
 MCMCIntervalPlot.h:100
 MCMCIntervalPlot.h:101
 MCMCIntervalPlot.h:102
 MCMCIntervalPlot.h:103
 MCMCIntervalPlot.h:104