36 #define NaN std::numeric_limits<float>::quiet_NaN() 38 #define IsNaN(a) TMath::IsNaN(a) 107 coutW(
Plotting) <<
"Empty sampling distribution given to plot. Skipping." << endl;
112 TString options(drawOptions);
126 coutW(
Plotting) <<
"Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
147 std::vector<Double_t>::iterator valuesIt =
fSamplingDistr.begin();
148 for (
int w_idx = 0; valuesIt !=
fSamplingDistr.end(); ++valuesIt, ++w_idx) {
155 double weightSum = 1.0;
156 if(options.Contains(
"NORMALIZE")) {
160 options.ReplaceAll(
"NORMALIZE",
"");
177 TString title = samplingDist->
GetTitle();
187 coutW(
Plotting) <<
"Empty sampling distribution given to plot. Skipping." << endl;
197 for (
int i=0; i<shaded->
GetNbinsX(); ++i) {
203 TString options(drawOptions);
205 if(options.Contains(
"NORMALIZE")) {
206 options.ReplaceAll(
"NORMALIZE",
"");
265 std::cerr <<
fName <<
"::addObject: called with a null pointer" << std::endl;
300 Double_t theMin(0.), theMax(0.), theYMin(
NaN), theYMax(0.);
322 if( !
IsNaN(theYMax) ) {
326 if( !
IsNaN(theYMin) ) {
337 if( !
IsNaN(theYMax) ) {
341 if( !
IsNaN(theYMin) ) {
351 while ((otherObj = otherIt->
Next())) {
431 if (samplDist == 0) {
438 shadedName +=
"_shaded";
441 if (!strcmp(obj->
GetName(), shadedName.Data())) {
451 TString shadedName(samplDist->
GetName());
452 shadedName +=
"_shaded";
459 if (!strcmp(obj->
GetName(), shadedName.Data())) {
579 if(samplDist ==
NULL){
606 obj->
Rebin(rebinFactor);
622 cout <<
"Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
626 TFile ofile(RootFileName, option, ftitle, compress);
RooPlot * fRooPlot
TODO remove class variable and instantiate locally as necessary.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
const std::vector< Double_t > & GetSamplingDistribution() const
Get test statistics values.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual Option_t * GetOption() const
virtual void SetMaximum(Double_t maximum=-1111)
void ApplyDefaultStyle(void)
Applies a predefined style if fApplyStyle is kTRUE (default).
void SetStatColor(Color_t color=19)
void SetFrameBorderMode(Int_t mode=1)
void SetLineColor(Color_t color, const SamplingDistribution *samplDist=0)
Sets line color for given sampling distribution and fill color for the associated shaded TH1F...
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
R__EXTERN TStyle * gStyle
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
void addTH1(TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a TH1 histogram object to this plot.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST")
adds the sampling distribution and returns the scale factor
virtual void SetMinimum(Double_t minimum=-1111)
tomato 1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
const std::vector< Double_t > & GetSampleWeights() const
Get the sampling weights.
void SetSampleWeights(const SamplingDistribution *samplingDist)
Determine if the sampling distribution has weights and store them.
void GetAbsoluteInterval(Double_t &theMin, Double_t &theMax, Double_t &theYMax) const
Iterator abstract base class.
void SetCanvasColor(Color_t color=19)
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
static const double x2[5]
void addObject(TObject *obj, Option_t *drawOptions=0)
Add a generic object to this plot.
void SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist=0)
void SetXRange(double mi, double ma)
change x range
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
void AddTH1(TH1 *h, Option_t *drawOptions="")
add a TH1
void SetMarkerSize(Size_t size, const SamplingDistribution *samplDist=0)
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Double_t AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions="NORMALIZE HIST")
Like AddSamplingDistribution, but also sets a shaded area in the minShaded and maxShaded boundaries...
RooRealVar represents a fundamental (non-derived) real valued object.
void SetOptLogx(Int_t logx=1)
RooList fOtherItems
holds TH1Fs only
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void DumpToFile(const char *RootFileName, Option_t *option="", const char *ftitle="", Int_t compress=1)
write to Root file
void SetPadBorderMode(Int_t mode=1)
void SetCanvasBorderMode(Int_t mode=1)
void SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist=0)
void SetPadColor(Color_t color=19)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetMaximum(Double_t maximum=-1111)
Set maximum value of Y axis.
TIterator * fIterator
other objects to be drawn like TLine etc.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
This class simply holds a sampling distribution of some test statistic.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
void RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist=0)
void SetFrameFillStyle(Style_t styl=0)
Namespace for the RooStats classes.
void AddTF1(TF1 *f, const char *title=NULL, Option_t *drawOptions="SAME")
add a TF1
static const double x1[5]
TH1F * GetTH1F(const SamplingDistribution *samplDist=NULL)
Returns the TH1F associated with the give SamplingDistribution.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
static Bool_t setAddDirectoryStatus(Bool_t flag)
void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char *title=NULL)
add a line
void SetMarkerColor(Color_t color, const SamplingDistribution *samplDist=0)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
std::vector< Double_t > fSampleWeights
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
This class provides simple and straightforward utilities to plot SamplingDistribution objects...
Mother of all ROOT objects.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
const TString GetVarName() const
void SetLineStyle(Style_t style, const SamplingDistribution *samplDist=0)
virtual void Add(TObject *obj)
virtual TObject * Next()=0
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
void SetOptLogy(Int_t logy=1)
void addOtherObject(TObject *obj, Option_t *drawOptions=0)
Add a generic object to this plot.
virtual Int_t GetNbinsX() const
virtual ~SamplingDistPlot()
Destructor of SamplingDistribution.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
static Bool_t addDirectoryStatus()
SamplingDistPlot(Int_t nbins=100)
Constructors for SamplingDistribution.
virtual void SetBorderSize(Int_t bordersize=4)
std::vector< Double_t > fSamplingDistr
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
virtual const char * GetTitle() const
Returns title of object.