// @(#)root/roostats:$Id$
// Author: 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_PointSetInterval
#define RooStats_PointSetInterval

#ifndef ROO_ARG_SET
#include "RooArgSet.h"
#endif
#ifndef ROO_TREE_DATA
#include "RooAbsData.h"
#endif
#ifndef RooStats_ConfInterval
#include "RooStats/ConfInterval.h"
#endif


namespace RooStats {

 class PointSetInterval : public ConfInterval {

  public:

     // default constructors
    explicit PointSetInterval(const char* name = 0);

    // constructor from name and data set specifying the interval points
    PointSetInterval(const char* name, RooAbsData&);

    // destructor
    virtual ~PointSetInterval();
        

    // check if parameter is in the interval
    virtual Bool_t IsInInterval(const RooArgSet&) const;

    // set the confidence level for the interval
    virtual void SetConfidenceLevel(Double_t cl) {fConfidenceLevel = cl;}

    // return the confidence level for the interval
    virtual Double_t ConfidenceLevel() const {return fConfidenceLevel;}
 
    // Method to return lower limit on a given parameter 
    //  Double_t LowerLimit(RooRealVar& param) ; // could provide, but misleading?
    //      Double_t UpperLimit(RooRealVar& param) ; // could provide, but misleading?
    
    // return a cloned list with the parameter of interest
    virtual RooArgSet* GetParameters() const;

    // return a copy of the data set (points) defining this interval
    RooAbsData* GetParameterPoints() const {return (RooAbsData*)fParameterPointsInInterval->Clone();}

    // return a cloned list with the parameter of interest
    Bool_t CheckParameters(const RooArgSet&) const ;

    // return lower limit on a given parameter 
    Double_t LowerLimit(RooRealVar& param) ;

    // return upper limit on a given parameter 
    Double_t UpperLimit(RooRealVar& param) ;

    
  protected:

    ClassDef(PointSetInterval,1)  // Concrete implementation of ConfInterval for simple 1-D intervals in the form [a,b]

  private:

    //    RooArgSet* fParameters; // parameter of interest
    Double_t fConfidenceLevel; // confidence level
    RooAbsData* fParameterPointsInInterval; // either a histogram (RooDataHist) or a tree (RooDataSet)

      
  };
}

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