ROOT logo
// @(#)root/roostats:$Id: SamplingDistPlot.h 26427 2009-05-20 15:45:36Z pellicci $

/*************************************************************************
 * 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_SamplingDistPlot
#define ROOSTATS_SamplingDistPlot

#include "RooList.h"
#include "RooPrintable.h"
#include "TNamed.h"
#include "TIterator.h"
#include "TH1F.h"

#include "RooStats/SamplingDistribution.h"

namespace RooStats {

 class SamplingDistPlot : public TNamed, public RooPrintable {

   public:
    SamplingDistPlot();

    // Constructors for SamplingDistribution
    SamplingDistPlot(const Int_t nbins);
    SamplingDistPlot(const char* name, const char* title, Int_t nbins, Double_t xmin, Double_t xmax);

    // Destructor of SamplingDistribution
    virtual ~SamplingDistPlot();

    void AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions=0);

    void Draw(const Option_t *options=0);

    void SetLineColor(const Color_t color, const SamplingDistribution *samplDist = 0);
    void SetLineWidth(const Width_t lwidth, const SamplingDistribution *samplDist = 0);
    void SetLineStyle(const Style_t style, const SamplingDistribution *samplDist = 0);

    void SetMarkerColor(const Color_t color, const SamplingDistribution *samplDist = 0);
    void SetMarkerStyle(const Style_t style, const SamplingDistribution *samplDist = 0);
    void SetMarkerSize(const Size_t size, const SamplingDistribution *samplDist = 0);

    void RebinDistribution(const Int_t rebinFactor, const SamplingDistribution *samplDist = 0);

    void SetAxisTitle(char *varName) {fVarName = TString(varName);}

  private:

    std::vector<Double_t> fSamplingDistr;
    std::vector<Double_t> fSampleWeights;

    Bool_t fIsWeighted;

    Int_t fbins;
    Int_t fMarkerType;
    Int_t fColor;

    TString fVarName;

  protected:

    TH1F* fhist;

    RooList fItems;
    TIterator* fIterator;

    void SetSampleWeights(const SamplingDistribution *samplingDist);

    void addObject(TObject *obj, Option_t *drawOptions=0);
    void GetAbsoluteInterval(Float_t &theMin, Float_t &theMax, Float_t &theYMax) const;

    ClassDef(SamplingDistPlot,1)  // Class containing the results of the HybridCalculator
  };
}

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