// @(#)root/roostats:$Id$

/*************************************************************************
 * Project: RooStats                                                     *
 * Package: RooFit/RooStats                                              *
 * Authors:                                                              *
 *   Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke       *
 *************************************************************************
 * 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_LikelihoodIntervalPlot
#define ROOSTATS_LikelihoodIntervalPlot

#include "RooPrintable.h"
#include "RooArgSet.h"

#include "TNamed.h"

#include "TH2F.h"

#include "RooStats/LikelihoodInterval.h"

namespace RooStats {

 class LikelihoodIntervalPlot : public TNamed, public RooPrintable {

   public:
    LikelihoodIntervalPlot();

    LikelihoodIntervalPlot(LikelihoodInterval* theInterval);

    // Destructor of SamplingDistribution
    virtual ~LikelihoodIntervalPlot();


    // returned plotted object (RooPlot or histograms)
    TObject * GetPlottedObject() const { return fPlotObject; }

    void SetLikelihoodInterval(LikelihoodInterval* theInterval);
    void SetPlotParameters(const RooArgSet *params) ;


    // set plot range (for 1D plot)
    void SetRange(double x1, double x2) { fXmin = x1; fXmax = x2; }
    // set plot range (for 2D plot)
    void SetRange(double x1, double y1, double x2, double y2) {
       fXmin = x1; fXmax = x2; 
       fYmin = y1; fYmax = y2; 
    }

    //set plot precision (when drawing a RooPlot)
    void SetPrecision(double eps) { fPrecision = eps; }
    // set the line color for the 1D interval lines or contours (2D)
    void SetLineColor(const Color_t color) {fLineColor = color;}
    // set the fill contour color
    void SetFillStyle(const Style_t style) {fFillStyle = style;}
    // set the fill contour color
    void SetContourColor(const Color_t color) {fColor = color;}
    void SetMaximum(const Double_t theMaximum) {fMaximum = theMaximum;}
    void SetNPoints(Int_t np) { fNPoints = np; }


    // draw the likelihood interval or contour
    // for the 1D case a RooPlot is drawn by default of the profiled Log-Likelihood ratio
    // if option "TF1" is used the objects is drawn using a TF1 scanning the LL function in a 
    // grid of the setetd points (by default 
    // the TF1 can be costumized by setting maximum and the number of points to scan 
    void Draw(const Option_t *options=0);

  private:

    Color_t fColor;         // color for the contour (for 2D) or function (in 1D)
    Style_t fFillStyle;     // fill style for contours
    Color_t fLineColor;     // line color for the interval (1D) or for other contours (2D)
    Int_t fNdimPlot;
    Int_t fNPoints; // number of points used to scan the PL 

    Double_t fMaximum;   // function maximum
    // ranges for plots 
    Double_t fXmin;
    Double_t fXmax;
    Double_t fYmin;
    Double_t fYmax;
    Double_t fPrecision;  // RooCurve precision

    LikelihoodInterval *fInterval;

    RooArgSet *fParamsPlot;
    TObject * fPlotObject;    // plotted object


  protected:

    ClassDef(LikelihoodIntervalPlot,2)  // Class containing the results of the IntervalCalculator
  };
}

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