Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:29:45

0001 // @(#)root/roostats:$Id$
0002 
0003 /*************************************************************************
0004  * Project: RooStats                                                     *
0005  * Package: RooFit/RooStats                                              *
0006  * Authors:                                                              *
0007  *   Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke       *
0008  *************************************************************************
0009  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOSTATS_LikelihoodIntervalPlot
0017 #define ROOSTATS_LikelihoodIntervalPlot
0018 
0019 #include "RooPrintable.h"
0020 #include "RooArgSet.h"
0021 
0022 #include "TNamed.h"
0023 
0024 #include "TH2F.h"
0025 
0026 #include "RooStats/LikelihoodInterval.h"
0027 
0028 namespace RooStats {
0029 
0030  class LikelihoodIntervalPlot : public TNamed, public RooPrintable {
0031 
0032    public:
0033     LikelihoodIntervalPlot();
0034 
0035     LikelihoodIntervalPlot(LikelihoodInterval* theInterval);
0036 
0037     /// returned plotted object (RooPlot or histograms)
0038     TObject * GetPlottedObject() const { return fPlotObject; }
0039 
0040     void SetLikelihoodInterval(LikelihoodInterval* theInterval);
0041     void SetPlotParameters(const RooArgSet *params) ;
0042 
0043 
0044     /// set plot range (for 1D plot)
0045     void SetRange(double x1, double x2) { fXmin = x1; fXmax = x2; }
0046     /// set plot range (for 2D plot)
0047     void SetRange(double x1, double y1, double x2, double y2) {
0048        fXmin = x1; fXmax = x2;
0049        fYmin = y1; fYmax = y2;
0050     }
0051 
0052     ///set plot precision (when drawing a RooPlot)
0053     void SetPrecision(double eps) { fPrecision = eps; }
0054     /// set the line color for the 1D interval lines or contours (2D)
0055     void SetLineColor(const Color_t color) {fLineColor = color;}
0056     /// set the fill contour color
0057     void SetFillStyle(const Style_t style) {fFillStyle = style;}
0058     /// set the fill contour color
0059     void SetContourColor(const Color_t color) {fColor = color;}
0060     void SetMaximum(const double theMaximum) {fMaximum = theMaximum;}
0061     void SetNPoints(Int_t np) { fNPoints = np; }
0062 
0063 
0064     /// draw the likelihood interval or contour
0065     /// for the 1D case a RooPlot is drawn by default of the profiled Log-Likelihood ratio
0066     /// if option "TF1" is used the objects are drawn using a TF1 scanning the LL function in a
0067     /// grid of the set points (by default
0068     /// the TF1 can be customized by setting maximum and the number of points to scan
0069     void Draw(const Option_t *options=nullptr) override;
0070 
0071   private:
0072      Color_t fColor = 0;        ///< color for the contour (for 2D) or function (in 1D)
0073      Style_t fFillStyle = 4050; ///< fill style for contours, half transparent by default
0074      Color_t fLineColor = 0;    ///< line color for the interval (1D) or for other contours (2D)
0075      Int_t fNdimPlot = 0;
0076      Int_t fNPoints = 0; ///< number of points used to scan the PL, default depends if 1D or 2D
0077 
0078      double fMaximum = -1; ///< function maximum
0079      // ranges for plots, default is variable range
0080      double fXmin = 0;
0081      double fXmax = -1;
0082      double fYmin = 0;
0083      double fYmax = -1;
0084      double fPrecision = -1; ///< RooCurve precision, use default in case of -1
0085 
0086      LikelihoodInterval *fInterval = nullptr;
0087 
0088      RooArgSet *fParamsPlot = nullptr;
0089      TObject *fPlotObject = nullptr; ///< plotted object
0090 
0091   protected:
0092 
0093     ClassDefOverride(LikelihoodIntervalPlot,2)  // Class containing the results of the IntervalCalculator
0094   };
0095 }
0096 
0097 #endif